Python

From RaySoft

Python is a high-level, general-purpose programming language. Its design philosophy emphasizes code readability with the use of significant indentation via the off-side rule. [1]

Python is dynamically typed and garbage-collected. It supports multiple programming paradigms, including structured (particularly procedural), object-oriented and functional programming. It is often described as a 'batteries included' language due to its comprehensive standard library. [1]

Documentation

Further Information

Components

2 pages found:

Additional Resources

Clients

3 pages found:

Add-ons

5 pages found:

Examples

8 pages found:

Hints

Show a list of all installed modules
import os
import sys

for dir in sys.path:
    if os.path.isdir(dir):
        for file in os.listdir(dir):
            print(file)
Redirect stderr to stdout in the current shell
NOTE:
This is very helpful when using online compilers like Ideone.com.
import sys

sys.stderr = sys.stdout
Provide a lightweight HTTP server
python -m 'http.server' 8000 --bind '127.0.0.1' --directory "${HOME}/web"
NOTE:
By default, server binds itself to all interfaces. The option -b / --bind specifies a specific address to which it should bind. [2]
NOTE:
By default, server uses the current directory. The option -d / --directory specifies a directory to which it should serve the files. [2]

References

  1. 1.0 1.1 Wikipedia contributors. "Python (programming language)." Wikipedia. https://en.wikipedia.org/wiki/Python_(programming_language) (accessed 05.05.2023)
  2. 2.0 2.1 Python contributors. "http.server." Python Software Foundation. https://docs.python.org/3/library/http.server.html (accessed 05.05.2023)