The Linux.uk Community Forum

General Help & Advice => Linux Support => Topic started by: pooky2483 on July 12, 2019, 11:48:57 PM

Title: [SOLVED] List of Python commands
Post by: pooky2483 on July 12, 2019, 11:48:57 PM
Just wondering where I can get a full list of Python (3.7.4) commands as I'm struggling to find a list anywhere, maybe I'm looking in the wrong place(s) or not using the correct search term(s).

TIA
Title: Re: List of Python commands
Post by: Mark Greaves (PCNetSpec) on July 13, 2019, 12:44:11 AM
The problem is that you're asking an meaningless question, python isn't a bunch of commands it's an object oriented programming language.

I don't mean to sound like I'm being awkward, but this really is one of those times when "RTFM" makes a lot of sense ;)

Even if it's only to learn what questions to ask the python pro's .. not that I'd likely be able to answer anyway, I'm only scratching the surface of python myself (I can make sense of what some of it is doing when I see it, but that's about it).




At a python shell prompt (not a bash prompt)>>>
help('modules')
and say>>>
help('os')
for example might help a little (if you can read that kinda gibberish) .. but the manual and online tutorials are where you'll find the most help if you wanna learn to program in python.
Title: Re: List of Python commands
Post by: pooky2483 on July 14, 2019, 11:11:59 AM
I know exactly what you're saying.
What I was looking for was something like a list of the 'commands' in a sort of index so I could see all of them in one place, not just throughout a manual, which does not cover every single one.
Title: Re: List of Python commands
Post by: pooky2483 on July 16, 2019, 12:36:02 PM
Found out how to get a list of python keywords...
In IDLE, enter the following;


import keyword
print(keyword.kwlist)


Result;

['False', 'None', 'True', 'and', 'as', 'assert', 'async', 'await', 'break', 'class', 'continue', 'def', 'del', 'elif', 'else', 'except', 'finally', 'for', 'from', 'global', 'if', 'import', 'in', 'is', 'lambda', 'nonlocal', 'not', 'or', 'pass', 'raise', 'return', 'try', 'while', 'with', 'yield']

Source:
https://www.programiz.com/python-programming/keyword-list (https://www.programiz.com/python-programming/keyword-list)