[Tutor] Re: cd reader

Chris Avery purplebo@babylonia.flatirons.org
Sun Nov 24 17:13:01 2002


Very well.  I got there.  The problem is writing the contents of the
returned list to a file.

Chris

> Chris Avery schrieb:
> 
> >Hello all,
> >I need to write a program that'll read the contents of a CD and write
> >the filenames to a file for printing.
> >
> >Where should I start?
> >
> Where are you? I think you can't start elsewhere.
> If you tell us where you are, perhaps we can recommend
> how to continue.
> 
> If you are, accidentally, in IDLE (or PythonWin)
> - try something like the following:
> 
>  >>> import os
>  >>> os.getcwd()
> 'C:\\Py4Kids'
>  >>> os.listdir(os.getcwd())
> ['kap01', 'kap02', 'kap03', 'kap04', 'kap05', 'kap06', 'kap07',
'kap09']
>  >>> os.chdir('kap09')
>  >>> os.listdir(os.getcwd())
> ['laufzeit.py', 'quadrat.py', 'reihe.py']
>  >>>
> 
> if you deed more information about module os, look at
> http://www.python.org/doc/current/lib/os-file-dir.html
> 
> Regards, Gregor
> 
> >
> >Thanks,
> >Chris
> >
> >
> >
> >_______________________________________________
> >Tutor maillist  -  Tutor@python.org
> >http://mail.python.org/mailman/listinfo/tutor
> >
> >
> >  
> >
> 
> 
> 
>