Difference between revisions of "Python notes"
From Wiki at Neela Nurseries
m (add link to Python3 "re" library, and note about Python's notion of byte data type.) |
m (→^ Python Libraries: add links to Python 3.12.2 docs on os and zlib libraries.) |
||
(3 intermediate revisions by the same user not shown) | |||
Line 15: | Line 15: | ||
</pre> | </pre> | ||
+ | Question: what is method chaining in Python? | ||
+ | <ul> | ||
+ | * https://note.nkmk.me/en/python-method-chain-line-break/ | ||
+ | </ul> | ||
<!-- odne komentar --> | <!-- odne komentar --> | ||
+ | |||
== [[#top|^]] Python Data Types == | == [[#top|^]] Python Data Types == | ||
Line 22: | Line 27: | ||
<ul> | <ul> | ||
* https://docs.python.org/3/library/re.html | * https://docs.python.org/3/library/re.html | ||
+ | </ul> | ||
+ | <!-- odne komentar --> | ||
+ | == [[#top|^]] Python Libraries == | ||
+ | Starting point to describe Python language libraries and cases where they are needed: | ||
+ | <ul> | ||
+ | * 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 | ||
+ | </ul> | ||
+ | |||
+ | <!-- odne komentar --> | ||
+ | |||
+ | == [[#top|^]] 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. | ||
+ | |||
+ | <ul> | ||
+ | * https://note.nkmk.me/en/python-long-string/ | ||
</ul> | </ul> | ||
<!-- odne komentar --> | <!-- odne komentar --> | ||
<!-- EOF --> | <!-- EOF --> |
Latest revision as of 17:17, 20 February 2024
2023-10-11 Wednesday
Contents
^ Overview
Python notes local page on Neela Nurseries wiki
^ Questions
Question: what is the syntax or python-ism in this construcxt?:
if __name__ == '__main__': main()
Question: what is method chaining in Python?
^ 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
^ 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.