Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
The time documentation
-
I found this list with all modules: http://omz-software.com/pythonista/docs/ios/index.html But I don‘t find the
time
module. Is that module on an other site, or where can I find all funktion? -
-
@cvp ok, thanks. But than why do this code don‘t work?
import datetime class t1 (): def __init__ (self): print(datetime.datetime) t1()
I only found datetime at first so that here is now datetime.
That what I don‘t understand is that here:
class datetime.date
Why is here in the documentation the wordclass
before thedatetime.date
? -
datetime
is amodule
datetime.datetime
is aclass
datetime.datetime.now()
is amethod
%
python3
>>> import datetime >>> print(datetime) <module 'datetime' from '/opt/homebrew/Cellar/python@3.9/3.9.1_8/Frameworks/Python.framework/Versions/3.9/lib/python3.9/datetime.py'> >>> print(datetime.datetime) <class 'datetime.datetime'> >>> print(datetime.datetime.now()) 2021-02-11 10:23:51.443904 # A more direct way to get to the useful stuff... >>> from datetime import datetime >>> print(datetime) <class 'datetime.datetime'> >>> print(datetime.now()) 2021-02-11 10:24:44.578089
-
@ccc ok, but than there is no different in the performance?
-
There might be a minor performance improvement if you avoid the dots...
-
@ccc ok, thanks