Python Commandline

satya - 12/29/2021, 1:48:51 PM

When installed, the following are on the path


c:\satya\i\python374C:\satya\i\python374\Scripts

satya - 12/29/2021, 1:50:42 PM

The python shell, or command line is documented here

The python shell, or command line is documented here

satya - 12/29/2021, 1:51:53 PM

The URL above is release specific

The link above is 3.7

Now it is at 3.11, fyi

satya - 12/29/2021, 1:53:42 PM

Invoking the interpreter


C:\>python

Python 3.7.4 
Type "help", "copyright", "credits" or "license" for more information.
>>>

satya - 12/29/2021, 1:55:15 PM

Asking for help


>>>help()

Notice the brackets ()
Because help() is a global function.

satya - 12/29/2021, 1:58:32 PM

Exiting the interpreter


>>>quit()

Or ctrl-z

satya - 12/29/2021, 2:00:42 PM

Using sub-commands off of help()


>>> help()

will prompt with

help>

To see topics type

help>topics

One of the topics is TYPES

so to get help on "TYPES"

help> TYPES

Notice that "TYPES" is case sensitive

satya - 12/29/2021, 2:02:49 PM

How to get out of More.... prompt

Use "q" or "quit" to come out of More...

satya - 12/29/2021, 2:04:17 PM

Example for help on types


help> types
Help on module types:

NAME
 types - Define names for built-in types 
 that aren't directly accessible as a builtin.

CLASSES
    builtins.object
        builtins.async_generator
        builtins.builtin_function_or_method
        builtins.classmethod_descriptor
        builtins.code
        builtins.coroutine
        builtins.frame
        builtins.function
        builtins.generator
        builtins.getset_descriptor
        builtins.mappingproxy
        builtins.member_descriptor
        builtins.method
        builtins.method-wrapper
        builtins.method_descriptor
        builtins.module
        builtins.traceback
        builtins.wrapper_descriptor
        DynamicClassAttribute
        SimpleNamespace

    AsyncGeneratorType = class async_generator(object)
     |  Methods defined here:
-- More  --

Use "q" or "quit" to get out

satya - 12/29/2021, 2:06:47 PM

Like help(), other built-in functions are documented here

Like help(), other built-in functions are documented here

satya - 12/29/2021, 2:07:38 PM

How to run a script file


python some-script-file.py

#.py is convention
#any text file will work as well

satya - 12/29/2021, 2:25:23 PM

Language Reference

Language Reference

satya - 12/29/2021, 2:26:00 PM

Standard Library

Standard Library

satya - 12/29/2021, 2:26:35 PM

Tutorial

Tutorial

satya - 12/29/2021, 3:16:11 PM

Quitting one more time

1. To quit python use quit() or ctrl-z

2. To quit help() use "q" or "quit" (no brackets)

3. To quit more... use "q" or "quit"