473,396 Members | 1,996 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Tkinter listbox and ftputil

Hi,
Again I need help about tkinter listbox.
example:

In listbox must write (imaginary file in server):

['-rw-r--r-- 1 ve****@vedran.byethost12.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!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Sep 1 '06 #1
2 1580

<ve************@yahoo.comwrote:
| Hi,
| Again I need help about tkinter listbox.
|
|
| example:
|
| In listbox must write (imaginary file in server):
|
| ['-rw-r--r-- 1 ve****@vedran.byethost12.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
Sep 2 '06 #2
<ve************@yahoo.comwrote 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 ad***@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 ad***@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 ad***@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 ad***@v-programs.byethost31.com
v-programs.byethost31.com 2376 Aug 28 08:48 sun.gif'
>>NameOfList = NameOfString.split()
print NameOfList[:]
['-rw-r--r--', '1', 'ad***@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

Sep 3 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Patrick L. Nolan | last post by:
Our Tkinter application has a big ScrolledText widget which is a log of everything that happens. In order to prevent people from making changes, we have it in DISABLED mode except when the...
2
by: Zhang Le | last post by:
Hello, Is there a quick way to replace the content of a single item in tkinter's listbox? Currently my solution is to first delete the item, then insert a new item at the same position. I think...
2
by: Harlin Seritt | last post by:
Whenever I set up something similar: vals = for v in vals: listbox.inset(END, v) I notice that when this listbox is displayed, there is never a default value. How can I make sure that one...
3
by: Harlin Seritt | last post by:
I've created a ghetto-ized ComboBox that should work nicely for Tkinter (unfortunately no dropdown capabilities yet). I've found why it's such a pain in the @ss to create one. You have to...
1
by: geon | last post by:
Hi, When I try to upload many files I get such a error message: Traceback (most recent call last): File "I:\Python\my_py\wwwzaci\xcopy_ftp.py", line 51, in ? except: x=host.upload(zdroj,...
0
by: veki | last post by:
HI,ALL I am new ftputil user and I need help about something: my prog: >>> import tkFileDialog >>> import ftputil >>> name=tkFileDialog.askopenfile() >>>ftp=ftputil.FTPHost() #Please when you...
3
by: vedran_dekovic | last post by:
Hi, I need help about Tkinter listbox widget.I want,when somebody click on any item(file) in Listbox,then in new Label widget text must be selected item from server. my program (wrong...
32
by: Kevin Walzer | last post by:
I'm a Tcl/Tk developer who has been working, slowly, at learning Python, in part because Python has better support for certain kinds of applications that I want to develop than Tcl/Tk does....
1
by: Croteam | last post by:
Hello, I trying to make ftputil client that uses ssl security.First I was try to make that with M2Crypto,but when I use it, I get the error: Traceback (most recent call last): File...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.