Re: [Tutor] shebang problem

2006-11-04 Thread Carlos Hanson
On Sat, November 4, 2006 11:07 am, Jonathon Sisson wrote: > Brian, > > It's not a permissions issue... > > (from the original e-mail...see below) > >> [EMAIL PROTECTED]:~/test$ ls -la shebangtest.py -rwxr-xr-- 1 brian > >> brian 68 2006-11-04 02:29 shebangtest.py > > This is clearly executable by

Re: [Tutor] Amazing power of Regular Expressions...

2006-11-04 Thread Jonathon Sisson
Ahh, sorry, sorry. I haven't been able to locate the thread that I read that summarized passage from, so I can't say who exactly said all of that... Nice quote on C/C++...made me laugh. Jonathon Alan Gauld wrote: > "Jonathon Sisson" <[EMAIL PROTECTED]> wrote > >> of them they're addicting...

Re: [Tutor] Encoding and XML troubles

2006-11-04 Thread Luke Paireepinart
Inputting XML into a Python program has nothing to do with what encoding the python source is in.So it seems to me that that particular PEP doesn't apply in this case at all.I'm guessing that the ElementTree module has an option to use Unicode input. ___

Re: [Tutor] Print Screen

2006-11-04 Thread Luke Paireepinart
I didn't set up a design doc or anything.I just randomly have ideas sometimes and I just make a prototype first so I can see what kind of problems arise,because when I just think about it I can't determine what I will need in order to make the app. For example, all the functions that I found to do

[Tutor] shebang problem

2006-11-04 Thread Jonathon Sisson
Brian, It's not a permissions issue... (from the original e-mail...see below) >> [EMAIL PROTECTED]:~/test$ ls -la shebangtest.py >> -rwxr-xr-- 1 brian brian 68 2006-11-04 02:29 shebangtest.py This is clearly executable by brian, and clearly being executed by brian. The shebang line is correc

Re: [Tutor] shebang problem

2006-11-04 Thread Rick Pasotto
On Sat, Nov 04, 2006 at 06:11:03PM -0600, Brian van den Broek wrote: > Hi all, > > I'm still getting comfortable with Linux and this might be an OS > rather than a python problem. > > I am trying to make a script directly executable. I've reviewed the > 2nd ed of the Nutshell, and I cannot work o

Re: [Tutor] shebang problem

2006-11-04 Thread Alan Gauld
[EMAIL PROTECTED]:~/test$ ls -la shebangtest.py -rwxr-xr-- 1 brian brian 68 2006-11-04 02:29 shebangtest.py so the file is called shebangtest.py... > [EMAIL PROTECTED]:~/test$ shebangtest > bash: shebangtest: command not found but you try to run shebangtest... bash can't find the file. you didn

Re: [Tutor] shebang problem

2006-11-04 Thread Carlos Hanson
On Sat, November 4, 2006 4:11 pm, Brian van den Broek wrote: > Hi all, > > I'm still getting comfortable with Linux and this might be an OS > rather than a python problem. > > I am trying to make a script directly executable. I've reviewed the > 2nd ed of the Nutshell, and I cannot work out what I'

[Tutor] shebang problem

2006-11-04 Thread Brian van den Broek
Hi all, I'm still getting comfortable with Linux and this might be an OS rather than a python problem. I am trying to make a script directly executable. I've reviewed the 2nd ed of the Nutshell, and I cannot work out what I'm doing wrong. I'm running ubunutu 6.10 (edgy eft). Here's a copy past of

Re: [Tutor] Amazing power of Regular Expressions...

2006-11-04 Thread Alan Gauld
"Jonathon Sisson" <[EMAIL PROTECTED]> wrote > of them they're addicting... As Alan Gauld stated in another thread > (I'm > pretty sure it was Alan): You'll get to the point that you want to > use > (regular expressions) all the time, even if they aren't the right > tool Nope, it wasn't me, may

[Tutor] Encoding and XML troubles

2006-11-04 Thread William O'Higgins Witteman
I've been struggling with encodings in my XML input to Python programs. Here's the situation - my program has no declared encoding, so it defaults to ASCII. It's written in Unicode, but apparently that isn't confusing to the parser. Fine by me. I import some XML, probably encoded in the Windows

Re: [Tutor] Amazing power of Regular Expressions...

2006-11-04 Thread Jonathon Sisson
Asrarahmed Kadri wrote: > tries to supply negative values, then match will return None. > So no hassle of using all those Ifs and Elifs > I think REGULAR Expressions can be quite powerful... Indeed...Regular expressions were discovered etched into the blade of a sword that had been pl

Re: [Tutor] A question abt exception handling

2006-11-04 Thread Dustin J. Mitchell
import traceback try: something_funny() except: traceback.print_exc() should do the trick for you. Dustin ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] A question abt exception handling

2006-11-04 Thread Asrarahmed Kadri
  Hi Folks,   I want to know how we can print the error message when an exception is generated. I mean "the exact error message that is generated by the python interpreter."   My code is as under:   def check_date(date,num_days):   # this function takes a date and number of days and returns the st

Re: [Tutor] Two Questions...(i) Checking for None (ii) Making commandline arguments mutually exclusive

2006-11-04 Thread Dustin J. Mitchell
> if x == None > > As simple as that. In fact, I think the following is even a little more readable: if x is None and in fact that syntax has some advantages in various corner cases. It's largely a matter of preference. Dustin ___ Tutor maillist

[Tutor] Amazing power of Regular Expressions...

2006-11-04 Thread Asrarahmed Kadri
Hi Folks,     I dont know much about Regular Expressions. But I just want to share my ideas.   I was trying to implement error checking code on the date argument:   I did this:     import re # the user should enter date in the format: dd/mm/ p = re.compile('\d\d/\d\d/\d\d\d\d')   m = p.match(da

Re: [Tutor] Two Questions...(i) Checking for None (ii) Making commandline arguments mutually exclusive

2006-11-04 Thread Alan Gauld
"Asrarahmed Kadri" <[EMAIL PROTECTED]> wrote > *-s -D -n -t > time>* > > the first argument which is -s (for source) can be replaced by -d > (for > destination) or -o (for observer) or -r (for reporter). Now what I > want is > to make sure that the user only supplies one of the options

[Tutor] Two Questions...(i) Checking for None (ii) Making command line arguments mutually exclusive

2006-11-04 Thread Asrarahmed Kadri
  Hi Folks,   I am trying to build a program which takes the following command-line arguments:      -s -D -n -t     the first argument which is -s (for source) can be replaced by -d (for destination) or -o (for observer) or -r (for reporter). Now what I want is to make sure that the user only s

Re: [Tutor] Print Screen

2006-11-04 Thread Chris Hengge
Wow, that hasn't come up in my searching, thanks! Looks like you are right and the project is dead, but the author did toss there code up for viewing so I can stumble around a bit there. On 11/3/06, Jonathon Sisson <[EMAIL PROTECTED]> wrote: Chris,I don't know if this has been mentioned yet, but t

Re: [Tutor] Print Screen

2006-11-04 Thread Jonathon Sisson
Chris, I don't know if this has been mentioned yet, but this site might be useful: http://bdash.net.nz/blog/2003/12/24/python-vnc-client/ The code base has (last I heard) fallen stagnant, but it may very well be worth a look as a starting point for your VNC project idea. Jonathon Chris Hengg