SORU
18 Temmuz 2010, Pazar


Python: okuma diziye satır satır dosya

Nasıl Python dosyasının her satırı okurum ve Dizideki bir öğe olarak her mağazası?

Dosyayı satır satır okumak istiyorum ve her satır dizinin sonuna eklenir.

CEVAP
18 Temmuz 2010, Pazar


with open(fname) as f:
    content = f.readlines()

list anlamı ve dizi olmadığını tahmin ediyorum.

Bunu Paylaş:
  • Google+
  • E-Posta
Etiketler:

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • InsideBlackBerry

    InsideBlackB

    14 Aralık 2009
  • manadude21

    manadude21

    11 Mart 2008
  • Perihelion

    Perihelion

    23 NİSAN 2008