G3258
Kilopat
- Katılım
- 9 Temmuz 2015
- Mesajlar
- 1.657
- Makaleler
- 5
- Çözümler
- 5
Elimde 3 tane .py dosyası var. Bunlar "main.py", "turkishSentences.py", "semicolons.py"
Ben "semicolons.py" dosyası içerisindeki "semicolonsSntcs" listesindeki verileri alıp, for döngüsüyle sonuna iki nokta ekleyip, "turkishSentences.py" adlı dosyaya kaydetmek istiyorum. Bunu nasıl yapabilirim? Aşağıdaki kodda iki nokta eklemeye kadar olan kısmı ve iki nokta eklemeyi başarabildim fakat bunu "turkishSentences.py" dosyasına kaydetmeyi beceremedim. Şimdiden yardımlarınız için teşekkür ederim.
[CODE lang="python" title="main.py"]from semicolons import semicolonsSntcs
from turkishSentences import trSentences
for i in range(0, len(semicolonsSntcs)):
trSentences.append(semicolonsSntcs + " : ")
print(*trSentences, sep="\n")[/CODE]
[CODE lang="python" title="semicolons.py"]semicolonsSntcs = [
"O John mu?",
"O John.",
"O John değil."
][/CODE]
[CODE lang="python" title="turkishSentences.py"]trSentences = [
][/CODE]
Ben "semicolons.py" dosyası içerisindeki "semicolonsSntcs" listesindeki verileri alıp, for döngüsüyle sonuna iki nokta ekleyip, "turkishSentences.py" adlı dosyaya kaydetmek istiyorum. Bunu nasıl yapabilirim? Aşağıdaki kodda iki nokta eklemeye kadar olan kısmı ve iki nokta eklemeyi başarabildim fakat bunu "turkishSentences.py" dosyasına kaydetmeyi beceremedim. Şimdiden yardımlarınız için teşekkür ederim.
[CODE lang="python" title="main.py"]from semicolons import semicolonsSntcs
from turkishSentences import trSentences
for i in range(0, len(semicolonsSntcs)):
trSentences.append(semicolonsSntcs + " : ")
print(*trSentences, sep="\n")[/CODE]
[CODE lang="python" title="semicolons.py"]semicolonsSntcs = [
"O John mu?",
"O John.",
"O John değil."
][/CODE]
[CODE lang="python" title="turkishSentences.py"]trSentences = [
][/CODE]
Son düzenleyen: Moderatör: