Re: [Tutor] A Byte of Python or Learn python the hard way

2014-04-13 Thread Luke Pettit
nsubscribe or change subscription options: > https://mail.python.org/mailman/listinfo/tutor > -- Luke Pettit ,,, ^..^,,, http://lukepettit-3d.blogspot.com/ ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] why do i keep getting syntax errors in python when this runs

2013-09-07 Thread Luke Pettit
ice of homework in my first year > Undergrad exactly like this. > > -- > > > James Griffin: jmz at kontrol.kode5.net > > A4B9 E875 A18C 6E11 F46D B788 BEE6 1251 1D31 DC38 > ___ > Tutor maillist - Tutor@python.org > T

Re: [Tutor] Coursera Python Course starts today

2013-08-20 Thread Luke Pettit
gt; >> last time as life got in the way. Hope to succeed this time. > >> > >> https://class.coursera.org/programming1-002/class/index > >> > >> Leam > >> > > -- > > http://31challenge.net > > http://31challenge.net/insight > _

Re: [Tutor] writing effective unittests

2013-01-03 Thread Luke Thomas Mergner
half the audio. https://www.youtube.com/watch?v=jTJHQ-zQMk4 Marakana Tech TV: https://www.youtube.com/watch?v=xdY7svOz6n4 At O'Reilly: http://onlamp.com/pub/a/python/2004/12/02/tdd_pyunit.html - Luke Mergner ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

[Tutor] writing effective unittests

2013-01-02 Thread Luke Thomas Mergner
good tutorial that I've missed. Based on the O'Reilly 2-Part introduction, I hope that learning to write tests will make my code better. Thanks, -- Luke Thomas Mergner Glendale, CA Sent from Mutt. ___ Tutor maillist - Tutor@python.org

Re: [Tutor] Tutor Digest, Vol 106, Issue 5

2012-12-03 Thread Luke Paireepinart
it. But I can easily see how someone new to the list would get confused. I also did not read the original e-mail due to its cluttered nature. Thanks, -Luke ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Tutor Digest, Vol 106, Issue 5

2012-12-03 Thread Luke Paireepinart
On Mon, Dec 3, 2012 at 9:24 AM, Steven D'Aprano wrote: > On 04/12/12 00:55, Spectral None wrote: > >> From:"tutor-requ...@python.org**" >> To:tutor@python.org >> Sent: Sunday, 2 December 2012, 17:34 >> Subject: Tutor Digest, Vol 106, Issue 5 >> >> Send Tutor mailing list submissions to >>

Re: [Tutor] Help with writing a program

2012-12-02 Thread Luke Paireepinart
One effort you could make would be to find the relevant Python 3 document discussing strings and check if it has some references to finding substrings. Let me know what you try and I'll help you if you get stuck. Thanks, -Luke On Sun, Dec 2, 2012 at 11:31 PM, fantasticrm wrote: > The

Re: [Tutor] FW: (no subject)

2012-12-02 Thread Luke Paireepinart
On Sun, Dec 2, 2012 at 8:41 PM, Ashfaq wrote: > Luke, > > Thanks. The generator syntax is really cool. > I misspoke, the correct term is "list comprehension". A generator is something totally different! Sorry about the confusion, my fault. I type too fast sometime

Re: [Tutor] FW: (no subject)

2012-12-01 Thread Luke Paireepinart
matically with the system time. points = [] > for i in range(0, 1): > > x=random.uniform(0,1) > > y=random.uniform(0,1) > > points.append ( (x, y) ) > Also you could use a generator for all these lines, points = [(random.uniform(0,1), random.uniform(0,1)) for

[Tutor] Datetime objects

2012-03-16 Thread Luke Thomas Mergner
on specific to a library (sqlalchemy). If it matters, I'm playing around with a small web log application built on Werkzeug, Sqlalchemy, and Jinja2. I'm actually very impressed with the progress I've made. Luke Mergner Mechanicsville, MD lmerg...@gmail.com___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Debugging While Loops for Control

2012-02-16 Thread Luke Thomas Mergner
> > -- > > Message: 1 > Date: Wed, 15 Feb 2012 23:57:08 -0500 > From: Luke Thomas Mergner > To: tutor@python.org > Subject: [Tutor] Debugging While Loops for Control > Message-ID: > Content-Type

[Tutor] Debugging While Loops for Control

2012-02-15 Thread Luke Thomas Mergner
ying to learn a few things in my spare time. Thanks in advance. Luke ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] How have I transgressed??

2011-08-21 Thread Luke Paireepinart
Same here as Andre said. I've gotten that email probably a dozen times by now. It's based on an amount of absence I believe. - Sent from a mobile device. Apologies for brevity and top-posting. - On Aug 21, 2011, at 2:37 PM, Andre Engels wr

[Tutor] Logger object not passed between modules

2011-07-25 Thread Luke Thomas Mergner
y comfortable with obviously. Thanks in advance. Code snippets and prints follow. Luke # File / module one. import FrameMaker # instantiates the subclassed wx.Frame object and fills it. class App(wx.App): def __init__(self) self.logger = self.Log() def Log(self)

[Tutor] IDLE/tk in 10.6

2011-07-15 Thread Luke Thomas Mergner
ons/2.7/lib/python2.7/lib-tk/Tkinter.py", line 39, in import _tkinter # If this fails your Python may not be configured for Tk ImportError: No module named _tkinter Luke Mergner lmerg...@gmail.com___ Tutor maillist - Tutor@pyt

Re: [Tutor] Python GUI

2011-06-28 Thread Luke Paireepinart
The error message tells you everything... On line 60, you try to add to "number" but the variable hasn't been defined. We aren't going to debug your code for you, do YOU think it will work apart from this? Have you tried running any of the code? It's almost always better to build small parts an

Re: [Tutor] Type error: must be string or read-only character buffer, not seq

2011-04-19 Thread Luke Paireepinart
It's saying one of your variables is not a string. Is one of them a sequence? Perhaps Mir-seq? If so, you need to come up with a way to build a string from this object. You can call the str method and pass in your object or you can explicitly create a string from the data in the object. ---

Re: [Tutor] Python on TV

2011-04-14 Thread Luke Paireepinart
I don't see how a content provider preventing you from accessing content internationally that they probably don't have international distribution rights to as censorship. It's not like your ISP is blocking your access. - Sent from a mobile device. Apologies for brevit

Re: [Tutor] List sorting issues

2011-03-28 Thread Luke Paireepinart
Sort returns none because it changes your list in-place. Print your list out after calling sort and you should see the new one. - Sent from a mobile device. Apologies for brevity and top-posting. - On Mar 28, 2011, at 11:53 AM, Eric Stevens

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] Why super does not work !

2011-01-17 Thread Luke Paireepinart
I think it might be related to your multiple inheritance, maybe super is calling the init of observable on the listbox portion or something? I hardly ever do multiple inheritance so I'm not sure. What happens if you swap observable to be the first one? - Sent from a

Re: [Tutor] (no subject)

2011-01-13 Thread Luke Paireepinart
On Thu, Jan 13, 2011 at 4:53 PM, Steven D'Aprano wrote: > lmho...@jacks.sdstate.edu wrote: >> >> Hello All, >> I am having an issue with lists and am not sure where to go from here any >> advice appreciated. I colored the areas of concern. >> blue my comments >> purple example of output >> red are

Re: [Tutor] Beginning Python and other resources (was Re: SlicingTuples)

2011-01-13 Thread Luke Paireepinart
Also check bigwords.com, they aggregate lots of other book sites and will get you a great deal, especially if you are buying multiple books because it smartly combines shipping and all. - Sent from a mobile device. Apologies for brevity and top-posting. --

Re: [Tutor] Sorting a List

2011-01-12 Thread Luke Paireepinart
Remember the sorted() method takes a key function, have this key function take in each filename and compare the numbers and you're all set! - Sent from a mobile device. Apologies for brevity and top-posting. - On Jan 12, 2011, at 8:17 PM, B

Re: [Tutor] question regarding regular expression compile

2011-01-12 Thread Luke Paireepinart
No. Did you try that? It doesn't evn look like valid python code to me. You want a single string with the r before it, not 3 separate strings. - Sent from a mobile device. Apologies for brevity and top-posting. - On Jan 12, 2011, at 8:02 AM,

Re: [Tutor] python hyperlinks question

2011-01-12 Thread Luke Paireepinart
Not really a python question, but maybe look at that pyexcel or whatever. Should be able to add links to it that way. Csv is jus a data interchange format though, if excel supports passing links thru it then you can do it, otherwise don't use csv for this. - Sent fro

Re: [Tutor] test- why no traffic?

2011-01-11 Thread Luke Paireepinart
i see you. did you change your settings so you don't get e-mails? On Tue, Jan 11, 2011 at 12:17 PM, wrote: > hmmm, wonder if my membership went belly up... no traffic arriving... > hmmm... > > ___ > Tutor maillist  -  tu...@python.org > To unsubscribe

Re: [Tutor] REGEX EXPLANATION

2010-12-21 Thread Luke Paireepinart
Which part of the regexes do you not understand? Have you tried figuring themselves out yourself first? We don't typically give out answers here. This is a tutor list, not a solve your problems for you list. We're here to teach you how to fish, not cook for you. So show us where you're stuck and

Re: [Tutor] Trying to parse a HUGE(1gb) xml file in python

2010-12-21 Thread Luke Paireepinart
You're not going to win any friends here Dave. Steven is well known on this list. He is sometimes abrasive but it's rarely if ever malicious. Anytime he's ever been rude to me it was deserved. Like how I top post from my phone. Or giving bad advice to newbies. People are getting irritated becau

Re: [Tutor] AttributeError: 'list' object has no attribute 'find'

2010-12-21 Thread Luke Paireepinart
Read() does return a string. I guess the better question would be... Are you using read? 'cause in the example you sent you used readlines() which returns a list of lines. - Sent from a mobile device with a bad e-mail client. - On Dec 21,

Re: [Tutor] Trying to parse a HUGE(1gb) xml file in python

2010-12-20 Thread Luke Paireepinart
If you can assume a well formatted file I would just parse it linearly, should be much faster. Read the file in as lines if the XML is already in human readable form, or just read in blocks and append to a list and do a join() when you have a whole match. - Sent from

Re: [Tutor] Help with using the ctypes module

2010-12-13 Thread Luke Paireepinart
I confess I don't know a lot about C so I may be off base here... But it looks like your c func extendarray returns a pointer to the new extended array, but you are not capturing this pointer in your python when you call the c func. So the python code is pointing at the old deallocated array.

Re: [Tutor] Question about the "main" Python help list

2010-12-04 Thread Luke Paireepinart
Next time you email tutor, start a new email msg instead of clearing out the contents of a reply to a different e-mail. When you do it like that it breaks threading, so all these emails are in the same thread as the "need help" one even though they aren't related to that e-mail. ---

Re: [Tutor] permutations?

2010-12-02 Thread Luke Paireepinart
Instead of nested fors which will grow exponentially in running time, consider this for removing reversals: newlist = [] tempdict = {} for i in oldlist: try: tempdict[i] except: tempdict[i] = 1 tempdict[i.reverse()] = 1 newlist.append(i) That's the gneral

Re: [Tutor] Is Python useful for emulating?

2010-11-28 Thread Luke Paireepinart
It probably won't be fast enough. I wrote an NES emu in python and I ran into a lot of performance issues. If you're new to emu scene, start with David winters' doc and write a chip-8 emu. I will help you learn the structure and process of writing an emulator. Then reimplememt it in c afterward

Re: [Tutor] While Loops: Coin Flip Game :p:

2010-11-16 Thread Luke Pettit
ails should add up to 100 >>> # not 173 or am I missing the point? >>> >>> >>> No, you're missing an indentation. If you check the code you're >> running, I think you'll find that you didn't unindent the line incrementing >> count. >> >> Of course, it's less error prone to simply use >> for count in xrange(100): >> >> instead of while count < 100: >> >> and you wouldn't need to increment count. >> >> DaveA >> >> > > > -- > With Regards, > Nithya S > > -- Luke Pettit ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] While Loops: Coin Flip Game :p:

2010-11-15 Thread Luke Pettit
t; > >> > Thanks, >> > S. Dawn Samson >> >> >From one beginner to another - it looks to me like you set the value of >> coin once then checked it 100 times. If you want to reset the value of >> coin maybe it (i.e. setting the value of coin, not just calling >> the value of coin) should be in the loop too? >> >> tom >> ___ >> Tutor maillist - Tutor@python.org >> To unsubscribe or change subscription options: >> http://mail.python.org/mailman/listinfo/tutor >> > > > > ___ > Tutor maillist - Tutor@python.org > To unsubscribe or change subscription options: > http://mail.python.org/mailman/listinfo/tutor > > -- Luke Pettit ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] variables question.

2010-11-10 Thread Luke Paireepinart
It's pretty typical for scoping rules. If you define variables outside of your funcs you can access them inside the func. If you want to change the value in the function you need to declare the scope as global. If you make another variable with the same name inside of a function it will shadow t

Re: [Tutor] Columnar Transposition Cipher question

2010-11-08 Thread Luke Pettit
sition cipher. I've never > heard of it before, but I'm sure www.google.com and > http://en.wikipedia.org have plenty to say on the subject. > > HTH, > Wayne > > ___ > Tutor maillist - Tutor@python.org > To unsubscr

Re: [Tutor] Server

2010-11-08 Thread Luke Paireepinart
On Mon, Nov 8, 2010 at 3:53 PM, Chris King wrote: >  On 11/5/2010 8:10 PM, Alan Gauld wrote: >> >> "Chris King" wrote >> If you are using Windows, turn off the built-in firewall. That's what fixed my problems. ~Corey >> >>> also, it is on the same network, so the server shouldn't b

Re: [Tutor] Columnar Transposition Cipher question

2010-11-08 Thread Luke Paireepinart
On Mon, Nov 8, 2010 at 5:28 PM, Natalie Kristine T. Castillo wrote: > Hi, I need help on how exactly to solve this: That's nice. > > To send secret messages you and your partner have decided to use the > columnar function you have written to perform columnar transposition cipher > for this course

Re: [Tutor] Commercial or Famous Applicattions.?

2010-11-08 Thread Luke Paireepinart
just off the top of my head... NASA uses it. Lots of games use Python as their game logic/scripting language (how many use PHP? probably approaching 0. LUA is more popular than Python but Python is much more popular than PHP). The first ever bittorrent client (the official one) was written in P

Re: [Tutor] Hi

2010-11-06 Thread Luke Pettit
r the > entire project: http://code.google.com/edu/ -- definitely worth checking > out. > > -trench > > On Fri, Nov 5, 2010 at 8:12 PM, Luke Pettit wrote: > >> Hi everyone, >> I'm just about to begin to learn python and have bookmarked a number of >> sites

Re: [Tutor] Hi

2010-11-06 Thread Luke Pettit
Thanks Alan I found those about an hour ago :) On 6 November 2010 20:11, Alan Gauld wrote: > > "Luke Pettit" wrote > > > I was interested in which video tutorials Glen was watching, and if anyone >> else could recommend some video tutorials to watch, >> &g

Re: [Tutor] test

2010-11-05 Thread Luke Paireepinart
You don't get your own e-mails back. On Fri, Nov 5, 2010 at 11:37 PM, Danyelle Davis wrote: > im wondering if im able to mail this list.  I sent an email asking for good > newbie projects but never saw it post.  All i got was the welcome/ info > email. > LN > _

[Tutor] Hi

2010-11-05 Thread Luke Pettit
nguage Maxscript http://rosettacode.org/wiki/Category:MAXScript and since Autodesk now own all the competitors software and they all (except Max) use Python for their coding I thought it would be the way to go when learning a new language. Blender also uses Python btw. My 3d site http://

Re: [Tutor] Looking for a tutor to review my code and provide constructive feedback.

2010-11-04 Thread Luke Paireepinart
Your code is not bad overall, pretty great for a beginner actually. I would say you should read guido's style guide though; some of your variable and function naming is nonstandard python. - Sent from a mobile device with a bad e-mail client. -

Re: [Tutor] Looking for a tutor to review my code and provide constructive feedback.

2010-11-04 Thread Luke Paireepinart
Also for your confirm entries read about sentinel values for while loops. It saves you repeating the conditional in the loop body. And you might want to .lower().strip()[0] the input choice so that they can use y, Y, yes, or whatever. Remember, users suck at generating accurate and correct input

Re: [Tutor] Looking for a tutor to review my code and provide constructive feedback.

2010-11-04 Thread Luke Paireepinart
Also for your confirm entries function, read about while loops - Sent from a mobile device with a bad e-mail client. - On Nov 4, 2010, at 3:10 PM, Glen Clark wrote: > Hello, > > I have completed my first python script. This is after watc

Re: [Tutor] (no subject)

2010-10-28 Thread Luke Paireepinart
On Thu, Oct 28, 2010 at 8:11 PM, Steven D'Aprano wrote: > >> postPos=words[3] > > This like will fail with NameError, because words is not defined anywhere. > > This is not the code you are running. We can't tell what is wrong with the > code you run when you show us something completely different

Re: [Tutor] (no subject)

2010-10-28 Thread Luke Paireepinart
This code shouldn't even actually execute, you should get an indexerror exception. Close your IDE and try it again. Should make the issue more clear. - Sent from a mobile device with a bad e-mail client. - On Oct 27, 2010, at 1:04 PM, "Terr

Re: [Tutor] functions: use return or exceptions?

2010-09-23 Thread Luke Paireepinart
You should do both. Raise an exception in the exceptional case. My general pattern is to return None if no results exist, return the results if they do exist, and raise an exception if I couldn't perform the function. Eg. If I have a function that creates a list of users with a first name of bob

Re: [Tutor] py-postgressql v1.0.1 question

2010-09-12 Thread Luke Paireepinart
> > Thanks for the tip. I'll do some more research but this sounds promising. > > Rance > Just be aware that some methods of list building will iterate over the list and evaluate it. So if you only want to retrieve the first 10 results but you do something like Results = [I.fetch() for I in c

Re: [Tutor] forcing hashlib to has string variables

2010-09-12 Thread Luke Paireepinart
with a bad e-mail client. - On Sep 12, 2010, at 1:54 PM, Rance Hall wrote: > Luke: > > On python3.1 I get the following error using your (untested) two line snippet: > > TypeError: Unicode-objects must be encoded before hashing > > If I add th

Re: [Tutor] forcing hashlib to has string variables

2010-09-12 Thread Luke Paireepinart
This is how I use it (untested) Import hashlib Print hashlib.md5("somestr").hexdigest() Works fine without using binary string. On Sep 12, 2010, at 1:19 PM, Rance Hall wrote: > Everybody knows you don't store plain text passwords in a database, > you store hashes instead > > consider: > > us

Re: [Tutor] recursive problem

2010-09-11 Thread Luke Paireepinart
On Sep 11, 2010, at 12:40 PM, Roelof Wobben wrote: > > > > >> From: st...@pearwood.info >> To: tutor@python.org >> Date: Sun, 12 Sep 2010 03:27:42 +1000 >> Subject: Re: [Tutor] recursive problem >> >> On Sun, 12 Sep 2010 03:18:19 am Steven D'Aprano wr

Re: [Tutor] exceptions problem

2010-09-10 Thread Luke Paireepinart
o the e-mail client to render the text. Yes, I could turn off HTML on my end, but that is a pain and breaks messages that I legitimately want to be HTML. Thanks, -Luke On Fri, Sep 10, 2010 at 6:56 PM, bob gailer wrote: > On 9/10/2010 2:48 PM, Roelof Wobben wrote: > > > Date: Fri, 10

Re: [Tutor] changing list index start

2010-09-10 Thread Luke Paireepinart
Yeah, just add 1 to it. When printing just do index+1 and when inputting the user's choice, subtract 1 and use it as the array index. Sent from my iPhone On Sep 10, 2010, at 4:36 PM, Rance Hall wrote: > I'm using the following function style I found on the net to create > menus for a command

Re: [Tutor] hashlib problems

2010-09-10 Thread Luke Paireepinart
In general, you shouldn't even hint at the possibility of there being a bug in the code unless you have test cases and a patch handy. Especially something as widely used as hashlib. It gives An air of arrogance about your post, whether you intend it or not. I think your issue got resolved alrea

Re: [Tutor] recursive problem

2010-09-09 Thread Luke Paireepinart
n Fri, 10 Sep 2010 01:05:22 am Joel Goldstick wrote: > > On Thu, Sep 9, 2010 at 10:26 AM, Luke Paireepinart > > > > wrote: > > > Shouldn't there be a way to do this without type checking? Duck > > > typing! > > > > > > Your post got me thi

Re: [Tutor] recursive problem

2010-09-09 Thread Luke Paireepinart
Shouldn't there be a way to do this without type checking? Duck typing! Sent from my iPhone On Sep 9, 2010, at 7:33 AM, Joel Goldstick wrote: > > > On Thu, Sep 9, 2010 at 7:59 AM, Shashwat Anand > wrote: > > > On Thu, Sep 9, 2010 at 3:11 PM, Roelof Wobben wrote: > > > From: anand.shas

Re: [Tutor] Adding to a CSV file?

2010-08-30 Thread Luke Paireepinart
em(word) here's your problem. MyWord is the value that is changing in each iteration of the loop, not word. Change your lines to word2=wnl.lemmatize(MyWord) word3=proter.stem(MyWord) and it should work fine. You should've gotten an undefined variable exception

Re: [Tutor] Moving from Python 2.5.4 to 2.5.2?

2010-08-16 Thread Luke Paireepinart
2010 at 3:57 PM, Wayne Watson wrote: > The question is would going back likely cause problems? I'm dealing with > neophytes. He's messed up before. > > On 8/16/2010 8:58 AM, Luke Paireepinart wrote: >> >> On Mon, Aug 16, 2010 at 10:39 AM, Wayne Watson >>  

Re: [Tutor] Moving from Python 2.5.4 to 2.5.2?

2010-08-16 Thread Luke Paireepinart
2.5.2? Why don't you all just upgrade to 2.5.4? -Luke ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] my Python learning exercise

2010-08-16 Thread Luke Paireepinart
; with other programming languages.  It is a simple text based game that > simply lets a user explore a maze of rooms. Anyone who finds this interesting may also want to look into http://inventwithpython.com/ , I hear it's a good book but I haven't personally

Re: [Tutor] problem loading and array from an external file

2010-08-11 Thread Luke Paireepinart
Don't pass none. It's an optional parameter. It's accepted practice to not pass optional parameters. Sent from my iPhone On Aug 11, 2010, at 6:46 PM, Bill Allen wrote: > On Tue, Aug 10, 2010 at 11:11 AM, Hugo Arts wrote: >> On Tue, Aug 10, 2010 at 9:59 AM, bob gailer wrote: >>> On 8/10/2010

Re: [Tutor] Question about strings

2010-08-09 Thread Luke Paireepinart
ge. Range(1,100) returns 1,2,,99. Hope that helps -luke Sent from my iPhone On Aug 9, 2010, at 11:02 AM, Daniel <.aste...@gmail.com> wrote: > Hi, I'm trying to solve an exercise, a beginners one but I have a question. > So the exercise sounds like this: > > Define

Re: [Tutor] Fwd: Need mentor

2010-08-09 Thread Luke Paireepinart
On Mon, Aug 9, 2010 at 1:32 AM, Ranjith Kumar wrote: > Hi all, > > I have described the theme of my project here, > Cheers > Ranjith, > This sounds kind of like homework. Is it homework? If not, where did you get this spec from? Thanks, -Luke ___

Re: [Tutor] Menu not working properly

2010-08-02 Thread Luke Paireepinart
. You are not being helpful. If you were kidding, make it more clear next time. > > there are more people who can and will help you. Unless I've missed a > response to a previous post of yours where people disrecommended your > postings, but that shouldn

Re: [Tutor] Simple Python Program

2010-07-31 Thread Luke Paireepinart
I think I agree more with bob on this one - he wasn't saying functions weren't important, just that they weren't important to this case. Sure polymorphism and inheritance and properties and generators and list comprehensions are awesome and useful, but I wouldn't suggest they are necessary for e

Re: [Tutor] Making a sound

2010-07-31 Thread Luke Paireepinart
You can generate the sound data in a buffer either in native python or using numpy, then play it back by loading the buffer into a sound object with pygame. It depends how much control you want on the sounds. You might want to use csound or supercollider or something if you want to programmatica

Re: [Tutor] problem with simple script

2010-07-28 Thread Luke Paireepinart
Just do a split of the input from the user on space or comma. If Len() of the split data is 1, do your [1, ...] interval, otherwise do the other interval. Sent from my iPhone On Jul 28, 2010, at 6:51 AM, "Richard D. Moores" wrote: > I have a practical need for a script that will give me a rand

Re: [Tutor] position of an element in list:

2010-07-23 Thread Luke Paireepinart
You can do it with any iterator Astr.index('o') I'm not sure what happens when there are multiple instances of 'o' though, check the docs on index. Sent from my iPhone On Jul 23, 2010, at 8:22 AM, Vineeth Rakesh wrote: > Hello all, > > How to return the position of a character in a strin

Re: [Tutor] how i can change two lists into one directory

2010-07-22 Thread Luke Paireepinart
Hey quit spamming the list please. Sent from my iPhone On Jul 22, 2010, at 7:08 PM, Alex Hall wrote: > On 7/22/10, ANKUR AGGARWAL wrote: >> hey i have just started making a app using python and just gt a problem.. >> >> i have two list >> a=["x","z"] >> b=[1,2] >> >> i want to make a direct

Re: [Tutor] sound libraries?

2010-07-22 Thread Luke Paireepinart
You can access openal through either pyglet or pygame I believe, and definitely thru panda3d. That would allow you to have true 3d sound positioning and I believe openal can automatically Doppler too, not sure though. Let us know what you go with or if you have questions. Sent from my iPhone O

Re: [Tutor] has it gone quiet or is it just me?

2010-07-21 Thread Luke Paireepinart
Not sure Alan. I haven't gotten any messages either, but this one came through just fine. -Luke On Wed, Jul 21, 2010 at 12:55 PM, Alan Gauld wrote: > I haven't had any tutor messages in 2 days. > Do I have a problem or are things just very quiet suddenly? > The archive isn

Re: [Tutor] searching for multiple strings in line.starswith()

2010-07-19 Thread Luke Paireepinart
You are using Line.startswith incorrectly, read the docs on it and see if you can figure out your problem an key us know. Pay attention to the parameters it takes and the values it returns. Sent from my iPhone On Jul 19, 2010, at 11:18 AM, Bala subramanian wrote: > Friends, > I have to extra

Re: [Tutor] A file containing a string of 1 billion random digits.

2010-07-17 Thread Luke Paireepinart
On Jul 17, 2010, at 7:19 PM, "Richard D. Moores" wrote: > I don't fully understand your "you always have two [chunks] in memory > at once". Does that take care of the overlap I think I need? I don't > want you or anyone to give me the the whole answer, but could you > clarify a bit about keeping

Re: [Tutor] now = ctime()[11:20]

2010-07-17 Thread Luke Paireepinart
Sorry the iPhone email client is terrible. It sent the previous email before I was done writing it. Anyway, the timeit module is available whenever you want to profile something and determine how long it takes to run. Sent from my iPhone On Jul 17, 2010, at 1:32 AM, "Richard D. Moores" wrote:

Re: [Tutor] now = ctime()[11:20]

2010-07-17 Thread Luke Paireepinart
If you are asking how to get a variable to call a function each time it's accessed... Well that's kind of a weird request. I know you can create properties in a class that act like variables but you can do whatever you want behind the scenes, like calling the now() function on each access. A muc

Re: [Tutor] Searching a text file's contents and comparing them toa list

2010-07-14 Thread Luke Paireepinart
You already know how to store multiple vars -- use lists! Just create a blank one before your loop and append() to it. Also you might think of a generic way to do this without relying on separate variables for each aisle, what if your store has 30 aisles? Hint: lists can contain any python objec

Re: [Tutor] Function returns 'None'

2010-07-11 Thread Luke Paireepinart
waste to have an extra variable and else block. But you know, potato potato. It's negligible from a performance standpoint, it's really just a question of readability. Do what makes you ( and the people who will read your code) happy. -luke ___

Re: [Tutor] Function returns 'None'

2010-07-11 Thread Luke Paireepinart
I think the new version is harder to understand. Sent from my iPhone On Jul 11, 2010, at 10:43 AM, Nick Raptis wrote: > On 07/11/2010 06:28 PM, Nick Raptis wrote: >> >> def recursfac(x,carryover=1): >>print 'x:',x,'carryover:', carryover >>if x > 1: >>carryover *= x >>c

Re: [Tutor] Running external commands from Python

2010-06-25 Thread Luke Paireepinart
e subprocess is intended to replace ALL of the previously-mentioned commands, even os.system. So in a sense they are all obsolete. Please see http://docs.python.org/library/subprocess.html for more information. Also, this list is awesome. Make much use of it. There haven't

Re: [Tutor] Running external commands from Python

2010-06-25 Thread Luke Paireepinart
On Fri, Jun 25, 2010 at 7:48 PM, David Hutto wrote: > On Fri, Jun 25, 2010 at 8:16 PM, Steven D'Aprano wrote: >> On Sat, 26 Jun 2010 08:46:17 am Randy Kao wrote: >>> Hi all, >>> >>> I'm a newbie to Python (switching from Perl) and had a question about >>> the best way to run external commands in

Re: [Tutor] Running external commands from Python

2010-06-25 Thread Luke Paireepinart
Subprocess module is the preferred strategy when You want to communicate with the command you're running. If not, you can use os.system. Sent from my iPhone On Jun 25, 2010, at 5:46 PM, Randy Kao wrote: > Hi all, > > I'm a newbie to Python (switching from Perl) and had a question about the >

Re: [Tutor] Better construct? (was no subject)

2010-06-12 Thread Luke Paireepinart
> >> ## Can someone suggest a pythonesque way of doing this? >> >> >> def getid(): >>    response  = raw_input('prompt') >>    if response not in [ "", "y", "Y", "yes"] : >>        getid()    # ouch >>    print "continue working" >>    # do more stuff >>    # do more stuff >> This seems like really

Re: [Tutor] PYTHON ON NOKIA E71

2010-05-30 Thread Luke Paireepinart
definitely possible. You could've probably found the reference on Google faster than posting here and waiting for a reply. Good luck, it's a lot of fun having Python on your phone! -Luke ___ Tutor maillist - Tutor@python.org To unsubscribe or

Re: [Tutor] list of dicts <-> dict of lists?

2010-05-28 Thread Luke Paireepinart
> I'm new to python, so i don't know if this is important, or what it means at > all.  I looked in setup.py, and it didn't tell me anything.  What does it > mean by "the necessary bits" were not found? Not really sure, but in the future please create a new e-mail to tutor@python.org rather than

Re: [Tutor] Successfully trapping the [505 file not found] error

2010-05-26 Thread Luke Paireepinart
> > What follows is the exception handling snippet: > ## -- > except ftplib.error_perm, e: >    msg = "Couldn't get %s %s" % (fname,str(sys.exc_info()[1])) >        log.add(msg) >        more-code-follows > ##

[Tutor] Fwd: Learning python using Michael Dawson's book

2010-05-17 Thread Luke Paireepinart
Forwarding. Peter use reply-all don't reply offlist please. -- Forwarded message -- From: Peter Date: Mon, 17 May 2010 10:08:47 -0400 Subject: Re: [Tutor] Learning python using Michael Dawson's book To: Luke Paireepinart Hi, The result in the book has letterin

Re: [Tutor] Learning python using Michael Dawson's book

2010-05-17 Thread Luke Paireepinart
I don't see any printing of dashes whatsoever. can you explain in more detail what output you're getting, how it's different from what you expected, and why you think that happened? On 5/17/10, Peter wrote: > Hello, > I am at the very beginning of learning Python. If anyone is familiar > with Mic

Re: [Tutor] application with tabs

2010-05-14 Thread Luke Paireepinart
Thanks for that info, Alan! It's pretty awesome to have support for a gui that looks native and is also included with Python by default. I'll check it out soon. On 5/14/10, Alan Gauld wrote: > > "Luke Paireepinart" wrote > >> well, but tkinter looks kinda cr

Re: [Tutor] application with tabs

2010-05-14 Thread Luke Paireepinart
appy and non-native on almost every platform. There are lots of resources for Qt, and for pyQt specifically. This is probably not the right place to ask this question though, we're more for general Python questions. May be better to ask on a wxpython list. HTH, -Luke _

Re: [Tutor] Design Question: File Object used everywhere

2010-05-13 Thread Luke Paireepinart
On Thu, May 13, 2010 at 11:49 PM, Jan Jansen wrote: > Hi there, > > I'm working on a code to read and write large amounts of binary data > according to a given specification. In the specification there are a lot of > "segments" defined. The segments in turn have defintions of datatypes and > what

Re: [Tutor] creating distribution lists in outlook

2010-05-12 Thread Luke Paireepinart
tion if you look into it, but I don't have outlook, I use Thunderbird. Are you able to use a plugin to perform the work or is that against your company's policies? I just don't see automating with COM being the cleanest / most robust approach, but if you really want to try it

Re: [Tutor] creating distribution lists in outlook

2010-05-12 Thread Luke Paireepinart
On Wed, May 12, 2010 at 6:20 PM, Pirritano, Matthew wrote: > That's the way we've been doing it. The issue, and inspiration for > pythonification is that the list has 1000+ emails. Outlook only allows > about 50 per list, which leads to the need to create 20+ separate lists, > which takes a consid

Re: [Tutor] creating distribution lists in outlook

2010-05-12 Thread Luke Paireepinart
import data from csv's already, and you may be able to structure these into groups in a clever way and avoid almost all of the work of interfacing Outlook to your program. Depending on the scale / frequency of this project it might not be feasible, but it's so

Re: [Tutor] raw_input a directory path

2010-05-12 Thread Luke Paireepinart
Where is the code that performs this? How are you running the script? Directory path should be no different than any other string. I'm guessing it has to do with backslashes but I'll wait until you explicate. -Luke ___ Tutor maillist -

  1   2   3   4   5   6   7   8   9   >