Re: [Tutor] Learning about callbaks

2008-01-02 Thread Michael Bernhard Arp Sørensen
Greetings, my master. I think you need to strip back and simplify, it looks like you may have been reading too many different resources and incorporated some ideas without really understanding what they do and why. I'm humbled by your insight. This is absolutely true. I did some research,

Re: [Tutor] Learning about callbaks

2008-01-02 Thread Alan Gauld
Michael Bernhard Arp Sørensen [EMAIL PROTECTED] wrote I did some research, reading and test last night and I finally got it working. Sorry, but you didn't! However you are very nearly there... class UserInput: def __init__(self): pass def test_callback(self, this_callback):

Re: [Tutor] Learning about callbaks

2008-01-02 Thread Michael Bernhard Arp Sørensen
Hi again. On Jan 2, 2008 2:25 PM, Alan Gauld [EMAIL PROTECTED] wrote: I did some research, reading and test last night and I finally got it working. Sorry, but you didn't! However you are very nearly there... Darn. :-( I've read what to wrote about the *parentheses*. I see why I was

[Tutor] Choice of GUI builders

2008-01-02 Thread Roy Chen
Hello all, I've been using PythonCard to build a GUI for a simple program I'm trying to write. It's simple and easy to use, and rather intuitive. However, it seems that it hasn't been updated in some time, and so I would like a recommendation for a cross-platform (preferably) GUI builder. I'm

[Tutor] need a way to get my own ip address

2008-01-02 Thread shawn bright
Greetings, i am looking for an easy way to get my own ip address as a string from python. I am using Ubuntu Linux if that makes any difference. thanks ! shawn ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] need a way to get my own ip address

2008-01-02 Thread jay
You could perhaps use this method import socket myIP = socket.gethostbyaddr(socket.gethostname())[2] Jay On Jan 2, 2008 8:25 AM, shawn bright [EMAIL PROTECTED] wrote: Greetings, i am looking for an easy way to get my own ip address as a string from python. I am using Ubuntu Linux if that

Re: [Tutor] need a way to get my own ip address

2008-01-02 Thread shawn bright
Thanks, Jay, in IDLE, this gave me 127.0.0.1 is there a way to get my assigned ip instead of the localhost one? thanks On Jan 2, 2008 8:31 AM, jay [EMAIL PROTECTED] wrote: You could perhaps use this method import socket myIP = socket.gethostbyaddr(socket.gethostname())[2] Jay On Jan 2,

Re: [Tutor] need a way to get my own ip address

2008-01-02 Thread jay
Well that will return the reverse lookup of the current hostname assigned to your system. Is this a Windows or Linux/Unix system? What does this return? print socket.gethostname() print socket.gethostbyaddr(socket.gethostname()) j On Jan 2, 2008 8:45 AM, shawn bright [EMAIL PROTECTED] wrote:

Re: [Tutor] Choice of GUI builders

2008-01-02 Thread Michael Langford
While some people are Adobe haters(They hate the web...etc), I think a slick alternative available now is Flex2 calling python via XMLRPC. I've been doing so lately. It is fast to pick up and makes slick looking GUI's rather quickly. It has a cheap GUI builder that actually works if you don't

Re: [Tutor] need a way to get my own ip address

2008-01-02 Thread shawn bright
It returns this ('hostname', [], ['127.0.1.1']) i am running this on a linux system thanks On Jan 2, 2008 8:50 AM, jay [EMAIL PROTECTED] wrote: Well that will return the reverse lookup of the current hostname assigned to your system. Is this a Windows or Linux/Unix system? What does this

Re: [Tutor] need a way to get my own ip address

2008-01-02 Thread jay
Well that is what I normally use, but I always have my hostname setup properly. In your case, that socket call won't work. You could try this link I found on google http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/439094 jay On Jan 2, 2008 9:00 AM, shawn bright [EMAIL PROTECTED] wrote:

Re: [Tutor] need a way to get my own ip address

2008-01-02 Thread shawn bright
Thanks, Jay, just what i was looking for. Works great. shawn On Jan 2, 2008 9:10 AM, jay [EMAIL PROTECTED] wrote: Well that is what I normally use, but I always have my hostname setup properly. In your case, that socket call won't work. You could try this link I found on google

Re: [Tutor] Learning about callbaks

2008-01-02 Thread Alan Gauld
Michael Bernhard Arp Sørensen [EMAIL PROTECTED] wrote I've read what to wrote about the *parentheses*. I see why I was wrong in my premature assumption. but I fail to understand why it did work. I suspect that if you look closely you'll find that the testing print statement came after the

Re: [Tutor] Choice of GUI builders

2008-01-02 Thread johnf
On Wednesday 02 January 2008 06:56:54 am Michael Langford wrote: While some people are Adobe haters(They hate the web...etc), I think a slick alternative available now is Flex2 calling python via XMLRPC. I've been doing so lately. It is fast to pick up and makes slick looking GUI's rather

Re: [Tutor] Choice of GUI builders

2008-01-02 Thread Alan Gauld
johnf [EMAIL PROTECTED] wrote On Wednesday 02 January 2008 06:08:10 am Roy Chen wrote: Hello all, I've been using PythonCard ... However, it seems that it hasn't been updated in some time, and so I would like a recommendation for a cross-platform (preferably) GUI builder. I tried to

Re: [Tutor] Choice of GUI builders

2008-01-02 Thread johnf
On Wednesday 02 January 2008 09:41:46 am Alan Gauld wrote: I tried to fined a decent GUI builder for wxPython but failed. There are two or three available but none of them really worked all that well. SPE seemed the best of a poor bunch. However... Take a look at Dabo www.dabodev.com

Re: [Tutor] Choice of GUI builders

2008-01-02 Thread johnf
On Wednesday 02 January 2008 06:08:10 am Roy Chen wrote: Hello all, I've been using PythonCard to build a GUI for a simple program I'm trying to write. It's simple and easy to use, and rather intuitive. However, it seems that it hasn't been updated in some time, and so I would like a

Re: [Tutor] providing a Python command line within a Tkinter appl

2008-01-02 Thread Tiger12506
eval will seriously limit you in this instance because eval only works on expressions, not statements. (Assignment won't work, for example). You can use exec though. (in which case, you wouldn't necessarily want a result back) just fyi text =my_get_pythoncommand() # text is the line of

Re: [Tutor] Learning about callbaks

2008-01-02 Thread Michael Bernhard Arp Sørensen
Hi. On Jan 2, 2008 6:36 PM, Alan Gauld [EMAIL PROTECTED] wrote: Can you modify the program *without modifying the classes* to use an ordinary function as the callback? Say this goodbye function: def goodbye(): print goodbye world This should not require more than 5 lines of new code

Re: [Tutor] Learning about callbaks

2008-01-02 Thread ALAN GAULD
Yes, exactly like that. Well done, you are now callback aware :-) Alan G. - Original Message From: Michael Bernhard Arp Sørensen [EMAIL PROTECTED] To: Alan Gauld [EMAIL PROTECTED] Cc: tutor@python.org Sent: Wednesday, 2 January, 2008 8:19:23 PM Subject: Re: [Tutor] Learning about

Re: [Tutor] Choice of GUI builders

2008-01-02 Thread Roy Chen
Thanks for all the help, Dabo looks interesting, but perhaps a bit overkill right now for what I have in mind. Certainly something useful to learn in the long run, though. I suppose with any GUI toolkit/builder, you're going to have learn some part of the API anyway. I might just see how I go

[Tutor] is it legal to have a class within a def

2008-01-02 Thread johnf
def someMethod(): class MyClass(object): . if something: . return someval -- John Fabiani ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] is it legal to have a class within a def

2008-01-02 Thread bob gailer
johnf wrote: def someMethod(): class MyClass(object): . if something: . return someval Legal? Well the police won't come after you! Python allows a class statement anywhere. So this use is part of the language. So the question becomes why would

[Tutor] How to convert ogg to MP3

2008-01-02 Thread goldgod a
hi, I would like to convert ogg files to mp3 files. how can I do that. Is there any inbuilt package. -- Thanks Regards, goldgod ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] is it legal to have a class within a def

2008-01-02 Thread johnf
On Wednesday 02 January 2008 09:31:19 pm you wrote: johnf wrote: def someMethod(): class MyClass(object): . if something: . return someval Legal? Well the police won't come after you! That's a good thing! Python allows a class statement anywhere. So