Re: [Tutor] Game programming - inventory management (was Help)

2006-11-28 Thread Luke Paireepinart
Bob Gailer wrote: > Please use a meaningful subject line. Many of us try to follow > "threads", and "help" does not help. > I have provided one for this case. > > Mohammed H. Hafeji wrote: > >> Need some help in python. >> >> How do i make the user choose wheter or not to pick it up? (i can d

Re: [Tutor] Why can't I import this?

2006-11-28 Thread Dick Moores
At 07:48 PM 11/28/2006, Kent Johnson wrote: >Dick Moores wrote: > > At 07:20 PM 11/28/2006, Kent Johnson wrote: > >> Try > >>from mine.toolTipDemo import demo > >> mine.toolTipDemo points to the module, then you need to reference a name > >> defined in the module. (You must have something called in

Re: [Tutor] OT What's next

2006-11-28 Thread Alan Gauld
"Amadeo Bellotti" <[EMAIL PROTECTED]> wrote > I've recently wanted to learn more about my hardware and i figured > what > better way then programming at the base level. I no it sounds stupid > but i > would like to learn to manage my own memory. so i was wondering if > anyone > has dipped ther

Re: [Tutor] Python Linux Distro Anyone

2006-11-28 Thread Dave Kuhlman
On Tue, Nov 28, 2006 at 10:45:29PM -0500, Amadeo Bellotti wrote: > I was thinking it would be really nice if i could make a Pocket Linux distro > that of course fits on one or two floppies (outdated I no but still are > amazing) thats just the Linux kernel, bash, and python. with of course a lot >

Re: [Tutor] Why can't I import this?

2006-11-28 Thread Kent Johnson
Dick Moores wrote: > At 07:20 PM 11/28/2006, Kent Johnson wrote: >> Try >>from mine.toolTipDemo import demo >> mine.toolTipDemo points to the module, then you need to reference a name >> defined in the module. (You must have something called intSpell in >> intSpell.py.) > > Interestingly (or not)

[Tutor] Python Linux Distro Anyone

2006-11-28 Thread Amadeo Bellotti
I was thinking it would be really nice if i could make a Pocket Linux distro that of course fits on one or two floppies (outdated I no but still are amazing) thats just the Linux kernel, bash, and python. with of course a lot of tiny scripts to do daily business and/or recovery. We could have a ma

Re: [Tutor] Why can't I import this?

2006-11-28 Thread Dick Moores
At 07:20 PM 11/28/2006, Kent Johnson wrote: >Dick Moores wrote: > > I just discovered something for Tkinter that I want to use. It's a > > Tooltip class, at . > > > > I've copied it to a file I named toolTipDemo.py and put it with a > > couple of other f

Re: [Tutor] Why can't I import this?

2006-11-28 Thread Kent Johnson
Dick Moores wrote: > I just discovered something for Tkinter that I want to use. It's a > Tooltip class, at . > > I've copied it to a file I named toolTipDemo.py and put it with a > couple of other files I use as modules. They're in > E:\Python25\Lib\

Re: [Tutor] Angles

2006-11-28 Thread Terry Carroll
On Tue, 28 Nov 2006, Carlos wrote: > I was never very good at trigonometry, but looks like my translation of > the equation is ok and the problem is some kind of python behavior, > because whenever the results exceed 100? (deg) Python returns the > complementary angle, it is possible to avoid t

[Tutor] OT What's next

2006-11-28 Thread Amadeo Bellotti
I've recently wanted to learn more about my hardware and i figured what better way then programming at the base level. I no it sounds stupid but i would like to learn to manage my own memory. so i was wondering if anyone has dipped there toe in either C or Assembly. If you have please tell me whic

Re: [Tutor] How to generate permutations of a given string

2006-11-28 Thread Carroll, Barry
Dick, et al: > -Original Message- > Date: Tue, 28 Nov 2006 12:57:51 -0800 > From: Dick Moores <[EMAIL PROTECTED]> > Subject: Re: [Tutor] How to generate permutations of a given string > To: Python Tutor List > Message-ID: <[EMAIL PROTECTED]> > Content-Type: text/plain; charset="us-ascii";

[Tutor] Why can't I import this?

2006-11-28 Thread Dick Moores
I just discovered something for Tkinter that I want to use. It's a Tooltip class, at . I've copied it to a file I named toolTipDemo.py and put it with a couple of other files I use as modules. They're in E:\Python25\Lib\site-packages\mine. One file th

[Tutor] Angles

2006-11-28 Thread Carlos
Hello to All: I'm trying to write a sun positioning system with the help of python. The idea is that you give the program a location, date and hour and it returns the position of the sun. I found a webpage that details the math behind this (http://www.usc.edu/dept/architecture/mbs/tools/vrsola

Re: [Tutor] Extract from Word Doc

2006-11-28 Thread John Fouhy
On 29/11/06, Steve Nelson <[EMAIL PROTECTED]> wrote: > Hello, > > Is there a way to pull "strings" out of a word document? Not unlike > the way the UNIX command "strings" does? Here's a crude attempt: >>> import string >>> s = file('myworddoc.doc').read() >>> t = ''.join(c for c in s if c in str

[Tutor] Extract from Word Doc

2006-11-28 Thread Steve Nelson
Hello, Is there a way to pull "strings" out of a word document? Not unlike the way the UNIX command "strings" does? I want this to be OS-portable, so shelling out is not an option. I tried opening the word doc and then looking at it using the object's methods, but it is all binary info, and can

Re: [Tutor] draw 3D using Tkinter?

2006-11-28 Thread Alan Gauld
"linda.s" <[EMAIL PROTECTED]> wrote > Is there any sample code to draw 3D using Tkinter? I don't think so, native Tkinter isn't really the ideal graphics environment. Its not what it was designed for. However there are almost certainly libraries around for 3D stuff that can use Tkinter, alth

Re: [Tutor] How to generate permutations of a given string

2006-11-28 Thread Dick Moores
At 02:49 PM 11/27/2006, John Fouhy wrote: >On 28/11/06, Carroll, Barry <[EMAIL PROTECTED]> wrote: > > I'm not sure these qualify as "simple", but they work. This was one of > > my very first projects in Python, so it may be more complicated than > > necessary. > >This is an alternative approach: >

[Tutor] Game programming - inventory management (was Help)

2006-11-28 Thread Bob Gailer
Please use a meaningful subject line. Many of us try to follow "threads", and "help" does not help. I have provided one for this case. Mohammed H. Hafeji wrote: > Need some help in python. > > How do i make the user choose wheter or not to pick it up? (i can do > picking up an item from a list

Re: [Tutor] WHy use SOAPpy if we can do the things using httplibmoduleRe: How to connect to the SOAP server and make arequest..........

2006-11-28 Thread Andreas Kostyrka
> you're basically using high-level libraries as an abstraction layer > (to make developing apps easier) to hide the messiness of the > lower-level implementation and details which may not be applicable to > your work. i mean, why use Python when you can do it in C? Wimp! You can do it in binary m

Re: [Tutor] WHy use SOAPpy if we can do the things using httplibmoduleRe: How to connect to the SOAP server and make arequest..........

2006-11-28 Thread wesley chun
> it is given how to > >create > > the SOAP ENVELOPE using > > httplib, so why bother about using SOAPpy...?? > > You can also read web pages using http POST and GET messages > to a socket using the socket library, but most folks find it easier > to use urllib. > > For that matter you can display o

[Tutor] Help

2006-11-28 Thread Mohammed H. Hafeji
Need some help in python. How do i make the user choose wheter or not to pick it up? (i can do picking up an item from a list): objectsCarried = [] inventory = ['bat'] lengthOfInventory =len(inventory) print 'The room holds:' for item in range(lengthOfInventory): print item, inventory[ite

Re: [Tutor] help with Tkinter, please

2006-11-28 Thread wesley chun
> What exactly is the advantage of a daemon thread over a normal > one in that case - other than that the application will end while > daemons are still running? In fact that might be the advantage. > But in that case daemons would only be useful for endless > loop type threads? for example, they

[Tutor] draw 3D using Tkinter?

2006-11-28 Thread linda.s
Is there any sample code to draw 3D using Tkinter? Thanks, Linda ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] help with Tkinter, please

2006-11-28 Thread Alan Gauld
"wesley chun" <[EMAIL PROTECTED]> wrote >> why do you recommend the use of daemons here? >> Wouldn't that just leave a load of silently running daemon >> threads eating up resources > > are you missing something? :-) i think there is a distinction > bewteen > a daemon/server process and daemon

[Tutor] Test

2006-11-28 Thread Jordan Greenberg
Hey, my messages don't seem to be showing up on the list... So if this one works, sorry for the test message, everybody! My school just decided not to allow any outgoing email to any SMTP server but their own *grumble* So I've been sending my tutor messages through that server but with this address

Re: [Tutor] WHy use SOAPpy if we can do the things using httplibmoduleRe: How to connect to the SOAP server and make arequest..........

2006-11-28 Thread Alan Gauld
"Asrarahmed Kadri" <[EMAIL PROTECTED]> wrote in message >I read the URL suggested by Simon, In that URL, it is given how to >create > the SOAP ENVELOPE using > httplib, so why bother about using SOAPpy...?? You can also read web pages using http POST and GET messages to a socket using the socke

Re: [Tutor] Modulo operator (was no subject)

2006-11-28 Thread Bob Gailer
See http://en.wikipedia.org/wiki/Modular_arithmetic for a comprehensive discussion. Especially the paragraph title Remainders. Often people ask "what's the practical use of modular arithmetic?" Consider how we tell time... -- Bob Gailer 510-978-4454 __

Re: [Tutor] Modulo operator (was no subject)

2006-11-28 Thread Bob Gailer
Please always provide a subject line. Otherwise it is very hard to follow threads. Noufal Ibrahim wrote: > Kopalle Narasimha wrote: > >> Hello, Everyone. >> >> I have a strange problem with floating point numbers. Please help me. >> I tried the following at the python prompt: >> >> Case 1: >>

Re: [Tutor] What is the meaning of using single underscore in front ofvariable name

2006-11-28 Thread Alan Gauld
"Asrarahmed Kadri" <[EMAIL PROTECTED]> wrote > Single underscore as a prefix in variable naming...?? whats it for?? > > Any idea.. Its a convention to indicate that this variable is not for general use. It is part of the internal implementation of the class or module. But it is only a conventio

[Tutor] Python for Kids

2006-11-28 Thread [EMAIL PROTECTED]
Hello, I bought the book "Python for Kids". started to read it, but can not find where I have to install xturlte? I use macintosh... Have python 2.5. If someone knows where I have to copy the xturtle and other files (for xturle) on macintosh, will be happy for help:) Thank You in advance, V

Re: [Tutor] timeout a routine

2006-11-28 Thread arbaro arbaro
Thanks a lot Jordan, I have no experience with classes at all yet, so your example will give me a really nice startting point. On 11/28/06, Jordan Greenberg <[EMAIL PROTECTED]> wrote: > arbaro arbaro wrote: > > Hello, > > > Is there a way to run the command > > os.path.isdir("/mnt/server/fold

Re: [Tutor] Does Fredrik Lundh's console module work on Win XP?

2006-11-28 Thread Dick Moores
At 07:10 AM 11/28/2006, you wrote: >Dick Moores wrote: >>This seems it might be very useful. I just downloaded and thought >>I'd installed "console-1.1a1-20011229.win32-py2.5.exe" in Python >>2.5 in Win XP, but I can't get it to appear. > >It seems to work for me. Try this program, based on the

Re: [Tutor] (no subject)

2006-11-28 Thread Noufal Ibrahim
Kopalle Narasimha wrote: > Hello, Everyone. > > I have a strange problem with floating point numbers. Please help me. > I tried the following at the python prompt: > > Case 1: 4.5/2.0 #Gives quotient > Answer: 2.25 > > Case 2: 4.5%2.0 #Gives Remainder > Answer: 0.5 > I

[Tutor] (no subject)

2006-11-28 Thread Kopalle Narasimha
Hello, Everyone. I have a strange problem with floating point numbers. Please help me. I tried the following at the python prompt: Case 1: >>> 4.5/2.0 #Gives quotient Answer: 2.25 Case 2: >>> 4.5%2.0 #Gives Remainder Answer: 0.5 How could a floating point division give a remainde

[Tutor] timeout a routine

2006-11-28 Thread arbaro arbaro
Hello, I have a small problem with accessing a directory that may or may not exist. - The program runs from a Linux OS. (though this shouldn't matter) - A mountpoint /mnt/server may have been made to a windows server with samba. I would like to find out if a folder on the server is reachable (eg

Re: [Tutor] WHy use SOAPpy if we can do the things using httplib moduleRe: How to connect to the SOAP server and make a request..........

2006-11-28 Thread Simon Brunning
On 11/28/06, Asrarahmed Kadri <[EMAIL PROTECTED]> wrote: > > I read the URL suggested by Simon, In that URL, it is given how to create > the SOAP ENVELOPE using > httplib, so why bother about using SOAPpy...?? The article discusses two ways of doing SOAP; by hand, and using SOAPpy. Building the SO

Re: [Tutor] Does Fredrik Lundh's console module work on Win XP?

2006-11-28 Thread Kent Johnson
Dick Moores wrote: > This seems it might be very useful. I just downloaded and thought I'd > installed "console-1.1a1-20011229.win32-py2.5.exe" in Python 2.5 in > Win XP, but I can't get it to appear. It seems to work for me. Try this program, based on the example in the docs: import Console

[Tutor] WHy use SOAPpy if we can do the things using httplib moduleRe: How to connect to the SOAP server and make a request..........

2006-11-28 Thread Asrarahmed Kadri
I read the URL suggested by Simon, In that URL, it is given how to create the SOAP ENVELOPE using httplib, so why bother about using SOAPpy...?? Any comments... Best Regards, Asrarahmed Kadri On 11/28/06, Simon Brunning <[EMAIL PROTECTED]> wrote: On 11/28/06, Asrarahmed Kadri <[EMAIL PROT

Re: [Tutor] What is the meaning of using single underscore in front of variable name

2006-11-28 Thread Simon Brunning
On 11/28/06, Asrarahmed Kadri <[EMAIL PROTECTED]> wrote: > What does this mean? > > _url = 'http://api.google.com/search/beta2' > _namespace = 'urn:GoogleSearch' > > Single underscore as a prefix in variable naming...?? whats it for?? It means "private by convention" - see

[Tutor] What is the meaning of using single underscore in front of variable name

2006-11-28 Thread Asrarahmed Kadri
Hi folks, What does this mean? _url = 'http://api.google.com/search/beta2' _namespace = 'urn:GoogleSearch' Single underscore as a prefix in variable naming...?? whats it for?? Any idea.. Regards, Asrarahmed -- To HIM you shall return. ___ Tutor mai

Re: [Tutor] Does Fredrik Lundh's console module work on Win XP?

2006-11-28 Thread Tim Golden
[Dick Moores] | This seems it might be very useful. I just downloaded and thought I'd | installed "console-1.1a1-20011229.win32-py2.5.exe" in Python 2.5 in | Win XP, but I can't get it to appear. | | My attempts: | === | E:\Python25\Lib\site-packages>Console

Re: [Tutor] help with Tkinter, please

2006-11-28 Thread Kent Johnson
wesley chun wrote: >>> "The entire Python program exits when no active non-daemon threads >>> are left." >> why do you recommend the use of daemons here? >> Wouldn't that just leave a load of silently running daemon >> threads eating up resources after the main program finishes? >> I don't see the

[Tutor] Does Fredrik Lundh's console module work on Win XP?

2006-11-28 Thread Dick Moores
This seems it might be very useful. I just downloaded and thought I'd installed "console-1.1a1-20011229.win32-py2.5.exe" in Python 2.5 in Win XP, but I can't get it to appear. My attempts: === E:\Python25\Lib\site-packages>Console.py Traceback (most recent ca

Re: [Tutor] help with Tkinter, please

2006-11-28 Thread Kent Johnson
wesley chun wrote: > if your operating system supports daemon > threads, set your unimportant threads as daemon threads -- from the > docs: > > "The entire Python program exits when no active non-daemon threads are left." > > http://docs.python.org/lib/thread-objects.html AFAIK daemon threads ar

Re: [Tutor] How to connect to the SOAP server and make a request..........

2006-11-28 Thread Simon Brunning
On 11/28/06, Asrarahmed Kadri <[EMAIL PROTECTED]> wrote: > I am using SOAPpy module to make SOAP requests. > > Can someone point me documentation that has list of functions that can be > used for carrying out various tasks. --

[Tutor] How to connect to the SOAP server and make a request..........

2006-11-28 Thread Asrarahmed Kadri
Hi folks, I am using SOAPpy module to make SOAP requests. Can someone point me documentation that has list of functions that can be used for carrying out various tasks. Thanks in anticipation. Best Regards, Asrarahmed Kadri -- To HIM you shall return.

Re: [Tutor] help with Tkinter, please

2006-11-28 Thread wesley chun
> > "The entire Python program exits when no active non-daemon threads > > are left." > > why do you recommend the use of daemons here? > Wouldn't that just leave a load of silently running daemon > threads eating up resources after the main program finishes? > I don't see the logic of that one? I'

Re: [Tutor] help with Tkinter, please

2006-11-28 Thread Alan Gauld
"wesley chun" <[EMAIL PROTECTED]> wrote > do the calculations. if your operating system supports daemon > threads, set your unimportant threads as daemon threads -- from the > docs: > > "The entire Python program exits when no active non-daemon threads > are left." Wes, why do you recommend th