Skip to content

Joao-Angelo-P/python-codes-exercises

Repository files navigation

python-codes-exercises

Treino mais aprofundando de Python. Carregar códigos Python

Try to simulate "python -m tkinter"

  • To run in the same directory path
(directory path)>python -m pkg_teste
  • Configure a $PYTHONPATH to directory path and you will can run globally
python -m pkg_teste

Interactive shell with python file

  • Create virtaul environment
python3 -m venv .venv
  • Activated virtaul environment (Linux)
source .venv/bin/activate
  • Deactivated virtaul environment
deactivate
  • Example: (Should not forget to run in virtual environment activated)
python3 -i ex.py
  • Run script "ex3.py" for extract data from file(text data)
python3 -i ex3.py
>>> arq = 'file_example.txt'
>>> __load__file(arq)
['oi', 'oi2', 'oi3', 'oi4', 'oi5', 'oi6']
  • No exercício 6(ex6.py), pequena demostração do porquê não usar lista vazia no segmento init de classes/objetos. O mais correto é adicionar um 'default' de 'None' e declarar a lista num 'if'.

About

Treino mais aprofundando de Python. Carregar códigos Python

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published