[Tutor] Linux/Windows
Bill Mill
bill.mill at gmail.com
Tue Oct 26 03:29:48 CEST 2004
Ali,
all the functions you mentioned should work just fine in linux. Linux
filesystems are very similar to windows filesystems. There are,
however, no c: or d: drives in linux. Instead, every file is contained
below one main ('root') directory, called '/'. As such, the file you
open will have to be something like '/var/temp/myfile.tmp'. For more
info, read http://www.tldp.org/LDP/Linux-Filesystem-Hierarchy/html/index.html
. I haven't read it, but I looked it over briefly and it seemed to
contain the important information about linux filesystems.
Peace
Bill Mill
bill.mill at gmail.com
On Mon, 25 Oct 2004 12:32:19 -0700 (PDT), Ali Polatel
<alipolatel at yahoo.com> wrote:
>
> Dear tutors,
> 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...
> I think there is no need to change the usual functions and classes all I
> need to do is a modification in creating files outside the programme.
> 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')
> Another thing is in windows the programme can understand it self-directory
> with os.getcwd() command...Can we also do it in Linux?I mean for example
> when I do:
> import os
> os.getcwd()
> the interpreter gives "c:\python23"
> How to do same in Linux?
> And I am not someone who is acquianted with Linux..Can someone create
> directories in Linux?(like the mkdir() function in windows)
> Thanks all for your help
> Ali Polatel
>
> ________________________________
> Do you Yahoo!?
> vote.yahoo.com - Register online to vote today!
>
>
> _______________________________________________
> Tutor maillist - Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor
>
>
>
More information about the Tutor
mailing list