[python-win32] Linux\Windows

Tim Golden tim.golden at viacom-outdoor.co.uk
Tue Oct 26 09:38:48 CEST 2004


[Ali Polatel]
> I have written a programme for windows (no GUI but 
> some commands which create and write things in text files)
> I want to modify this programme so that it will work in Linux...

> If anyone who knows how to do this in Linux can you tell me 
> the equivalent of the function in Linux?:
> "go=open('c:/test.txt','w')"
>  go.write('Hello world\n')

Ummm... the only thing you need to change is the location
of the file. If you don't know where to put the file on
Linux instead of "c:/" then maybe you ought to find out
before you go any further. A sensible choice might be:

go = open ("~/test.txt", "w")

which will put the file in the user's home directory.

> Another thing is in windows the programme can 
> understand it self-directory with os.getcwd() 
> command...Can we also do it in Linux?

Yes.

> And I am not someone who is acquianted with Linux..
> Can someone create directories in Linux?
> (like the mkdir() function in windows)

Yes.

By the way, if you haven't already, please post to
the main Python newsgroup / mailing list; either
news:comp.lang.python or 
http://mail.python.org/mailman/listinfo/python-list

HTH
TJG

________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________


More information about the Python-win32 mailing list