| | |
How do I recognise strings and numbers
Please support our Python advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Mar 2007
Posts: 110
Reputation:
Solved Threads: 31
obj[:3] is a slice of the time.struct_time object. The asterisk preceding the list returned by the slice expands the list into individual elements. Example: The DeprecationWarning you are seeing is unrelated to the code we are discussing, but originates in the pyXLWriter module. Warnings can be suppressed or turned into exceptions with a call to filterwarnings(), which adds an entry to the warning filter. See Python documentation.
Python Syntax (Toggle Plain Text)
>>> d = time.strptime('16/06/2010', '%d/%m/%Y') >>> d (2010, 6, 16, 0, 0, 0, 2, 167, -1) >>> [d[0],d[1],d[2]] [2010, 6, 16] >>> datetime.date(d[0],d[1],d[2]) datetime.date(2010, 6, 16) >>> datetime.date(*d[:3]) datetime.date(2010, 6, 16) >>> d[:3] (2010, 6, 16) >>>
![]() |
Other Threads in the Python Forum
- Previous Thread: VolumeRendering.py
- Next Thread: Getting size of all files in folder, and finding out some offsets..
| Thread Tools | Search this Thread |
Tag cloud for Python
abrupt ansi anti approximation assignment avogadro backend basic beginner binary bluetooth calculator character code customdialog decimals dictionaries dictionary drive dynamic examples excel exe file float format ftp function gnu graphics gui heads homework http ideas import input java launcher leftmouse line linux list lists loop module mouse number numbers output parsing path pointer port prime program programming progressbar projects py2exe pygame pyqt python random recursion recursive refresh schedule scrolledtext sqlite ssh statistics stdout string strings sudokusolver sum table terminal text thread threading time tkinter tlapse tricks tuple tutorial twoup ubuntu unicode update urllib urllib2 variable wikipedia windows write wxpython xlib





