datetime Attribute error in python -


i'm trying run following 3 lines of python code on command line using python 3.5.0. gives me error- attribute error: module 'datetime' has no attribute 'date'. want print current date. please help.

import datetime current = datetime.date.today() print(current) 

there nothing wrong code. reduced bit though:

import datetime datetime.date 

which should cause error. if causes error, installation messed or, unlikely, there's bug in python. please make sure don't have datetime.py in working directory. further, check output of dir(datetime) after importing , different version of python.


Comments

Popular posts from this blog

javascript - Chart.js (Radar Chart) different scaleLineColor for each scaleLine -

apache - Error with PHP mail(): Multiple or malformed newlines found in additional_header -

java - Android – MapFragment overlay button shadow, just like MyLocation button -