SORU
12 ŞUBAT 2009, PERŞEMBE


Python ile dosya ayıklama uzantısı

Bir işlevi, bir dosya adı uzantısı ayıklamak için var mı?

CEVAP
12 ŞUBAT 2009, PERŞEMBE


Evet. Kullanım os.path.splitext:

>>> import os
>>> filename, file_extension = os.path.splitext('/path/to/somefile.ext')
>>> filename
'/path/to/somefile'
>>> file_extension
'.ext'

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

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • emimusic

    emimusic

    10 Mart 2006
  • L33TNoonProductions

    L33TNoonProd

    24 EYLÜL 2010
  • TVNorge

    TVNorge

    5 EKİM 2006