| | |
writing to a file
Please support our Python advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
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 |
abrupt ansi anti approximation assignment avogadro backend beginner binary bluetooth calculator character cmd code customdialog data decimals dictionaries dictionary drive dynamic error examples excel exe file float format function gnu graphics gui heads homework http ideas import input java launcher leftmouse line linux list lists logging loop module mouse number numbers output parsing path pointer port prime programming progressbar projects push py2exe pygame pyqt python random recursion schedule screensaverloopinactive script scrolledtext sqlite statistics stdout string strings sudokusolver sum table terminal text thread threading time tkinter tlapse tricks tuple tutorial twoup ubuntu unicode urllib urllib2 variable wikipedia windows write wxpython xlib






