09:05:00

TXT Tool Yardım Python

Bu Konuyu Görüntüleyen Kullanıcılar (Toplam: 1, Üyeler: 0, Misafirler: 1)

BLACKBİRD81

Çaylak
Katılım
25 Ocak 2025
Mesajlar
27
Tepkime puanı
2
Puanları
3
Bir TXT Dosyasında 0 ile biten satırdan sonraki 6 satırı başka TXT dosyasına yazıcak için exe için yardımcı olur musunuz?



import os



def main():

inp, out = "input.txt", "output.txt"

if not os.path.exists(inp):

print("HATA: input.txt bulunamadı.")

input("Devam etmek için tuşa basın...")

return

with open(inp, "r", encoding="utf-8", errors="ignore") as f:

lines = f.readlines()

res = []

for i, l in enumerate(lines):

if l.rstrip().endswith("0"):

res += lines[i+1:i+7]

with open(out, "w", encoding="utf-8") as f:

f.writelines(res)

print("Tamamlandı! output.txt oluşturuldu.")

input("Çıkmak için tuşa basın...")



if name == "main":

main()





benim pcde exe yapamıyorum.Gerçek exe olarak yardımcı olabilir misiniz?
 

Son mesajlar

shape1
shape2
shape3
shape4
shape5
shape6
Geri
Üst