Re: [Tutor] Finding prime numbers

2007-09-20 Thread Luke Paireepinart
intrusive to paste the code inline, and it has unpleasant side-effects in certain situations. Most e-mail clients that I'm aware of are set to, by default, inline the code at the end of the e-mail as you're viewing it anyway. -Luke ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Advice for a Multimedia Major [was: Counting method calls]

2007-09-23 Thread Luke Paireepinart
own thread. Don't post in another, unrelated thread. -Luke ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] python problem - help!!

2007-09-23 Thread Luke Paireepinart
Chris wrote: > > I need your help! > > > > I have this problem that I can’t seem to figure out. Can you help? > The problem is listed below, and below it is my code that I have so far. > What results / errors are you getting, how are they different from the result

[Tutor] [Fwd: Re: python problem - help!!]

2007-09-23 Thread Luke Paireepinart
not directly to me. Use the "reply all" button, or "reply to group" button, to do this. If such a button is not available in your mail client, carbon-copy (cc) a copy of the message to tutor@python.org You'll have much more luck finding an answer if you ask the whole lis

Re: [Tutor] tutor_request

2007-09-24 Thread Luke Paireepinart
oops, forgot to send this to tutor as well. And I'm the one always complaining about direct e-mails :) Luke Paireepinart wrote: bedilu woldemariam wrote: help! here, take this: Hope that helped, -Luke --- Begin Message --- bedilu woldemariam wrote: help! here, take

Re: [Tutor] os.rename anomaly in Python 2.3 on Windows XP

2007-10-08 Thread Luke Paireepinart
th Unicode. Your filenames aren't being interpreted correctly. Perhaps os.listdir is giving you the UTF-8 versions rather than the Unicode versions of the filenames? -Luke > ___ > Tutor maillist - Tutor@python.org > http://mail.python.org

Re: [Tutor] Sqrt on a variable

2007-10-09 Thread Luke Paireepinart
o explain how to fix it in a way we think you'll understand. To answer your question, try typing the following two lines into the interactive interpreter (Python shell) >>> import math >>> help(math.sqrt) The help() function reads the documentation strings from

Re: [Tutor] File upload from python shell

2007-10-14 Thread Luke Paireepinart
s ImageShack by any coincidence, I have some code that does that already. If it's something else, the code would probably be similar. Let me know if you want to take a look at that. -Luke ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] File upload from python shell

2007-10-14 Thread Luke Paireepinart
Paulino wrote: > Luke Paireepinart escreveu: >> Paulino wrote: >>> Hello! >>> >>> >>> How can I upload a file from python? >>> >>> If it is a form to fill with values it's simple: >>> >>> >>> urlopen(&q

Re: [Tutor] newbie question

2007-10-15 Thread Luke Paireepinart
ot;*len(tpl)]) % tpl > I don't see the point of building a format string and then substituting for it. Why not just do: print "Specials: " + ' '.join(menu_specials.values()) -Luke ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Decimal Conversion

2007-10-15 Thread Luke Paireepinart
http://reprap.org)...and <http://reprap.org%29...and> then munged > some of its syntactic sugar into the python area of my brain. Python > does not support that operation for + You can append ints to strings in Java using +? -Luke __

Re: [Tutor] reading POST method in cgi script

2007-10-15 Thread Luke Paireepinart
, if I write my own python program, and I want to use your printform() function, I can do import form which will import your functions into my namespace, and I can then do form.printform() If you don't have the above 2 lines, then when I import your form.py module, main() will be run every time, causing all the main() stuff to be executed even if I really just wanted to use one of your functions, which in almost every case is an "unwanted side-effect." Hope this has helped in some way, -Luke ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] repeated times

2007-10-29 Thread Luke Paireepinart
linda.s wrote: > I want to run an .exe file and get the output many times. > Can any one give me an example about how to use python to generate the > automatic process? > Yes. -Luke ___ Tutor maillist - Tutor@python.org http://mai

Re: [Tutor] Can I create 3D game with python ?

2007-11-26 Thread Luke Paireepinart
ld if you asked on a message board specifically designed for that library. For example, asking on [EMAIL PROTECTED] is a good idea for pygame-related questions. Hope that helps, -Luke ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Button 1 Motion Event

2007-12-04 Thread Luke Paireepinart
Johnston Jiaa wrote: > I'm creating a drawing program, like MS Paint in Tkinter. I bound > the event to my Canvas object. The function it's bound > to creates an oval at the event's x and y attributes. > > This works fine if the user is dragging slowly, but if he does a > sudden dragging m

[Tutor] [Fwd: Re: Button 1 Motion Event]

2007-12-04 Thread Luke Paireepinart
Johnston, please reply on-list. You have to either use "reply-all" or type "tutor@python.org" as a recipient, because messages aren't sent to tutor@python.org by default when you click "reply". Thanks, -Luke --- Begin Message --- That being said, you s

Re: [Tutor] Button 1 Motion Event

2007-12-05 Thread Luke Paireepinart
. I believe TKInter supports that, but I haven't used that library in a long time. Again, _please reply on-list_ unless you want a discussion to be private, in which case specify in the e-mail so we know it wasn't an accident. -Luke ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Mail? What's that?

2007-12-05 Thread Luke Paireepinart
... Subject: testin'... ... ... This is a test ''' >>> s.sendmail("[EMAIL PROTECTED]",tolist,msg) { "[EMAIL PROTECTED]" : ( 550 ,"User unknown" ) } >>> s.quit() In the above example, the messa

Re: [Tutor] updating a print statement

2007-12-10 Thread Luke Paireepinart
Ole Henning Jensen wrote: > Sry about the previous mail. > > - Original Message - > > I have a print statement in a for loop so I can watch the progress > > for line in file(file): > the_line = line.split() > if the_line: > print ("Index = %.2f") %index > > Is there a way t

Re: [Tutor] user-given variable names for objects

2007-12-12 Thread Luke Paireepinart
tData.keys()): break Of course this is by no means an ideal solution, it merely serves as an example. Does this make sense, and do you understand why it's better to use dictionaries than to use variables to achieve this? [note - no code was tested, not guaranteed to work :)] -Luke ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Python Versions

2007-12-13 Thread Luke Paireepinart
y likely that raw_input() is the culprit of confusion > here. Hey Tiger, your system clock is set incorrectly and your e-mail was flagged as being sent 12/12/2008, causing it to appear after an e-mail sent as a reply - confusing. Please remedy this situation ;P -Luke

Re: [Tutor] user-given variable names for objects

2007-12-13 Thread Luke Paireepinart
> > > By the way, what was the purpose of the line with > > time.sleep(1) > > It pauses for 1 second. But i'm not sure why he wanted a pause! :-) > Just because it would dump a bunch of stuff to the screen really quickly that you couldn't read as soon as some events expired. ___

Re: [Tutor] user-given variable names for objects

2007-12-13 Thread Luke Paireepinart
On Dec 13, 2008 3:12 PM, Tiger12506 <[EMAIL PROTECTED]> wrote: > I may sound like a know-it-all, but dictionaries *are* iterators. I'm used to that from you :P > > [a for a in eventData if eventData[a] < time.time()] > > This is more efficient. The keys method creates a list in memory first and

[Tutor] XML data reading

2007-12-20 Thread Lockhart, Luke
e from memory. I first tried to use the basic Python XML libraries, and then my friend recommended SAX - but so far as I can tell, either method requires numerous lines of code to support one new tag. Is this what I'm going to have to do, o

[Tutor] XML

2007-12-20 Thread Lockhart, Luke
Is this what I'm going to have to do, or is there a simpler way? Thanks in advance, Luke ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] updates andcompletion of goals

2007-12-25 Thread Luke Paireepinart
he problems. I will be happy to re-test your software upon next release. Good luck. As of now, I see no reason why I should "pony up the dough", though. -Luke ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] the tutor list has been strangely silent for a few days. Anyone know

2008-01-17 Thread Luke Paireepinart
bill.wu wrote: > the tutor list has been strangely silent for a few days. Anyone know > what has happened? why? I got about 20 e-mails from the list yesterday. Do you consider this slient? or do you maybe have a problem receiving messages? > _

Re: [Tutor] IronPython, the wii remote, and blender

2008-01-26 Thread Luke Paireepinart
ar (4 LEDs) so you can determine exact 3D positioning. You have to use kalman filters to estimate your position based on accelerometer data while the LEDs aren't visible. > Oh, and if this is just a crazy idea, please tell me so. It's not crazy, it just requires some advanced knowled

Re: [Tutor] An -1.#IND error

2008-01-26 Thread Luke Paireepinart
Dinesh B Vadhia wrote: > After a matrix*vector multiplication (ie. b = Ax, with A, x and b all > floats), the b vector elements are all "-1.#IND". What does this > mean? Btw, they are no divisions in the program eg. no divide by zeros. A code sample would be _much_ more helpful here. Please inc

Re: [Tutor] how to make python program as executable

2008-01-30 Thread Luke Paireepinart
Alan Gauld wrote: > "brindly sujith" <[EMAIL PROTECTED]> wrote > > >> i am developing a GUI application in python(tkinter) >> >> i want to know how to make the python program as a application ie i >> want to >> make it executable >> > > If you are on Windows it should be executable alread

Re: [Tutor] Iron Python and Visual Basic 2005 Express

2008-01-30 Thread Luke Paireepinart
d thus they can interface with each other. I'm sure the Wikipedia article on CLR would be a lot more informative than I can be. HTH, -Luke ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] results not quite 100 percent yet

2008-01-31 Thread Luke Paireepinart
Alan Gauld wrote: > "bhaaluu" <[EMAIL PROTECTED]> wrote > > >> how to program a TAG in Python. My goal is to code >> the game in POOP >> > > POOP > Python Object-Oriented Programming. You really should try to be less funny. I totally didn't read your e-mail seriously cause I was l

Re: [Tutor] lan with python

2008-02-11 Thread Luke Paireepinart
use Twisted for a more robust solution. There are other alternatives as well. Might I ask why your code uses Pygame and TKinter together? Why didn't you just code the GUI of your game in Pygame? Did you use Pygame just because of the sound-playing abilities? (I don't have time to read

[Tutor] Noob requesting help...

2008-02-16 Thread John Luke
Hi, I've recently started to get into Python, and I've made a bit a progress so far, but I still have a long way to go. Along my search for tutorials, I've come across this: # Waits until a password has been entered. Use Control-C to break out without # the password #Note that this must not be t

Re: [Tutor] Silly question: Modifying code while the script is running

2008-02-20 Thread Luke Paireepinart
ke changes. imported scripts are automatically executed. (I assume on reload they are also, but you should check this.) This is considered taboo unless it's very necessary, but I hope you have fun anyway. Let me know how it goes. HTH, -Luke ___ Tu

Re: [Tutor] Python oddity

2008-02-27 Thread Luke Paireepinart
e single copy that you have. So each time you call the function, you'll have another "Hi!" in bar. The usual method to avoid this is as follows: def foo(bar=None): if bar: print bar else: bar = "Hi!&quo

Re: [Tutor] Python oddity

2008-02-28 Thread Luke Paireepinart
#x27;) >>> a[0] ['a', 'c', 'd'] So a list() does a shallow copy as well. Here's a continuation, with deepcopy(): >>> import copy >>> b = copy.deepcopy(a) >>> b is a False >>> b[0] is a[0] False >>> b[0].append('e') >>> a[0] ['a', 'c', 'd'] HTH, -Luke ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] Sum of List Elements

2005-09-24 Thread Luke Jordan
far is to write a function that adds list[0] and list[1], then list[1] and list [2], etc. Of course, this isn't what I want. I'd like to be able to sum a list of any size without having to type list[0]+list[1] I am totally stumped. :( Luke -- "Whether you're an honest ma

Re: [Tutor] Sum of List Elements

2005-09-24 Thread Luke Jordan
Thanks for the help everyone, for answering a simple question and pointing me toward more resources.On 9/24/05, bob < [EMAIL PROTECTED]> wrote:At 08:11 AM 9/24/2005, Luke Jordan wrote:>Hi All, >>I have spent an embarrassingly large amount of time trying to solve what>on its

Re: [Tutor] Can anyone teach me...?

2005-10-12 Thread luke p
nathan, there are a few GUI options available to you. the one that is bundled with the python installation is TKInter.  that's an "i" not an "L". you can also use the python interface for WxWindows, I forget what it's called. anyway, TKInter looks fairly nice, some say it doesn't have the windows "

[Tutor] dictionaries in classes

2005-10-14 Thread Luke Jordan
sense that there is something basic that I either don't know or am overlooking.   Thanks in advance.   Luke ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] Assign to vars by iteration

2005-10-17 Thread Luke Jordan
I've got a bunch of pickled class instances, and I'm trying to load them as variables using a function. The class has a self.name attribute, and I've got a list of self.name for all the instances pickled separately. When I would like to attach the names of each instance to the corresponding class

[Tutor] Please excuse the previous message sent in error

2005-10-17 Thread Luke Jordan
Sincerely, Luke ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] define vars by iteration

2005-10-19 Thread Luke Jordan
I've got a bunch of pickled class instances with self.name attributes, and I would like to assign the instances themselves to variables named whatever is stored in self.name using a function. "Can't assign to literal", right? Is there a way to do th

Re: [Tutor] define vars by iteration

2005-10-20 Thread Luke Jordan
t;> classDictionary["Yard"]   the thing is I would like to be able to get at Yard's attributes by typing   >>> Yard.anAttribute garbage cans   at the prompt rather than   >>> Yard = classDictionary["Yard"] >>> Yard.anAttribute garbage cansIt

Re: [Tutor] define vars by iteration

2005-10-24 Thread Luke Jordan
(sorry, low-hanging fruit :))    Luke  On 10/20/05, Danny Yoo <[EMAIL PROTECTED]> wrote: >  Also, I have done what I'm trying to do successfully by populating a> dictionary with class instances named after self.name <http://self.name>,> which, after the function r

Re: [Tutor] Help? Making Variables out of the header row in a CSV file

2006-06-20 Thread Luke Paireepinart
#x27;DebugMsgLog.2006_05_31.14_33_25A'], 'ModIdJobCfg': ['_2_3_4_5_6', '_2_3_4_5_6'], 'Weight': ['75', '75'], 'Color': ['white', 'white'], 'PurgeCauseFaultID': ['927', '1003'], 'Caliper': ['104', '104'], 'Height': ['431800', '431800'], 'PurgePrepared': ['Y', 'Y'], 'FinisherCfg': ['DUAL_BFM', 'DUAL_BFM'], 'Drilled': ['FALSE', 'FALSE']} > The final product would allow me to select the input file, specify some thing > like the value of the "PPM" or "Grain" (and combinations thereof), and > write the output to a new CSV file. The last bit would be some math on the > contents of a couple of the fields. > You mean you want to be able to make a new CSV file using the contents of the old one, or create an entirely new one using just stuff you need? Please clarify here. > Ralph Luke ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Help? Making Variables out of the header row in a CSV file

2006-06-20 Thread Luke Paireepinart
Kent Johnson wrote: [snip better solution than mine] Yeah. I didn't know what CSV files were and I should've researched it a bit. Didn't know there was a CSV module. Good explanation Kent. -Luke ___ Tutor maillist - Tutor@

Re: [Tutor] Writing over a line in a text file

2006-06-21 Thread Luke Paireepinart
kieran flanagan wrote: > Hi > > I have a question regarding writing text to a file. I am directing > output to a logfile. During one of the loops, I have a command that > will issue a message on how long it is waiting for by doing something > like this > > while something: > > pr

Re: [Tutor] doubt in Regular expressions

2006-06-25 Thread Luke Paireepinart
ould just look into adding a Google SiteSearch to your page. python.org did this and it works fantastically. If you insist on continuing in this, I wish you luck and I hope everything turns out how you want it. Are you going to send us a link to it when you're done? -Luke ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Unit testing

2006-06-27 Thread Luke Paireepinart
[snip] > class nameB: >def __init__(self, sema): > self.sema = sema > > >def run(self): > self.semaA.acquire() > > I think here Kent meant self.sema.acquire() [snip] ___ Tutor maillist - Tutor@python.org

Re: [Tutor] Query regarding Unittest module behaviour

2006-07-04 Thread Luke Paireepinart
__name__ == "__main__": main() --- Now if you do >>> import a nothing will be printed. But, if you do "python a.py" on command line, you'll see "hello" be printed. I think this is the problem you're having. HTH, -Luke ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Beer Bottles

2006-07-06 Thread Luke Paireepinart
Steve Nelson wrote: > A bunch of my friends and I have been chatting about "99 bottles of > beer" - and how to make the shortest code to do it. I have: > > for i in range(100,0,-1): >print "%s bottles of beer on the wall, %s bottles of beer\nTake on > down, pass it around.."%(i,i) > print "Go

Re: [Tutor] How to learn messages frim help()?

2006-07-09 Thread Luke Paireepinart
(a) your number is 2 note that you could just do >>> print 'your number is %s.' % a your number is 2. that will take care of the type conversion for you. HTH, Luke ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Need Help

2006-07-11 Thread Luke Paireepinart
elf,amt): > self.balance = self.balance - amt > def getbalance(self): > return self.balance > What you have there is a class, not an instance of a class. read more about the difference at http://www.python.org/doc/2.2.3/tut/node11.html or some other tutori

Re: [Tutor] Need Help

2006-07-11 Thread Luke Paireepinart
gize to the OP. It's also better that they tell us it's a homework problem than trying to mislead us, I reckon. Anyway, does the Original Poster have any more questions or have we answered them all? -Luke ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] How do I get my machine to run an SMTP server?

2006-07-11 Thread Luke Paireepinart
[snip code] > *When I run the program using IDLE, I get the following:* > > Send the contents of a directory as a MIME message. > > Usage: dirmail [options] from to [to ...]* > > Options: > -h / --help > Print this message and exit. > > -d directory > --directory=directo

Re: [Tutor] abs beginner first project

2006-07-12 Thread Luke Paireepinart
ng like that. Pygame is easier to learn than Tkinter and WxWindows imho. But if you want to make the text editor anyway, I wish you luck, and I'll help wherever I can. Or were you suggesting a console-based text editor? Cheers, -Luke ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] unbound method function()

2006-07-12 Thread Luke Paireepinart
od' means 'needs class instance to call but didn't get called with one.' > > Its weird (to me) b/c i have other methods calling methods from other > classes just fine, but on this one method i get that error. You're probably calling methods defined witho

Re: [Tutor] abs beginner first project

2006-07-12 Thread Luke Paireepinart
ork! I need to learn what lamdba does, clearly. Thanks a ton for telling me. To Alan, Yeah, I guess it is trivially simple to do use lambda. I didn't realize. Thanks for your help too. -Luke Also, when I reply to a message, should I 'cc:' to [EMAIL PROTECTED], add an extra &#x

Re: [Tutor] Hi, need help on zip commands for windows

2006-07-12 Thread Luke Paireepinart
same arguments as the 'zip' command on Linux. This is probably not likely, however, so you have three routes as I see it. 1. look into zipping files with the 'zlib' library. 2. find a port of the linux 'zip' program and put it in the same directory as your progra

Re: [Tutor] email anonymizing

2006-07-12 Thread Luke Paireepinart
anil maran wrote: > hi i m trying to anonymize emails hi. > everytime someone enters > [EMAIL PROTECTED] > > i want to generate > > [EMAIL PROTECTED] and use this email in the web application > > I want to do this in python > can you please explain how to do this Yes. Are you trying to anonymize t

Re: [Tutor] email anonymizing

2006-07-13 Thread Luke Paireepinart
uot; % (email,tmp))#adds their crap to the table. print "The e-mail address '%s' anonymized is '%s'" % (email,tmp) except: print """ """ print '' Hope that works. Also, if you haven&#x

Re: [Tutor] Regular Expression Misunderstanding

2006-07-14 Thread Luke Paireepinart
> I have a file full of lines beginning with the letter "b". I want a > RE that will return the whole line if it begins with b. > > I find if I do eg: > > m = re.search("^b", "b spam spam spam") m.group() > 'b' > > How do I get it to return the whole line if it begins w

Re: [Tutor] create 1000 000 variables

2006-07-15 Thread Luke Paireepinart
Сергій wrote: > In fact I want to create a list of variables from the list of strings > > Example: ['var1', 'var2', 'var3'] - list of strings > And I need to create variables var1, var2, var3 named as strings in > the list, and: > var1 == 'var1' > var2 == 'var2' > var3 == 'var3' > > How to

Re: [Tutor] python challenge 2

2006-07-17 Thread Luke Paireepinart
devayani barve wrote: > this is what i did for level 2 of python challenge: > > > dict={'a':'c','b':'d','c':'e','d':'f','e':'g','f':'h','g':'i','h':'j','i':'k','j':'l','k':'m','l':'n','m':'o','n':'p','o':'q','p':'r','q':'s','r':'t','s':'u','t':'v','u':'w','v':'x','w':'y','x':'z','y':'a','z':'b','

Re: [Tutor] about copy.copy

2006-07-18 Thread Luke Paireepinart
linda.s wrote: > what is the difference between b and c in the following code? #---copyexample.py import copy a=[1,4,5] b=a c=copy.copy(a) del(a[0]) print a print b print c #---eof output: [4, 5] [4, 5] [1, 4, 5] I.E. 'b' is just a reference to 'a', so modifying 'a' by deleting an element cha

Re: [Tutor] about copy.copy

2006-07-18 Thread Luke Paireepinart
linda.s wrote: > But in the following example, a/b/c change and it looks like there is > no difference. I don't know then :) I'm sure Kent or Alan can give you the lowdown. They're probably sleepin' right now or something. I'd say try googling 'copy.copy documentation', see what you get. ___

Re: [Tutor] Needing to create a program that will search my hard drive for certain files in certain folders

2006-07-19 Thread Luke Paireepinart
Bobby J. Howerton Jr. wrote: > Hello, > I am new to programming in Python, but I am very excited about the > possibilities that it (Python) has. > > I maybe jumping the gun a little bit here, but this is what I would > like to do: > *

Re: [Tutor] images in pygame

2006-07-23 Thread Luke Paireepinart
rue: > events = pygame.event.wait( ) > if events.type == pygame.QUIT: > break > > windows.blit( _text_, _rtext_ ) > pygame.display.flip( ) > so when the '001.png' runs into the 'rockwholescreen.gif' you want it to display 'testing' in red? You don't have any detection in your first 'while' loop that breaks out of the loop if it finds a collision between these two images. Right now all your code does is move an image around. I'm attaching an example zip of what I would do to solve this problem. > pygame.quit( ) > > > thanks.. sure. Just remember, the pygame mailing list specializes in these kinds of questions and can give you lots of good pointers. -Luke ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] IDLE Caching

2006-07-23 Thread Luke Paireepinart
Bugra Cakir wrote: > Hi, > > I have a problem with IDLE on Windows. > While I'm executing a python script in IDLE subsequence you mean subsequent :) > editing and executions on the file sometimes doesn't reflect the changes. > For example, i changed the file then save it, execute it, although i >

Re: [Tutor] IDLE Caching

2006-07-24 Thread Luke Paireepinart
[snip code] > look at this code. Edit this code with IDLE. For example change one of > the 'self' statement > in the code. For instance change self => slf then save the file and > press F5(Run Module) > It doesn't complain about the code !!! this is my problem. > I think maybe you're just confuse

Re: [Tutor] remove function

2006-07-26 Thread Luke Paireepinart
Christopher Spears wrote: > Here is a class called PriorityQueue: > > class PriorityQueue: > def __init__(self): > self.items = [] > > def isEmpty(self): > return self.items == [] > > def insert(self, item): >

Re: [Tutor] playing around with function

2006-07-28 Thread Luke Paireepinart
> > Does anybody have any solution on this coding style? > > I don't understand your coding style. I suspect it's because you didn't include all of your code, but if you did, I have no idea what you're trying to accomplish. > Thanks, > Just tryin' to help. > da > Luke ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] The Self

2006-07-31 Thread Luke Paireepinart
y we want to change the city name, cause we meant to put 'Indianapolis.' All we have to do is this: address1.city = 'Indianapolis' Basically, when you call any function inside of a class, using a class instance, (calling address1.anything is calling a function in an instance of

Re: [Tutor] Binary fractions, recommendations?

2006-08-03 Thread Luke Paireepinart
Liam Clarke wrote: > Hi all, > > I was recently playing with the problem of implementing the floor() > functionality, modulo being specifically mentioned in the briefing. > > you could convert the float to a string, split on the decimal point, and convert the left-hand side back to an integer :

Re: [Tutor] Listbox selection

2006-08-04 Thread Luke Paireepinart
Michael Lange wrote: > Hi Joe, > [snip post] Fix your date/time please Michael. I don't think it's been February 10th for quite some time :) ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] IDLE Crashing

2006-08-04 Thread Luke Paireepinart
Hi Adam. Adam Gomaa wrote: > I'm having trouble with this script. When I run it, it crashes IDLE... > which is no fun. :( > > I'm running Ubuntu 6.06 w/ python 2.4 > > When I say crash, I mean really _crash_. IDLE stop responding, and I > have to killall idle && killall python2.4 before I can res

Re: [Tutor] help regarding forms... (fwd)

2006-08-07 Thread Luke Paireepinart
Terrence Brannon wrote: > > > On 8/7/06, *Danny Yoo* <[EMAIL PROTECTED] > > wrote: > > > Hi Anil, > > Please do not email me directly. > > > this list is setup to send to the poster by default. I made the mistake of > doing such a thing earlier myself. > I kno

Re: [Tutor] Unusual behavior in readline

2006-08-08 Thread Luke Paireepinart
.readlines():' > [snip stuff] > Readline is supposed to read an entire line on each call, yet it is > only reading one character. > No, it is, in fact, reading an entire line on _each_ call, the only problem being that you only call it once. HTH, -Luke > > > -

Re: [Tutor] Rock, Paper, Scissors

2006-08-11 Thread Luke Paireepinart
Robert Wierschke wrote: > the else part can't have a condition!!! > ___ > Tutor maillist - Tutor@python.org > http://mail.python.org/mailman/listinfo/tutor > > Are you referring to Alan's post? You should have included the original text in your reply

Re: [Tutor] Rock, Paper, Scissors

2006-08-11 Thread Luke Paireepinart
> He wasn't. From the original post: > > elif human.choice == 'rocks' and computer.choice == > 'scissors': > print "Human wins!" > human.points = human.points + 1 > else human.choice == 'scissors' and computer.choice > == 'rocks': > print "

Re: [Tutor] Global variables

2006-08-13 Thread Luke Paireepinart
Kermit Rose wrote: > > > From: Danny Yoo > Date: 08/09/06 16:23:35 > To: Kermit Rose > Cc: tutor@python.org > > > If I can figure out how to make my main function subroutine declare global > variables > then I won't need to pass parameters most parameters to the other > subroutines, >

Re: [Tutor] Python on network problems

2006-08-13 Thread Luke Paireepinart
what it's supposed to do, and why the network is involved at all. It seems like the kids should be able to run python scripts on any computer in Lab1 without fiddling with the network whatsoever, so I suspect that there's some additional information that I'm not getting. C

Re: [Tutor] Having trouble getting mind around decimal module

2006-08-14 Thread Luke Paireepinart
Dick Moores wrote: > I'm having trouble getting my mind around the decimal module. From > the tutorial () I > can see how to get 1/7 to, say, 32 places: > > >>> from decimal import Decimal > >>> getcontext().prec = 32 > >>> Decimal(1) / Decimal

Re: [Tutor] suggestions for read unread items datastructure

2006-08-14 Thread Luke Paireepinart
anil maran wrote: > i m sure the users need to maintain their own data, > but as a provider we need to store their information > right, sessions and cookies work only during their > stay in the site, after they exit, im sure they would > like to come back to the same info, wont u > > so i was wonde

Re: [Tutor] Global variables

2006-08-14 Thread Luke Paireepinart
> From: Luke Paireepinart > > are you asking a question? > > > Kermit Rose wrote: > > > Yes. How can I make a package of functions declare global variables for > passing information between > the functions in the package? > > a 'pack

Re: [Tutor] How to un-import modules?

2006-08-14 Thread Luke Paireepinart
Michael P. Reilly wrote: > On 8/14/06, *Dick Moores* <[EMAIL PROTECTED] > > wrote: > > Actually, my question is, after using IDLE to do some importing of > modules and initializing of variables, how to return it to it's > initial condition without closing and

Re: [Tutor] how to remove html ags

2006-08-14 Thread Luke Paireepinart
f you have a problem learning regular expressions and you need clarification about something, ask us. This list is here to help you learn and understand the Python language, not to generate code for you. :-). -Luke ___ Tutor maillist - T

Re: [Tutor] Global variables

2006-08-14 Thread Luke Paireepinart
Kermit Rose wrote: > > > From: Alan Gauld > Date: 08/14/06 18:42:41 > To: Kermit Rose; Luke Paireepinart > Cc: tutor@python.org; Danny Yoo > Subject: Re: [Tutor] Global variables > > > That may be true but you will make your code much less reusable >

Re: [Tutor] What does import really do?

2006-08-14 Thread Luke Paireepinart
jim stockford wrote: Hi Jim. > For example, > import os > import sys > > My take is that one uses the import keyword in a > program. > The Python interpreter reads the program and > generates machine code. > The import keyword directs the Python interpreter > to find some library (which

Re: [Tutor] processing multi entry logs

2006-08-14 Thread Luke Paireepinart
ocess_id is common to both the startdata and enddata. The only problem is determining if the entry is start or end data. Now you have a dictionary where the keywords are the processids and the data is a two-element list. Does that do what you need? HTH, -Luke ___

Re: [Tutor] more rps

2006-08-15 Thread Luke Paireepinart
[snip] > > class Computer: > >def __init__(self): > > self.points = 0 > > self.choice = " " > > > > def plays(self): > > comp_choice = random.randint(0,2) > > if comp_choice == 0: > >self.choice = 'rock' > > elif comp_choice == 1: > >self.choice = 'paper'

Re: [Tutor] about threads

2006-08-15 Thread Luke Paireepinart
b.py program]??' If the latter case, I guess you could find that by googling as well, if it exists. > regards > e. > Cheers, -Luke ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] threads and webpy

2006-08-16 Thread Luke Paireepinart
ing that you are using 'web.py' isn't very helpful. What actual code are you using to run the webserver? (Or maybe web.py contains a simple webserver in the module when it's run as main?) HTH, -Luke > cheers > e. > > > - > > Коли

Re: [Tutor] All of Kermit's E-Mails [was: Global Variables]

2006-08-16 Thread Luke Paireepinart
ople using Python every day, and phrases like 'not implemented correctly' or 'there's a bug in python' are converted in my ears to '*i'm complaining because i can't get my program to work*' It's identical, to me, as when I'm playing Counter

Re: [Tutor] puzzled again by decimal module

2006-08-18 Thread Luke Paireepinart
Dick Moores wrote: > At 02:41 PM 8/18/2006, Bob Gailer wrote: > >> Dick Moores wrote: >> >>> As an exercise that I thought would help me understand the decimal >>> module, I've been trying write a script (precisionFactorial.py) >>> that uses a modified fact(n) to compute precise factorial

Re: [Tutor] tkinter events:

2006-08-21 Thread Luke Paireepinart
ee it. It's commented, but if you need any more help than the comments feel free to write me back. Just be sure to use the reply-all button so the whole list can see the response. -Luke (note: code attached) #!/usr/bin/python # This program implements . it was originally written by #Zsiros L

Re: [Tutor] Limiting Characters

2006-08-21 Thread Luke Paireepinart
Marcus Dean Adams wrote: > > I’m fairly new to python, I’ve been dabbling in it for school and I > have a question. I’ve written a few programs using graphical windows > with input boxes such as a stopwatch, temperature converter, etc. > I’ve always found a gui much prettier than command line.

Re: [Tutor] Securing a Computer...

2006-08-31 Thread Luke Paireepinart
ey is pressed (That still resets when the window is minimized, inactive, etc.) You could make a Pygame program that does a grab_all, or tkinter for that matter.this probably won't work though.I won't go into detail.-Luke Check out AOL.com today. Breaking

<    1   2   3   4   5   6   7   8   9   >