Python

From KirkWiKi
Revision as of 14:27, 25 January 2023 by Kittell (talk | contribs) (→‎Packages)
Jump to navigation Jump to search

Elsewhere:

Packages

pip

Update pip (ref):

  • [Mac] pip install -U pip
  • [Windows] python -m pip install -U pip

Update package: pip install [package_name] --upgrade

File input/output

with open('workfile') as f:
    for line in f:
        print(line, end='')

Formatting

Classes

https://docs.python.org/3/tutorial/classes.html

__repr__