Re: the annoying, verbose self

2007-11-27 Thread Steven D'Aprano
On Mon, 26 Nov 2007 21:48:36 +0100, Ton van Vliet wrote: > On Mon, 26 Nov 2007 20:14:50 +0100, Bruno Desthuilliers > <[EMAIL PROTECTED]> wrote: > >>> However, I was more thinking in terms of attributes only >> >>Too bad : in Python, everything's an object, so 'methods' are attributes >>too. > >

FREE AIR TICKET

2007-11-27 Thread amutharr
AIR TICKET FOR SWIZ ANSWER SIMPLE QUESTIONhttp://rexmier.blogspot.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Rss Feed Creator

2007-11-27 Thread Stefan Behnel
Shane Geiger wrote: > James Matthews wrote: >> I am looking for a library that will create Rss/Atom feeds in python. >> It needs to format the XML in a readable format! Does anyone have any >> suggestions? http://trac.openplans.org/openplans/browser/TaggerClient/trunk/taggerclient/atom.py?rev=6717

Re: Rss Feed Creator

2007-11-27 Thread Vladimir Rusinov
On 11/27/07, James Matthews <[EMAIL PROTECTED]> wrote: > > I am looking for a library that will create Rss/Atom feeds in python. It > needs to format the XML in a readable format! Does anyone have any > suggestions? You can also use some xml-based template engine (Kid or Genshi). -- Vladimir Ru

Re: the annoying, verbose self

2007-11-27 Thread Bruno Desthuilliers
Steven D'Aprano a écrit : > On Mon, 26 Nov 2007 21:48:36 +0100, Ton van Vliet wrote: > >> On Mon, 26 Nov 2007 20:14:50 +0100, Bruno Desthuilliers >> <[EMAIL PROTECTED]> wrote: >> However, I was more thinking in terms of attributes only >>> Too bad : in Python, everything's an object, so 'meth

Why are class methods not classmethods?

2007-11-27 Thread Steven D'Aprano
There's some subtle behaviour going on here that I don't really follow. Class methods apparently aren't classmethods. >>> class Parrot(object): ... def method(self, *args): ... return self, args ... @classmethod ... def cmethod(cls, *args): ... return cls, arg

Re: gnosis XML objectify

2007-11-27 Thread Stefan Behnel
Wang, Harry wrote: > Test Suite Started @ 2007-11-26 11:34:46.617000 > Traceback (most recent call last): > File "C:\UDR2\UDRxmlGateway.py", line 370, in > ParseAll() > File "C:\UDR2\UDRxmlGateway.py", line 286, in ParseAll > py_obj = gnosis.xml.objectify.XML_Objectify(InputFile).make_

Re: the annoying, verbose self

2007-11-27 Thread Roy Smith
In article <[EMAIL PROTECTED]>, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > Steven D'Aprano a écrit : > > On Mon, 26 Nov 2007 21:48:36 +0100, Ton van Vliet wrote: > > > >> On Mon, 26 Nov 2007 20:14:50 +0100, Bruno Desthuilliers > >> <[EMAIL PROTECTED]> wrote: > >> > However, I was m

Re: Why are class methods not classmethods?

2007-11-27 Thread Marc 'BlackJack' Rintsch
On Tue, 27 Nov 2007 09:12:28 +, Steven D'Aprano wrote: > Can anyone explain why class methods bound to a class are instancemethods > rather than classmethods? I'd say because they are bound to the class which is the instance that is passed as first argument. Just like unbound methods turn i

Re: the annoying, verbose self

2007-11-27 Thread MonkeeSage
On Nov 27, 3:20 am, Roy Smith <[EMAIL PROTECTED]> wrote: > If you want to have a little fun: > > class peverse: > def __call__(self): > raise AttributeError ("peverse instance has no __call__ method") > > x = peverse() > x() That is "peverse", but still... from types import FunctionT

Re: Rss Feed Creator

2007-11-27 Thread James Matthews
Thank you everyone! On Nov 27, 2007 10:13 AM, Vladimir Rusinov <[EMAIL PROTECTED]> wrote: > > > On 11/27/07, James Matthews <[EMAIL PROTECTED]> wrote: > > > > I am looking for a library that will create Rss/Atom feeds in python. It > > needs to format the XML in a readable format! Does anyone hav

Re: Find & Replace hyperlinks in a string

2007-11-27 Thread MonkeeSage
On Nov 27, 1:37 am, Nico Grubert <[EMAIL PROTECTED]> wrote: > Hi there, > > I have a string containing some hyperlinks. I'd like to replace every > hyperlink with a HTML style link. > > Example: > > Replace >'http://www.foo.com/any_url' > with >'http://www.foo.com/any_url";>http://

vanga machan vanga

2007-11-27 Thread abi
http://goast.50webs.com/ http://bigchurch.com/go/g912753-pmem http://indianfriendfinder.com/go/g912753-pmem -- http://mail.python.org/mailman/listinfo/python-list

Re: the annoying, verbose self

2007-11-27 Thread Bruno Desthuilliers
Colin J. Williams a écrit : > Bruno Desthuilliers wrote: > [snip]> >> Too bad : in Python, everything's an object, so 'methods' are >> attributes too. > > What do you see as a problem here? You snipped too much... Tony wrote "However, I was more thinking in terms of attributes only" (implying:

Re: the annoying, verbose self

2007-11-27 Thread Bruno Desthuilliers
MonkeeSage a écrit : > On Nov 27, 3:20 am, Roy Smith <[EMAIL PROTECTED]> wrote: > >> If you want to have a little fun: >> >> class peverse: >> def __call__(self): >> raise AttributeError ("peverse instance has no __call__ method") >> >> x = peverse() >> x() print callable(x) => True

Re: spawning a process with subprocess

2007-11-27 Thread Nick Craig-Wood
MonkeeSage <[EMAIL PROTECTED]> wrote: > Couple of things. You should use poll() on the Popen instance, and > should check it explicitly against None (since a 0 return code, > meaning exit successfully, will be treated as a false condition the > same as None). Also, in your second example, you b

Re: trouble selling twisted

2007-11-27 Thread Nick Craig-Wood
[EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > i have a lot of trouble selling twisted a a client lib for network > access (on embedded platform) the group i'm a member of wants to > write some unmaintainable threaded blocking junk in c--. Finish the code in the time it takes them to work out w

Re: Find & Replace hyperlinks in a string

2007-11-27 Thread gsal
You mean in Python? 'cause if it is a one time shot kind of thing, I would simply open the file in my favorite editor (NEdit) and use a Search and Replace, check the regexp box and type my expression...something along the lines of ([^:]+)://([^:/]+)(: ([0-9]+))?(/.*) to find URLs and then replace w

Re: spawning a process with subprocess

2007-11-27 Thread MonkeeSage
On Nov 27, 4:30 am, Nick Craig-Wood <[EMAIL PROTECTED]> wrote: > MonkeeSage <[EMAIL PROTECTED]> wrote: > > Couple of things. You should use poll() on the Popen instance, and > > should check it explicitly against None (since a 0 return code, > > meaning exit successfully, will be treated as a fa

Re: spawning a process with subprocess

2007-11-27 Thread Ove Svensson
bhunter <[EMAIL PROTECTED]> writes: > Hi, > > I've used subprocess with 2.4 several times to execute a process, wait > for it to finish, and then look at its output. Now I want to spawn > the process separately, later check to see if it's finished, and if it > is look at its output. I may want

Re: the annoying, verbose self

2007-11-27 Thread MonkeeSage
On Nov 27, 4:22 am, Bruno Desthuilliers > You don't have to subclass function to define a callable type that > implements the descriptor protocol so it behaves just like a function in > the context of an attribute lookup. I'm aware, and I understand that python's types (as with other duck- typed

Re: the annoying, verbose self

2007-11-27 Thread Iain King
On Nov 27, 9:20 am, Roy Smith <[EMAIL PROTECTED]> wrote: > In article <[EMAIL PROTECTED]>, > Bruno Desthuilliers <[EMAIL PROTECTED]> > > > > wrote: > > Steven D'Aprano a écrit : > > > On Mon, 26 Nov 2007 21:48:36 +0100, Ton van Vliet wrote: > > > >> On Mon, 26 Nov 2007 20:14:50 +0100, Bruno Desth

Re: the annoying, verbose self

2007-11-27 Thread Bruno Desthuilliers
MonkeeSage a écrit : > On Nov 27, 4:22 am, Bruno Desthuilliers > >> You don't have to subclass function to define a callable type that >> implements the descriptor protocol so it behaves just like a function in >> the context of an attribute lookup. > > I'm aware, and I understand that python's t

see most important news

2007-11-27 Thread RANI
see most important news http://earnmac.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: the annoying, verbose self

2007-11-27 Thread Duncan Booth
Iain King <[EMAIL PROTECTED]> wrote: > FTR, I won't be using this :) I do like this syntax though: > > class Vector: > def __init__(self, x, y, z): > self.x = x > self.y = y > self.z = z > def abs(self): > using self: > return math.sqrt(.x*.x +

Re: the annoying, verbose self

2007-11-27 Thread Iain King
On Nov 27, 12:03 pm, Duncan Booth <[EMAIL PROTECTED]> wrote: > Iain King <[EMAIL PROTECTED]> wrote: > > FTR, I won't be using this :) I do like this syntax though: > > > class Vector: > > def __init__(self, x, y, z): > > self.x = x > > self.y = y > > self.z = z > >

It works! Was: Installing Python 3000 on Leopard (Mac OS) fails...

2007-11-27 Thread André
On Nov 26, 9:59 pm, "André" <[EMAIL PROTECTED]> wrote: > While I made some progress in trying to install Py3k from source (for > the first time), it has failed... > > Here are the steps I went through (not necessarily in that order - > except for those that matter). > > 1. After installing Leopard,

Re: How to Teach Python "Variables"

2007-11-27 Thread Neil Cerutti
On 2007-11-26, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Hrvoje Niksic wrote: >> greg <[EMAIL PROTECTED]> writes: >> >> > none wrote: >> >> IIRC, I once saw an explanation how Python doesn't have >> >> "variables" in the sense that, say, C does, and instead has >> >> bindings from names to obj

reading/writing files

2007-11-27 Thread sandipm
Hi, I am trying to read a file and write into other file. if I do it for simple text file, it works well. but for pdfs or some other mime types, its failing. actually main problem is i am uploading file using cgi, in this process I am getting content of file, and I am trying to save the file. I

Keyword passing to superclass written in C

2007-11-27 Thread Sven Erik Knop
Hi I am getting slightly frustrated and wonder if you can help me. Consider a Python class Foo implemented in C++. I have declared an initialization method like this static int Foo_init(P4Adapter *self, PyObject *args, PyObject *kwds) { } and I am subclassing Foo in Python, which works fine i

Re: reading/writing files

2007-11-27 Thread sandipm
f1= open("file1.pdf", "rb") x = f1.read() open("file2.pdf", "wb").write(x) works... thanks sandip On Nov 27, 5:43 pm, sandipm <[EMAIL PROTECTED]> wrote: > Hi, > > I am trying to read a file and write into other file. if I do it for > simple text file, it works well. > but for pdfs or some ot

Re: How can I create customized classes that have similar properties as 'str'?

2007-11-27 Thread Licheng Fang
On Nov 27, 10:45 am, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > On Sun, 25 Nov 2007 02:42:36 -0800, Licheng Fang wrote: > > I mentioned trigram counting as an illustrative case. In fact, you'll > > often need to define patterns more complex than that, and tens of > > megabytes of text may generat

Different kinds of Import Errors

2007-11-27 Thread Thomas Guettler
If you look at this code, you see there are two kind of ImportErrors: 1. app_name has no attribute or file managment.py: That's OK. 2. managment.py exists, but raises an ImportError: That's not OK: reraise # Import the 'management' module within each installed app, to register # d

Re: Best ways of managing text encodings in source/regexes?

2007-11-27 Thread J. Clifford Dyer
On Tue, Nov 27, 2007 at 01:30:15AM +0200, tinker barbet wrote regarding Re: Best ways of managing text encodings in source/regexes?: > > Hi > > Thanks for your responses, as I said on the reply I posted I thought > later it was a bit long so I'm grateful you held out! > > I should have said (bu

Re: Different kinds of Import Errors

2007-11-27 Thread kyosohma
On Nov 27, 7:35 am, Thomas Guettler <[EMAIL PROTECTED]> wrote: > If you look at this code, you see there are two kind of ImportErrors: > > 1. app_name has no attribute or file managment.py: That's OK. > 2. managment.py exists, but raises an ImportError: That's not OK: reraise > > # Import t

Re: Best ways of managing text encodings in source/regexes?

2007-11-27 Thread Kumar McMillan
On Nov 26, 2007 4:27 PM, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > > myASCIIRegex = re.compile('[A-Z]') > > myUniRegex = re.compile(u'\u2013') # en-dash > > > > then read the source file into a unicode string with codecs.read(), > > then expect re to match against the unicode string using eith

you want?

2007-11-27 Thread shoplife0001
Dear Friends The Shoplifes.com belongs to Shoplife Limited Company who mainly sell personal stylish electronic consumable products such as Mobile phones, Laptops, Digital Cameras, Digital Videos,Mp3,Mp4 and bulk products such as LCD TV, Motorcycles and so on. The specific item please visit our c

Re: the annoying, verbose self

2007-11-27 Thread Neil Cerutti
On 2007-11-26, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > Patrick Mullen a écrit : > (snip) >> Still an unnecessary lookup on tmp though :) And it would be useless >> to use it for one assignment, the idea is to eliminate all the typing >> with this: >> >> self.var1 = 5 >> self.var2 = "a va

Re: How to Teach Python "Variables"

2007-11-27 Thread hdante
On Nov 25, 5:31 pm, none <""atavory\"@(none)"> wrote: > Aurélien Campéas wrote: > > none a écrit : > >> Hello, > > >> IIRC, I once saw an explanation how Python doesn't have > >> "variables" in the sense that, say, C does, and instead has bindings > >> from names to objects. Does anyone hav

read/write to java socket in python

2007-11-27 Thread madsornomads
Hi all, I have a problem with reading from a Java server after I have written to it - it just hangs. It works fine if I just write to the server and not try to write. I have read the HOWTO on sockets - and it states that there is a problem (something about flushing), but not what the solutions is.

Re: reading/writing files

2007-11-27 Thread BartlebyScrivener
On Nov 27, 7:14 am, sandipm <[EMAIL PROTECTED]> wrote: > f1= open("file1.pdf", "rb") > x = f1.read() > open("file2.pdf", "wb").write(x) > > works... > > thanks > sandip You might also like: http://pybrary.net/pyPdf/ -- http://mail.python.org/mailman/listinfo/python-list

Re: read/write to java socket in python

2007-11-27 Thread Jean-Paul Calderone
On Tue, 27 Nov 2007 07:08:04 -0800 (PST), [EMAIL PROTECTED] wrote: >Hi all, > >I have a problem with reading from a Java server after I have written >to it - it just hangs. It works fine if I just write to the server and >not try to write. I have read the HOWTO on sockets - and it states >that ther

Re: read/write to java socket in python

2007-11-27 Thread hdante
On Nov 27, 1:08 pm, [EMAIL PROTECTED] wrote: > Hi all, > > I have a problem with reading from a Java server after I have written > to it - it just hangs. It works fine if I just write to the server and > not try to write. I have read the HOWTO on sockets - and it states > that there is a problem (s

A bug in Python's regular expression engine?

2007-11-27 Thread Just Another Victim of the Ambient Morality
This won't compile for me: regex = re.compile('(.*\\).*') I get the error: sre_constants.error: unbalanced parenthesis I'm running Python 2.5 on WinXP. I've tried this expression with another RE engine in another language and it works just fine which leads me to believe the p

Re: Why are class methods not classmethods?

2007-11-27 Thread Chris Mellon
On Nov 27, 2007 3:12 AM, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > There's some subtle behaviour going on here that I don't really follow. > Class methods apparently aren't classmethods. > > > >>> class Parrot(object): > ... def method(self, *args): > ... return self, args > ...

Re: A bug in Python's regular expression engine?

2007-11-27 Thread Diez B. Roggisch
Just Another Victim of the Ambient Morality wrote: > This won't compile for me: > > > regex = re.compile('(.*\\).*') > > > I get the error: > > > sre_constants.error: unbalanced parenthesis > > > I'm running Python 2.5 on WinXP. I've tried this expression with > another RE eng

Re: Keyword passing to superclass written in C

2007-11-27 Thread Chris Mellon
On Nov 27, 2007 6:47 AM, Sven Erik Knop <[EMAIL PROTECTED]> wrote: > Hi > > I am getting slightly frustrated and wonder if you can help me. > > Consider a Python class Foo implemented in C++. I have declared an > initialization method like this > > static int > Foo_init(P4Adapter *self, PyObject *a

Re: A bug in Python's regular expression engine?

2007-11-27 Thread Neil Cerutti
On 2007-11-27, Just Another Victim of the Ambient Morality <[EMAIL PROTECTED]> wrote: > This won't compile for me: > > > regex = re.compile('(.*\\).*') > > I get the error: > sre_constants.error: unbalanced parenthesis Hint 1: Always assume that errors are in your own code. Blaming li

Re: A bug in Python's regular expression engine?

2007-11-27 Thread Paul Hankin
On Nov 27, 3:48 pm, "Just Another Victim of the Ambient Morality" <[EMAIL PROTECTED]> wrote: > This won't compile for me: > > regex = re.compile('(.*\\).*') > > I get the error: > > sre_constants.error: unbalanced parenthesis > > I'm running Python 2.5 on WinXP. I've tried this express

Re: A bug in Python's regular expression engine?

2007-11-27 Thread Just Another Victim of the Ambient Morality
"Paul Hankin" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Nov 27, 3:48 pm, "Just Another Victim of the Ambient Morality" > <[EMAIL PROTECTED]> wrote: >> This won't compile for me: >> >> regex = re.compile('(.*\\).*') >> >> I get the error: >> >> sre_constants.error: u

Re: It works! Was: Installing Python 3000

2007-11-27 Thread jim-on-linux
On Tuesday 27 November 2007 07:20, André wrote: > On Nov 26, 9:59 pm, "André" <[EMAIL PROTECTED]> wrote: > > While I made some progress in trying to install Py3k from source > > (for the first time), it has failed... > > > > Here are the steps I went through (not necessarily in that order > > - exc

Re: Should proxy objects lie about their class name?

2007-11-27 Thread Fuzzyman
On Nov 26, 11:56 pm, Carl Banks <[EMAIL PROTECTED]> wrote: > On Nov 20, 3:50 pm, [EMAIL PROTECTED] (John J. Lee) wrote: > > > Not much to add to the subject line. I mean something like this: > > > ProxyClass.__name__ = ProxiedClass.__name__ > > > I've been told that this is common practice. Is it

Re: How to Teach Python "Variables"

2007-11-27 Thread Aaron Watters
On Nov 27, 10:06 am, hdante <[EMAIL PROTECTED]> wrote: > On Nov 25, 5:31 pm, none <""atavory\"@(none)"> wrote: > And that's it. I think that there is confusion because everything we > do with python variables are pointer dereferences, except for the > attribution, that instead of dereferencin

count pages in a pdf

2007-11-27 Thread belred
is it possible to parse a pdf file in python? for starters, i would like to count the number of pages in a pdf file. i see there is a project called ReportLab, but it seems to be a pdf generator... i can't tell if i would be able to parse a pdf file programmically. thanks for any recommendations

Re: count pages in a pdf

2007-11-27 Thread Tim Golden
[EMAIL PROTECTED] wrote: > is it possible to parse a pdf file in python? for starters, i would > like to count the number of pages in a pdf file. i see there is a > project called ReportLab, but it seems to be a pdf generator... i > can't tell if i would be able to parse a pdf file programmically

Re: How to Teach Python "Variables"

2007-11-27 Thread Chris Mellon
On Nov 27, 2007 10:25 AM, Aaron Watters <[EMAIL PROTECTED]> wrote: > On Nov 27, 10:06 am, hdante <[EMAIL PROTECTED]> wrote: > > On Nov 25, 5:31 pm, none <""atavory\"@(none)"> wrote: > > > And that's it. I think that there is confusion because everything we > > do with python variables are poi

Re: A bug in Python's regular expression engine?

2007-11-27 Thread MonkeeSage
On Nov 27, 10:19 am, "Just Another Victim of the Ambient Morality" <[EMAIL PROTECTED]> wrote: > That is funny. Thank you for your help... > Just for clarification, what does the "r" in your code do? It means a "raw" string (as you know ruby, think of it like %w{}): This page explains a

Re: Should proxy objects lie about their class name?

2007-11-27 Thread Steven Bethard
Fuzzyman wrote: > On Nov 26, 11:56 pm, Carl Banks <[EMAIL PROTECTED]> wrote: >> On Nov 20, 3:50 pm, [EMAIL PROTECTED] (John J. Lee) wrote: >>> Not much to add to the subject line. I mean something like this: >>> ProxyClass.__name__ = ProxiedClass.__name__ >>> I've been told that this is common pra

Re: A bug in Python's regular expression engine?

2007-11-27 Thread MonkeeSage
On Nov 27, 10:52 am, MonkeeSage <[EMAIL PROTECTED]> wrote: > On Nov 27, 10:19 am, "Just Another Victim of the Ambient Morality" > > <[EMAIL PROTECTED]> wrote: > > That is funny. Thank you for your help... > > Just for clarification, what does the "r" in your code do? > > It means a "raw" s

Re: Keyword passing to superclass written in C

2007-11-27 Thread Sven Erik Knop
Duh of course. Not sure what I had done in Python/Python. Now it works. Thanks a lot. Sven Erik Chris Mellon wrote: On Nov 27, 2007 6:47 AM, Sven Erik Knop <[EMAIL PROTECTED]> wrote: Hi I am getting slightly frustrated and wonder if you can help me. Consider a Python class Foo implement

Re: Should proxy objects lie about their class name?

2007-11-27 Thread Robin Becker
Steven Bethard wrote: ... > The Python 3 machinery allows *other* classes to lie about whether or > not your object is an instance or subclass of them, without requiring > them to set your __class__ or __bases__. So, for example, you can > create a class ``Integer`` and make ``issubclass(in

Re: How can I create customized classes that have similar properties as 'str'?

2007-11-27 Thread Chris Mellon
On Nov 27, 2007 7:16 AM, Licheng Fang <[EMAIL PROTECTED]> wrote: > On Nov 27, 10:45 am, Steven D'Aprano > > <[EMAIL PROTECTED]> wrote: > > On Sun, 25 Nov 2007 02:42:36 -0800, Licheng Fang wrote: > > > I mentioned trigram counting as an illustrative case. In fact, you'll > > > often need to define p

os.path.islink documentation error?

2007-11-27 Thread Giampaolo Rodola'
os.path.islink documentation says: "Return True if path refers to a directory entry that is a symbolic link. Always False if symbolic links are not supported." It's not clear to me why it is mentioned the DIRECTORY term. Shouldn't os.path.islink be used to just check if the *path* passed as argum

Re: count pages in a pdf

2007-11-27 Thread Andreas Lobinger
Tim Golden wrote: > [EMAIL PROTECTED] wrote: > >> is it possible to parse a pdf file in python? for starters, i would >> like to count the number of pages in a pdf file. i see there is a >> project called ReportLab, but it seems to be a pdf generator... i >> can't tell if i would be able to pars

Re: count pages in a pdf

2007-11-27 Thread Jon Ribbens
On 2007-11-27, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > is it possible to parse a pdf file in python? for starters, i would > like to count the number of pages in a pdf file. i see there is a > project called ReportLab, but it seems to be a pdf generator... i > can't tell if i would be able

Unsupported operator for Decimal: + (or -)

2007-11-27 Thread Todd O'Bryan
This seems to have come up earlier... http://mail.python.org/pipermail/python-list/2007-July/451187.html but no resolution. We're seeing the same thing. We're using Django's DecimalField type and when we try to add or subtract values--which should be decimal.Decimal objects--we occasionally get

Looking for a Python tutor

2007-11-27 Thread hong2221
I'm looking for a Python programmar that is willing write simple functions, prices can be talked over. Contact me asap. -- http://mail.python.org/mailman/listinfo/python-list

Re: os.path.islink documentation error?

2007-11-27 Thread Diez B. Roggisch
Giampaolo Rodola' schrieb: > os.path.islink documentation says: > > "Return True if path refers to a directory entry that is a symbolic > link. Always False if symbolic links are not supported." > > It's not clear to me why it is mentioned the DIRECTORY term. > Shouldn't os.path.islink be used to

Re: Unsupported operator for Decimal: + (or -)

2007-11-27 Thread Diez B. Roggisch
Todd O'Bryan schrieb: > This seems to have come up earlier... > > http://mail.python.org/pipermail/python-list/2007-July/451187.html > > but no resolution. > > We're seeing the same thing. We're using Django's DecimalField type > and when we try to add or subtract values--which should be > decim

Re: How to Teach Python "Variables"

2007-11-27 Thread Donn Cave
In article <[EMAIL PROTECTED]>, Aaron Watters <[EMAIL PROTECTED]> wrote: > I would try to avoid talking > in generalities about python variables versus C or > lisp or whatever, unless I was teaching an upper division > college programming languages survey class. > > Instead, I'd fire up the in

Re: Unsupported operator for Decimal: + (or -)

2007-11-27 Thread Chris Mellon
On Nov 27, 2007 11:45 AM, Todd O'Bryan <[EMAIL PROTECTED]> wrote: > This seems to have come up earlier... > > http://mail.python.org/pipermail/python-list/2007-July/451187.html > > but no resolution. > > We're seeing the same thing. We're using Django's DecimalField type > and when we try to add or

Re: How to Teach Python "Variables"

2007-11-27 Thread hdante
On Nov 26, 7:49 am, Hrvoje Niksic <[EMAIL PROTECTED]> wrote: > greg <[EMAIL PROTECTED]> writes: > > none wrote: > >> IIRC, I once saw an explanation how Python doesn't have > >> "variables" in the sense that, say, C does, and instead has bindings > >> from names to objects. > > > If you're talk

Re: read/write to java socket in python

2007-11-27 Thread madsornomads
On Nov 27, 4:21 pm, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: > On Tue, 27 Nov 2007 07:08:04 -0800 (PST), [EMAIL PROTECTED] wrote: > >Hi all, > > >I have a problem with reading from a Java server after I have written > >to it - it just hangs. It works fine if I just write to the server and > >

Pulling data from a .asps site

2007-11-27 Thread hall . jeff
There's a government website which shows public data for banks. We'd like to pull the data down programmatically but the data is "hidden" behind .aspx... Is there anyway in Python to hook in directly to a browser (firefox or IE) to do the following... 1) Fill the search criteria 2) Press the "Sea

Re: read/write to java socket in python

2007-11-27 Thread James Matthews
It's a socket interface it should be universal! On Nov 27, 2007 4:08 PM, <[EMAIL PROTECTED]> wrote: > Hi all, > > I have a problem with reading from a Java server after I have written > to it - it just hangs. It works fine if I just write to the server and > not try to write. I have read the HOWT

Fwd: Pulling data from a .asps site

2007-11-27 Thread Todd O'Bryan
-- Forwarded message -- From: Todd O'Bryan <[EMAIL PROTECTED]> Date: Nov 27, 2007 1:48 PM Subject: Re: Pulling data from a .asps site To: [EMAIL PROTECTED] Check out Selenium Remote Control! It's very easy to use. On Nov 27, 2007 1:37 PM, <[EMAIL PROTECTED]> wrote: > There's a

Re: How to Teach Python "Variables"

2007-11-27 Thread Robin Kåveland Hansen
Aurélien Campéas <[EMAIL PROTECTED]> wrote (Sun, 25 Nov 2007 20:09:59 +0100): > none a écrit : > > That's something I've often heard and I don't get it. Somehow I don't > understand how C variables are not like python bindings (the differences > being that C variables are statically typed and c

Re: spawning a process with subprocess

2007-11-27 Thread bhunter
Wow, everyone. Great comments. Thanks so much! A few points on all of the above, just so I don't look too stupid: * The problem with the testcase, I believe, was the size of the file and the output pipe filling up, as Nick suggested. When run on a smaller file, with Jordan's suggestions, it wo

Re: How to Teach Python "Variables"

2007-11-27 Thread Brian Blais
On Nov 27, 2007, at Nov 27:1:21 PM, hdante wrote: This shouldn't confuse a C programmer if he understands that assignment changes the pointer address, instead of copying the value: Coming from C, I found the pointer analogy to work pretty well, but in my head I always felt that integers (o

Re: How to Teach Python "Variables"

2007-11-27 Thread Aaron Watters
On Nov 27, 11:52 am, "Chris Mellon" <[EMAIL PROTECTED]> wrote: > > I would try to avoid talking > > in generalities about python variables versus C or > > lisp or whatever, unless I was teaching an upper division > > college programming languages survey class. > > I disagree, although it's not real

Re: read/write to java socket in python

2007-11-27 Thread madsornomads
On Nov 27, 4:29 pm, hdante <[EMAIL PROTECTED]> wrote: > On Nov 27, 1:08 pm, [EMAIL PROTECTED] wrote: > > > > > Hi all, > > > I have a problem with reading from a Java server after I have written > > to it - it just hangs. It works fine if I just write to the server and > > not try to write. I have

Re: Looking for a Python tutor

2007-11-27 Thread James Matthews
Please post on the job section! On Nov 27, 2007 6:46 PM, hong2221 <[EMAIL PROTECTED]> wrote: > I'm looking for a Python programmar that is willing write simple > functions, prices can be talked over. Contact me asap. > -- > http://mail.python.org/mailman/listinfo/python-list > -- http://searc

create pywintypes.CreateGuid() compatible guids on Linux ?

2007-11-27 Thread GHUM
Hello, I created lots of guids via pywintypes.CreateGuid() on windows. Now I would like to run the same software on Linux / Solaris / FreeBSD. So I should produce "compatible" GUIDS on that systems. "compatible" having the meaining: "Providing similiar likelehood of collisions". of course "go

Re: How to Teach Python "Variables"

2007-11-27 Thread hdante
On Nov 27, 2:25 pm, Aaron Watters <[EMAIL PROTECTED]> wrote: > > I hope the participants in this thread realize > that this sort of discussion will cause > any programming newbie to immediately melt into the > floor. All right, answering the original question is good. :-P 1) If the students can

Re: Looking for a Python tutor

2007-11-27 Thread Arnaud Delobelle
On Nov 27, 5:46 pm, hong2221 <[EMAIL PROTECTED]> wrote: > I'm looking for a Python programmar that is willing write simple ^^ > functions, prices can be talked over. Contact me asap. You should start with a prospelling :) -- Arnaud -- http://mail.python.org/ma

Re: create pywintypes.CreateGuid() compatible guids on Linux ?

2007-11-27 Thread Chris Mellon
On Nov 27, 2007 1:09 PM, GHUM <[EMAIL PROTECTED]> wrote: > Hello, > > I created lots of guids via pywintypes.CreateGuid() on windows. > > Now I would like to run the same software on Linux / Solaris / > FreeBSD. > > So I should produce "compatible" GUIDS on that systems. "compatible" > having the

Re: How to Teach Python "Variables"

2007-11-27 Thread MonkeeSage
On Nov 27, 11:50 am, Donn Cave <[EMAIL PROTECTED]> wrote: > In contrast, I suspect that someone who learns Python concepts > in terms of explanations like `boxes' or `pointers' or whatnot > is at some disadvantage while that lasts, like translating a > foreign language to your own instead of attac

Re: It works! Was: Installing Python 3000

2007-11-27 Thread André
On Nov 27, 11:17 am, jim-on-linux <[EMAIL PROTECTED]> wrote: > On Tuesday 27 November 2007 07:20, André wrote: > > > > > On Nov 26, 9:59 pm, "André" <[EMAIL PROTECTED]> wrote: > > > While I made some progress in trying to install Py3k from source > > > (for the first time), it has failed... > > > >

chdir() problem

2007-11-27 Thread Hodginshut
I am trying to get a hold of anyone at Fenix in Thailand. Can you be of any help? Pizza Hut London, Ont. Canada -- http://mail.python.org/mailman/listinfo/python-list

Re: read/write to java socket in python

2007-11-27 Thread Bjoern Schliessmann
[EMAIL PROTECTED] wrote: > I have a problem with reading from a Java server after I have > written to it - it just hangs. It works fine if I just write to > the server and not try to write. Excuse me? > I have read the HOWTO on sockets - and it states that there is a > problem (something about f

Passing arguments to subclasses of unittest.TestCase

2007-11-27 Thread Tom Harris
Hi, Is there a way to pass arguments to TestCases when running tests? I have a test suite that need to be configured slightly differently for 3 different products, and rather than do a hack I wondered if there was a canonical way to do it. I _know_ that py.test can do it trivially. I am rather

Re: Pulling data from a .asps site

2007-11-27 Thread Zepo Len
On Tue, 27 Nov 2007 20:37:19 +0200, <[EMAIL PROTECTED]> wrote: > > There's a government website which shows public data for banks. We'd > like to pull the data down programmatically but the data is "hidden" > behind .aspx... > > Is there anyway in Python to hook in directly to a browser (firefox o

Re: Running unmodified CGI scripts persistently under mod_wsgi.

2007-11-27 Thread Istvan Albert
On Nov 25, 1:55 am, Graham Dumpleton <[EMAIL PROTECTED]> wrote: > The other question is whether there is even a demand for this. Do > people want to be able to take unmodified Python CGI scripts and try > to run them persistently in this way, or would they be better off > converting them to proper

Re: spawning a process with subprocess

2007-11-27 Thread Thomas Bellman
bhunter <[EMAIL PROTECTED]> wrote: > * The problem with the testcase, I believe, was the size of the file > and the output pipe filling up, as Nick suggested. When run on a > smaller file, with Jordan's suggestions, it works fine. With a larger > file, it's necessary to do as Nick says. If the

Re: Should proxy objects lie about their class name?

2007-11-27 Thread John J. Lee
"Diez B. Roggisch" <[EMAIL PROTECTED]> writes: > John J. Lee schrieb: >> [EMAIL PROTECTED] (John J. Lee) writes: >> >>> Not much to add to the subject line. I mean something like this: >>> >>> ProxyClass.__name__ = ProxiedClass.__name__ >>> >>> >>> I've been told that this is common practice. Is

get mouse

2007-11-27 Thread Shawn Minisall
I'm just trying to test and see if the get mouse statements are working in my program. If they are, in the console window, it should go back to the prompt. It doesn't for all of them, just the last rectangle...sometimes. Am I setting them up correctly? here's the relevant code...thx The f

Re: fork/exec with input redirection

2007-11-27 Thread Dan Upton
> > > ./gobmk_base.linux_x86 --quiet --mode gtp < 13x13.tst > > > > > The only thing I could really think of to try was > > > > >os.execv("./gobmk_base.linux_x86", ["./gobmk_base.linux_x86", > > > "--quiet", "--mode", "gtp", "<", "13x13.tst"]) > > > > > but this apparently doesn't work. Is the

Re: How to Teach Python "Variables"

2007-11-27 Thread Aaron Watters
On Nov 27, 2:20 pm, MonkeeSage <[EMAIL PROTECTED]> wrote: > On Nov 27, 11:50 am, Donn Cave <[EMAIL PROTECTED]> wrote: > I agree with your point, but I think the distinction is this: > pedagogical analogies should be truly *analogous* -- they should not > be "analogies" that are only vaguely si

Re: Pulling data from a .asps site

2007-11-27 Thread Diez B. Roggisch
[EMAIL PROTECTED] schrieb: > There's a government website which shows public data for banks. We'd > like to pull the data down programmatically but the data is "hidden" > behind .aspx... > > Is there anyway in Python to hook in directly to a browser (firefox or > IE) to do the following... > > 1)

Re: Passing arguments to subclasses of unittest.TestCase

2007-11-27 Thread Diez B. Roggisch
Tom Harris schrieb: > Hi, > > Is there a way to pass arguments to TestCases when running tests? I have > a test suite that need to be configured slightly differently for 3 > different products, and rather than do a hack I wondered if there was a > canonical way to do it. > > I _know_ that py.t

  1   2   >