| | |
writing to a file
![]() |
•
•
Join Date: Nov 2008
Posts: 58
Reputation:
Solved Threads: 0
I am trying to write some simple information to a file and i am getting the error message "No such file or directory when i know full well it exists. If you take the url http://www.adamplowman.com/uni_project/log.txt you get the file
heres the code
heres the code
Python Syntax (Toggle Plain Text)
#!/usr/bin/python print "Creating a text file with the write() method." text_file = open("http://www.adamplowman.com/uni_project/log.txt", "w") text_file.write("Line 1\n") text_file.write("This is line 2\n") text_file.write("That makes this line 3\n") text_file.close()
It could work if you pass a file path to open, like
uni_project/log.txt , but nothing that starts whith http://. Last edited by Gribouillis; Jan 23rd, 2009 at 9:25 am.
•
•
Join Date: Nov 2008
Posts: 58
Reputation:
Solved Threads: 0
i am struggling with this
so if the file i want to write to is located here
http://www.adamplowman.com/uni_project/log.txt
and my code to write to the file is running from here
http://adamplowman.com/cgi-bin/proje...ing_to_file.py
is this possible?
so if the file i want to write to is located here
http://www.adamplowman.com/uni_project/log.txt
and my code to write to the file is running from here
http://adamplowman.com/cgi-bin/proje...ing_to_file.py
is this possible?
![]() |
Similar Threads
- writing to file (Python)
- writing to a file (C++)
- Writing in a file (C++)
- Read/write to same file > once, Help (C++)
- writing to a file (Java)
- Saving a file (Java)
- file input and output (C)
Other Threads in the Python Forum
- Previous Thread: tkinter
- Next Thread: Two questions: wxpython registerhotkey and os.system
| Thread Tools | Search this Thread |
alarm assignment avogadro beginner bluetooth character cmd code customdialog cx-freeze data decimals dictionary directory dynamic error examples exe file float format function generator getvalue gnu graphics gui halp homework http ideas import input ip itunes java leftmouse line linux list lists logging loop maintain maze millimeter module mouse number numbers output parsing path port prime programming projects push py2exe pygame pyglet pyqt python queue random recursion schedule screensaverloopinactive script scrolledtext slicenotation sqlite ssh stdout string strings sudokusolver table terminal text thread threading time tlapse tuple tutorial ubuntu unicode urllib urllib2 variable variables ventrilo verify vigenere web webservice wikipedia wxpython xlib






