Skip to content

Python3 - Struktur eines Projektes

Python3
1 1 159
  • Ich hatte mich gestern mal versucht ein wenig einzulesen, wie man ein Python Projekt strukturiert. Dabei habe ich wieder viele interessante Dingen gelernt.

    Eine Sache davon ist das hier

    requirements.txt erzeugen

    (restic_ui-RwXjz-0W) frank@frank-MS-7C37:~/restic_ui$ pipenv lock -r > requirements.txt
    

    Inhalt aktuell

    cffi==1.15.0
    cryptography==36.0.1
    pycparser==2.21
    pyqt5-qt5==5.15.2
    pyqt5-sip==12.9.0
    pyqt5==5.15.6
    

    Meine aktuelle Struktur sieht so aus

    frank@frank-MS-7C37:~/Restic_UI_Produktiv/restic-ui-public$ tree
    .
    ├── icons
    │   ├── add.svg
    │   ├── delete.svg
    │   ├── document-save.svg
    │   ├── edit.svg
    │   ├── exit.svg
    │   ├── folder-open.svg
    │   ├── help-info.svg
    │   ├── media-playback-start.svg
    │   ├── reload.svg
    │   ├── Restic_Logo.png
    │   ├── Restic_UI_main_screen.png
    │   └── settings.svg
    ├── LICENSE
    ├── log.txt
    ├── Pipfile
    ├── Pipfile.lock
    ├── README.md
    ├── requirements.txt
    ├── setup.py
    └── src
        ├── create.py
        ├── crypt.py
        ├── functions.py
        ├── __init__.py
        ├── __pycache__
        │   ├── crypt.cpython-38.pyc
        │   ├── functions.cpython-38.pyc
        │   ├── settings.cpython-38.pyc
        │   └── waitingspinnerwidget.cpython-38.pyc
        ├── restic_ui.py
        ├── settings.py
        └── waitingspinnerwidget.py
    
    3 directories, 30 files
    

    Die Ansicht bekommt man mit

    apt install tree
    

    Quellen

  • Python - mehrsprachiges GUI

    Python3 python3
    1
    1
    0 Stimmen
    1 Beiträge
    217 Aufrufe
    Niemand hat geantwortet
  • Restic UI - QThread

    Restic UI restic-ui python3
    1
    0 Stimmen
    1 Beiträge
    156 Aufrufe
    Niemand hat geantwortet
  • Python3 - PyQt5 QIcon

    Python3 pyqt5 python3
    2
    2
    0 Stimmen
    2 Beiträge
    189 Aufrufe
    FrankMF
    Die Suchpfade findet man hiermit print(QIcon.themeSearchPaths()) Ausgabe ['/home/frank/.icons', '/usr/share/cinnamon/icons', '/var/lib/flatpak/exports/share/icons', '/usr/share/icons', ':/icons']
  • Django - Webframework

    Python3 django python3
    1
    2
    0 Stimmen
    1 Beiträge
    147 Aufrufe
    Niemand hat geantwortet
  • Restic UI - Documentation

    Restic UI restic-ui python3 pyqt5
    1
    1
    0 Stimmen
    1 Beiträge
    349 Aufrufe
    Niemand hat geantwortet
  • Python3 - String-Operatoren

    Python3 python3
    1
    0 Stimmen
    1 Beiträge
    174 Aufrufe
    Niemand hat geantwortet
  • Python3 - RegEx für ein LineEdit

    Python3 pyqt5 python3
    2
    1
    0 Stimmen
    2 Beiträge
    231 Aufrufe
    FrankMF
    Gut, Menschen die mich kennen, wissen das IPv6 nicht so mein Spezialgebiet ist. Es hilft aber nichts, auch damit muss man sich beschäftigen Es war etwas schwierig was Passendes zu finden, aber ich denke das hier ist ganz gut. Ob es alle Möglichkeiten bei IPv6 beinhaltet, weiß ich nicht zu 100%. Hier eine Seite, wo ich was Passendes gefunden habe. https://ihateregex.io/expr/ipv6/ Code # regex für IPv6 reg_ex = QRegExp('^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$') input_validator = QRegExpValidator(reg_ex, self.lineedit2_ipv6) self.lineedit2_ipv6.setValidator(input_validator) Ein paar Test von mir ergaben, das es so aussieht als wenn es funktioniert
  • Python und GUI

    Verschoben Python3 python3
    1
    1
    0 Stimmen
    1 Beiträge
    198 Aufrufe
    Niemand hat geantwortet