Python 1

From Crowfly

Jump to: navigation, search

The System Libraries

The System libraries provide important functionality.

Show todays date, called showdate.py:

import datetime

print datetime.datetime.now()

Try it.

Here's an improvement, showdate2.py

import datetime

d = datetime.datetime.now()
print "The time right now is", d.strftime("%m/%d/%Y %I:%M %p").lower()
Personal tools