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

  • HouseholdHacker

    HouseholdHac

    6 Kasım 2007
  • HowToBasic

    HowToBasic

    8 Aralık 2011
  • MVLV28

    MVLV28

    17 Mart 2008