| | |
file handling in python
Please support our Python advertiser: Programming Forums - DaniWeb Sister Site
![]() |
Yes. You can use
You'll need to take that into account on a per-file basis.
open to open a file and return the file handle. Note that some formats (ie, .doc) are not "flat" text files, meaning they may have some binary data, markup, etc.You'll need to take that into account on a per-file basis.
•
•
•
•
So how do I open eg a file with file name jag.doc that is stored in my documents folder, how do I specify where the file is located?
To specify the file's location you can type the absolute path to the file, ie
C:\Documents and Settings\<user_name>\My Documents\jag.doc ; however in PYthon \ is an escape character. In light of this you could either use the forward slash / like linux or use a double backslash \\ Last edited by jlm699; Aug 21st, 2009 at 2:47 pm.
![]() |
Similar Threads
- File Handling (Python)
- File Handling (Python)
- File Handling. Implimentation problem. (C)
- please give me a simple file handling program (C)
- File Handling (C)
- C File handling - search within file without reading content? (C++)
Other Threads in the Python Forum
- Previous Thread: Control Structures in Python
- Next Thread: Selecting files with certain file names
| Thread Tools | Search this Thread |
Tag cloud for Python
alarm assignment avogadro beginner bluetooth character cmd code copy customdialog cx-freeze data decimals dictionary directory dynamic error examples excel exe file float font format function generator gnu graphics gui halp homework http ideas import input itunes java leftmouse line linux list lists logging loop maze module mouse number numbers output parsing path port prime program programming projects push py2exe pygame pyglet pyqt python random recursion schedule screensaverloopinactive script scrolledtext sqlite ssh stdout string strings sudokusolver table terminal text thread threading time tkinter tlapse tuple tutorial ubuntu unicode update urllib urllib2 variable ventrilo verify vigenere web webservice wikipedia windows wxpython xlib






