Re: [Tutor] How do I make Python draw?

2005-07-27 Thread luke
> Thanks. Will ask if I have any more questions. Maybe I won't have to go to > Visual Basic to write my games. Maybe Python will do the trick. Oh my god. Don't ever compare Python to Basic on a python mailing list. You'll get eaten alive ;-) Seriously though, If you take the time to learn PyGame,

Re: [Tutor] OT: we won't eat VB programmers for lunch [Was: How do I make Python draw?]

2005-07-27 Thread luke
hehe. <3 malbolge. Yeah, I actually learned basic as my first language... I don't mind it. I just don't like it all that much. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] learning classes (kinda long)

2005-07-30 Thread luke
t["hi"].avar #should print "hi!!!" print classesdict["what's up"].avar #should print "what's up!!!" #end of code I hope that helps ya. -Luke ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] substitute function

2005-07-31 Thread luke
Are you making a biology program Srinivas? - Original Message - From: "Kent Johnson" <[EMAIL PROTECTED]> Cc: Sent: Sunday, July 31, 2005 2:46 PM Subject: Re: [Tutor] substitute function > Srinivas Iyyer wrote: > > Hello group: > > > > Is there a 'substitute' function in python. > > > >

Re: [Tutor] Help with file I/O.

2005-07-31 Thread luke
gs): text = ["hello\r\n","Good Morning nathan.\r\n"] filename = "" for arg in args: if arg == "-f" or arg == "--filename": grab_next_arg = 1 continue if grab_next_arg: filename = arg break if filename != "

Re: [Tutor] What's the invaild syntax? Error message and relative codesupplied.

2005-07-31 Thread luke
ich = int(raw_input("Change which Grade: ")) HTH, -Luke ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] deck dealing program

2005-08-07 Thread luke
d(identify_card(deck.pop(randint(0,len(deck)-1    y += 1    break     print cards if __name__ == "__main__":    main()   #Luke ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] deck dealing program

2005-08-08 Thread luke
b.) Looking for suggestions on how to improve the code? > c.) Offering the code as a demo for Nathan et al.? > > I was just doing stuff along the same lines and was having fun seeing the > different approaches to the same problem. > > --Todd > > On Monday 08 August 2005 02:38

Re: [Tutor] Question on listing cards, then deleting one or more items by user's choice.

2005-08-09 Thread luke
>Say I deal 5 cards, and then list them. How would I print the list of cards, with the numbers >of each card(the position in the list)? Then delete a certain card or cards, based upon the >user's choice?. hope this points you in the right direction Nathan. -Luke #st

Re: [Tutor] Would like some help

2005-08-15 Thread luke
s (.items()) and it will concatenate (append?) these to the new dictionary. hope that helps. Luke - Original Message - From: "Howard Kao" <[EMAIL PROTECTED]> To: Sent: Monday, August 15, 2005 6:32 AM Subject: [Tutor] Would like some help > Directly Quoted From

Re: [Tutor] How can I make this run right?

2005-08-15 Thread luke
t you just said you wanted number! which is confusing because I think everyone thought you were just excited. you could always use a recursive function for factorial, IE. def factorial(n): if n > 1: return factorial(n-1) * n else: return n HTH, Luke P.S. Try to fix yours it'll help yo

Re: [Tutor] convert a file from plaintext(Ascii) to unicode? very quickquestions

2005-08-15 Thread luke
code. then you could do a f = file(filename, "w") f.writelines(text) f.close() sorry I don't know more about it but I hope that helps you. -Luke - Original Message - From: "D. Hartley" <[EMAIL PROTECTED]> To: "Python tutor" Sent: Monday, August

Re: [Tutor] convert a file from plaintext(Ascii) to unicode? very quickquestions

2005-08-15 Thread luke
List: I'm forwarding this private message(hope you don't mind Denise) I personally have no idea what to do, but someone else might be able to help. -Luke - Forwarded Message - text is a list, so you can't encode it. but you can iterate over each of the elements and encod

Re: [Tutor] no rsplit

2005-08-22 Thread luke
>v = "64x43x12" -> '64x43', '12' > > How split it by the las 'x'? [snip] >>>v = "64x43x12" >>>temp = v.split("x")[-1:] >>>print temp ['12'] that's the best I can do for now. HTH,

Re: [Tutor] Split a string into characters

2005-08-22 Thread luke
> How do I split a string like "Hans" into a list of characters > ['H','a','n','s']? [snip] well you could write your own function... def splititems(itemlist): templist = [] for item in itemlist: templist.append(item) return templist print splititems("Hello") or even def

Re: [Tutor] Game Engine HowTos?

2005-09-05 Thread luke
torials on the site explicitly, but you should be able to figure out how to write one if you look through the other tutorials. also, you might want to look into joining the pygame mailing list. they are very helpful. -Luke Afterthought: This e-mail was entirely pointless I apologize but I am send

Re: [Tutor] Newbie Just Joining

2010-01-11 Thread Luke Paireepinart
Hey, welcome to the list! No probemas so far? On 1/11/10, Kamron Bennett wrote: > I'd like to say hi and I'm a new member of this mailing list. > > -- > "You'll never know if you don't go, you'll never shine if you don't glow" > -Smash Mouth "All Star" > -- Sent from my mobile device __

Re: [Tutor] need help in python

2010-01-21 Thread Luke Paireepinart
Don't post messages to the list in reply to other messages, it messes up threading. Other than that, you'll have to tell us more about your assignment if you want help. -Luke On Thu, Jan 21, 2010 at 11:48 AM, invincible patriot < invincible_patr...@hotmail.com> wrote: > hi &

[Tutor] Fwd: length of a string? Advice saught

2010-01-27 Thread Luke Paireepinart
-- Forwarded message -- From: Luke Paireepinart Date: Wed, 27 Jan 2010 18:01:35 -0600 Subject: Re: [Tutor] length of a string? Advice saught To: Kirk Z Bailey Are you using the post or the get method to submit the form? That's likely your problem. Strings in Python are

Re: [Tutor] I love python

2010-01-28 Thread Luke Paireepinart
Glad you like it. I do too. I'm taking a graduate course "Crafting Compilers" and my prof. said I could use Python to write my compiler. It'll be the first one for his class that wasn't written in C/C++. On Thu, Jan 28, 2010 at 10:53 AM, Samuel de Champlain < samueldechampl...@gmail.com> wrote:

Re: [Tutor] I love python

2010-01-28 Thread Luke Paireepinart
: > Whoaa...even me too have Compilers as a graduate course this sem, (lex, > flex, yacc stuff) but the labs have not started yet. Will see how much > pythonic I can make this lab :D > > > On Fri, Jan 29, 2010 at 12:36 AM, Luke Paireepinart < > rabidpoob...@gmail.com> wr

Re: [Tutor] can any one help

2010-01-30 Thread Luke Paireepinart
ys both need to be a lot more clear with your questions. If it doesn't seem like you put in the effort for a proper post then you're unlikely to get a proper reply. -Luke > Sorry I also teach Python. > > def fibn(n): > > a,b=15,2 > > while a>n: > > print

Re: [Tutor] please help me

2010-01-30 Thread Luke Paireepinart
ving, you're not going to get a reply. We're busy people, make it easy for us to help you. -Luke ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Problem creating a search

2010-01-30 Thread Luke Paireepinart
in memory (at least I don't think it will, I believe that it's a generator so it's yielding each line). It probably will run more slowly than Anand's solution, though. Depends on your requirements. Good luck with Python and hopefully we can help you with any other stumbli

[Tutor] please help me

2010-01-31 Thread Luke Paireepinart
n error message include the whole traceback, don't paraphrase it.) In other words, if you don't have code that you've tried and a specific problem you're having, you're not going to get a reply. We're busy people, make it easy for us to help you. -Luke ---

Re: [Tutor] python and sqlite

2010-01-31 Thread Luke Paireepinart
Yes, it works fine with sqlite. I've seen very large projects use it just fine. I'd recommend googling "pysqlite" or something similar. -Luke On Sun, Jan 31, 2010 at 11:03 AM, Samuel de Champlain < samueldechampl...@gmail.com> wrote: > My project is relatively

Re: [Tutor] can any one help

2010-01-31 Thread Luke Paireepinart
d us with what you've tried we can help you a little more. How do you think you should do the multiplication? You mentioned a 'for loop' but you didn't actually try using one in your code. Also one hint, strings can be used directly in this situation. as an example, a = &#

Re: [Tutor] Simple variable type question

2010-02-05 Thread Luke Paireepinart
You want to promote one of your variables to float before you do the calculation, this will make all other variables automatically cast. So (float(y2) - y1) / (x2-x1). if you do the float cast after the calculation, you will do the calculation as integers and so even though you'll get "2.0" you wo

Re: [Tutor] Simple variable type question

2010-02-05 Thread Luke Paireepinart
On Fri, Feb 5, 2010 at 12:45 PM, Alan Gauld wrote: > > "Antonio de la Fuente" wrote > >> the doctest for the slope function failed, because is expecting a >> >> floating point value and not an integer: >> > > So convert it to a float. > > Or just > return float(y2-y1/x2-x1) > > Alan why are y

Re: [Tutor] List Comprehension question

2010-02-08 Thread Luke Paireepinart
On Mon, Feb 8, 2010 at 4:15 PM, wrote: > I've been trying to work my way through some 'beginner projects' I found > around the web, one of them involves generating some random numbers. I > decided to use a list of lists, and I'm wondering if this is a valid > comprehension...IDLE doesn't seem to

Re: [Tutor] python

2010-02-08 Thread Luke Paireepinart
quite. On Mon, Feb 8, 2010 at 8:54 PM, ailx ailx wrote: > python > > ___ > Tutor maillist - Tutor@python.org > To unsubscribe or change subscription options: > http://mail.python.org/mailman/listinfo/tutor > >

Re: [Tutor] Just a Note

2010-02-12 Thread Luke Paireepinart
This doesn't make any sense. What do you mean "tries to open up a news service"? When you read the e-mail? What system are you using? On Fri, Feb 12, 2010 at 8:30 PM, Randy Raymond wrote: > By the way, Alan Gauld's emails generate an error in my system. His is > the only emails I have a probl

Re: [Tutor] Getting caller name without the help of "sys._getframe(1).f_code.co_name" ?

2010-02-13 Thread Luke Paireepinart
On Sat, Feb 13, 2010 at 9:56 AM, patrice laporte wrote: > > Hi, > > Being in an exeption of my own, I want to print the name of the caller, and > I'm looking for a way to have it. > > Could you tell us exactly why you want to do this? It seems sort of strange. Also couldn't you pass the caller a

Re: [Tutor] Getting caller name without the help of "sys._getframe(1).f_code.co_name" ?

2010-02-14 Thread Luke Paireepinart
n statements, I've always had no trouble finding where exceptions occurred, and I'm not sure what information is missing from the traceback that you'd like to convey to the user. On Sun, Feb 14, 2010 at 5:33 AM, patrice laporte wrote: > > 2010/2/13 Luke Paireepinar

Re: [Tutor] Editing html using python

2010-02-14 Thread Luke Paireepinart
On Sun, Feb 14, 2010 at 5:10 AM, Amit Sethi wrote: > Hi I need to edit html programmatically . Sadly the html might be broken at > places . I was using BeautifulSoup but there were lots of problems and it is > also not maintained can some one guide me to any tutorials on editing html > using lxml

Re: [Tutor] "Sounding" Off, IDLE (Win7)

2010-02-18 Thread Luke Paireepinart
System Speaker is just the driver for the builtin speaker in your computer (but it will redirect sound to your main speakers if you have some). You'll get sounds out of your regular speakers, you just won't get system beeps anymore, if you disable System Speaker. On Thu, Feb 18, 2010 at 6:09 PM,

Re: [Tutor] pyMVPA and OSError

2010-02-20 Thread Luke Paireepinart
On Thu, Feb 18, 2010 at 10:23 AM, Juli wrote: > Dear All, > > I am very much new to python, therefore I am likely to feel stupid > about asking this. I need pyMPVA module to play around with some fMRI > data. I have installed Python2.6 on Mac OS X Leopard. When I input >>> > import mvpa i get a d

Re: [Tutor] Superclass call problem

2010-02-20 Thread Luke Paireepinart
Your call to super is wrong. It should be super and you pass the class and instance, then call init. On 2/20/10, Alan Harris-Reid wrote: > Hi, > > I am having trouble understanding how superclass calls work. Here's > some code... > > class ParentClass(): > def __init__(self): > do so

Re: [Tutor] fast sampling with replacement

2010-02-20 Thread Luke Paireepinart
Can you explain what your function is doing and also post some test code to profile it? On Sat, Feb 20, 2010 at 10:22 AM, Andrew Fithian wrote: > Hi tutor, > > I'm have a statistical bootstrapping script that is bottlenecking on a > python function sample_with_replacement(). I wrote this functio

Re: [Tutor] fast sampling with replacement

2010-02-20 Thread Luke Paireepinart
On Sat, Feb 20, 2010 at 1:50 PM, Kent Johnson wrote: > On Sat, Feb 20, 2010 at 11:22 AM, Andrew Fithian > wrote: > > can > > you help me speed it up even more? > > import random > > def sample_with_replacement(list): > > l = len(list) # the sample needs to be as long as list > > r = xra

Re: [Tutor] Superclass call problem

2010-02-20 Thread Luke Paireepinart
> > > Hi Kent, thanks for the reply, > > Sorry, left out 'object' from my example. The actual code already reads > class ParentClass(object): > > Did you figure it out from my previous e-mail? ___ Tutor maillist - Tutor@python.org To unsubscribe or cha

Re: [Tutor] os.path.basename() issue with path slashes

2010-02-20 Thread Luke Paireepinart
On Sat, Feb 20, 2010 at 6:11 PM, Dayo Adewunmi wrote: > Shashwat Anand wrote: > >> >> >> >> >> for dirname, subdirname, filenames in os.walk(absolutePath): >> for filename in filenames: >> print "" >>%(currentdir,filename,currentdir,filename) >> >> >> I see a small

Re: [Tutor] What Editori?

2010-02-23 Thread Luke Paireepinart
On Tue, Feb 23, 2010 at 3:08 PM, Giorgio wrote: > O_O. > > I've downloaded some python examples from my debian server. Then, have > edited one of them with pyscript. The IDLE (the real idle alan :D) was > giving out a "unexpected indent" error, so i've checked again and again the > code -it was o

Re: [Tutor] Python-based address standardization script?

2010-02-24 Thread Luke Paireepinart
On Wed, Feb 24, 2010 at 4:14 PM, Serdar Tumgoren wrote: > Hey folks, > Anyone know if there's a Python script floating out there to standardize > U.S. addresses? I couldn't find anything on ActiveState or by Googling...I'm > interested in something similar to this Perl module: > > http://search.cp

Re: [Tutor] Python-based address standardization script?

2010-02-24 Thread Luke Paireepinart
gt;> >>> I could really use this too, I haven't been able to find one. Would you >> be interested in porting the Perl one? Maybe we could work on it if no one >> knows of any Python versions? >> > > Hey Luke, > > I'm definitely interested in porting

Re: [Tutor] wHY

2010-02-25 Thread Luke Paireepinart
YOU DON'T GET YOUR OWN MESSAGES BACK. On Thu, Feb 25, 2010 at 5:11 PM, Kirk Bailey wrote: > IS NOTHING FROM THE LIST COMING TO ME? > > -- > > > Cheers! > -Kirk D Bailey > > THINK > +-+ > .*.| BOX | > ..*+-+ > *** THINK > ___

Re: [Tutor] PyAutoRun

2010-02-26 Thread Luke Paireepinart
ed. > However, it`d be awesome if you could just fork it at github, pull, > modify and push. :) > I'm not too clear, perhaps you could explain what advantage this has over just writing a shell script / makefiles? -Luke ___ Tutor maillis

Re: [Tutor] First program

2010-03-12 Thread Luke Paireepinart
at the moment. I could probably make more comments but it's late and I need to go to bed, hopefully that's a decent enough start. Also (just FYI - you didn't do anything wrong) when replying to a post please use "reply-all" so that the group will get the message. If you u

Re: [Tutor] First program

2010-03-12 Thread Luke Paireepinart
Ray, please reply on-list in the future in case someone else has input. On Fri, Mar 12, 2010 at 8:01 PM, Ray Parrish wrote: > Luke Paireepinart wrote: > >print "A %s with dimensions %sx%s has an area of %s." % (choice, height, >> width, width*height) >&

Re: [Tutor] First program

2010-03-12 Thread Luke Paireepinart
older Python versions, this should read > > print('%s, is not a valid choice'%(choice)) > > Also you don't have to use parenthesis around single items, and also print is not usually used as a function either. So really for older versions the convention would be print &

Re: [Tutor] First program

2010-03-13 Thread Luke Paireepinart
necessary if you do not use "," but use "+" instead. So there are at least 2 reasons why + is worse than comma. Another thing to be aware of is that if you use commas, print inserts a space in the string, which may be either an advantage or a disadvantage depending on what you're trying to do. -Luke ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] First program

2010-03-13 Thread Luke Paireepinart
On Sat, Mar 13, 2010 at 12:04 PM, Ray Parrish wrote: > Luke Paireepinart wrote: > >> >> Your version creates at least 10 intermediate strings before outputting. >> Remember strings are immutable in Python. So you're constructing strings >> The area of a >&g

Re: [Tutor] movement controls

2010-03-18 Thread Luke Paireepinart
You should probably decouple the view from the model - have the character move around in a 2d plane in the model and then just draw the level in a certain area around the 2d coordinates of the character. On Thu, Mar 18, 2010 at 6:51 PM, wrote: > A little stuck and could do with any sudjestions.

Re: [Tutor] Movement controls useing pygame

2010-03-19 Thread Luke Paireepinart
do is say that my idea didn't make sense or wouldn't work for you in this case. -Luke On Thu, Mar 18, 2010 at 7:45 PM, wrote: > A little stuck and could do with any sudjestions. > > Aim:- > When the character goes past the middle of the screen, the background & > l

Re: [Tutor] movement controls

2010-03-19 Thread Luke Paireepinart
te a lot of your code -- the key here is that you should've written it this way (MVC) in the first place. Read up more on MVC, and specifically how it relates to game design. Also, when you reply, use Reply to All otherwise your reply is only seen by me, not by the other members

Re: [Tutor] Efficiency and speed

2010-03-19 Thread Luke Paireepinart
le value and its corresponding bin index. If this doesn't make sense let me know. If you are able to run the sim offline and reorder your sample space, and I'm not just being dumb & misunderstanding what you're trying to do (which is entirely possible), try it this way. If you h

Re: [Tutor] Finding duplicates entry in file

2010-03-20 Thread Luke Paireepinart
er: open("output.txt", "w").write("\n".join(sorted(set([i.strip() for i in open("input.txt")] Just for fun :) also, in your algorithm, why are you assuming there are at most 1 extra entries in the case of a duplicate? Why not generalize it for all duplicate

Re: [Tutor] Finding duplicates entry in file

2010-03-20 Thread Luke Paireepinart
line entries. Whew. > Can you please try to post to the list in plain-text rather than HTML? it is very hard to read your font on my system. Thanks, -Luke ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://

Re: [Tutor] Finding duplicates entry in file

2010-03-20 Thread Luke Paireepinart
On Sat, Mar 20, 2010 at 10:20 PM, Steven D'Aprano wrote: > On Sun, 21 Mar 2010 09:10:52 am Luke Paireepinart wrote: > > On Sat, Mar 20, 2010 at 4:50 PM, Ken G. > wrote: > > > Thanks for the info. I already adopted a program from another > > > person and i

Re: [Tutor] Prime numbers

2010-03-28 Thread Luke Paireepinart
that's the case, please let us know that it's homework. We will still help you, we just follow certain guidelines when providing homework assistance so as not to "give it away" and still allow you to reason / come up with the solution on your own, as your teacher probably intended. -L

Re: [Tutor] the binary math "wall"

2010-04-20 Thread Luke Paireepinart
stored as a float, there's no turning back. You need to get ahold of this value before it becomes a float and deal with it in a different way. The most straightforward is to deal with the parts individually as integers. Eventually you will develop a distrust for floats and you will intrinsical

[Tutor] Changing Default Install Path on Windows

2010-04-21 Thread Luke Paireepinart
ve learned today is that your 64-bit Python install path should will be where it normally is (HKLM\Software\Python\PythonCore\version\InstallPath) but your 32-bit path will be in that special WowNode directory. Hope that helps someone in the future, -Luke _

Re: [Tutor] (no subject)

2010-04-27 Thread Luke Paireepinart
ding in the end, trust me. Also why do you think the problem you're having is your "items button [doesn't] work" when it's pretty clear from the traceback that your code crashes due to trying to access a variable that doesn't exist? -Luke ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Using Regex to produce text

2010-04-27 Thread Luke Paireepinart
to the length of many patterns so this would be fairly pointless. For example, what would getListofPossibleText do for the pattern ".*" ? I think the better question is: what are you trying to do? Or perhaps: Why do you think you need to solve your problem this way? -Luke __

Re: [Tutor] Python beginner having troubles understanding word lists and character lists

2010-04-28 Thread Luke Paireepinart
too clear on what you're talking about. What part is confusing you exactly? Could you provide a code example? Thanks, -Luke ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] python list, right! but concretely?

2010-05-01 Thread Luke Paireepinart
ctually is, but I have read about it somewhere so I do know that it's possible to find the implementation details. Good luck, -Luke ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Iterating through a list of strings

2010-05-03 Thread Luke Paireepinart
wanting to create variable names from strings, before they discover that dictionaries are the correct response. Hope that helps, -Luke ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Iterating through a list of strings

2010-05-03 Thread Luke Paireepinart
at if you did for line in open('packages.txt'): etc... it would automatically close the file handle after the loop terminated. Have I been wrong this whole time? -Luke ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Iterating through a list of strings

2010-05-03 Thread Luke Paireepinart
On Mon, May 3, 2010 at 3:50 AM, Stefan Behnel wrote: > Luke Paireepinart, 03.05.2010 10:27: >> What's this bizarre syntax? > > Look it up in the docs, it's called "with statement". Its purpose here is to > make sure the file is closed after the execution of

Re: [Tutor] Iterating through a list of strings

2010-05-03 Thread Luke Paireepinart
2010/5/3 spir ☣ : > On Mon, 03 May 2010 10:55:11 +0200 > Stefan Behnel wrote: > >> Luke Paireepinart, 03.05.2010 10:27: >> > On Mon, May 3, 2010 at 1:49 AM, Stefan Behnel wrote: >> >>                 line = line.split('%', 1)[0] >>

Re: [Tutor] Help required to count no of lines that are until 1000 characters

2010-05-11 Thread Luke Paireepinart
ou are counting newlines as well? You may not want to do this, depending on your intended application. Hope that helps, -Luke ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] (no subject)

2010-05-11 Thread Luke Paireepinart
I'd have rather you top-posted, then I wouldn't have wasted 30 seconds scrolling past a bunch of irrelevant crap that I just gloss over anyway. If I want context I'll read the previous messages in the thread. but that's just MHO. -Luke On Tue, May 11, 2010 at 9:28 PM, Dav

Re: [Tutor] (no subject)

2010-05-11 Thread Luke Paireepinart
I'm just not going to quote previous threads because with my top-posting and dave's bottom-posting and whatever the heck Siva's posting was... whatever. Read previous e-mails if you need context. Siva is it possible that you accidentally installed the 64-bit version of python 3.1? ___

Re: [Tutor] (no subject)

2010-05-12 Thread Luke Paireepinart
> > Siva is it possible that you accidentally installed the 64-bit version of > python 3.1? > Hi Luke > I checked again and found that Python Shell has the following which is win32 > > Python 3.1.2 (r312:79149, Mar 21 2010, 00:41:52) [MSC v.1500 32 bit (Intel)] > on

Re: [Tutor] Find Elements in List That Equal A Specific Value

2010-05-12 Thread Luke Paireepinart
On Wed, May 12, 2010 at 1:22 PM, bob gailer wrote: > On 5/12/2010 1:58 PM, Su Chu wrote: >> >> I have three lists, one with unique values (list 1), one a sequence of >> values that are not necessarily unique (list2), and a shorter list with the >> unique values of list 2 (list 3). List 1 and List

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 -

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] 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
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] 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] 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] 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] 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

[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] 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 > ##

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] 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] 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] 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] 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
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] 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] 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] 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] 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] 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] 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] 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] 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] 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

  1   2   3   4   5   6   7   8   9   >