On 07/15/2011 07:39 PM, Richard D. Moores wrote:
On Fri, Jul 15, 2011 at 16:21, xDog Walker<thud...@gmail.com> wrote:
I believe on Windows, you can almost always use a forward slash in a path:
C:/somewhere/somewhereelse/
with open("C:/test/test.txt", "a") as file_object:
print("Hello, world!", file=file_object)
Yes, that works for me with Windows Vista. However, if test.txt is
empty, it puts in a blank line as line 1; line 2 is "Hello, world!".
Dick
_
I expect that your extra newline was already in the "empty" file. It
cannot have anything to do with using the forward slash for the filename.
DaveA
--
DaveA
_______________________________________________
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor