Re: [Tutor] Paradox database files

2005-03-08 Thread Victor Bouffier
Hi all, I know this is OT from Python, but does anybody know how to fix my library issues. I get some awkward dependencies issues from these pylib libraries. # rpm -Uvh pxlib-0.4.3-1.i386.rpm error: Failed dependencies: libbz2.so.1.0 is needed by pxlib-0.4.3-1.i386 but when I look into

[Tutor] getting a webpage via python

2005-03-08 Thread Paul Tremblay
Is there a simple way to get a web page with python? I have done no network programming with python before. My router (a Linksys 54G model) stores the IP/MAC addresss in a web page. There is no way for me to access them except through the web. Righ now, I am using this code: command = 'lynx

RE: [Tutor] getting a webpage via python

2005-03-08 Thread Eric Culpepper
You could use the builtin modules like urllib2, httplib, or you could use John Lee's spifftastic module mechanize. I use mechanize a lot for automating downloading files from various partner websites my company has relations with. http://docs.python.org/lib/module-httplib.html

Re: [Tutor] getting a webpage via python

2005-03-08 Thread Ewald Ertl
Hi Paul! As mentioned earlier by Kent in this group under the subject: Subject: Re: [Tutor] Downloading from http Mark Kels wrote: On Sat, 12 Feb 2005 09:25:10 -0500, Jacob S. [EMAIL PROTECTED] wrote: urllib or urllib2 or maybe httplib maybe? urlopen( url[, data]) I'm sorry,

[Tutor] Re: [Pysqlite-users] Querying 2 databases together

2005-03-08 Thread Liam Clarke
Care to post the SQL of what you're trying to do? On Tue, 8 Mar 2005 17:01:07 +0100, Pierre-Yves Delens [EMAIL PROTECTED] wrote: bonjour, Iread through SqLite syntax (Attach), and found some old posts on PySqLite, but.. I didn't manage to join a table from a 2d database file in my query.

[Tutor] Re: [Pysqlite-users] Querying 2 databases together

2005-03-08 Thread Liam Clarke
Ack - wrong list. On Wed, 9 Mar 2005 06:52:57 +1300, Liam Clarke [EMAIL PROTECTED] wrote: Care to post the SQL of what you're trying to do? On Tue, 8 Mar 2005 17:01:07 +0100, Pierre-Yves Delens [EMAIL PROTECTED] wrote: bonjour, Iread through SqLite syntax (Attach), and found some

Re: [Tutor] getting a webpage via python

2005-03-08 Thread Paul Tremblay
On Tue, Mar 08, 2005 at 11:50:12AM -0500, Kent Johnson wrote: Paul Tremblay wrote: You can use urllib2 to do this. It is a little work to set it up to use Basic authentication. Here is an example (slightly modified from the urllib2 example page): import urllib2 # Create an

Re: [Tutor] getting a webpage via python

2005-03-08 Thread Kent Johnson
Paul Tremblay wrote: So I just make a file called /etc/router_passwords and include something like WRT54G username password Then parse the file, and supply the info to the password handler? This is easy to do, and I guess it is secure. No, it's not secure at all. In either case (password in

RE: [Tutor] Acessing files in Windows 2000

2005-03-08 Thread John Purser
Try c:\\my documents\\memo.txt John -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Dave S Sent: Tuesday, March 08, 2005 14:24 To: Python Tutor Subject: [Tutor] Acessing files in Windows 2000 I have a script that converts data relating to my work. It

Re: [Tutor] HELP: subclass of int

2005-03-08 Thread jfouhy
Quoting Max Noel [EMAIL PROTECTED]: I'm not absolutely confident with inheritance in Python (nearly all of my serious OO work has been in Java), but shouldn't the call to the superclass's constructor be the very first statement of the subclass's constructor? No ... Or, well, maybe

RE: [Tutor] Acessing files in Windows 2000

2005-03-08 Thread Eric Culpepper
Try something like this (change the username to the user you're logged in as, or Administrator if that's how you're logged in): c:\\documents and settings\\username|Administrator\\my documents\\memo.txt -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of

Re: [Tutor] Acessing files in Windows 2000

2005-03-08 Thread jfouhy
Quoting Dave S [EMAIL PROTECTED]: I need to access 'memo.txt' in 'my documents' on windows am struggling. I have tried just about every combination of \ and / and \\ and // but to no avail. I need something like ... C:\My Documents\memo.txt Can anyone advise me ? I've never had any

RE: [Tutor] Acessing files in Windows 2000

2005-03-08 Thread John Purser
I agree with a previous poster, check your path. I think either the path doesn't exist or you don't have permission to get to it. John -Original Message- From: Dave S [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 08, 2005 14:50 To: [EMAIL PROTECTED] Cc: 'Python Tutor' Subject: Re:

Re: [Tutor] HELP: subclass of int

2005-03-08 Thread Terry Carroll
On Tue, 8 Mar 2005, Shidai Liu wrote: I'll sum up a question as following: def int5(): '''return 5''' return 5 class my_int(int): def __init__(self): self.id = int5() int.__init__(self, self.id) # FIXME: this line doesn't work the above code act like

RE: [Tutor] Acessing files in Windows 2000

2005-03-08 Thread Shitiz Bansal
I faced the same problem once.Dont remember the solution, but it is definitely the slashes which are causing the problem.I couldnt find a specific rule in whole of microsoft documentation, so i assume it has to be hit and try.Try a mix of backslashes n forward slashes till u get there. Whats

Re: [Tutor] Acessing files in Windows 2000

2005-03-08 Thread Terry Carroll
On Tue, 8 Mar 2005, Dave S wrote: IOError: [Errno 2] No such file or directory: 'c:\\my documents\\memo.txt' My two thoughts. 1) is there actually a directory named my documents at the root? I don't know about Win2000, but for Win XP, the my documents directory is actually C:\Documents

[Tutor] regular expression question

2005-03-08 Thread Mike Hall
I'd like to get a match for a position in a string preceded by a specified word (let's call it Dog), unless that spot in the string (after Dog) is directly followed by a specific word(let's say Cat), in which case I want my match to occur directly after Cat, and not Dog. I can easily get the spot

Re: [Tutor] regular expression question

2005-03-08 Thread Mike Hall
First, thanks for the response. Using your re: my_re = re.compile(r'(dog)(cat)?') ...I seem to simply be matching the pattern Dog. Example: str1 = The dog chased the car str2 = The dog cat parade was under way x1 = re.compile(r'(dog)(cat)?') rep1 = x1.sub(REPLACE, str1) rep2 =

Re: [Tutor] regular expression question

2005-03-08 Thread Sean Perry
Mike Hall wrote: First, thanks for the response. Using your re: my_re = re.compile(r'(dog)(cat)?') ...I seem to simply be matching the pattern Dog. Example: str1 = The dog chased the car str2 = The dog cat parade was under way x1 = re.compile(r'(dog)(cat)?') rep1 = x1.sub(REPLACE, str1)

Re: [Tutor] regular expression question

2005-03-08 Thread Danny Yoo
On Tue, 8 Mar 2005, Mike Hall wrote: Yes, my existing regex is using a look behind assertion: (?=dog) ...it's also checking the existence of Cat: (?!Cat) ...what I'm stuck on is how to essentially use a lookbehind on Cat, but only if it exists. Hi Mike, [Note: Please do a

Re: [Tutor] regular expression question

2005-03-08 Thread Mike Hall
This will match the position in front of dog: (?=dog) This will match the position in front of cat: (?=cat) This will not match in front of dog if dog is followed by cat: (?=dog)\b (?!cat) Now my question is how to get this: (?=cat) ...but ONLY if cat is following dog. If dog does not have cat

Re: [Tutor] Acessing files in Windows 2000

2005-03-08 Thread Danny Yoo
[Windows bashing cut] Python's support for Windows stuff is actually quite good, thanks to the work of Mark Hammond: http://starship.python.net/crew/mhammond/ A lot of us here do use Windows for COM programming. Let's get back to talking about Python programming and let's help Dave with

Re: [Tutor] Acessing files in Windows 2000

2005-03-08 Thread R. Alan Monroe
I have a script that converts data relating to my work. It works great on my Linux system but some of my colleagues run windows. I am attempting to convert the file paths to windows but am having no luck. I need to access 'memo.txt' in 'my documents' on windows am struggling. I have tried

Re: [Tutor] Acessing files in Windows 2000

2005-03-08 Thread Max Noel
On Mar 9, 2005, at 01:13, Shitiz Bansal wrote: Whats worse, I had found that the rule is different for different versions of windows.Just proves what we all know...Windows Suxx. The Windows OS sucks! And blows! At the same time! (name the reference, get a cookie ;) ) -- Max maxnoel_fr at yahoo dot

Re: [Tutor] HELP: subclass of int

2005-03-08 Thread Kent Johnson
Shidai Liu wrote: Hi all, I'll sum up a question as following: def int5(): '''return 5''' return 5 class my_int(int): def __init__(self): self.id = int5() int.__init__(self, self.id) # FIXME: this line doesn't work the above code act like this: I = my_int() I 0 I want

[Tutor] working with new classes

2005-03-08 Thread C Smith
Hello, After learning about the new class behavior, I am trying to implement a circular type list where, for example, you can compare the nth value to the (n+1)th value without worrying about going past the end of the list. (An old approach might be to create a function that converts a given