Re: [Tutor] tkinter, create widgets during runtime?

2011-01-27 Thread Elwin Estle
>From the lack of replies...I am guessing that this can't be done.  Tho I just >realized I had a typo in part of it. The line that reads: "Is there a way to do something like this in Tkinter?  Or am I correct in guessing that if it is not possible, it is probably more complicated than the above

Re: [Tutor] get xml for parsing?

2011-01-27 Thread Alex Hall
On 1/27/11, Stefan Behnel wrote: > Alex Hall, 27.01.2011 05:01: >> How would I go about getting the xml from a website through the site's >> api? The url does not end in .xml since the xml is generated based on >> the parameters in the url. For example: >> https://api.website.com/user/me/count/10?

Re: [Tutor] tkinter, create widgets during runtime?

2011-01-27 Thread Karim
I never did that but this is python! You can create anything you want at runtime! Make a factory method in you gui class which inherit from Frame or whatever container code below is testing: >>> from Tkinter import * >>> class gui(Frame): ... def __init__(self, master=None): ...

Re: [Tutor] tkinter, create widgets during runtime?

2011-01-27 Thread python
Elwin, There is a dedicated Python Tkinter mailing list called tkinter-discuss. I would post your question to this mailing list - I've found them very helpful. Malcolm ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options

Re: [Tutor] tkinter, create widgets during runtime?

2011-01-27 Thread Wayne Werner
On Wed, Jan 26, 2011 at 11:21 AM, Elwin Estle wrote: > With Tcl/Tk, you can generate widgets "on the fly" during program > execution, without having to explicitly create them in your code. i.e., > something like: > > for {set i 0} {$i <= 5} {incr i} { > label .myLabel_$i -text "this is label

[Tutor] Facebook

2011-01-27 Thread Christopher King
Dear Tutors, I'm using the Facebook API. How do you get an access token? The documentations at http://developers.facebook.com/docs/api, but I can't figure out an easy way to do it. Sincerely, Chris ___ Tutor maillist - Tutor@python.org To unsub

Re: [Tutor] tkinter, create widgets during runtime?

2011-01-27 Thread Karim
Hello Wayne, I provided a complete example see the mail above, pretty similar to yours. Regards Karim On 01/27/2011 04:54 PM, Wayne Werner wrote: On Wed, Jan 26, 2011 at 11:21 AM, Elwin Estle mailto:chrysalis_reb...@yahoo.com>> wrote: With Tcl/Tk, you can generate widgets "on the fly"

Re: [Tutor] Facebook

2011-01-27 Thread Luke Paireepinart
And what have you tried? What libs are you using? Which part is confusing you? - Sent from a mobile device. Apologies for brevity and top-posting. - On Jan 27, 2011, at 9:08 AM, Christopher King wrote: > Dear Tutors, > I'm using the Fa

Re: [Tutor] Facebook

2011-01-27 Thread Christopher King
Well actually I got it working now. I used the library from https://github.com/facebook/python-sdk/. It said you had to create an app, which I didn't want to do. That is, to get the access token. An access token is what gives me the right to look at peoples profile. What I found, was an app al

Re: [Tutor] Facebook

2011-01-27 Thread Steven D'Aprano
Luke Paireepinart wrote: And what have you tried? What libs are you using? Which part is confusing you? Surely it is the part Christopher says... getting an access token? I wonder whether he has read this? http://developers.facebook.com/docs/authentication/?_fb_noscript=1 (which is the first

Re: [Tutor] tkinter, create widgets during runtime?

2011-01-27 Thread Karim
Sorry, I forgot to update continuously the Frame: >>> app.mainloop() Karim On 01/27/2011 02:59 PM, Karim wrote: I never did that but this is python! You can create anything you want at runtime! Make a factory method in you gui class which inherit from Frame or whatever container code below

Re: [Tutor] tkinter, create widgets during runtime?

2011-01-27 Thread Karim
Sorry, I forgot to update continuously the Frame: >>> a.mainloop() Karim On 01/27/2011 02:59 PM, Karim wrote: I never did that but this is python! You can create anything you want at runtime! Make a factory method in you gui class which inherit from Frame or whatever container code below is

[Tutor] small ElementTree problem

2011-01-27 Thread Alex Hall
Hi all, I am using, and very much enjoying, the ElementTree library. However, I have hit a problem. Say I have something along the lines of: Message from Service 1.0 1 result 1 2 result 2 In my ResultSet class, I parse this to get the text of elements like message or

Re: [Tutor] tkinter, create widgets during runtime?

2011-01-27 Thread Elwin Estle
Thanks!  That was just what I was looking for. --- On Thu, 1/27/11, Wayne Werner wrote: From: Wayne Werner Subject: Re: [Tutor] tkinter, create widgets during runtime? To: "Elwin Estle" Cc: tutor@python.org Date: Thursday, January 27, 2011, 10:54 AM On Wed, Jan 26, 2011 at 11:21 AM, Elwin Es

[Tutor] ascii codec cannot encode character

2011-01-27 Thread Alex Hall
Hello again: I have never seen this message before. I am pulling xml from a site's api and printing it, testing the wrapper I am writing for the api. I have never seen this error until just now, in the twelfth result of my search: UnicodeEncodeError: 'ASCII' codec can't encode character u'\u2019' i

Re: [Tutor] small ElementTree problem

2011-01-27 Thread Karim
id is a tag so it is a OBJECT Element with attributes accessible by dictionnary x.attrib[key] and x.text for tag content text. canonical string representation of your Element object: Obj.id :>composite pattern. For result use iterator as below (not tested but should be ok): *_/#Parsing:/

Re: [Tutor] small ElementTree problem

2011-01-27 Thread Alex Hall
Thanks, I think I have it working. On 1/27/11, Karim wrote: > > id is a tag so it is a OBJECT Element with attributes accessible by > dictionnary x.attrib[key] and x.text for tag content text. > > canonical string representation of your Element object: Obj.id :> 'result' at [mem addr] > And roo

Re: [Tutor] ascii codec cannot encode character

2011-01-27 Thread Steven D'Aprano
Alex Hall wrote: Hello again: I have never seen this message before. I am pulling xml from a site's api and printing it, testing the wrapper I am writing for the api. I have never seen this error until just now, in the twelfth result of my search: UnicodeEncodeError: 'ASCII' codec can't encode ch

Re: [Tutor] ascii codec cannot encode character

2011-01-27 Thread Alex Hall
On 1/27/11, Steven D'Aprano wrote: > Alex Hall wrote: >> Hello again: >> I have never seen this message before. I am pulling xml from a site's >> api and printing it, testing the wrapper I am writing for the api. I >> have never seen this error until just now, in the twelfth result of my >> search

Re: [Tutor] small ElementTree problem

2011-01-27 Thread Stefan Behnel
Hi, since you said that you have it working already, here are just a few comments on your code. Alex Hall, 27.01.2011 23:23: all=root.findall("list/result") for i in all: self.mylist.append(Obj().parse(i)) It's uncommon to use "i" for anything but integer loop variables. And 'all' is not