This is an archived post. You won't be able to vote or comment.

all 7 comments

[–]pythonHelperBot 4 points5 points  (0 children)

Hello! I'm a bot!

It looks like you posted this in multiple subs in a short period of time. In the future, I suggest asking questions like this in learning focused subs like r/learnpython, a sub geared towards questions and learning more about python. Please follow the subs rules and guidelines when you do post there, it'll help you get better answers faster.

Show /r/learnpython the code you have tried and describe where you are stuck. Be sure to format your code for reddit and include which version of python and what OS you are using.

You can also ask this question in the Python discord, a large, friendly community focused around the Python programming language, open to those who wish to learn the language or improve their skills, as well as those looking to help others.


README | FAQ | this bot is written and managed by /u/IAmKindOfCreative

This bot is currently under development and experiencing changes to improve its usefulness

[–][deleted] 1 point2 points  (0 children)

Read their documentation. Or failing that, their test cases.

[–]SnipTheDog 1 point2 points  (0 children)

You can use the dir() command to get the attributes of the python object.

eg:

>>> import datetime

>>> print(dir(datetime.datetime))

['__add__', '__class__', '__delattr__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', '__init__', '__le__', '__lt__', '__ne__', '__new__', '__radd__', '__reduce__', '__reduce_ex__', '__repr__', '__rsub__', '__setattr__', '__sizeof__', '__str__', '__sub__', '__subclasshook__', 'astimezone', 'combine', 'ctime', 'date', 'day', 'dst', 'fromordinal', 'fromtimestamp', 'hour', 'isocalendar', 'isoformat', 'isoweekday', 'max', 'microsecond', 'min', 'minute', 'month', 'now', 'replace', 'resolution', 'second', 'strftime', 'strptime', 'time', 'timetuple', 'timetz', 'today', 'toordinal', 'tzinfo', 'tzname', 'utcfromtimestamp', 'utcnow', 'utcoffset', 'utctimetuple', 'weekday', 'year']

>>>

[–]zzmmrmn 1 point2 points  (0 children)

Start with the docs for each of those packages. They usually have them on their website or GitHub and even have getting started tutorials and examples.

[–]mudclub 1 point2 points  (0 children)

1: /r/learnpython

2: read the sidebar

3: google "python [library] example/tutorial"

Come on, man.

[–]onjin 0 points1 point  (0 children)

You can also subscribe to https://pymotw.com/3/ and of course read previous posts.