Tkinter listbox and ftputil

V

vedran_dekovic

Hi,
Again I need help about tkinter listbox.


example:

In listbox must write (imaginary file in server):

['-rw-r--r-- 1 (e-mail address removed)12.com vedran.byethost12.com
3506 Jun 25 14:40 file.gif']


.....and then when somebody click on file in listbox,then in new Entry
widget must
write just filename example: 'file.gif' , not other file
informations






THANKS!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 
H

Hendrik van Rooyen

| Hi,
| Again I need help about tkinter listbox.
|
|
| example:
|
| In listbox must write (imaginary file in server):
|
| ['-rw-r--r-- 1 (e-mail address removed)12.com vedran.byethost12.com
| 3506 Jun 25 14:40 file.gif']
|
|
| ....and then when somebody click on file in listbox,then in new Entry
| widget must
| write just filename example: 'file.gif' , not other file
| informations
|
|
|
|
|
|
| THANKS!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

This thing looks like a list with one item in it, and the item looks like a
string ['.....']

So you can access the string as the first item in the list, and then you can use
split() on the string part, - this will give you list of words - the last word
in the list will be the one you want...

hth - Hendrik
 
H

Hendrik van Rooyen

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 (e-mail address removed)31.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 (e-mail address removed)31.com
| v-programs.byethost31.com 2376 Aug 28 08:48 sun.gif'
|
| .... so can you help to I split:
|
| '-rw-r--r-- 1 (e-mail address removed)31.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 (e-mail address removed)31.com v-programs.byethost31.com 2376 Aug 28 08:48 sun.gif'
NameOfList = NameOfString.split()
print NameOfList[:]
['-rw-r--r--', '1', '(e-mail address removed)31.com',
'v-programs.byethost31.com', '2376', 'Aug', '28', '08:48', '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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,821
Latest member
AleidaSchi

Latest Threads

Top