[Tutor] Hello World in Python without space

Richard D. Moores rdmoores at gmail.com
Sat Jul 16 01:39:32 CEST 2011


On Fri, Jul 15, 2011 at 16:21, xDog Walker <thudfoo at 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


More information about the Tutor mailing list