return 42 / divideBy
print('Error: Invalid argument.')
## Either of these two lines could throw an IOError, say
## if the file does not exist or the read() encounters a low level error.
f = open(filename, 'rU')
text = f.read()
## Control jumps directly to here if any of the above lines throws IOError.
sys.stderr.write('problem reading:' + filename)
## In any case, the code then continues with the line after the try/except
import time; # This is required to include time module.
ticks = time.time()
localtime = time.localtime(time.time())
print("Local current time :", localtime)
This would produce the following result, which could be formatted in any other presentable form −
Local current time : time.struct_time(tm_year=2013, tm_mon=7,
tm_mday=17, tm_hour=21, tm_min=26, tm_sec=3, tm_wday=2, tm_yday=198, tm_isds
localtime = time.asctime( time.localtime(time.time()) )
cal = calendar.month(2008, 1)
print ("Here is the calendar:")
This would produce the following result −
Here is the calendar:
Mo Tu We Th Fr Sa Su
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31
Too much useless information above 🙂 I will compensate it with next post which will introduce pandas and numpy(Two great libraries).
To be continued …