Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > de.comp.lang.python > #6301
| Path | csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail |
|---|---|
| From | ram@zedat.fu-berlin.de (Stefan Ram) |
| Newsgroups | de.comp.lang.python |
| Subject | Re: PDT: Dateien kopieren und Kopien verifizieren |
| Date | 25 Aug 2025 19:19:33 GMT |
| Organization | Stefan Ram |
| Lines | 61 |
| Expires | 1 Jun 2026 11:59:58 GMT |
| Message-ID | <strip-20250825201240@ram.dialup.fu-berlin.de> (permalink) |
| References | <Kopieren-20240826223722@ram.dialup.fu-berlin.de> <r-20240826233716@ram.dialup.fu-berlin.de> <lj828nFsth7U1@mid.individual.net> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=UTF-8 |
| Content-Transfer-Encoding | 8bit |
| X-Trace | news.uni-berlin.de tVxpZ0xEqR9KdsR+hufMOgSl3StrpeQoSR9FYa76f+dJrX |
| Cancel-Lock | sha1:BSTtN92lQr91WYIKB/RteL8l7QI= sha256:vUObG8O576dggyHQ48IgY/OUugSGYcY6Ssu66cLeQFU= |
| X-Copyright | (C) Copyright 2025 Stefan Ram. All rights reserved. Distribution through any means other than regular usenet channels is forbidden. It is forbidden to publish this article in the Web, to change URIs of this article into links, and to transfer the body without this notice, but quotations of parts in other Usenet posts are allowed. |
| X-No-Archive | Yes |
| Archive | no |
| X-No-Archive-Readme | "X-No-Archive" is set, because this prevents some services to mirror the article in the web. But the article may be kept on a Usenet archive server with only NNTP access. |
| X-No-Html | yes |
| Content-Language | de-DE-1901 |
| Xref | csiph.com de.comp.lang.python:6301 |
Show key headers only | View raw
Hermann Riemann <nospam.ng@hermann-riemann.de> schrieb oder zitierte: >Warum so kompliziert? >Versuch mal: >sources1 =[ source.strip() for source in ''' > >C:\otherdir\example.txt >C:\somedir\example.txt >C:\somedir\example1.txt > >''' .strip().split( '\n' ) if source ] Ich habe mir das ".strip()" jetzt mal angesehen (nach ziemlich genau einem Jahr): Oben ist das ".strip().split( '\n' )" ja vollkommen in Ordnung. Aber bei x = ''' abc def '''.strip() würde das auch die Einrückung vor "a" entfernen. Aber diese Einrückung ist für mich manchmal wichtig. Dann könnte man: x = ''' abc def '''.strip( '\n' ) schreiben. Aber machmal sind mir auch Leerzeilen am Anfang oder am Ende wichtig, wie in: x = ''' abc def '''.strip( '\n' ) , die dann verschwinden würden. Ich möchte eben genau das eine Zeilenende nach "'''" und manchmal das eine vor "'''" entfernen, aber alles andere wörtlich übernehmen. Und dies erreiche ich genau mit "[1:]" oder "[1:-1]" wie in: x = ''' abc def '''[1:-1] . Daher ist das für mich mein allgemeines Muster um mehrzeiligen Text zu zitieren, dessen Zeilen direkt eingebettet werden, ohne "'''" zu enthalten.
Back to de.comp.lang.python | Previous | Next — Previous in thread | Find similar
Re: PDT: Dateien kopieren und Kopien verifizieren Hermann Riemann <nospam.ng@hermann-riemann.de> - 2024-08-28 09:34 +0200 Re: PDT: Dateien kopieren und Kopien verifizieren Hermann Riemann <nospam.ng@hermann-riemann.de> - 2024-08-28 14:05 +0200 Re: PDT: Dateien kopieren und Kopien verifizieren ram@zedat.fu-berlin.de (Stefan Ram) - 2025-08-25 19:19 +0000
csiph-web