User Tools

Site Tools


programmieren:python

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
programmieren:python [2021/11/05 18:39] – [Tipps] felixprogrammieren:python [2025/01/07 15:32] (current) – [Package-Management] felix
Line 7: Line 7:
   * **Python-Skript via Batch** starten ([[https://redd.it/729u0t/|Quelle auf Reddit]])   * **Python-Skript via Batch** starten ([[https://redd.it/729u0t/|Quelle auf Reddit]])
     * ''%%cmd /k "python -m srcFolder.main"%%''     * ''%%cmd /k "python -m srcFolder.main"%%''
-    * besser (''your_python_script_file_without_extension'' hat in diesem Fall eine ''if __name__ == 'main''-"Methode"): +    * besser (''your_python_script_file_without_extension'' hat in diesem Fall eine\\ ''if __name__ == 'main''-"Methode"): 
- <code cmd>%%cmd /k "call venv\scripts\activate & python -m src.your_python_script_file_without_extension" + <code batch>cmd /k "call venv\scripts\activate & python -m src.your_python_script_file_without_extension"</code>\\ 
-pause%%</code>+ oder noch besser: venv activaten, dann ins src-Verzeichnis springen und dort den Bot starten; klappt beim Tender-Screening!\\ 
 + <code batch>cmd /k "call venv\Scripts\activate & cd src & python -m your_python_script_file_without_extension"</code>
     * v.a. wenn der 'venv'-Ordner nicht im src-Ordner sondern auf gleicher Ebene liegt     * v.a. wenn der 'venv'-Ordner nicht im src-Ordner sondern auf gleicher Ebene liegt
   * **pip-Packages lokal**/offline installieren (via cmd.exe)   * **pip-Packages lokal**/offline installieren (via cmd.exe)
Line 16: Line 17:
     - ggf. vorher ''%%venv\Scripts\activate%%''     - ggf. vorher ''%%venv\Scripts\activate%%''
     - ''%%pip install ./packagename-1.3.3.7%%''     - ''%%pip install ./packagename-1.3.3.7%%''
 +
 +==== Package-Management ====
 +
 +<WRAP center round info 100%>
 +pipx is not a tool for managing a projects virtual environment. It is used to install command line applications (implemented as Python packages e.g. ruff, mypy, ...) in isolated environments, while making the CLI of those applications available globally (i.e. without needing to activate a virtual environment).
 +</WRAP>
 +
 +  * [[https://www.reddit.com/r/learnpython/comments/jq5miv/comment/gblibwq/|pip vs. pipx]]
 +  * [[https://dev.to/bowmanjd/python-tools-for-managing-virtual-environments-3bko|Übersicht zum Managen von Virtual Environments]]
 +
programmieren/python.1636133969.txt.gz · Last modified: by felix

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki