Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > de.comp.lang.python > #5556
| From | Hartmut Goebel <h.goebel@goebel-consult.de> |
|---|---|
| Newsgroups | de.comp.lang.python |
| Subject | Re: [Python-de] Programming-Guidelines |
| Date | 2019-10-24 11:14 +0200 |
| Organization | Goebel Consult |
| Message-ID | <mailman.139.1571908487.32318.python-de@python.org> (permalink) |
| References | <831c8f4e-ab87-34bd-b7f2-4d2cf6eff38b@thomas-guettler.de> <mailman.138.1571904149.32318.python-de@python.org> <h1d7o7F8encU1@mid.individual.net> <8f590d9a-981e-70c1-94d8-49c6baac5faf@goebel-consult.de> |
[Multipart message — attachments visible in raw view] - view raw
Am 24.10.19 um 11:04 schrieb Hermann Riemann:
> Um in Python bei bei Suche mit grep -rp pyc Dateien
> nicht zu durchsuchen, verwende ich symbolische links.
> ( das Gleiche um die von *emacs erzeugte *~
> nicht auch zu durchsuchen.)
Wenn Du deinen Dateien mit git verwaltetes, dann ist git grep Dein Freund.
> if not os.path.exists(ordnername):
> os.system("mkdir "+ordnername)
> verwende ich des öfteren.
Fröstel!
1) os.system sollte man nicht versenden, sondern subprocess.run()
2) String.Konkatination ist brandgefährlich. wenn man einen externe
Prozess startet. das ist ein Einfallstor für Shell-Escape-Angriffe.
3) Du möchtest "os.makedirs()" verwenden.
--
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:
https://www.goe-con.de/blog/gemeinsam-die-gala-zur-verleihung-der-der-bigbrotherawards-gucken
Kolumne:
https://www.goe-con.de/hartmut-goebel/cissp-gefluester/2012-09-steht-ein-manta-fahrer-vor-der-uni
Back to de.comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar
[Python-de] Programming-Guidelines Thomas Güttler <guettliml@thomas-guettler.de> - 2019-10-24 09:56 +0200
Re: [Python-de] Programming-Guidelines Hermann Riemann <nospam.ng@hermann-riemann.de> - 2019-10-24 11:04 +0200
Re: [Python-de] Programming-Guidelines Hartmut Goebel <h.goebel@goebel-consult.de> - 2019-10-24 11:14 +0200
Re: [Python-de] Programming-Guidelines Hermann Riemann <nospam.ng@hermann-riemann.de> - 2019-10-24 14:38 +0200
Re: [Python-de] Programming-Guidelines Hartmut Goebel <h.goebel@goebel-consult.de> - 2019-10-24 14:52 +0200
Re: [Python-de] Programming-Guidelines Hermann Riemann <nospam.ng@hermann-riemann.de> - 2019-10-24 17:56 +0200
Re: [Python-de] Programming-Guidelines Felix Schwarz <felix.schwarz@web.de> - 2019-10-25 10:46 +0200
Re: [Python-de] Programming-Guidelines Erich Schnoor <eschnoor@multi-matrix.de> - 2019-10-25 12:34 +0200
Re: [Python-de] Programming-Guidelines Erich Schnoor <eschnoor@multi-matrix.de> - 2019-10-25 12:27 +0200
csiph-web