Re: [Tutor] First steps for C++/Qt developers

2010-05-14 Thread steve
nowing how CGI works helps immensely. For a high level overview of web programming using python, see: http://docs.python.org/howto/webservers.html hth, cheers, - steve -- random spiel: http://lonetwin.net/ what i'm stumbling into: http://lonetwin.

Re: [Tutor] First steps for C++/Qt developers

2010-05-15 Thread steve
said ... Like languages or GUI toolkits, once you learn one moving to another is relatively painfree. Provided it does what you need and has a good support network don't stress over it! +1 hth, cheers, - steve -- random spiel: http://lonetwin.net/ what i'm stumbling into: http://lonetwi

[Tutor] Question about packaging with distutils (specifying metadata)

2010-05-17 Thread steve
is it considered good 'style' to import the module one is packaging, in the setup.py to access these variables ? cheers, - steve (*) can't find a reference for doing this in the docs, but I think doing this is a pretty strong convention -- I've seen in most (all?) standard

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

2010-07-23 Thread steve
On 07/23/2010 08:01 AM, Robert wrote: looks like this guy figured out how to send email in a loop User-Agent: Mutt/1.5.20 (2009-06-14) Or just discovered Mutt but hasn't figured out the keybindings yet. -- random spiel: http://lonetwin.net/ what i'm stumbling into: http://lonetwin.stumbleupo

Re: [Tutor] ImportError: cannot import name log

2009-09-17 Thread steve
ation would be the same as for any other import errors. Check your PYTHONPATH and paste the entire traceback if it still does not work. cheers, - steve -- random non tech spiel: http://lonetwin.blogspot.com/ tech randomness: http://lonehacks.blogspot.com/ w

[Tutor] An editable buffer for the Python shell (similar to '\e' on sql prompts)

2005-08-05 Thread Steve
m/ASPN/Cookbook/Python/Recipe/438813 Just thought some one else also would find this useful. Regards Steve ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] hello.py: line 1: print: command not found

2008-08-11 Thread steve
Hi In order to execute python script by fedora terminal ; insert #! /bin/env python as the first line in the script. Python scripts end with a file extension of .py, as indicated above. It is also possible in Unix to automatically launch the Python interpreter without explicitly invoking it by

Re: [Tutor] Confirmation about __init__()

2010-01-16 Thread Steve Willoughby
Robert wrote: > I have read quite a bit in the past 2 months, ( I have also looked at codes) > At this point, I think I understand well what __init__() is and does - > But, I have yet to see this *specifically* spelled out about the the > __init__ method for a Class; > > It is OPTIONAL, correct ?

Re: [Tutor] adding more text to a file

2010-01-17 Thread Steve Willoughby
Magnus Kriel wrote: > It might be that when you create a file for the first time with 'a', > that it will through an exception. So you will have to try with 'w', and > if there is an exception, you know the file does not exist and you will > have to create the file for the first time with 'w'. Tha

Re: [Tutor] smtp project

2010-01-17 Thread Steve Willoughby
Kent Johnson wrote: > On Sun, Jan 17, 2010 at 3:45 PM, Kirk Z Bailey > wrote: >> I am writing a script that will send an email message. This will run in a >> windows XP box. The box does not have a smtp server, so the script must >> crete not merely a smtp client to talk to a MTA, it must BE one

Re: [Tutor] why inline-only string literals?

2010-02-07 Thread Steve Willoughby
g, leading to confusion and possibly misleading error messages. So by making you explicitly state when you wanted multi-line strings, it makes it easier to spot this common mistake as well as making your intent more clear when just looking at the code. -- Steve Willoughby| Using b

tutor@python.org

2010-02-13 Thread Steve Willoughby
100 # 1.2.3.4 >>8= 000100100011 # 0.1.2.3 0xff= & ---- 0011 # 3 -- Steve Willoughby| Using billion-dollar satellites st...@alchemy.com | to hunt for

tutor@python.org

2010-02-14 Thread Steve Willoughby
ntain- ing your code easier in the future if it's very clear what you intended the code to accomplish, and how. -- Steve Willoughby| Using billion-dollar satellites st...@alchemy.com | to hunt for Tupperware. ___ Tutor maillist - Tutor@pyt

Re: [Tutor] What Editori?

2010-02-23 Thread Steve Willoughby
you think it's a good editor? Do you know other names? Whether any particular editor is "good" as long as it does the minimum amount necessary for programming, is entirely subjective. Try a few and see how they work for you. Actually, I suppose even ed and TECO qualify for some w

Re: [Tutor] What Editori?

2010-02-23 Thread Steve Willoughby
On Tue, Feb 23, 2010 at 06:13:51PM +0100, spir wrote: > I use geany which is imo good for every language... and has the absolutely > necessary duplicate feature ;-) (*). Most have a variety of features which could be called by that name. What specifically are you referring to here? --

Re: [Tutor] OOD - Another class question

2010-02-28 Thread Steve Willoughby
On Sun, Feb 28, 2010 at 06:24:09PM -0500, James Reynolds wrote: > I have another question related to OOD. What I have is a module with one > parent class and two child classes. Some stuff is done to the object that is > passed to the function in one of the child classes and this then calls a > func

Re: [Tutor] Why is the max size so low in this mail list?

2010-03-01 Thread Steve Willoughby
ist, or (and you know it'll happen) 1600x1200 screenshots of error messages. -- Steve Willoughby| Using billion-dollar satellites st...@alchemy.com | to hunt for Tupperware. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Printing time without "if" statement

2010-03-07 Thread Steve Willoughby
dule periodic time output too. -- Steve Willoughby| Using billion-dollar satellites st...@alchemy.com | to hunt for Tupperware. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Changing the value in a list

2010-03-11 Thread Steve Willoughby
e created you can't change them, although you can construct new strings from them, so if you wanted to make a string which had characters 9 and 10 replaced with "08" you could say: line = line[:9]+"08"+line[11:] -- Steve Willoughby

Re: [Tutor] Raw string

2010-04-18 Thread Steve Willoughby
only impossible, but wouldn't really even make sense to do. > >Is there a function with same effect as raw string marker, as my > >problem must be solved differently? If you mean to take a string which contained the same characters as Python recognizes as escape sequences, like &qu

Re: [Tutor] Which Designer

2010-04-25 Thread Steve Willoughby
a lot more polished. There are other toolkits with their advocates as well, of course, but if someone were just starting out with Python GUI programming, I'd recommend looking around at your options before starting with Tk. -- Steve Willoughby| Using billion-dollar

Re: [Tutor] Programming pic chips with python

2010-04-26 Thread Steve Willoughby
y program "closer to the bare metal" in assembly or C. You may be interested in looking at xwisp, though, as a related topic. That is a PIC programmer (i.e., software to manage the transfer of programs into the chip itself) written in Python. -- Steve Willoughby| Using b

Re: [Tutor] what is wrong with this code?

2010-04-26 Thread Steve Willoughby
etc., are NOT values, they are part of the SQL syntax and you have to build them as part of the string itself. -- Steve Willoughby| Using billion-dollar satellites st...@alchemy.com | to hunt for Tupperware. ___ Tutor maillist - Tutor@python.org

Re: [Tutor] Newbie & Unittest ...

2010-05-06 Thread Steve Willoughby
to create a factory function which will generate the individual test methods when the testcase object is created. --steve ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

[Tutor] ttk printing (was Re: application with tabs)

2010-05-15 Thread Steve Willoughby
ndows, although the PostScript output is likely adequate on Unix and Macs). Is there something people are using in that space for Tk? -- Steve Willoughby| Using billion-dollar satellites st...@alchemy.com | to hunt for Tupperware. ___ Tutor maillis

Re: [Tutor] ttk printing (was Re: application with tabs)

2010-05-15 Thread Steve Willoughby
. (And, yeah, I've been known to output groff and TeX from apps too :) -- Steve Willoughby| Using billion-dollar satellites st...@alchemy.com | to hunt for Tupperware. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] ttk printing (was Re: application with tabs)

2010-05-15 Thread Steve Willoughby
he way to go. > > But if you only need a GUI to control a program's operations (as I do) > then Tkinter is fine. I'd agree with all of the above. -- Steve Willoughby| Using billion-dollar satellites st...@alchemy.com | to hunt for Tupperware. ___

[Tutor] Loop basics (was Re: what is wrong with this syntax?)

2010-05-18 Thread Steve Willoughby
I'm changing the subject line because this is going into a different topic. On Tue, May 18, 2010 at 05:39:50PM +0100, Dipo Elegbede wrote: > A LITTLE EXPLANATIONS ON CONTINUE WOULD BE APPRECIATED TOO. > in a recap, i would appreciate any brief explanation on > 1. break > 2. continue > 3. while loo

Re: [Tutor] OOP clarification needed

2010-06-01 Thread Steve Willoughby
sses are themselves callable objects (specifically, calling them is how you construct new instances of a class), "win" will end up referring to a newly-constructed instance of whatever object class was passed as "kind". If no "kind" parameter was given, it will defa

Re: [Tutor] Doubts galore.

2010-06-10 Thread Steve Willoughby
t; > Please someone enlighten me. > > Prasad > _______ > Tutor maillist - Tutor@python.org > To unsubscribe or change subscription options: > http://mail.python.org/mailman/listinfo/tutor -- Steve Willoughby| Using billion-doll

Re: [Tutor] Doubts galore.

2010-06-10 Thread Steve Willoughby
f x==0 and y>0: do_something_else(y) yet_another_function(y**3) else: raise ValueError('values for x and y not in allowed range') -- Steve Willoughby| Using billion-dollar satellites st...@alchemy.com | to hunt for Tupperware. __

Re: [Tutor] Question

2010-06-19 Thread Steve Bricker
use that to move on to others. Steve Bricker On Fri 10/06/18 22:55 , Independent Learner nbr1ninrs...@yahoo.com sent: ~After doing a google search, I could not find any good solid anwsers. So I will apologize ahead of time since this is not really a Python specific question. However... ~I was

Re: [Tutor] Use flag to exit? (OT - PEP 8 Gripe)

2010-06-25 Thread Steve Willoughby
But what you're doing is still possible, of course. If your choice of tools is otherwise exactly what you want to stick with, this is simply the price you need to pay for that. If the tradeoff is still worth it for you, then stick with it. --steve

Re: [Tutor] capturing error msg in exception

2010-06-27 Thread Steve Willoughby
On 27-Jun-10 10:12, Adam Bark wrote: On 27 June 2010 17:47, Payal c. What is the correct Python of writing, except as e: print 'Msg : ' , e# Capturing all exceptions Since exceptions are (should be?) subclasses of Exception, you can do: except Exception as e: I think the

Re: [Tutor] "x and y" means "if x is false, then x, else y"??

2010-07-05 Thread Steve Willoughby
On 05-Jul-10 00:27, Richard D. Moores wrote: See. I am quite familiar with the meaning of "x and y" in Python, and how it is evaluated -- first x, and only if x is False, then evaluate y. But I just can't read "if x

Re: [Tutor] what is wrong with the syntax?

2010-07-10 Thread Steve Willoughby
On 10-Jul-10 10:05, Dipo Elegbede wrote: Hi all, please tell me what is wrong with the syntax as written herein: http://pastebin.com/BkLi0A4H I am actually trying to let a user input something and have the input returned in a reverse form and also see the lenght of the input. please help. Is th

Re: [Tutor] str format conversion help

2010-07-14 Thread Steve Willoughby
On 14-Jul-10 11:35, eMyListsDDg wrote: '\x00\x11\xb2\x00@,O\xa4' the above str is being returned from one key/value pair in a dictionary. it is the addr of a network device. i want to store the addr's in their 8byte mac format like this, [00 11 b2 00 40 2C 4F A4] the combinations of

[Tutor] FTP from mainframe

2010-07-29 Thread Steve Bricker
python26libftplib.py", line 428, in retrlines callback(line) TypeError: 'file' object is not callable Not sure what I'm missing. Steve Bricker ___ 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 Steve Willoughby
On 01-Sep-10 13:10, Mark Weil wrote: Not perfect, but you could check for each browser's binary. import os os.path.isfile("/usr/bin/firefox") You'd probably be better off at least looking at the user's PATH variable, which would likely catch platform variations in where the browser would be

Re: [Tutor] unittest testing order...

2010-09-27 Thread Steve Willoughby
On 27-Sep-10 15:07, Modulok wrote: In an ideal world, I agree. This is possible for pure functional programming where state is avoided. However, when dealing with object oriented, imperative programming, state changes cannot be avoided. Generally, a unit test should test a single aspect of a si

Re: [Tutor] Operating in Place

2010-09-28 Thread Steve Willoughby
On 28-Sep-10 13:03, Corey Richardson wrote: I hate doing this: string = string.lower() Is there a way to do it without the "string =" part? Thanks. Depends on the class. In this specific case, string objects are immutable (for some good reasons which are beyond the immediate point), so once

Re: [Tutor] using "in" with a dictionary

2010-09-28 Thread Steve Willoughby
On 28-Sep-10 14:58, Alex Hall wrote: Hi all, yet again: I have a dictionary that will look something like: d={ (1,2):"a", (3,4):"b" } How can I say: if (1,2) in d: print d[(1,2)] Did you try this? It looks fine to me as it is. (1,2) is an immutable value (a tuple), so it is able to be use

Re: [Tutor] just what does read() return?

2010-09-30 Thread Steve Willoughby
On 30-Sep-10 15:49, Alex Hall wrote: re.split(r"\n+", self.original) That did it, and my program once again runs as expected. Thanks! If you don't need blank lines stripped out (r'\n+' considers multiple consecutive \n characters to be a single record separator), you can avoid the regex and j

Re: [Tutor] function error

2010-10-02 Thread Steve Willoughby
On 02-Oct-10 10:32, Emile van Sebille wrote: File "my_turtle.py", line 19 if (abs(turtle.position()[0])> turtle.window_height()/2) or ^ SyntaxError: invalid syntax How does Python know that the next line is the continuation of your if statement, instead of the beginning of a new line of code?

Re: [Tutor] EXECUTING PYTHON AND SQL STAMENTS

2010-10-04 Thread Steve Willoughby
On 04-Oct-10 07:32, Norman Khine wrote: On Mon, Oct 4, 2010 at 4:04 PM, Susana Iraiis Delgado Rodriguez wrote: os.system('"C:/Archivos de programa/FWTools2.4.7/bin/ogr2ogr.exe"'+" " +"arg1" +" "+ "-where" +" "+ "arg2" +" " +"arg3") You're including the text "arg1" in the command, not

Re: [Tutor] Zip Command

2010-10-14 Thread Steve Willoughby
On 14-Oct-10 08:32, ALAN GAULD wrote: gzip - aka gunzip GNU opensource version - probably your best bet. This is not correct. Gzip zip's format is not the same as the pkzip related format used by Winzip and other "zip" utilities. Gzip also only compresses, it does not deal

Re: [Tutor] How to pass a python variable to subprocess.call?

2010-10-25 Thread Steve Willoughby
On 25-Oct-10 15:19, Abhijeet Rastogi wrote: subprocess.call("ls -l "+mydir,shell=True) will do the job. In python, we can simply concatenate the strings like that. How do I replace /usr/local/bin in the subprocess call with the mydir variable? It's often preferable (for reasons ranging

[Tutor] BeautifulSoup confusion

2009-04-09 Thread Steve Lyskawa
I's but I can't see to get re.compile to work right. If I could get it to give me the URI only without tags or link description, that would be ideal. Thanks for your help. Steve Lyskawa ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] OOP / Classes questions

2009-04-10 Thread Steve Willoughby
method could just ignore that parameter if you don't care about that, or you could examine it to see details as to what event led you to the OnQuit action. -- Steve Willoughby| Using billion-dollar satellites st...@alchemy.com | to hunt for Tupperware. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

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

2009-05-03 Thread Steve Willoughby
Nick Burgess wrote: > 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): re.search (r'Domains:', line) is

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

2009-05-03 Thread Steve Willoughby
Alan Gauld wrote: >> if re.search != (r'Domains:', line): > > Because you are assigning a tuple containing a string and a line of text > to a name which is currently bound to a function object (re.search) Actually, he's COMPARING the two, not assigning. But comparing a function object and a tupl

Re: [Tutor] t = (1, *(2, 3))

2009-05-14 Thread Steve Willoughby
Lie Ryan wrote: > Jabin Jezreel wrote: >> I am not allowed to do > t = (1, *(2, 3)) >> >> But I am allowed to do > def ts(*t): >> return t >> > ts(1, *(2, 3)) >> (1, 2, 3) >> >> I realize I can do > (1,) + (2,3) >> (1, 2, 3) >> >> What is the rationale behind not having

Re: [Tutor] t = (1, *(2, 3))

2009-05-14 Thread Steve Willoughby
> won't work without breaking python object model. > > If such construct creates a new tuple, it would > > need to break python's object model [...] > > Break how? > ___ > Tutor maillist - Tuto

Re: [Tutor] Python popen command using cat > textfile .... how toterminate

2009-05-15 Thread Steve Willoughby
python fiorst. > There often is. Almost always. Plus, if you do it in Python your program will work on Windows. And MacOS. And VMS. And a Unix system where the user has a "cat" program which behaves differently than yours does... which trying to call "cat" you

Re: [Tutor] Python popen command using cat > textfile .... how toterminate

2009-05-15 Thread Steve Willoughby
On Fri, May 15, 2009 at 08:51:26AM -0700, Steve Willoughby wrote: > On Fri, May 15, 2009 at 04:18:16PM +0100, Alan Gauld wrote: > > echo ^D | cat > foo > > > > sends a CtrlD to cat which writes an empty file to foo. > > And since this seems to be a point of co

Re: [Tutor] improvement of if - else code

2009-06-04 Thread Steve Willoughby
: > countries = [ > {'name': y, 'title': x, 'selected': y == address_country} > for x, y in root.get_authorized_countries(context) ] > > Thanks > ___ > Tutor mail

Re: [Tutor] PYTHONPATH-corrected

2009-06-30 Thread Steve Willoughby
s on a suse linux 10 box > > -- > Bob Rea > mailto:pet...@petard.us > http://www.petard.us > http://www.petard.us/blog > http://www.petard.us/gallery > ___ > Tutor maillist - Tutor@python.org > http://mail.python.org/mailman/listin

Re: [Tutor] os.system and/or subprocess.call problem...

2009-07-10 Thread Steve Willoughby
fore the subprocess starts up and tries to read it. Are you either calling .flush() or .close() or something equivalent BEFORE starting the subprocess? When you start the subprocess, is it being started in the directory you think it is? -- Steve Willoughby| Using billion-dollar satell

Re: [Tutor] os.system and/or subprocess.call problem...

2009-07-10 Thread Steve Willoughby
sf.ini > > And I know the above is valid otherwise, as I have put in a print statement > and copied the actual line I generated and it executed fine... :) > > Thank you for your reply; I appreciate all help I get on this. :) > -Isaac > -- Steve Willoughby| Using billi

Re: [Tutor] File I/O help

2009-07-23 Thread Steve Willoughby
you're at it, look at the return value from the append method for lists. What are you accomplishing by assigning that back onto the variables grade and name above? > grades.sort() # Sort the grades in ascending order All the grades? Seems like you need a way to keep track of t

Re: [Tutor] flag to call methods on objects?

2009-07-30 Thread Steve Willoughby
would just automatically decode that for you. However, in only another line or so of code, you can encrypt your data using AES or Blowfish or whatever, which would require highly specialized tools, extremely expensive equipment, and if you were not either a major government, independently wealthy and

Re: [Tutor] web2py vs django

2009-09-09 Thread Steve Willoughby
ting and cool in their own ways, at that point I had what I needed and it worked well. I suspect those who use Pylons or Django or whatever would say the same thing. -- Steve Willoughby| Using billion-dollar satellites st...@alchemy.com | to hunt f

Re: [Tutor] Executing a command from a specific directory

2009-09-16 Thread Steve Willoughby
t;Ping is not successful.") > >pLogger.info("Ping is not successful.") Also... this looks backwards. If "Request timed out.." is NOT found then the ping was NOT successful? -- Steve Willoughby| Using billion-dollar satellites st...@alchemy

Re: [Tutor] eazy python question involving functions and parameters

2009-09-20 Thread Steve Willoughby
//www.nabble.com/eazy-python-question-involving-functions-and-parameters-tp25530128p25530128.html > Sent from the Python - tutor mailing list archive at Nabble.com. > > ___ > Tutor maillist - Tutor@python.org > To unsubscribe or change subs

Re: [Tutor] How to perform variable assignment and

2009-10-03 Thread Steve Willoughby
ces you see when one language is specifically designed to make code very clear and explicit and another wasn't. --steve ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Checking for Python version

2009-10-06 Thread Steve Willoughby
On Tue, Oct 06, 2009 at 09:42:04AM -0500, Wayne wrote: > On Tue, Oct 6, 2009 at 9:26 AM, Christian Witts wrote: > if sys.version < '2.4': >sys.exit("Need at least Python 2.4") > > AFAIK the string comparison is reliable Not quite. What happens when you

Re: [Tutor] Checking for Python version

2009-10-06 Thread Steve Willoughby
On Tue, Oct 06, 2009 at 09:47:43AM -0500, Wayne wrote: > On Tue, Oct 6, 2009 at 9:46 AM, Steve Willoughby wrote: > > > On Tue, Oct 06, 2009 at 09:42:04AM -0500, Wayne wrote: > > > On Tue, Oct 6, 2009 at 9:26 AM, Christian Witts > >wrote: > > > if sys.version

Re: [Tutor] What is Curses and why do they call it that.

2009-10-12 Thread Steve Willoughby
in each case--a boon when using a slow modem). If you want to change text attributes or set up data entry screens (or information displays) on a plain text terminal window or system console, it's worth looking at curses. -- Steve Willoughby| Using billion-dollar satellites st...@alchemy.c

Re: [Tutor] First line of a python program

2009-10-12 Thread Steve Willoughby
at is this for or do for the program? > > Thanks in advance, > > Katt > ___ > Tutor maillist - Tutor@python.org > To unsubscribe or change subscription options: > http://mail.python.org/mailman/listinfo/tutor -- Steve

Re: [Tutor] Methods that return instances of their own class?

2009-10-15 Thread Steve Willoughby
> > l5="Defect | (% 3d,% 3d) | (% 3d,% 3d) |\n" % (self[1] > > [0][0], self[1][0][1], self[1][1][0], self[1][1][1]) > > l6=" -\n" > > return l1+l2+l3+l4+l5+l6 > > What is the

Re: [Tutor] updating Unix config file

2009-10-20 Thread Steve Willoughby
On Tue, Oct 20, 2009 at 10:44:16AM -0400, Matt Herzog wrote: > Yes, thanks. What failed was the invocation of PIPE. Apparently I had to > explicitly import PIPE from subprocess or python had no clue as to what PIPE > was! > > Dare I say, "wtf?" since when fo I have to specify such? Shouldn't im

Re: [Tutor] i can't for the life of me get "#! /usr/bin/env python" or "#!/usr/bin/python" to work

2009-10-21 Thread Steve Willoughby
local/bin/python "Aha! Looks like python is in /usr/local/bin!" Put that location in your shebang line: #!/usr/local/bin/python -- Steve Willoughby| Using billion-dollar satellites st...@alchemy.com | to hunt for Tupperware. __

Re: [Tutor] Python at my work

2009-12-03 Thread Steve Bricker
BODY { font-family:Arial, Helvetica, sans-serif;font-size:12px; }We have Python applications for work with testing reports printed to PDF files. Don't know if you have that needed. Steve Bricker Now blogging at srbricker.blogspot.com On Thu 09/12/03 11:46 , skrab...@comcast.net sent

[Tutor] Why is this not an error?

2005-03-20 Thread Steve N
in the loop with 1 in the loop with 2 in the loop with 3 in the loop with 4 not found: 4 >>> -- Steve __ Do you Yahoo!? Yahoo! Mail - Easier than ever with enhanced search. Learn more. http://info.mail.yahoo.com/mail_250 _

Re: [Tutor] What is the best book to start? - Many Thanks!

2005-04-06 Thread Steve George
since then. http://www.amazon.com/exec/obidos/tg/detail/-/0130260363/qid=1112776154/sr=1-20/ref=sr_1_20/002-9100626-6616001?v=glance&s=books Best of luck, Steve On Apr 5, 2005 2:37 AM, Hoffmann <[EMAIL PROTECTED]> wrote: > Hi John, > > Certainly, I will check it out. &

Re: [Tutor] Re: GUI module selection?

2005-04-13 Thread Steve George
tributions. If it's cross-platform then WX is probably better as they've focused on this area. If it's Mac OSX then PyObj seems the way to go. Cheers, Steve On 4/13/05, Lee Cullens <[EMAIL PROTECTED]> wrote: > I'm trying to narrow down the detailed trials I need

Re: [Tutor] What's the invalid syntax? Code supplied

2005-08-07 Thread steve reighard
em for the help they give so frequently, good-naturedly, and freely.  I will not mourn the fact that Nathan refuses to share his card dealing algorithm with the rest of us; but I would greatly miss the instruction of the people who try to help him understand the concepts and techniques of

Re: [Tutor] Random module.. or?

2007-08-07 Thread steve reighard
that mean. In your catfish example suitable values might be mean = 10 inches with a standard deviation of 4 inches. There are several numerical algorithms that massage a uniformly distributed random value (or several uniformly distributed random value

Re: [Tutor] Plz help me from this

2007-09-04 Thread Steve Willoughby
iles, but a little less conveniently. Then once you have your input from the user, it's just a simple matter of calling os.chmod() and os.chown() to make the changes. (Note that os.chown() changes the owner and/or group in one call.) HTH --steve ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Plz help me from this

2007-09-05 Thread Steve Willoughby
Carlos Daniel Ruvalcaba Valenzuela wrote: > Yes is very possible to do this with python. > > Checkout the os.system and os.popen functions to run external commands > (chmod, chown). While those are ways of calling external commands, it is best to use built-in language features like os.chmod() an

Re: [Tutor] Importing Excel sheet data

2007-09-06 Thread Steve Willoughby
saradhi dinavahi wrote: > I am new to the Python Programming. I want to Import Excel sheet data > using Python. Can any one please provide me the code and explain the > basic steps and method of executing the code. If you can get your Excel data into CSV format, the csv module others have alrea

Re: [Tutor] Python / CGI

2007-09-06 Thread Steve Willoughby
e the "play/not play" decision for each date, which is what is displayed in the normal calendar view. The whole thing only took 318 lines of straight Python code, including all the HTML displayed on all those forms. The "calendar" module is your friend for apps like this,

Re: [Tutor] Python / CGI

2007-09-07 Thread Steve Willoughby
John wrote: > Steve, > > If you're interested in just banging out a Python app, though, my > experience > was writing a calendaring tool for a group of my friends who get > together > [...] > This sounds very cool, is it something you could post?

Re: [Tutor] rewriting script

2007-09-07 Thread Steve Willoughby
Christopher Spears wrote: > I have written a script that reads and displays text > files: > > #!/usr/bin/env python > > 'readTextFile.py -- read and display text file' > > import os > > # get filename > while True: > fname = raw_input('Enter file name: ') > print > if os.path.exists

Re: [Tutor] Apache, CGI-BIN, Python

2007-09-09 Thread Steve Willoughby
Ryan wrote: > I am running a Linux box and cannot find my Apache cgi-bin to put some > python scripts in. I know I probably have to create one but don't know > where and how. On Linux under Apache 2.2, I've seen it in /usr/lib/cgi-bin which always struck me as weird, but there you go. On BSD,

Re: [Tutor] Just bought Python in a Nutshell

2007-09-13 Thread Steve Holden
ll-written book, and contains enough information that almost every Python programmer will find it a useful addition to his or her bookshelf. You will enjoy it whether you choose to read from the beginning or just dip in. regards Steve -- Steve Holden+1 571 484 6266 +1 800 494 311

Re: [Tutor] Really basic web templating

2007-09-30 Thread Steve Willoughby
s do this, for one example. If you request a URL you get a script which serves the page if it exists, or creates a blank one if it doesn't. You can use Python's string template module as an easy way to format up variable text into style templates you set up as text files, or

Re: [Tutor] Sending Email

2007-10-03 Thread Steve Willoughby
imple for plain text. -- Steve Willoughby| Using billion-dollar satellites [EMAIL PROTECTED] | to hunt for Tupperware. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Sending Email

2007-10-03 Thread Steve Willoughby
people in the sendmail() parameter but not in the To: or Cc: headers, and they are blind-carbon-copied. -- Steve Willoughby| Using billion-dollar satellites [EMAIL PROTECTED] | to hunt for Tupperware. ___ Tutor maillist - Tutor@p

Re: [Tutor] Sending Email

2007-10-03 Thread Steve Willoughby
On Wed, Oct 03, 2007 at 02:09:07PM -0700, Steve Willoughby wrote: > On Wed, Oct 03, 2007 at 05:02:52PM -0400, Kent Johnson wrote: > > One gotcha is that msg must also include From and Two headers. A > > slightly longer example is here: > > http://docs.python.org/lib/SMTP-

Re: [Tutor] Updating MySQL Database

2007-10-07 Thread Steve Willoughby
Rick Pasotto wrote: > (ip,fqdn) = line.split(',') > updatequery = "update resultstable set %s where ip = %s" % (fqdn,ip) > cursor.execute(updatequery) > connection.close() > > Alternatively you could do: > > connection = MySQLdb.connect(db=self.todatabase,host-self.host, >

Re: [Tutor] internet access

2007-10-11 Thread Steve Willoughby
This is where it's an advantage to setting up an old PC as a firewall for your network. Stick Linux on it, set up your filtering rules, and let it sit between your home network and the outside world. You can then have it block that PC's access to the Internet via cron scripts, possibly even s

Re: [Tutor] Difference between Perl and Python

2007-11-04 Thread Steve Willoughby
Varsha Purohit wrote: > Hello everyone, >I wanted to know what are the differences between perl and > python, since both of them are scripting languages... There is plenty of difference between them and between all the other scripting languages. Look beyond the notion of "scripting" and

Re: [Tutor] assignment question

2007-11-11 Thread Steve Willoughby
Ryan Hughes wrote: > Hello, > > Why does the following not return [1,2,3,4] ? > x = [1,2,3].append(4) print x > None because the append() method doesn't return a copy of the list object; it just modifies the list itself. so your code constructs a list object with 3 elements, appends

Re: [Tutor] network - send one line of text

2007-11-23 Thread Steve Willoughby
Michael Langford wrote: > On 11/23/07, elis aeris <[EMAIL PROTECTED]> wrote: >> is it possible to do this with python? >> >> >> a server script to listen for >> >> a client script, it sends a line of text to server when a given criteria is >> met. > > Sounds like python may not be simplest path to

Re: [Tutor] comparing dates

2007-11-23 Thread Steve Willoughby
Lawrence Shafer wrote: > How would I compare these two dates and extract the difference in H:M:S?? > > 22 Nov 2007 18:54:07 > 23 Nov 2007 23:24:23 Look at the datetime module's timedelta operations. ___ Tutor maillist - Tutor@python.org http://mail.p

Re: [Tutor] How is "tuple" pronounced?

2007-12-10 Thread steve reighard
On Dec 10, 2007 11:14 PM, earlylight publishing < [EMAIL PROTECTED]> wrote: > Is it tuh-ple (rhymes with supple) > > or is it two-ple (rhymes with nothing that I can think of)? > > How unscrupulous of you! > > > ___ Tutor maillist - Tutor@python.org h

Re: [Tutor] constants, flags or whatever

2007-12-19 Thread Steve Willoughby
Dave Kuhlman wrote: > On Wed, Dec 19, 2007 at 09:41:13PM -0500, bob gailer wrote: > >> 1 - I see no value in introducing variables. I'd just use string constants: >> >> action = "moving" >> . >> . >> if action == "jumping": >> >> etc. > > I agree. But, some people do prefer something that looks

Re: [Tutor] import sys; sys.exit()

2008-01-10 Thread Steve Willoughby
nt(message_qty) except ValueError: spam = 0 print "Warning:", message_qty, "is not a valid-looking number" print "proceeding with a value of 0 instead." If the int() function raises a ValueError, the code here will deal gracefully with that, and carry on. Any

Re: [Tutor] Change dictionary value depending on a conditional statement.

2008-02-11 Thread Steve Willoughby
Kent Johnson wrote: > Try >list.append({'id': 'name', 'link': ('YY','XX')[total > 0]}) I'd caution against that, though. It's clever and cute, sure, but the meaning of it is obfuscated enough to be unpythonic because [total > 0] as a subscript doesn't mean anything unless you know you're ta

  1   2   3   4   >