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
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 i
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
> 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
[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 hi
Sorry, my last reply crossed this one (and yes, I forgot again to CC
the list).
I'm experimenting now with your use of the "or" operator( "|") between
two expressions, thanks.
On Mar 8, 2005, at 6:42 PM, Danny Yoo wrote:
On Tue, 8 Mar 2005, Mike Hall wrote:
Yes, my existing regex is using a lo
>
> Regular expressions are a little evil at times; here's what I think you're
> thinking of:
>
> ###
> >>> import re
> >>> pattern = re.compile(r"""dog(?!cat)
> ...| (?<=dogcat)""", re.VERBOSE)
> >>> pattern.match('dogman').start()
> 0
> >>> pattern.search('dogcatcher').start
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" do
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
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.su
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)
>>>
On Tue, 8 Mar 2005, Mike Hall wrote:
> 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 direct
Mike Hall wrote:
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
On Tue, 8 Mar 2005 17:15:00 -0800 (PST), Terry Carroll <[EMAIL PROTECTED]>
wrote:
> 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.
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
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:\Documen
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 worse,
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
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: [Tu
John Purser wrote:
Try c:\\my documents\\memo.txt
John
Unfortunately thats a no go ...
palm.py
palm memo.txt to oocalc data.csv convertor, written by lentil ;)
[EMAIL PROTECTED] - enter "palm software" in the title or it will be junked
09-03-2005 v1.02w Coded for Windows
07-03-2005 v1.02 Cod
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 nev
On Mar 8, 2005, at 22:26, John Purser wrote:
Try c:\\my documents\\memo.txt
John
Or even better, c:/My Documents/memo.txt
In most programming languages, you can use the slash as a path
separator under Windows as well. It'll save you a lot of trouble.
-- Max
maxnoel_fr at yahoo dot fr -- ICQ
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 settingsmy documents\\memo.txt
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of
Dave S
Sent: Tuesday, Marc
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, ma
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 w
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 just
On Mar 8, 2005, at 22:10, 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
I'm not absolutely confident
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 it to
Hello tutors,
I experience problems with signal handlers, and the explanatzions in the docs
don't
seem to help me much.
The code I try to handle basically comes down to this (it's supposed to run on
linux only, btw):
from Tkinter import *
import tkSnack
root = Tk()
tkSnack.initializeSnack(roo
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 the
On Tue, Mar 08, 2005 at 01:42:40PM -0500, Kent Johnson wrote:
> Date: Tue, 08 Mar 2005 13:42:40 -0500
> From: Kent Johnson <[EMAIL PROTECTED]>
> User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206)
> Cc: python tutor
> Subject: Re: [Tutor] getting a webpage via python
>
> Paul Tremblay wrote:
Paul Tremblay wrote:
This is giving me 401 error, authorization required. Here's what I have:
auth_handler = urllib2.HTTPBasicAuthHandler()
auth_handler.add_password('realm', '127.0.0.1', 'myname', 'password')
opener = urllib2.build_opener(auth_handler)
# ...and install it globally so it can be use
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
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
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
That did the trick. Thanks Ewald.
FYI, I used the '--nodeps' directive once I realized there were really
no major issues.
I still needed to keep the added symlink since the px libraries couldn't
find the libbz2.so.1.0 file.
Thanks again to all. That was great help.
Victor
Ewald Ertl wrote:
Hi Vi
Paul Tremblay wrote:
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
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
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
http://docs.pyt
Hi Victor
on Tue, 08 Mar 2005 10:06:50 -0600 Victor Bouffier <[EMAIL PROTECTED]> wrote :
-
Victor Bouffier > Hi all,
Victor Bouffier > I know this is OT from Python, but does anybody know how to
fix my
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 -r
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 my
42 matches
Mail list logo