Tkinter listbox and ftputil

Hendrik van Rooyen mail at microcorp.co.za
Sun Sep 3 06:29:22 EDT 2006


 <vedran_dekovic at yahoo.com> wrote by email:

Please keep it on the list...

| Hi,
| Hi and Thanks for all your help,everything work.But I have one
| question,in string I am "new",and I don't know how to exactly split:
|
| example:
|
| '-rw-r--r--   1 admin at v-programs.byethost31.com
| v-programs.byethost31.com     2376 Aug 28 08:48 sun.gif'
|
|
| in new entry must write just filename:  sun.gif not:
|
| '-rw-r--r--   1 admin at v-programs.byethost31.com
| v-programs.byethost31.com     2376 Aug 28 08:48 sun.gif'
|
| .... so can you help to I split:
|
| '-rw-r--r--   1 admin at v-programs.byethost31.com
| v-programs.byethost31.com     2376 Aug 28 08:48 sun.gif'   from that
| import just: sun.gif
|
|                                                               THANK
| YOU!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

IDLE 1.1.3      ==== No Subprocess ====
>>> NameOfString = '-rw-r--r--   1 admin at v-programs.byethost31.com
v-programs.byethost31.com     2376 Aug 28 08:48 sun.gif'
>>> NameOfList = NameOfString.split()
>>> print NameOfList[:]
['-rw-r--r--', '1', 'admin at v-programs.byethost31.com',
'v-programs.byethost31.com', '2376', 'Aug', '28', '08:48', 'sun.gif']
>>> print NameOfList[-1]
sun.gif
>>>

That should see you on yer way... - Have you read the tutorial?

You should also learn to use the interactive interpreter - it is your friend...

- Hendrik






More information about the Python-list mailing list