[Python-de] Re: Verstaendnis-Frage zu yield und Liste dahinter

2025-04-05 Thread Hartmut Goebel
") oder print(name, wert, sep=":") -- Schönen Gruß Hartmut Goebel Dipl.-Informatiker (univ), CISSP, CSSLP, ISO 27001 Lead Implementer Information Security Management, Security Governance, Secure Software Development Goebel Consult, Landshut http://www.goebel-consult.de Blog:

[Python-de] Re: subprocess.call() funktioniert nicht mit Windows?

2025-03-27 Thread Hartmut Goebel
um kümmert, wenn es nötig wäre. Ohne das wird autoexec.bat fuer jeden Befehl ausgefuehrt. Das entspricht /etc/profile Ich vermute, Du meinst die Flags für "cmd"?! Ich frage weshalb überhaupt ober "cmd". -- Schönen Gruß Hartmut Goebel Dipl.-Informatiker (univ), CISSP, CSSL

[Python-de] Re: subprocess.call() funktioniert nicht mit Windows?

2025-03-26 Thread Hartmut Goebel
Hi, def syscall(*cmd): cmd = ['cmd','/d','/c']+list(cmd) subprocess.call(cmd) Ich habe keine Ahnung von Windows, wunder mich aber, weshalb Du cmd /d /c davor stellst. Ich hätte vermutet, dass Python sich selbst darum kümmert, wenn es nötig wäre. -- Sc

[Python-de] Re: ssl.wrap_socket?

2025-03-23 Thread Hartmut Goebel
",port)) sock = sslctx.wrap_socket(sock,server_hostname="anderer-name-auf-mein-server.de") -- Schönen Gruß Hartmut Goebel Dipl.-Informatiker (univ), CISSP, CSSLP, ISO 27001 Lead Implementer Information Security Management, Security Governance, Secure Software Development Goebel Consult, Landshu

[Python-de] Re: Pfade, Modulnamen und import-Statements

2025-01-26 Thread Hartmut Goebel
package.module" ausführen, das geht: python -m package.module -- Schönen Gruß Hartmut Goebel Dipl.-Informatiker (univ), CISSP, CSSLP, ISO 27001 Lead Implementer Information Security Management, Security Governance, Secure Software Development Goebel Consult, Landshut http://www.goe

[Python-de] Re: PDT: Dateien kopieren und Kopien verifizieren

2024-08-27 Thread Hartmut Goebel
enen und ist leichter zu lesen. DIto unten. if filecmp.cmp( source_path, target_file_path, shallow=False ): pass Hier würde ich eine "okay" ausgeben. HTH -- Schönen Gruß Hartmut Goebel Dipl.-Informatiker (univ), CISSP, CSSLP, ISO 2700

[Python-de] Re: PDT: Datei blockweise kopieren

2024-08-18 Thread Hartmut Goebel
xample\to.txt" ) Hint: Die öffnende Klammer hinter "copy_and_compare" und Du kannst Dir den Backslash sparen. -- Regards Hartmut Goebel | Hartmut Goebel |h.goe...@crazy-compilers.com| |www.crazy-compilers.com | compilers which you thought are imposs

[Python-de] Re: Zuweisung via return

2024-07-05 Thread Hartmut Goebel
"Nachname:", nachname, ", sep="", file=f) Allerdings ist das nicht ganz so übersichtlich. Faustregel für mich ist daher eher: Wenn print und Leerzeichen zwischen den Elementen, dann *kein* Muster/Format. Allerdings: wenn der Output übersetzbar sein soll, dann is

[Python-de] Re: Kurze Variablennamen

2024-07-04 Thread Hartmut Goebel
ja auch davon ab, wieviel Code im "except"-Block steckt. -- Regards Hartmut Goebel | Hartmut Goebel |h.goe...@crazy-compilers.com| |www.crazy-compilers.com | compilers which you thought are impossible | ___ python-de Maili

[Python-de] Re: Zuweisung via return

2024-07-03 Thread Hartmut Goebel
aktuellen Rechnern nicht messbar sein - trotzdem wird mehr Rechenzeit und Speicher benötigt :-) Siehe auch https://de.wikipedia.org/wiki/Wirthsches_Gesetz -- Regards Hartmut Goebel | Hartmut Goebel |h.goe...@crazy-compilers.com| |www.crazy-compilers.com | compilers

[Python-de] Re: Zuweisung via return

2024-07-03 Thread Hartmut Goebel
Am 02.07.24 um 20:56 schrieb Andreas Röhler: print("zaehler: {}".format(zaehler)) Immer wieder sehe ich diese unnötigen und ineffizienten String-Formatierungen bei "print". print("zaehler:", zaehler) tut genau das gleiche. -- Regards Hartmut Goebel | H

[Python-de] Re: Pfade, Modulnamen und import-Statements

2024-05-11 Thread Hartmut Goebel
ser installiert nach $HOME/.local/lib/pythonX.YZ/site-packages. pip list zeigt Dir, was wo installiert ist. (Bei aktivem venv aber im venv und nicht im System.) -- Regards Hartmut Goebel | Hartmut Goebel |h.goe...@crazy-compilers.com| |www.crazy-compilers.com | compile

[Python-de] Re: Pfade, Modulnamen und import-Statements

2024-05-04 Thread Hartmut Goebel
t; muss Du ja auch den "Pfad" zum Modul angeben - warum wollte das in einem Modul anders sein? -- Regards Hartmut Goebel | Hartmut Goebel |h.goe...@crazy-compilers.com| |www.crazy-compilers.com | compilers which you thought are impossible | __

[Python-de] Re: sqlite3-datenbank

2024-02-10 Thread Hartmut Goebel
n. * Du möchtest die "join" Methode von Strings kennenlernen und Dir diverse Schleifen in Deinem Code sparen -- Schönen Gruß Hartmut Goebel Dipl.-Informatiker (univ), CISSP, CSSLP, ISO 27001 Lead Implementer Information Security Management, Security Governance, Secure Software Develo

[Python-de] Re: sqlite3-datenbank

2024-02-09 Thread Hartmut Goebel
)", data) con.commit() # Remember to commit the transaction after executing INSERT. -- Schönen Gruß Hartmut Goebel Dipl.-Informatiker (univ), CISSP, CSSLP, ISO 27001 Lead Implementer Information Security Management, Security Governance, Secure Software Development Goebel Consult, Landsh