Hirdetés
Új hozzászólás Aktív témák
-
cousin333
addikt
Ebben az esetben egyszerűen így módosítanám a korábbi kódomat:
import osstart_string = 'START'stop_string = 'STOP'name_string = 'Adat:'filename = Noneoutput_file = Nonewith open('szoveg.txt', 'r') as input_file:for line in input_file:if line.startswith(start_string):output_file = open('output.txt', 'w')elif line.startswith(stop_string):output_file.close()if filename is not None:os.rename('output.txt', filename + '.txt')else:output_file.write(line)if name_string in line:loc = line.find(name_string )loc += len(name_string ) + 2filename = line[loc:loc+8]Elképzelhető, hogy kicsit módosítani kell a számokon, de azt már meg tudod nézni.
Új hozzászólás Aktív témák
- Kávé kezdőknek - amatőr koffeinisták anonim klubja
- Napelem
- Audi, Cupra, Seat, Skoda, Volkswagen topik
- Kormányok / autós szimulátorok topikja
- DVBViewer
- Rendszergazda topic
- One otthoni szolgáltatások (TV, internet, telefon)
- Eredeti játékok OFF topik
- Gyermekkorunk menő dumái
- Projektor topic
- További aktív témák...
- Zotac mini PC, több db
- Acer óriás laptop 17" 4GB RAM 500GB HDD DVD újszerű 91%-os akku!
- Apple iPhone 15 Plus 128GB, Kártyafüggetlen, 1 Év Garanciával
- Dell Precision 5570 4K+ OLED Touch / i7-12800H 14C / 16-32G / 512G / RTX A2000 8G / IR FPR WS
- Dell Precision 7560 FHD / i7-11850H / 32G / 512G G4 / RTX A4000 8G / SCR WS tervező
Állásajánlatok
Cég: PCMENTOR SZERVIZ KFT.
Város: Budapest
Cég: Laptopszaki Kft.
Város: Budapest


