Difference between revisions of "Python notes"
m (→^ Python Libraries) |
(→^ Questions: - add question regarding what is difference between Python library and Python module?) |
||
Line 6: | Line 6: | ||
<!-- odne komentar --> | <!-- odne komentar --> | ||
− | == [[#top|^]] Questions == | + | == [[#top|^]] Python Questions == |
− | Question: what is the syntax or python-ism in this | + | Question: what is the syntax or python-ism in this construct?: |
<pre> | <pre> | ||
Line 19: | Line 19: | ||
* https://note.nkmk.me/en/python-method-chain-line-break/ | * https://note.nkmk.me/en/python-method-chain-line-break/ | ||
</ul> | </ul> | ||
+ | |||
+ | Question: what is the difference between a Python library and a Python module? | ||
+ | |||
<!-- odne komentar --> | <!-- odne komentar --> | ||
Revision as of 20:40, 24 June 2024
2023-10-11 Wednesday
Contents
^ Overview
Python notes local page on Neela Nurseries wiki
^ Python Questions
Question: what is the syntax or python-ism in this construct?:
if __name__ == '__main__': main()
Question: what is method chaining in Python?
Question: what is the difference between a Python library and a Python module?
^ Python Data Types
The following Python3 online documentation page mentions early on how Python distinguishes Unicode strings and 8-bit strings which it also calls 'bytes'. This may be a starting point to understanding how and when Python3 treats data as bytes:
^ Python Libraries
Starting point to describe Python language libraries and cases where they are needed:
- https://docs.python.org/3/library/os.html . . . os library - "Miscellaneous operating system interfaces"
- https://docs.python.org/3/library/sys.html . . . sys library
- https://docs.python.org/3/library/zlib.html . . . zlib library
^ Python Modules
Python scripting language includes a module called `subprocess`. Sounds like this module is akin to C library's `exec()` family functions, at least in the functionality it provides. Starting notes on Python subprocess here:
^ Strings and Long Lines
To express long lines in Python there are a couple of methods. The `textwrap` library or module contains some utils to help with this. To use parentheses about a multi-line string also provides a way.