Re: [Tutor] PDF and Python

2004-12-10 Thread nick
DF's a doddle. Thanks for the link Kent :) Nick . ___ Tutor maillist - [EMAIL PROTECTED] http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Tutor Digest, Vol 78, Issue 97

2010-08-21 Thread Nick
From: tutor-bounces+nblack3=student.gsu@python.org [tutor-bounces+nblack3=student.gsu@python.org] on behalf of tutor-requ...@python.org [tutor-requ...@python.org] Sent: Saturday, August 21, 2010 1:25 PM To: tutor@python.org Subject: Tutor Digest,

Re: [Tutor] Tutor Digest, Vol 78, Issue 99 -- Prime numbers

2010-08-21 Thread Nick
"Perhaps you should try something a little bit less ambitious. Write a program to test whether a number is divisible by 3. Then write a program to test whether a number is divisible by 3 or 5. Then write a third program to test whether a number is divisible by 3, 5 or 7. Then generalise that third

Re: [Tutor] Tutor Digest, Vol 78, Issue 100 -- Prime numbers using square root of n

2010-08-21 Thread Nick
"We're still doing too much work. Why go all the way up to n? We know that (say) 93 can't possibly divide into 99, or 57 into 59. The largest number we need to check is the square root of n. The reason is a little subtle, so think about it, don't just take my word. Hint: write down the factors of,

Re: [Tutor] Writing a prime number program using upper bound of square root of n

2010-08-22 Thread Nick
"1 * 120 = 120 2 * 60 = 120 3 * 40 = 120 4 * 30 = 120 5 * 24 = 120 6 * 20 = 120 8 * 15 = 120 10 * 12 = 120 10.9545 * 10.9545 = 120 12 * 10 = 120 <=== already seen this one! > Also I can write a program that > tests whether the number is a factor of 2, 3, 5, 7, but I think > you're trying to poin

[Tutor] project euler prime factorization problem

2010-08-29 Thread Nick
The prime factors of 13195 are 5, 7, 13 and 29. What is the largest prime factor of the number 600851475143 ? #don't forget 2,3,5,7. this function doesn't deliver those as output. def is_prime(b): #checks a number greater than 7 to see if it is prime and returns if is. if b % 2 != 0 and b

Re: [Tutor] project euler prime factorization problem

2010-08-29 Thread Nick
"Did you test the program? That is one way to tell whether it works perfectly. What you showed above will do one visible thing - it will print "Don't forget to consider primes 2, 3, 5, and 7\n". The rest is a somewhat confusing collection of function definitions and comments. You never call the

[Tutor] Scribbler Robot

2010-09-16 Thread Nick
http://www.georgiarobotics.com/roboteducation/robot-kit.html you can check the robot out at this link. is this a good buy you guys think, or is there a better python compatible robot out there? I just want something to keep me interested in programming and that gives me ideas of programs to

[Tutor] Is pydoc the right API docs?

2009-11-24 Thread Nick
I'm not sure I'm using pydoc correctly. I only seem to get abbreviated help rather than full documentation. It happens often enough that I think I'm doing something wrong. For example, I want to upgrade my scripts to use .format() from using %. $ pydoc format Help on built-in function f

Re: [Tutor] the art of testing

2009-11-24 Thread Nick
As well as the other replies, consider that you are doing "unit" testing: http://en.wikipedia.org/wiki/Unit_test One method is black-box testing, which is where the thing (class, function, module) you are testing is treated as a black box, something that takes input and returns output, and how i

Re: [Tutor] hi

2005-01-11 Thread nick
Quoting "Gopinath V, ASDC Chennai" <[EMAIL PROTECTED]>: > Hi > Can any1 please tell me how do i open an editor in python running in > linux os > Hi Gopinath, try os.system, ie import os os.system('/usr/bin/xterm &') Regards Nick . ___

Re: [Tutor] [Python-ideas] "value" ~ "data" ~ "object"

2010-04-15 Thread Nick Coghlan
ngs in Python which aren't first class objects, since they reflect lookup entries in some namespace or container, such as the mapping from names to pointers in a class or module __dict__ or a function's locals, or the items stored in a list or set. Cheers, Nick. -- Nick Coghlan

Re: [Tutor] newbie to gui programming

2010-07-06 Thread Nick Raptis
k it might be a good choice for a new python programmer, exactly for the above reasons. I think it might be worth the hurdles and pay off in the end. Nick On 07/06/2010 09:48 PM, Alan Gauld wrote: There are many toolkits but these have as many similarities as differences. But none of them w

Re: [Tutor] newbie to gui programming

2010-07-07 Thread Nick Raptis
u so much for the answers, you're such a helpful bunch. Nick On 07/07/2010 10:16 AM, Alan Gauld wrote: "Nick Raptis" wrote Really good news is that on this very list on another thread, someone suggested Dabo http://dabodev.com/ It's a python library on top of wxPython and it&

Re: [Tutor] differences between mmap and StringIO

2010-07-07 Thread Nick Raptis
a StringIO instance, copy your file to it, close the file, do whatever you want in memory, open your file again for writing, copy the StringIO to it, close both. I'd consider that overkill for most projects Is there something in particular you want to do? Nick On 07/08/2010 01:52 AM, Eduard

Re: [Tutor] newbie to gui programming

2010-07-08 Thread Nick Raptis
is that after trying wxPython with a book a bit I decided that GUI programming was not my thing at all, and started writing games with pygame. Many similar concepts, twice the fun. Now I'm doing web work. Give it time, trust your gut and don't panic, you'll end up right where you wa

Re: [Tutor] Django Read

2010-07-08 Thread Nick Raptis
www.amazon.com/Definitive-Guide-Django-Development-Second/dp/143021936X/ The printed one is a bit more updated (1.1) and pays off it's money because of it's great reference section :) Nick On 07/08/2010 03:48 PM, Dipo Elegbede wrote: Hi all, I have done a little basic on python a

Re: [Tutor] Having a return when subprocess.Popen finishes

2010-07-08 Thread Nick Raptis
rward: use the shortcut output = subprocess.check_output("your command here") Always check latest documentation for your python version too http://docs.python.org/library/subprocess.html Nick On 07/08/2010 04:04 PM, Paul VanGundy wrote: Hi All, I'm trying to get data from sub

Re: [Tutor] Function returns 'None'

2010-07-11 Thread Nick Raptis
ver And this returns x: 3 carryover: 1 x: 2 carryover: 3 x: 1 carryover: 6 6 Done! What you should learn from this is that, when doing recursion, figuring out what your function should do on the way up is as crucial as what you want it to do on the way down. Nick __

Re: [Tutor] Function returns 'None'

2010-07-11 Thread Nick Raptis
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 carryover = recursfac(x-1, carryover) return carryover And this returns x: 3 carryover: 1 x: 2 carryover

Re: [Tutor] Function returns 'None'

2010-07-11 Thread Nick Raptis
On 07/11/2010 06:50 PM, Luke Paireepinart wrote: I think the new version is harder to understand. Sent from my iPhone On Jul 11, 2010, at 10:43 AM, Nick Raptis wrote: Aww! A critic! You humble me (really, I'm not being sarcastic here, I welcome it gladly) I won't argue about

Re: [Tutor] Python Documentation Clarification

2010-07-12 Thread Nick Raptis
g/reference/introduction.html?highlight=brackets#notation Nick ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

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

2010-07-14 Thread Nick Raptis
ses too) For example, print "\n".join(first_run) will get you started. I think the end code you're looking for is something like output = ["\n".join(run) for run in sorted_list] print "\n".join(output) but I'm not sure if you've got the ha

Re: [Tutor] nested list help

2010-07-27 Thread Nick Raptis
ript is very basic and it doesn't tend to a lot of things you'd might want, like eliminating double values or sorting, but it should start you on your path. Nick ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] need help with msvcrt.getch()

2010-07-27 Thread Nick Raptis
that /getch() gets and debug from there Nick ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Calculating and returning possible combinations of elements from a given set

2010-07-27 Thread Nick Raptis
nk Thank you very much in advance! Take a look in the itertools module http://docs.python.org/library/itertools.html Check the section "*Combinatoric generators:" (website doesn't have an anchor link for that, search around a bit) Nick * ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] problem with simple script

2010-07-28 Thread Nick Raptis
but it isn't not for me. Advice, please. Thanks, Dick Moores Split the input before the if. Fork based on the length of the resulting list. :) Nick ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] String replace question

2010-07-28 Thread Nick Raptis
ere, it just get's represented as two. In fact, you should have escaped \. your self writing the line as such: uri.replace('.', '\\.') but since \. is not a special character, python is smart enough to not mind Nick ___ Tu

Re: [Tutor] input problem

2010-08-22 Thread Nick Raptis
chine with as editor SPE. Roelof You are using Python 2.x, so you should use raw_input() instead of input(). Note that in Python 3.x, raw_input() has been renamed to just input(), with the old 2.x input() gone. Nick ___ Tutor maillist - Tutor@pytho

Re: [Tutor] input problem

2010-08-22 Thread Nick Raptis
ion as an exercise, there is a build in method of string that accomplishes the same effect. Try x=fruit.count(letter) - Give a bit of thought about what would happen if someone enters a whole string instead of a character for letter. How should your program accommodate that? Nick

Re: [Tutor] input problem

2010-08-22 Thread Nick Raptis
As I understand you never get the prompts, right? Nick ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] How to print the installed web browser

2010-09-01 Thread Nick Raptis
; Ranjith, get ready for some configuration file parsing. But if you just want to open a url with the default browser, you can just execute "xdg-open your-url" as a subprocess. Hope I shifted you to the right direction. Nick PS-trivia: I got to guess these just

Re: [Tutor] How to print the installed web browser

2010-09-01 Thread Nick Raptis
On 09/01/2010 11:46 AM, Nick Raptis wrote: Alan, let me make a wild guess here. Ubuntu does have little "Preferred applications" config tool. I don't know how or where it stores this data, but my guess is it's the same place xdg (as in xdg-open) gets it's configu

[Tutor] returning the entire line when regex matches

2009-05-03 Thread Nick Burgess
How do I make this code print lines NOT containing the string 'Domains'? import re for line in log: if re.search (r'Domains:', line): print line This does not work... if re.search != (r'Domains:', line): ___ Tutor maillist - Tutor@pytho

Re: [Tutor] returning the entire line when regex matches

2009-05-04 Thread Nick Burgess
the files into one big one before the parse would work but I would need help with that too. the tutelage is much appreciated -nick On Sun, May 3, 2009 at 6:21 PM, Alan Gauld wrote: > > "Alan Gauld" wrote > >>> How do I make this code print lines NOT containing

Re: [Tutor] returning the entire line when regex matches

2009-05-04 Thread Nick Burgess
Compiling the regular expression works great, I cant find the tutorial Mr. Gauld is referring to!! I searched python.org and alan-g.me.uk. Does anyone have a link? On Mon, May 4, 2009 at 1:46 PM, Martin Walsh wrote: > Nick Burgess wrote: >> So far the script works fine, it avoids pri

Re: [Tutor] returning the entire line when regex matches

2009-05-05 Thread Nick Burgess
for root, dirs, files in os.walk('./'): for f in files: if f.endswith('.txt'): allfiles.append(os.path.join(root, f)) This returns a list of the *.txt files. Of course now I am stuck on how to apply the delimiter and search function to the items in the list..? Any clues/ex

Re: [Tutor] returning the entire line when regex matches

2009-05-05 Thread Nick Burgess
forgot to add this at the top, allfiles = [] On Tue, May 5, 2009 at 6:15 PM, Nick Burgess wrote: > for root, dirs, files in os.walk('./'): >    for f in files: >        if f.endswith('.txt'): >            allfiles.append(os.path.join(root, f)) > > This

[Tutor] converting xls to csv

2009-05-30 Thread Nick Burgess
Hi list, I am trying to make this code work. I don't have any experience with defining things and this is my second program. The error returmed is "SyntaxError: invalid syntax" code: #!/usr/bin/python import cvs def convertXLS2CSV(aFile): '''converts a MS Excel file to csv w/ the same n

Re: [Tutor] converting xls to csv

2009-05-31 Thread Nick Burgess
9 it returns all of the rows, so I now its reading OK.. Thanks for your time, -nick On Sun, May 31, 2009 at 3:57 AM, Alan Gauld wrote: > > "Nick Burgess" wrote >> >> I am trying to make this code work.  I don't have any experience with >> defining things

Re: [Tutor] converting xls to csv

2009-05-31 Thread Nick Burgess
Got it. the row is not a string or buffer but the cell is.. for row in spamReader: for cell in row: if pattern.search(cell): print ', '.join(row) On Sun, May 31, 2009 at 5:09 AM, Nick Burgess wrote: > Thank you for your response and my apologies for t

Re: [Tutor] converting xls to csv

2009-06-06 Thread Nick Burgess
TypeError: coercing to Unicode: need string or buffer, list found On Sun, May 31, 2009 at 12:45 PM, Richard Lovely wrote: > 2009/5/31 Nick Burgess : >> Got it. >> >> the row is not a string or buffer but the cell is.. >> >> for row in spamReader: >>    for ce

Re: [Tutor] converting xls to csv

2009-06-06 Thread Nick Burgess
or cell in row: if pattern.search(cell): print ', '.join(row) XLS.xls.org1.csv XLS.xls.org2.csv XLS.xls.org3.csv On Sat, Jun 6, 2009 at 3:33 PM, Emile van Sebille wrote: > On 6/6/2009 12:19 PM Nick Burgess said... >> >> Thank you. The data is

Re: [Tutor] converting xls to csv

2009-06-06 Thread Nick Burgess
Thanks everyone, the following code works great. It returns the name of the file and the row that matched the reqex. Is it posible to take the regex compile from user input? To make it take an argument, like > csvSearch.py 10.192.55 af = re.compile(sys.argv[1]) pattern = re.compile(af)

[Tutor] searching for an ip and subnets in a dir of csv's

2009-07-28 Thread Nick Burgess
Good evening List, I am trying to have this script search for an IP or nearest subnet match in a dir of csv's. It works with an absolute match, It will be receiving a whole IP address, so if there is no absolute match no data is returned, however if it is listed somewhere in a subnet I want to kn

Re: [Tutor] searching for an ip and subnets in a dir of csv's

2009-07-29 Thread Nick Burgess
join(row) On Wed, Jul 29, 2009 at 8:13 AM, Wayne wrote: > On Tue, Jul 28, 2009 at 9:36 PM, Nick Burgess > wrote: >> >> Good evening List, >> >> I am trying to have this script search for an IP or nearest subnet >> match in a dir of csv's. It works

Re: [Tutor] clear screen inside python interpreter

2009-08-06 Thread Nick Raptis
m("clear") I resently made a 'game of life' clone and used the first method to clear the screen. It's good enough for many things! Nick Monte Milanuk wrote: Okay, simple question: is there anything similar to to 'clear' or 'cls' to clean up a

Re: [Tutor] droplet like behaviour in Python

2009-08-11 Thread Nick Raptis
tell. (Also put your usual #!/usr/bin/env python in there to work for you) Nick ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] droplet like behaviour in Python

2009-08-11 Thread Nick Raptis
nstallation specific rather than python/script specific. That turns the question it to a whole new direction for me. Nick Nick Raptis wrote: pedro wrote: #!/usr/bin/env python # encoding: utf-8 import sys theFilePath = sys.argv[1] print theFilePath But when I try to drop something on

Re: [Tutor] To write data in two different fonts?

2009-08-12 Thread Nick Raptis
ript you can then code different fonts or sizes according to any logic you want. Won't go into explaining HTML though (hint: use the class HTML attribute) If it sounds more complex than you'd like, it's ok. It's more powerful and more rewarding too. Once you get the basic structu

Re: [Tutor] To write data in two different fonts?

2009-08-12 Thread Nick Raptis
Dave Angel wrote: As I said, you'd probably get in trouble if any of the lines had '&' or '<' characters in them. The following function from the standard library can be used to escape the line directly, or of course you could use the function Nick supplied.

Re: [Tutor] To write data in two different fonts?

2009-08-13 Thread Nick Raptis
ng sorted messing things up. Thanks for the insight. Nick ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] Which version to start with?

2009-10-05 Thread Nick Hird
What is the best version of python to start out with? I see some discussions on the net about not going to 3.1 but staying with the 2.x releases. But then i see that 3.1 is better if your just starting. Thanks for any insight on which version to go with. -Nick

Re: [Tutor] Which version to start with?

2009-10-05 Thread Nick Hird
Thanks all! I think i will install the newly released 2.6.3 and go from there. Its a little intimidating but i guess i gotta jump right in and get my feet wet. Thanks again! -Nick On Mon, Oct 5, 2009 at 5:59 PM, wesley chun wrote: > On Mon, Oct 5, 2009 at 2:24 PM, Nick Hird wrote: >>

[Tutor] Not storing the PATH in ZipFile?

2009-10-14 Thread Nick Hird
store the path in the zip file? When i decompress the files, i would like them to not be associated with a particular folder or path, just the files. I looked through the docs but didn't see anything to disable the path. Thanks, -Nick ___ Tutor mai

Re: [Tutor] Not storing the PATH in ZipFile?

2009-10-14 Thread Nick Hird
That was it. Thanks so much! I was looking at the docs and didn't think that applied to the path that was stored. Thanks Again! -Nick On Wed, Oct 14, 2009 at 12:16 PM, Kent Johnson wrote: > On Wed, Oct 14, 2009 at 11:38 AM, Nick Hird wrote: >> I was reading another thread and deci

[Tutor] Can python determine Battery or AC Power?

2009-10-28 Thread Nick Hird
. Thanks! -Nick ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Can python determine Battery or AC Power?

2009-10-28 Thread Nick Hird
es though.  So what O.S. are you > on? > > On Wed, Oct 28, 2009 at 4:15 PM, Nick Hird wrote: >> >> Is there a way in python to tell if the power source for a laptop is >> ac or battery? I am trying to write a small script to print out my >> system stats and would

Re: [Tutor] Introduction - log exercise

2009-11-17 Thread Nick Stinemates
> I will read lines from file, with the 'for loop', and then I will check them > for > 'foo' matches with a 'while loop', if matches I (somehow) re-initialise the > list, and if there is no matches for foo, I will append line to the list. > When I > get to a blank line (end of block), write myLis

[Tutor] walking directories

2005-01-07 Thread Nick Lunt
me a pointer in the right direction I would be very grateful. Many thanks Nick . ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

RE: [Tutor] walking directories

2005-01-08 Thread Nick Lunt
hankyou Ryan and Jacob, I obviously did not read the docs for os.walk correctly, many thanks. >>Alan G. >>personally I'd use find and sed in Linux, right tool >>for the job etc.. Yes I could use *nix tools for the job, but I want to do it in python to see if I can :) Thanks ag

FW: [Tutor] walking directories

2005-01-09 Thread Nick Lunt
Hello, I sent this reply a few days ago, but it doesn't seem to have appeared on the list, so Im resending it. Many thanks Nick . -Original Message- From: Nick Lunt [mailto:[EMAIL PROTECTED] Sent: 08 January 2005 19:44 To: 'python tutor' Subject: RE: [Tutor] walk

Re: [Tutor] 3 questions for my port scanner project

2005-02-26 Thread Nick Lunt
Nr 3. If your using python sockets try socket.settimeout(x) Nick . On Sat, 2005-02-26 at 15:12 +0200, Mark Kels wrote: > Hi list. > > Here are the questions (-: > 1. How do I make a progress bar in Tkinter ? > 2. I got a while loop which does the port scan itself. How can I end

Re: [Tutor] sys.argv[1: ] help

2005-02-27 Thread Nick Lunt
Richard, if you try to print sys.argv[1:] when sys.argv only contain sys.argv[0] then you are bound to get an empty list returned, [] . Im not sure I understand the problem you think you've got but here's what happens with sys.argv for me, and it's correct. [argl.py] $ cat argl.py #!/usr/bin/py

[Tutor] reading from stdin

2005-03-01 Thread Nick Lunt
pipe in the correct way ? The way Im doing it works (so far) but should I be doing it another way ? Many thanks Nick . ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] reading from stdin

2005-03-01 Thread Nick Lunt
nce. > For stdin this make sense, you have no idea how much data will be > piped in. Thanks Sean, I agree with you on both accounts there. Cheers Nick . ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] reading from stdin

2005-03-01 Thread Nick Lunt
s soon as the first line is available. You should be > reading sys.stdin as an iterator (same thing you'd do for a file): > > import sys > for line in sys.stdin: > # do stuff with that line of input Aha, that makes sense. Thanks very much. Nick . ___

Re: [Tutor] reading from stdin

2005-03-01 Thread Nick Lunt
xreadlines() these days just does 'return self', I believe. File objects are > their own iterators; you can just do: > > for line in sys.stdin: > # do stuff > Same as Max Noel said, must be a good idea ;) Thankyou Nick . ___

Re: [Tutor] reading from stdin

2005-03-02 Thread Nick Lunt
Thanks to everyone who helped me with this. It's certainly given me something to think about :) Cheers Nick . On Tue, 2005-03-01 at 23:13 -0600, David Rock wrote: > * Nick Lunt <[EMAIL PROTECTED]> [2005-03-01 22:23]: > > On Tue, 2005-03-01 at 14:14 -08

Re: [Tutor] reading from stdin

2005-03-02 Thread Nick Lunt
Hi Hugo, many thanks for pointing that out. It all helps :) Thanks again, Nick . On Tue, 2005-03-01 at 17:35 -0600, Hugo GonzÃlez Monteverde wrote: > Everypne else has answered pretty muh about this. I just want to add > that if you want to read noncanonically (less thana line ending

Re: [Tutor] [HELP]how to test properties of a file

2005-04-04 Thread Nick Lunt
I've gotten into the habit of just using the os.?_OK stuff. eg >>> import os >>> os.access('/', os.W_OK) False >>> os.access('/tmp', os.W_OK) True Thats gotta be simple if I understand it lol :) Nick . Alan Gauld wrote: The simplest, IMHO, is : t

Re: [Tutor] [HELP]how to test properties of a file

2005-04-05 Thread Nick Lunt
v file open in Excel or some other app ? Or is is password protected maybe ? Sorry not much help. Nick . ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] clock.py

2005-05-23 Thread Nick Lunt
" >print "Just right" >___ >Tutor maillist - Tutor@python.org >http://mail.python.org/mailman/listinfo/tutor > > > Hi Feziwe, you might want to look at the random module to generate 'guess' ramdon.randrange(

Re: [Tutor] Are Empty "Placeholder" Functions possible?

2005-05-26 Thread Nick Lunt
Hi John, you can use 'pass' . This works the same as with exceptions, eg try: open('somefile') except IOError: pass so we can have class doNothing: def __init__(self): pass def boring(self, other): pass Hop

Re: [Tutor] screen scraping web-based email (Alan Gauld)

2007-04-19 Thread Switanek, Nick
Alan, Please let us know when you have a draft of your tutorial on Beautiful Soup and such. I'd be eager to have a look! Thanks, Nick ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] python internet archive API?

2007-04-25 Thread Switanek, Nick
ave any suggestions for a way to go about this pythonically? Many thanks, Nick ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] sys.path, managing modules and packages

2007-04-25 Thread Switanek, Nick
my scripts or at the command line. Thanks, Nick ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] number guessing game

2007-05-08 Thread Treloar, Nick
here is my code so far from Tkinter import* root = Tk() root.title("main screen") root.maxsize(width=350,height=200) root.minsize(width=350,height=200) root.resizable(width=YES,height=YES) def child1(): c1 = Toplevel(root) c1.guess_ent = Entry(c1, width = 35,) c1.guess_ent.grid(row = 1

[Tutor] random number guessing game

2007-05-08 Thread Treloar, Nick
i am tying to buil a program using child screens the program is going the make a random number and the user has to guess it . so far i have made the gui but how do i progame it to make the random number This message is intended for the addressee named and may contain privileged information or

[Tutor] were do i put the random number genorator

2007-05-10 Thread Treloar, Nick
sy") c1.geometry("200x200") Button(c1,text="clear", command = NIck).grid(row=1,column=0) Button(c1,text="new game",).grid(row=1,column=1) def NIck(): child1.box_txt.delete(0.0, END) def child2(): c2 = Toplevel(root) box_

[Tutor] (no subject)

2007-05-29 Thread Treloar, Nick
how do you import sounds This message is intended for the addressee named and may contain privileged information or confidential information or both. If you are not the intended recipient please delete it and notify the sender. ___ Tutor maillist -

Re: [Tutor] PyCrust IDE/Shell

2007-06-01 Thread Switanek, Nick
Hi Alan, Your excitement for the PyCrust IDE made me want to check it out, but after downloading wxPython and the "Docs and Demos" at http://www.wxpython.org/download.php#prerequisites I've not been able to find an IDE to launch. Can you explain what I need to do

Re: [Tutor] PyCrust IDE/Shell

2007-06-01 Thread Switanek, Nick
y and CreateMacScripts.py, which creates the MS-DOS batch files from the extension-less files), so how should I run pycrust? Thanks in advance for any further help you can provide. Nick -Original Message- From: Hiếu Hoàng [mailto:[EMAIL PROTECTED] Sent: Friday, June 01, 2007 3:42

Re: [Tutor] PyCrust IDE/Shell

2007-06-01 Thread Switanek, Nick
Hi Alan, Thanks for the path. I find a .py, .pyc, and an icon file name PyCrust, but no .pyw. Any ideas? Thanks, Nick ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] PyCrust IDE/Shell

2007-06-01 Thread Switanek, Nick
of python installed, so maybe there is some confusion there? If so, I'd be grateful for help understanding what I need to do to resolve it. Thanks, Nick From: Grant Hagstrom [mailto:[EMAIL PROTECTED] Sent: Friday, June 01, 2007 4:33 PM To: Switanek,

[Tutor] (no subject)

2007-06-22 Thread Nick Treloar
im not sure why this progrm isnt running properly one of the button wont open and it teel me a computer_guess is not defined here is my code #NiCk TrEloaR PrOgRaMiNg Co. #scissors paper rock #10/6/07 from Tkinter import* from random import choice class Application(Frame): def __init__

[Tutor] lan with python

2008-02-10 Thread Treloar, Nick
hey i was just wondering if any one could tell me if they know if you can make multi player games through lan with python heres the code i want to lan. just hash out the sound files #NiCk TrEloaR PrOgRaMiNg Co. #scissors paper rock #10/6/07 from Tkinter import* import pygame from random

[Tutor] Should I be thinking of threads for this ?

2005-08-25 Thread Nick Lunt
ould cause performance problems relating to the OS. So I'm thinking I will need to learn python threads (no bad thing) instead, but Im hoping that someone could tell me if that seems the best way to go ? I will be getting to grips with python threads a

Re: [Tutor] Should I be thinking of threads for this ?

2005-08-27 Thread Nick Lunt
at's one way I was thinking of doing it. I'll run it like that on about 10 active files and see how it stacks up. > twisted.protocols.basic.FileSender and > twisted.internet.stdio.StandardIO look like they may be starting points. Thanks for the twisted

Re: [Tutor] Tail -f problem

2005-08-31 Thread Nick Lunt
ill only work if your current mysql install is an RPM. Cheers Nick . ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] how to create GUI for Python progs

2005-10-13 Thread Nick Lunt
list. I would recommend that you go here http://pythoncard.sourceforge.net/index.html to get PythonCard and then go here http://pythoncard.sourceforge.net/walkthrough1.html to read the docs. It will take all of 10 minutes to be able to create a decent GUI. Hth, Nick . ___

Re: [Tutor] how to alter list content

2005-10-13 Thread Nick Lunt
t is this type of list: > ['DSC1', 'DSC2', 'DSC3'] > i.e. the names w/o the file extension. > > what's the easiest way of doing this? > > marc You need the split() method. ie >> l = ['DSC1.JPG', 'DSC000

Re: [Tutor] Python 2.4.1 on Mndrk Linux 10.1 - path

2005-10-14 Thread Nick Lunt
dir/python'. What I must stress is that you do not overwrite your default python installation, leave it as it is, otherwise many of mandrakes GUI tools will no work. I hope that helps, feel free to ask more questions about this as I have had to overcome the same issue on RHEL serveral t

Re: [Tutor] Python 2.4.1 on Mndrk Linux 10.1 - path

2005-10-15 Thread Nick Lunt
Hi Andy, Andy Dani wrote: >Thanks Nick, > >Any idea about the second question? When I python from >/usr/loca/Python-2.4.1/bin, it does launch the interpreter but with an >traceback error saying there is some conflict with "import readline" line on >pythonrc.py fi

[Tutor] new user question about while loops

2005-10-25 Thread Nick Eberle
Sorry for potential double post, error with first send -- Hello all,   I had a new question about python. I am pretty much in tutorial learning stages, but attempting to create sample programs not in my book to learn how to cons

Re: [Tutor] new user question about while loops

2005-10-25 Thread Nick Eberle
< 100:    flip -= 1    random.randrange(2)    if flip < 100:    break   print "\nThe amount of times tails came up was" , tails , "The amount of times heads came up was" , heads   raw_input() From: bob [mailto:[EMAIL PROTECTED]Sent: Tue 10/25/2005 10:58 PMTo: Nick Eberle;

Re: [Tutor] new user question about while loops

2005-10-26 Thread Nick Eberle
Ahh makes much more sense, thanks for all the help! I'll go back and rework it, keeping in mind trying to solve each piece separately. Thanks again all. -Original Message- From: Alan Gauld [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 26, 2005 1:53 AM To: Nick Eberle; bob;

[Tutor] Global var problem

2005-10-28 Thread Nick Lunt
I get the same error even after declaring x to be global. No doubt the answer is staring me in the face ... but I still can't see it. Cheers Nick . ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Global var problem

2005-10-29 Thread Nick Lunt
info. > > Meanwhile lets simplify by removing the class bit > > > def h(): > global x > x += 1 > print x > > h() # prints 43 Many thanks to Alan, Andrei, Hugo and Welsey for helping me to understand where I was going wrong. I though

Re: [Tutor] new topic draft

2005-11-14 Thread Nick Lunt
at Alan. I always seem to get myself into difficulty with the os.walk routine, but you explained it brilliantly there. Have to admit, I couldn't be bothered to read the "So What is the Operating System" bit tho cos as you say on the page, we don't

  1   2   >