python “import datetime” v.s. “from datetime import datetime”
问题 I have a script that needs to execute the following at different lines in the script: today_date = datetime.date.today() date_time = datetime.strp(date_time_string, '%Y-%m-%d %H:%M') In my import statements I have the following: from datetime import datetime import datetime I get the following error: AttributeError: 'module' object has no attribute 'strp' If I change the order of the import statements to: import datetime from datetime import datetime I get the following error: AttributeError: