User Tools

Site Tools


programmieren:python

Python

Tutorials

Tipps

  • Python-Skript via Batch starten (Quelle auf Reddit)
    • cmd /k "python -m srcFolder.main"
    • besser (your_python_script_file_without_extension hat in diesem Fall eine
      if name == 'main-“Methode”):
cmd /k "call venv\scripts\activate & python -m src.your_python_script_file_without_extension"


oder noch besser: venv activaten, dann ins src-Verzeichnis springen und dort den Bot starten; klappt beim Tender-Screening!

cmd /k "call venv\Scripts\activate & cd src & python -m your_python_script_file_without_extension"
  • v.a. wenn der 'venv'-Ordner nicht im src-Ordner sondern auf gleicher Ebene liegt
  • pip-Packages lokal/offline installieren (via cmd.exe)
  1. von pypi.org im jeweiligen Package unter “Download files” die .tar.gz-Datei herunterladen
  2. die .tar.gz-Datei mit 7-ZIP öffnen und den Ordner in der .tar-Datei (gleicher Name wie die .tar.gz-Datei) auf gleiche Ebene legen wie venv-Ordner vom Projekt
  3. ggf. vorher venv\Scripts\activate
  4. pip install ./packagename-1.3.3.7

Package-Management

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).

programmieren/python.txt · Last modified: by felix

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki