<p>这可能对你有帮助。使用Python内置函数<a href="https://docs.python.org/3/library/functions.html#dir" rel="nofollow noreferrer">dir()</a></p>
<pre><code>from datetime import datetime
dir(datetime)
</code></pre>
<blockquote>
<p>['<strong>add</strong>', '<strong>class</strong>', '<strong>delattr</strong>', '<strong>dir</strong>', '<strong>doc</strong>',
'<strong>eq</strong>', '<strong>format</strong>', '<strong>ge</strong>', '<strong>getattribute</strong>', '<strong>gt</strong>',
'<strong>hash</strong>', '<strong>init</strong>', '<strong>init_subclass</strong>', '<strong>le</strong>', '<strong>lt</strong>',
'<strong>ne</strong>', '<strong>new</strong>', '<strong>radd</strong>', '<strong>reduce</strong>', '<strong>reduce_ex</strong>',
'<strong>repr</strong>', '<strong>rsub</strong>', '<strong>setattr</strong>', '<strong>sizeof</strong>', '<strong>str</strong>',
'<strong>sub</strong>', '<strong>subclasshook</strong>', 'astimezone', 'combine', 'ctime',
'date', 'day', 'dst', 'fold', 'fromisocalendar', 'fromisoformat',
'fromordinal', 'fromtimestamp', 'hour', 'isocalendar', 'isoformat',
'isoweekday', 'max', 'microsecond', 'min', 'minute', 'month', 'now',
'replace', 'resolution', 'second', 'strftime', 'strptime', 'time',
'timestamp', 'timetuple', 'timetz', 'today', 'toordinal', 'tzinfo',
'tzname', 'utcfromtimestamp', 'utcnow', 'utcoffset', 'utctimetuple',
'weekday', 'year']</p>
</blockquote>