[Tutor] critique my script!

2006-06-23 Thread Christopher Spears
I wrote a script that creates a gui using pygtk. The gui consists of a vertical scrollbar and two buttons. The user picks a number (degrees Fahrenheit) with the scrollbar and then clicks the convert button. A functions converts the number to its equivalent in degrees Celsius and prints a respons

Re: [Tutor] How can I add my folder to pythonpath?

2006-06-23 Thread Kent Johnson
Emily Fortuna wrote: > If I understand what you're asking (forgive me if I misunderstood), you > need to create a file in the mymodules directory and call it __init__.py > (even if you don't put anything in this file). This tells Python that > it is a package containing modules. Then, in your

Re: [Tutor] How can I add my folder to pythonpath?

2006-06-23 Thread Andrew Robert
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 What you need to do is append your existing path. for example: import sys sys.path.append(r'd:\python_modules') You can then import any modules that reside in that path as if they where part of the standard library. Andy -BEGIN PGP SIGNATURE--

Re: [Tutor] How can I add my folder to pythonpath?

2006-06-23 Thread Laszlo Antal
On 06/23/06 at 2:11 PM you wrote: > If I understand what you're asking (forgive me if I misunderstood), > you need to create a file in the mymodules directory and call it > __init__.py (even if you don't put anything in this file). This tells > Python that it is a package containing modules.

Re: [Tutor] How can I add my folder to pythonpath?

2006-06-23 Thread Emily Fortuna
If I understand what you're asking (forgive me if I misunderstood), you need to create a file in the mymodules directory and call it __init__.py (even if you don't put anything in this file). This tells Python that it is a package containing modules. Then, in your program myprogram.py, you ca

Re: [Tutor] Is this correct syntax for what I want?

2006-06-23 Thread Alan Gauld
> The data is account name and 12.50 (example). > I want to access the data to add and subtract from it. > For example > 12.50 - 2.25 = 10.25 > 10.25 + 4.75 = 15.00 Sorry, I meant the data structures. You mentioned you had a list of tuples? And you wanted to perform addition./subtraction on memb

Re: [Tutor] Is this correct syntax for what I want?

2006-06-23 Thread Nathan Pinno
The data is account name and 12.50 (example). I want to access the data to add and subtract from it. For example 12.50 - 2.25 = 10.25 10.25 + 4.75 = 15.00 Thanks, Nathan Pinno - Original Message - From: "Alan Gauld" <[EMAIL PROTECTED]> To: "Nathan Pinno" <[EMAIL PROTECTED]>; Sent: Friday

[Tutor] How can I add my folder to pythonpath?

2006-06-23 Thread Laszlo Antal
Hi, This is how my directory looks myprogram(this is the main folder for my program) | myprogram.py mymodules (this is where I store my modules) | mymodule1.py mymodule2.py I would like to import from mymodules folder my modules1.py, mymodules2.py into myprogram.py

Re: [Tutor] Is this correct syntax for what I want?

2006-06-23 Thread Alan Gauld
Nathan, Can you show us an example of the data? And what you want to do to it, ie before and after values. Its not clear to me whether you want to add the number to the number while keeping it in the tuple (Which is impossible because tuples are immutable) or whether you simply want to access the

Re: [Tutor] A few more notes on Python interfaces

2006-06-23 Thread Alan Gauld
> more about it. Needless to say, my notes benefited much from the > comments on this list. You can find these notes here: > >http://www.rexx.com/~dkuhlman/python_comments.html#interfaces > > I'll welcome any comments. Nice work. One wee point is that the term prorocol is an OOP community

Re: [Tutor] Needing help with my account tracker program.

2006-06-23 Thread Bob Gailer
Nathan Pinno wrote: > Hey all, > > I was wondering if you could help me fix a glitch in my program that's > preventing it from running. > > Here's the code: > accountlist = [] accountlist = {} # dictionary rather than list > > def load_file(ac): > import os > filename = 'accounts.txt

[Tutor] Needing help with my account tracker program.

2006-06-23 Thread Nathan Pinno
Hey all,   I was wondering if you could help me fix a glitch in my program that's preventing it from running.   Here's the code: accountlist = []   def load_file(ac):    import os    filename = 'accounts.txt'    if os.path.exists(filename):    store = open(filename, 'r')    for line

Re: [Tutor] MySQLdb: cant get '... where field in %s' to work for string sequences

2006-06-23 Thread Matt Richardson
On 6/22/06, Justin Ezequiel <[EMAIL PROTECTED]> wrote: > how can I get 'select ... from ... where field in %s' to work for > sequences of strings? > sequences of integers works just fine > > import MySQLdb > > DBCRED = {'host': 'localhost', 'user': 'userjustin', > 'passwd': 'passwdjustin'

Re: [Tutor] Python Word Unscrambler

2006-06-23 Thread Kent Johnson
Null Mr.Freeman wrote: > Python Word Unscrambler: > > OK, this is the Python code I'm using to unscramble words but it > unscrambles one word at a time, can someone please help me out and tell > me how can I improve my code to make it decrypt several words at a time? > P.S: Another thing is that

Re: [Tutor] Is this correct syntax for what I want?

2006-06-23 Thread murtog_
You can do: letterlist[x] += amount letterlist[x] -= amount Cheers, -- murtog_ [ http://murtog.blogspot.com ] ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] what does the warning indicate?

2006-06-23 Thread Carlos Daniel Ruvalcaba Valenzuela
By the way, when do you get this warning? while starting the python interpreter (python.exe)?, it's IDLE which gives you that warning? or could it be some code? if it is code then send it to the list, i'm sure will be able to help you more that way :) Regards, Carlos Daniel Ruvalcaba _