Re: [Tutor] Fastest way to iterate through a file

2007-07-01 Thread Luke Paireepinart
elis aeris wrote: > I found out that by making a copy of it, it can be load() ed ! ImageGrab returns an image instance. You can get the pixel data directly using getdata(). There's no reason to do what you're doing. -Luke ___ Tutor maill

Re: [Tutor] optimization: faster than for

2007-07-01 Thread Luke Paireepinart
#x27;, list).tostring() > >>.5.: > >> > >> In [6]:f7([97, 98, 99]) > >> Out[6]:'abc' Would run in IronPython, Jython or cPython. The way that the code is marked up (adding In or >>> before each line) is a feature of the IDE that one uses

Re: [Tutor] (no subject)

2007-07-05 Thread Luke Paireepinart
ple can tell just from the subject line what your general problem is. -Luke ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] How can I escape a pound symbol in my script?

2007-07-05 Thread Luke Paireepinart
"£")' > $ cat foo > £ > I thought this was very amusing. If it wasn't meant as a joke, sorry. I laughed. > Try to include parts of your code that's not working to this list for > us to see, there might be some other errors in it. > I second this.

Re: [Tutor] backslashes

2007-07-08 Thread Luke Paireepinart
> print line > if line==password: > print > print > print"you password was",line,"and it took",guesses,"guesses" > break > > > > > > p.s i am about to look up how to type to pyt

Re: [Tutor] object names

2007-07-08 Thread Luke Paireepinart
dynamically, and you haven't given us a reason why you need to do this. We're not withholding information from you to be egregious, we're doing it for your own good. You most likely don't need to do this, and we gave you a perfectly viable alternative i

Re: [Tutor] file methods

2007-07-09 Thread Luke Paireepinart
s - have you looked into any of the tutorials that people have referred you to? It appears that you aren't putting forth the effort to learn Python, and you're just presenting us with any issues you need to solve (I.E. getting us to do it for you). Personally, I don't have an

Re: [Tutor] An interesting case... of east vs. west

2007-07-10 Thread Luke Paireepinart
t somewhere I have to be, but I believe that you could use regexps to solve this quite easily. Good luck, and hopefully someone more helpful will chime in. -Luke ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Making Incremental Filenames

2007-07-10 Thread Luke Paireepinart
ually just use %s for everything (maybe that's bad ;) Or, as John Fouhy pointed out (I wouldn't have written this e-mail if I'd received his before starting this one) you can use the %d. Also, just a future warning: If you want to substitute a bu

Re: [Tutor] I/O error (?)

2007-07-11 Thread Luke Paireepinart
27; b = 42 abba = 0xABBA Then you can do this: mylist = [x,b,abba] and print from the list. -Luke ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] green brackets?

2007-07-11 Thread Luke Paireepinart
> f.write("parameter_2 = " + str(y) + "\n") > f.write("n\") > > for some reason that last bracket of the 2nd and last line line in > IDLE are green.\ > why is that? -Luke ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] please add me

2007-07-11 Thread Luke Paireepinart
Alan Gauld wrote: > You need to add yourself. > Technically, he doesn't need to add himself. We could just add his e-mail address for him. But that might violate some ToS or something. -Luke ___ Tutor maillist - Tutor@pyth

Re: [Tutor] strange output

2007-07-11 Thread Luke Paireepinart
Are you doing this in a file or using the >>> prompt? > If its at the >>> prompt then it will remember the number_1 values > from earlier. If you are saying you now have a file without the > number_1 stuff and just the function above then that is indeed odd! > Also, IDLE without a subprocess will keep modules and such around, and since those are just objects, I suspect it keeps local variables too, until you restart IDLE. -Luke ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Question

2007-07-13 Thread Luke Paireepinart
> Try > > tfile.write(str(i)+'\n') > > OR > > tfile.write( "d\n" % i) Alan meant tfile.write("%d\n" % i) of course ;) -Luke ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] (no subject)

2007-07-13 Thread Luke Paireepinart
[EMAIL PROTECTED] wrote: > Hello, > Hi, welcome to the list. Please use meaningful subject lines in the future. -Luke ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Tutor Digest, Vol 41, Issue 47

2007-07-13 Thread Luke Paireepinart
ssible, and therefore less likely that you'll get a meaningful response. Just thought I'd bring the issue to your attention, in case you didn't realize. -Luke ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] CGI error

2007-07-13 Thread Luke Paireepinart
an the unix-style. > > 1. > > >2. # Define function to generate HTML form. >3. def generate_form(): >4. print "\n" >5. print "\n" > > [snip more code] > > And the server log - > > [snip server log] > >

Re: [Tutor] how do I input " as part of a string?

2007-07-13 Thread Luke Paireepinart
d learn properly, and it went ignored. Do I have your attention? (Apologies to Alan et. al. for my tactlessness.) -Luke ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] interpreter restarts

2007-07-13 Thread Luke Paireepinart
E, and to restart the interpreter would mean restarting IDLE. Boy, that 'edit with idle' thing sure does cause some problems, don't it? :) -Luke ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] reading random line from a file

2007-07-14 Thread Luke Paireepinart
hon doesn't know beforehand where newlines are located inside of the file. So even if this were possible, it would still read in all of the file up to and including the line you want, so that it could count the number of newlines. Why is it a problem to input it all at once? -Luke ___

Re: [Tutor] reading random line from a file

2007-07-15 Thread Luke Paireepinart
that many quotes. So, like i said before, I doubt this will cause any significant performance problem in pretty much any normal situation. Also, by the way - please reply to me on-list so that others get the benefit of our conversations. -Luke ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] loop example from 'Learning to Program'

2007-07-15 Thread Luke Paireepinart
previews at Yahoo! Games. > http://videogames.yahoo.com/platform?platform=120121 > You know, gmail doesn't have ads online and it doesn't tack these ads onto your messages. Think about it ;) -Luke ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] loop example from 'Learning to Program'

2007-07-15 Thread Luke Paireepinart
o the interpreter? Is this exactly what you typed? > can someone tell me what the syntax error is, and how > to correct it? > There's nothing wrong with the code. Let's try to figure out what else it could be. -Luke ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] loop example from 'Learning to Program'

2007-07-15 Thread Luke Paireepinart
List > ~ > > here's the result: > > ~$ ./foreach.py > You have to run the code like this: python foreach.py So that python is executing the code instead of bash. HTH, -Luke ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] curses

2007-07-16 Thread Luke Paireepinart
File "", line 1, in > File "C:\Python25\lib\curses\__init__.py", line 15, in > from _curses import * > ImportError: No module named _curses > > > That and cygwin. > > -Tino There's a Console module that you can use to

Re: [Tutor] curses

2007-07-16 Thread Luke Paireepinart
Hey bhaaluu - I've enjoyed your posts to the list so far. They're very informative and well-written. -Luke bhaaluu wrote: > On 7/16/07, Tiger12506 <[EMAIL PROTECTED]> wrote: > >> curses does not run on my Windows XP computer. >> Is this supposed to be a

Re: [Tutor] interpreter restarts

2007-07-16 Thread Luke Paireepinart
t;> process as IDLE, and to restart the interpreter would mean restarting >> IDLE. >> Boy, that 'edit with idle' thing sure does cause some problems, don't it? >> :) >> -Luke >> > > Thanks, Luke. I hadn't thought of that. Question: Why

Re: [Tutor] interpreter restarts

2007-07-16 Thread Luke Paireepinart
what you were doing <_<. > >> As you will notice, there are some parameters there at the end. >> the -n is the one you're interested in . >> -n means no subprocess. >> > > Yes. Yes. That is what I'm interested in. > Sigh

Re: [Tutor] IDLE Usage - was Interpreter Restarts

2007-07-16 Thread Luke Paireepinart
transfer utility? could you write your code on your local computer then just transfer the final code to the server? A lot of Python programmers use Vi for writing their code. do you have access to that through SSH? I'm not quite sure what you mean by "SSH editor." -Luke ___

Re: [Tutor] Question from a newbie

2007-07-18 Thread Luke Paireepinart
? The way you save in PythonWin should be similar to saving in another program, but I haven't used it in a few years so I may have forgotten something. Thanks for giving us you

Re: [Tutor] while Loop

2007-07-18 Thread Luke Paireepinart
usedPocketsOne = (UsedPocketsOne - junkiesOne + labSpaceOne) * 17 This shouldn't even run - you should get a syntax error because UsedPocketsOne is not defined anywhere else in the program (that you've shown us.) Perhaps you're running it in IDLE with no subprocess and some value for U

Re: [Tutor] while Loop

2007-07-18 Thread Luke Paireepinart
Darren Williams wrote: > Luke and Kent, you're right, I didn't think JavaScript calculated > multiplaction and division before addition and subtraction but seems > it does :) > > I dunno what you mean about usedPocketsOne not being defined, didn't I > define it

Re: [Tutor] pybluez + link quality

2007-07-18 Thread Luke Paireepinart
etooth protocol, so you might want to check to see if what you're trying to do is cross-platform. -Luke ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Working with bash (subversion)

2007-07-18 Thread Luke Paireepinart
a basic example: >>> 'hello ' + 'world!' 'hello world!' Does that tell you everything you need to know? (recall that whether 'world!' is referenced using a variable name or used directly, the effect will be the same. I.E. a = 'ba' a + 'nana' has the same end result as 'ba' + 'nana'with the exception being that the variable 'a' is not defined or is not bound to a new value after this statement.) HTH, -Luke ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Working with bash (subversion)

2007-07-18 Thread Luke Paireepinart
ot platform-independent. It seems pretty useless, as far as I can tell. -Luke ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Working with bash (subversion)

2007-07-18 Thread Luke Paireepinart
term 'command' was the problem, eh? -Luke ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Working with bash (subversion)

2007-07-18 Thread Luke Paireepinart
pires: ', > 'Comment (1 line):', '', ''] > ==== > > Thanks very much to all who replied, it's amazing how quick help arrives! > Well, I for one would rather answer your questions than study for a Differential Equations test :) > -Justin -Luke ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Python Image library

2007-07-18 Thread Luke Paireepinart
y (3,5) or, to count from 0, (2,4). But yeah, the general idea is there. If my math is wrong I'm sure you won't hesitate to correct me ;) -Luke ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] reading random line from a file

2007-07-19 Thread Luke Paireepinart
uld be to build an index of the offset of the start of each line, and then randomly select from this list. that makes each line equally probable, and you can set up your class so that the index is only built on the first call to the function. -Luke

Re: [Tutor] Style question with classes and modules

2007-07-19 Thread Luke Paireepinart
#x27;re using in that particular module's implementation. Secondly, you'd have to create a new aggreateBase for each new set of imports that you'd want to use, otherwise certain modules would be importing things they didn't actually need. It's much easier and clearer to put the i

Re: [Tutor] python: how do I create a list of definitions?

2007-07-19 Thread Luke Paireepinart
like this: > > for a in range(10): > If x = list[a][0]: If is invalid. Python is case sensitive. 'if' and 'If' are not the same. Also, you're using an assignment instead of a comparison again. > string = string + list[a][1] > > > ? You

Re: [Tutor] python: how do I create a list of definitions?

2007-07-19 Thread Luke Paireepinart
> >> You can observe this in the following situation: >> >>> y = x = 2243 >> >>> y >> 2243 >> > > I think this is a special case of assignment. Try > y = (x = 2243) > and you will see that (x = 2243) is not an expression. > Oh. Thanks for pointing that out. I wondered why I couldn't "pr

Re: [Tutor] another question ( unrelated )

2007-07-20 Thread Luke Paireepinart
is delegated (relegated?) to the other threads mostly, until the sleep is up. Or, if you didn't want a constant amount of time to be given up to the other threads, you'd have to communicate to the halted thread when it should resume. Those are my thoughts on this, but as I said,

Re: [Tutor] scrips again

2007-07-20 Thread Luke Paireepinart
d? are you creating both of them in the same way? By 'command prompt' do you mean 'IDLE interactive interpreter' or do you mean the DOS prompt? 'the one that worked' is 'the first one', right? how can the first one bring up the answer

Re: [Tutor] How to determine if every character in one string is in another string?

2007-07-20 Thread Luke Paireepinart
but it should work (since your condition was that all characters must be printable; a different condition may not be satisfied by the strip because it only removes characters from the ends.) Let me know if this works :) -Luke ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Generators

2007-07-23 Thread Luke Paireepinart
while TRUE: mean the same thing. > The thing is - it is an infinite loop. This should be while True: not while TRUE: unless you set TRUE = True beforehand, since Python is case-sensitive. -Luke ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] about importing a module

2007-07-23 Thread Luke Paireepinart
t importanting a module? ;) >> > > It's not *how* IDLE imports the module, but that fact that IDLE imports the > module before his script would be executed. For example: > Actually I was just teasing you about saying 'IDLE, which _importants_ many modules'

Re: [Tutor] What exactly is [::-1]?

2007-07-25 Thread Luke Paireepinart
but I'd just google 'python list slicing' to find it, so I'll leave that as an exercise for the reader. > Thank you for your help. I lurk about on this list and have learned a > fair bit. > Good to hear :) -Luke ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Livewires questions

2007-07-26 Thread Luke Paireepinart
Tonu Mikk wrote: > Luke, thank you for your quick and complete response. Based on your > suggestions I have already made some progress! BTW, I am so glad that > I can ask this list my Python questions and get help. I began feeling > quite stuck and not knowing where to turn f

Re: [Tutor] adapting a converter openoffice

2007-07-26 Thread Luke Paireepinart
. I.E. when you exit the python program, the soffice instance that it started (if it started one) will be ended. Although, you could probably just allow the python program to continue to run. Not sure, I don't know anything about linux and I haven't had to do something similar to th

Re: [Tutor] Sum of Scores

2007-07-26 Thread Luke Paireepinart
Tiger12506 wrote: >> bhaaluu wrote: >> >>> Greetings, >>> >>> Beautiful! Thank you SO much for all the variations. >>> I'm so sure I'll have much to learn from them. This >>> is exactly the kind of stuff I'm currently studying. >>> > > I assume this is for me. Thank you kindly! :-) > >

Re: [Tutor] Livewires questions

2007-07-25 Thread Luke Paireepinart
using a while loop inside of your move_player and move_robots function. But you only call these functions if you KNOW that a movement key was pressed. Basically, this means that one of your 'if' conditions will ALWAYS be true inside of your while: loops, and you'll break

Re: [Tutor] Livewires Python course

2007-07-25 Thread Luke Paireepinart
-mail client threw your e-mail in with the 'function declaration problems' thread, which, if I had decided I didn't need to watch that thread anymore, would've resulted in your question getting overlooked. So overall your questions get less exposure that way, as wel

Re: [Tutor] What exactly is [::-1]?

2007-07-25 Thread Luke Paireepinart
Dick Moores wrote: > At 08:38 PM 7/25/2007, Luke Paireepinart wrote: >> > I would like to know what exactly the index notation of [::-1] is, >> where >> > it comes from and if there are other variants. >> > >> This is called list slicing. Look into it

Re: [Tutor] Livewires questions

2007-07-25 Thread Luke Paireepinart
27;s at the position 1.4, he won't be able to move any closer to the wall. > > > Thank you again for looking at this. The attached bit of code has > taken a long time to create. I admire all who can program :-). Hey, I'm going to send this e-mail now, so everyone on the list (you included) will be able to read it, but I'm going to send another one in a second with comments on your code (Unless you don't want ;) > Tonu -Luke ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Sum of Scores

2007-07-26 Thread Luke Paireepinart
the program, quit it, then ran it again, in less than a second. (or possibly reloaded the module) But you can call the random functions in your code as often as you want safely. > Perhaps this is a question for the 'language lawyers'? > Not sure what this means. -

[Tutor] shelves behaving badly

2007-07-27 Thread Luke Jordan
se the shelve at the end of my code. Now, if I open the shelve in the same shell as the script ran in, right after I run it, I get the updated shelve. but any other method of opening the shelve results in the shelve missing the data from the third report. Any ideas what's

Re: [Tutor] Sum of Scores

2007-07-28 Thread Luke Paireepinart
ro, I consider the pattern to never repeat :) > > Ahhh... > Your computer ~ sitting on a pedestal in the middle of nowhere in AD > 3.0e5988, the last shrine to the ancient past-- A technological marvel to > the ape like creatures whom are all that remain of the once all powerful >

Re: [Tutor] Sum of Scores

2007-07-28 Thread Luke Paireepinart
for *nearly* an eternity, and at that point the pattern starts > repeating. > So normally, after the period is up, it would choose a new seed? or does it repeat after the period whether or not the time has changed? > I was just being nit-picky and silly. I told you it was late :-) >

Re: [Tutor] Livewires questions

2007-07-28 Thread Luke Paireepinart
Luke Paireepinart wrote: > > > I ran the code that you had included, thank you for this. It did > produce the player and the robot on the grid, but the keyboard > commands > did not work. I wasn't entire sure why, but I thought I would let > you kn

Re: [Tutor] Which GUI?

2007-07-31 Thread Luke Paireepinart
Terry Carroll wrote: > On Wed, 1 Aug 2007, Ian Witham wrote: > > >> I'm no expert (yet) but I have come across this fun online tool which helps >> you choose a GUI toolkit for Python: >> >> Choose Your GUI Toolkit >> > > I think it's rigged. I answer

Re: [Tutor] Textual Captchas: Would like to show that bots can crack a simple text captcha

2007-08-01 Thread Luke Paireepinart
to submit the values "q = 2000" and "x = 100" I would do this: http://www.example.com/captcha.html?q=2000&x=100 If this is the case, you don't even have to deal with the HTML. Just use urllib to load this web address, and save the page locally, so you can check if it says "YOU SOLVED IT" or "YOU SUCK" or whatever. > In advance, thanks for any help that you may give. > > - Kyle > -Luke ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] shelves behaving badly

2007-08-02 Thread Luke Jordan
time edits/reruns are made. thanks for the tip on checking things with os. On 8/2/07, Kent Johnson <[EMAIL PROTECTED]> wrote: > > Luke Jordan wrote: > > i've implemented a database as a shelve of record class instances. some > > of the fields in each record are dictionaries

Re: [Tutor] [OT] Re: os.path.exists(path) returns false when the path actually exists!

2007-08-03 Thread Luke Paireepinart
x27;s nearly as efficient as what WE write by hand." Then it turned out it did. Then when Python came along, some C programmers were heard saying "Ah, but it'll never run as fast as our C programs will!" But then the world came to realize that the fact remains that the computers are constantly increasing in speed of execution, and humans are not. So we've reached the level where the shift occurs from increasing computing efficiency to increasing user efficiency. And the more user-friendly the software is, the more user-efficient the resulting interaction will be. P.S. Why don't I ever see Linux-bashing on this list? -Luke ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Parsing several files

2007-08-03 Thread Luke Paireepinart
lieve that the 'for line in open(filename):' will automatically read in the file and then close the file stream, but you may want to check that it does close the file. Code untested. -Luke ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Float and decimal spaces

2007-08-03 Thread Luke Paireepinart
Toon Pieton wrote: > Hey all! > > My memory seem to have a horrible leak. How does one limit the amount > of decimal spaces for a float? I used to know that... > > Example: not 5.398042156, but 5.4 (if I decide to have only one place). Usually you do this during display, while you leave the actual

Re: [Tutor] Python Editors .. which do you reccomend for a amateur?

2007-08-04 Thread Luke Paireepinart
Tony Noyeaux wrote: > I've been using Python IDLE,.. tried DrPython,.. had a try of > ActiveState Komodo IDE, Active Python,... > > What is a good python editor to use. I've seen good and bad with all > of the above from my newcomer perspective.. wondering what other feel > is a good editor to

Re: [Tutor] Batch file copy script

2007-08-06 Thread Luke Paireepinart
hich I don't have. It is also impossible to download the 700 MB iso > images for the server / alternate CDs as I only have a dial-up > connection. To make the situation worse, these CDs could not be found in > local stores in my city. So the only option left is making the server > and alternate CDs myself. This is why I need the script. > That sucks. It was sounding kind of like a homework problem at first, but I believe you. I hope I helped, if you have any other questions please ask! -Luke ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Ingenious script (IMO)

2007-08-06 Thread Luke Paireepinart
weird orders? > Dictionaries are implemented as hash tables, not linked lists or some other data structure. see > http://en.wikipedia.org/wiki/Hash_table for more info. a dictionary's keys may coincidentally be ordered how you'd expect them to be, but it's not requ

Re: [Tutor] superscript with easydialogs

2007-08-06 Thread Luke Paireepinart
I think EasyDialogs is a Mac thing. > Ben mentioned Windows specifically in his original post. I think that's why Alan was talking about it. -Luke ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] executing file properly

2007-08-07 Thread Luke Paireepinart
Thorsten Kampe wrote: > * Vivian Tini (Tue, 7 Aug 2007 12:20:29 +0200) > >> The TestCases executable works properly when I run it from the shell prompt. >> >> Then I try to run it from the Python command prompt by the following script: >> > import os > os.system("home/.../.../.../T

Re: [Tutor] how to sort a dictionary by values

2007-08-07 Thread Luke Paireepinart
e off "reverse=True". The default is least to > greatest, which is what he wanted, I think. > It wouldn't have taken you very long to check to see what he wanted :) To save you time ;) he did want them in decreasing order. -Luke ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] dial-up from Python

2007-08-08 Thread Luke Paireepinart
Diego Lindoso wrote: > > > -- > Diego Lindoso. > Fone: 3466-2387 > Cel : 9634-5993 Beeep! Beep beep boop boop beep cs shhk shhk csh [connection timeout] -Luke ___ Tutor maillist - Tutor@python.org http://mail.

Re: [Tutor] WinPdb?

2007-08-09 Thread Luke Paireepinart
Dick Moores wrote: > (I posted this to the python-list 24 hours ago, and didn't get a > single response. How about you guys?) You mean this list? Cause if you mean this list, then you didn't post it correctly. > > The only debugging I've done so far is to put in print statements > where I want

Re: [Tutor] Losing the expressiveness ofC'sfor-statement?/RESENDwith example

2007-08-10 Thread Luke Paireepinart
> >> The most clear and efficient is probably: >> >> myList.sort() > > Alan - this was totally unnecessary and trashes the entire > (legitimate) context of my question. Perhaps his reply was too succinct, but I felt it had a good point - for the common case when one just wants to sort a list, it's much easier to use the sort() method than to reimplement a sort. I understand your original example was just a case where a situation under discussion arose, and the sorting itself was irrelevant, but Alan's comment wasn't totally unnecessary. He's right, myList.sort() is much more clear and efficient. -Luke ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] IDLE 1.2 Question

2007-08-11 Thread Luke Paireepinart
rocess. There have been many threads about this, it's usually a Windows issue. -Luke ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Security [Was: Re: Decoding]

2007-08-13 Thread Luke Paireepinart
Khamid Nurdiev wrote: > It is Good that you have the book because i have a few questions > concerning the books again. This book by M. Zelle is getting really > difficult shortly after that section (also as i see the examples are > getting fewer) but it was easy till that part, so the question i

Re: [Tutor] Security [Was: Re: Decoding]

2007-08-14 Thread Luke Paireepinart
ssh/config. > > > P.S. > Michael, sorry for the double post to you, I missed the "reply all" > button the first time. > I don't think you missed on account of me receiving two e-mails as well. :) -Luke ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Graphing the random.gauss distribution

2007-08-14 Thread Luke Paireepinart
>> This could be a list comprehension: >> d = [ [k, 0] for k in range(200) ] >> > > So you recommend using list comprehensions wherever possible? (I sure > wouldn't have thought of that one..) > No, of course not! "wherever possible" would include [foo(25) for x in range(300)] in order to

Re: [Tutor] Question re Tutor List Etiquette

2007-08-14 Thread Luke Paireepinart
for the list manager to configure the list to include a > "Reply-To" header. If this would be possible for the admins to do > with Tutor -- to include a "Reply-To: tutor@python.org" header in the > posts sent out by the

Re: [Tutor] Need help on "How to Think Like a Computer Scientist: Learning with Python".

2007-08-15 Thread Luke Paireepinart
drop of water to keep alive. I really > appreciate any assistance you can give. > I don't know if there's a site specifically for that book - check google maybe? As far as specific questions go, though, if you let us know what problem you're having we'd love to try to help

Re: [Tutor] Opening Multiple Files

2007-08-17 Thread Luke Paireepinart
ined before the start of the loop, and then add the tally of each file's words to the total tally variable. Does this make sense? Can you figure out how to do this? Not sure what your frequency problem is. Try to abstract what your code is doing to as high a level as you c

Re: [Tutor] Floating Confusion

2007-08-22 Thread Luke Paireepinart
rrational number in base-10, is it possible that it's a simple (rational) number in a higher base? I mean, I suppose a base of Pi would result in Pi being 1, but what about integer bases? Is there some kind of theory that relates to this and why there's not a higher

Re: [Tutor] Converting code to string

2007-08-23 Thread Luke Paireepinart
Bernard Lebel wrote: > Hello, > > I'm looking for a way to convert Python code into a string. > > For example, let say I have this function: > > def myFunc(): > print 'hello world' > > > Now in the same module, I'd like to take this function and convert it > into a string: > > """def myFunc():

Re: [Tutor] Spawning terminals from Python - A failed question

2007-08-25 Thread Luke Paireepinart
hat you already had a workable solution with os.system but you didn't take the time to think if your current tool set could be used to perform the task, and instead invested the time in searching for the commands module. -Luke > >>> However both os.system and the commands

Re: [Tutor] A fun puzzle

2007-08-25 Thread Luke Paireepinart
hat he should have put in a pair of 256k sticks to go with the > pair that were already there. Assuming you're meaning to talk about megabytes and not kilobytes, I'm not sure how easy it would be to get dual-channel 256 mb sticks anyway, the minimum I usually see is 512 (512x2 for 1024 total). Ah, never mind, I was wrong. Newegg has some 2x256MB sets for $30. -Luke ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Help Request: Nested While commands

2007-08-25 Thread Luke Paireepinart
ail is completely new or just a modified subject line, and consequently your e-mail was placed in the same thread as the "the and command" so your message got buried under an avalanche of unrelated discussion on my end. Thanks, -Luke ___ Tutor ma

Re: [Tutor] clearing a text document

2007-08-29 Thread Luke Paireepinart
ng and it will erase all previous contents and create the file if it doesn't already exist. -Luke ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Formatting output into columns

2007-08-30 Thread Luke Paireepinart
y do for line in open('test.txt'): depending on your Python version. I believe it's 2.3+. I have 2.4 and it works there, at least. If using an older version of Python, you can use .readlines() instead of .read().splitlines() I believe Kent and Alan already helped you with your o

Re: [Tutor] making math problems mmmm fun

2007-09-11 Thread Luke Paireepinart
is as good a time as any to start learning it. -Luke ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] editTextFile.py

2007-09-12 Thread Luke Paireepinart
ring are deprecated anyway.) We can deduce that by default string.join uses space as the separation character. But by leiu of the example "\n".join() we know we can say "somestring".join(strings_to_join) and it will join the strings with that character in between each string. " ".join(stripped_lines) would have the same effect as string.join(stripped_lines). So what do you do if you don't want any characters at all separating your strings? Simple: use an empty string: "".join(stripped_lines) As I mentioned above, there are multiple ways to approach this problem. One other thing you could do if you wanted the program to be functionally equivalent is just use writelines() instead of write() and then you don't have to join the strings. -Luke ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] [pygame] Re: Just bought Python in a Nutshell

2007-09-14 Thread Luke Paireepinart
Lamonte Harris wrote: > Wow I just got it, and its nice doesn't even look used god damn. :D. It's generally considered rude to curse in technical forums such as this. Also, please use more punctuation. You're hard to understan

Re: [Tutor] remove blank list items

2007-09-14 Thread Luke Paireepinart
t;> d={1:"a", 2:"b"} >>>> k=d.keys() >>>> type(k) >>>> > > He worded it incorrectly since there is actually a 'set' type, but what he meant was that there wouldn't be multiples of e

Re: [Tutor] Is there some sort of Python Error log.

2007-09-14 Thread Luke Paireepinart
ommand prompt to catch your errors. -Luke ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Finding all the letters in a string?

2007-09-17 Thread Luke Paireepinart
;afdlkjal32jro3kjlkj(*&&^%&^TUHKLJDHFKJHS(*&987" print ''.join([item for item in teststr if item.isalnum()]) No imports required, may be an abuse of isalnum since (I assume) this is generally intended for use on whole strings and not on single-character strings, but either way, it works. Also note isalpha() and isdigit() for checking specific items in a string. -Luke ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] IRC bot

2007-09-20 Thread Luke Paireepinart
end stuff to the server in the same structure (using an online reference to find the commands and their corresponding arguments.) If you don't feel like following this approach, I can just give you some code that listens to the IRC server and echoes everything. But that somehow seems le

Re: [Tutor] OO triangulation

2007-09-20 Thread Luke Paireepinart
\ / \ > / > Td1 = d1.NextPoint(C) ## Td1Td1 > As you can see, your code is not very readable. Please post large sections of code as attachments in the future. This is probably the main reason you've gotten no replies. -Luke ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] uncomprehension on RE

2007-09-20 Thread Luke Paireepinart
munge addresses and things were sent to the list by default> > The "reply-to-all" or "reply-list" or "reply-group" functions should do what you want. We'll not get into the semantics of why the list doesn't munge. It's an unproductive discussion that the admins don't like. -Luke ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] IRC bot

2007-09-20 Thread Luke Paireepinart
7;d give more help, but I'm in extremely busy right now. Freenode doesn't let you send private messages if you don't identify yourself, but it's simple to create a password. Just do a /msg NickServ register password SO make sure you register your bot prior to using this, or you

Re: [Tutor] OO triangulation

2007-09-20 Thread Luke Paireepinart
ted to ease of testing and how much I understand about the topic already, so I'm more likely to help people who 1) post well-formatted code I can run directly, 2) post something I know a decent bit about, or both. -Luke > The code > works fine, and although I don't understand

<    1   2   3   4   5   6   7   8   9   >