ANN: pyRMChart 0.0.1 is released

2007-11-27 Thread oyster
1. What is it? pyRMChart is an interface to DLL-verison RMChart(http://rmchart.com), which is a free, lightweight and elegant chart creator 2. Dependency? Python + ctypes 3. How to install? a) you should install RMChart and make sure it works. On win2k/me/98, maybe you have to get a copy of

Re: PyMultimethods

2007-11-27 Thread [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote: > On Nov 27, 7:14 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> > wrote: > > I've written a small project that implements multimethods for python. > > Interesting. Were you aware of the article Guido wrote on multimethods > in python? ( www.artima.com/weblogs/viewpost.jsp?thr

Google Highly Open Participation Contest

2007-11-27 Thread Titus Brown
Dear Python community, I'm happy to announce that the Python Software Foundation is part of a new Google Open Source program, the Highly Open Participation Contest. This contest is an effort by Google to engage pre-college students in open source programming: Google is offering prizes and awards f

Re: Catching a segfault in a Python library

2007-11-27 Thread Brian Cole
On Nov 25, 1:37 am, Donn Ingle <[EMAIL PROTECTED]> wrote: > MrJean1 wrote: > > Try catching SIGSEGV using the Python signal module > > > > An example (for SIGALRM) is on the next page > > > > However, it may n

Re: PyMultimethods

2007-11-27 Thread miller . paul . w
On Nov 27, 7:14 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > I've written a small project that implements multimethods for python. Interesting. Were you aware of the article Guido wrote on multimethods in python? ( www.artima.com/weblogs/viewpost.jsp?thread=101605 ) Although I'm a decent p

Need some help with 'with'

2007-11-27 Thread Mike Kent
I recently found myself needing to do this a lot: lock a record in a file read the record into a buffer alter the buffer write the buffer back to the record unlock the record I'd love to be able to create a context for this to use with the 'with' statement, something like: from __future__ import

Re: Books on Python

2007-11-27 Thread BartlebyScrivener
On Nov 27, 9:05 pm, "barcaroller" <[EMAIL PROTECTED]> wrote: > Can someone kindly recommend some good books on the following: > > Python for beginners > Python for advanced users > http://wiki.python.org/moin/PythonBooks -- http://mail.python.org/mailman/listinfo/python-list

ANN: Wing IDE 3.0.2 released

2007-11-27 Thread Stephan Deibel
Hi, I'm happy to announce version 3.0.2 of Wing IDE, an advanced development environment for the Python programming language. It is available from: http://wingware.com/downloads This release focuses on fixing usability issues found in Wing 3.0.1, including missed Search in Project matches, failu

Re: How to Teach Python "Variables"

2007-11-27 Thread Steven D'Aprano
On Tue, 27 Nov 2007 10:21:36 -0800, hdante wrote: > Python variables are pointers and that's it. How do I increment a Python variable so that it points to the next address, like I can do with pointers in C, Pascal, and other languages? -- Steven. -- http://mail.python.org/mailman/listinfo/

Python-URL! - weekly Python news and links (Nov 28)

2007-11-27 Thread Gabriel Genellina
QOTW: ""Given that C++ has pointers and typecasts, it's really hard to have a serious conversation about type safety with a C++ programmer and keep a straight face. It's kind of like having a guy who juggles chainsaws wearing body armor arguing with a guy who juggles rubber chickens wearing a T-s

Books on Python

2007-11-27 Thread barcaroller
Can someone kindly recommend some good books on the following: Python for beginners Python for advanced users Is there a bible like Larry Wall's Programming Perl or Bjarne Stroustrup's The C++ Programming Language? -- http://mail.python.org/mailman/listinfo/python-list

Python Nmap Scour sP script for linux

2007-11-27 Thread Daniel Folkes
I made this script for fun. you need to have Nmap installed on your linux computer and it will find all the computers on the network and then run Nmap on it. Hope you enjoy! import os fn = 'i.result' ip = '192.168.1.1-255' ip1 = ip[:3] ips = [] os.system("nmap -sP 192.168.1.1-255 > "+fn) f = o

Re: looking for ocbc example

2007-11-27 Thread Carl K
jay graves wrote: > On Sep 21, 2:43 am, Tim Golden <[EMAIL PROTECTED]> wrote: >> Carl K wrote: >>> It seems there are 2 odbc modules - pyOdbc and mxOdbc - anyone know the >>> difference? >> In short, pyodbc is open source; mxOdbc requires a commercial license. >> pyodbc is a newcomer, but appears

Re: the annoying, verbose self

2007-11-27 Thread Steven D'Aprano
On Tue, 27 Nov 2007 10:11:48 +0100, Bruno Desthuilliers wrote: > Fine. Now since Python let you define your own callable types and your > own descriptors, you can as well have an attribute that behave just like > a method without being an instance of any of the method types - so the > above test d

python as a static library with Visual Studio 2005

2007-11-27 Thread Patrick Stinson
There doesn't seem to be any clear documentation on how to build python as a static library using Visual Studio 2005. Everything builds, links, and runs fine using python as a dll, but I get a ton of unresolved symbols using a static library. I defined Py_NO_ENABLE_SHARED=1 in the library project

Re: Different kinds of Import Errors

2007-11-27 Thread Graham Dumpleton
On Nov 28, 12: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

Re: Pulling data from a .asps site

2007-11-27 Thread Tim Williams
On 27/11/2007, [EMAIL PROTECTED] <[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 or > IE

[RFC] PyMultimethods

2007-11-27 Thread [EMAIL PROTECTED]
I've written a small project that implements multimethods for python. I'd like anyone who's interested to check out the code and give me some feedback, such as what features they would like to see added, what could be improved, etc. This is actually one of my first projects I did with python. I d

Re: Global variables within classes.

2007-11-27 Thread Hrvoje Niksic
Kevac Marko <[EMAIL PROTECTED]> writes: > When changing default value, is there any way to change class > attribute and all referenced attributes too? > > class M: > name = u"Marko" > > a, b = M(), M() > a.name = u"Kevac" > print M.name, a.name, b.name > -> Marko Kevac Marko > > Is there any w

Re: Contextmenu in a QTreeWidget with PyQT

2007-11-27 Thread [EMAIL PROTECTED]
On Nov 22, 8:30 am, David Boddie <[EMAIL PROTECTED]> wrote: > On Wed Nov 21 19:46:48 CET 2007,blavenwrote: > > > I apologize in advance if this is not the correct forum to ask this > > and if someone knows a better place, please let me know. > > There is a mailing list for PyQt/PyKDE issues: > > h

Re: string conversion latin2 to ascii

2007-11-27 Thread John Machin
On Nov 28, 8:45 am, [EMAIL PROTECTED] wrote: > On Nov 27, 3:35 pm, Martin Landa <[EMAIL PROTECTED]> wrote: > > > Hi all, > > > sorry for a newbie question. I have unicode string (or better say > > latin2 encoding) containing non-ascii characters, e.g. > > > s = "Ukázka_možnosti_využití_programu_Ope

Re: Global variables within classes.

2007-11-27 Thread Kevac Marko
On Nov 10, 8:39 pm, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > > Don't think so. It's a surprise for many but then class attributes are > not that common in code or they even use this "gotcha" for > immutable default values. As long a the value isn't changed the default > value is just

Re: How to Teach Python "Variables"

2007-11-27 Thread MonkeeSage
On Nov 27, 2:49 pm, Aaron Watters <[EMAIL PROTECTED]> wrote: > In practice there is too much to understand all at > once and in the beginning you have to say "don't worry about that > right now, consider it magic..." Of course they should > eventually understand it. Of course. But then it really

Re: Different kinds of Import Errors

2007-11-27 Thread kyosohma
On Nov 27, 3:50 pm, [EMAIL PROTECTED] (Aahz) wrote: > In article <[EMAIL PROTECTED]>, > > <[EMAIL PROTECTED]> wrote: > > ># untested > >args = exc.args[0] > >if args.find('management') != -1: > >raise > > YM > > if 'management' in args: > raise > > HTH, HAND ;-) > -- > Aahz ([EMAIL PROTEC

Re: string conversion latin2 to ascii

2007-11-27 Thread Martin v. Löwis
> sorry for a newbie question. I have unicode string (or better say > latin2 encoding) containing non-ascii characters, e.g. > > s = "Ukázka_možnosti_využití_programu_OpenJUMP_v_SOA" That's not a Unicode string (at least in Python 2); it is a latin-2 encoded byte string; it has nothing to do with

Re: Different kinds of Import Errors

2007-11-27 Thread Aahz
In article <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]> wrote: > ># untested >args = exc.args[0] >if args.find('management') != -1: >raise YM if 'management' in args: raise HTH, HAND ;-) -- Aahz ([EMAIL PROTECTED]) <*> http://www.pythoncraft.com/ "Typing is cheap. Thin

Re: string conversion latin2 to ascii

2007-11-27 Thread kyosohma
On Nov 27, 3:35 pm, Martin Landa <[EMAIL PROTECTED]> wrote: > Hi all, > > sorry for a newbie question. I have unicode string (or better say > latin2 encoding) containing non-ascii characters, e.g. > > s = "Ukázka_možnosti_využití_programu_OpenJUMP_v_SOA" > > I would like to convert this string to p

string conversion latin2 to ascii

2007-11-27 Thread Martin Landa
Hi all, sorry for a newbie question. I have unicode string (or better say latin2 encoding) containing non-ascii characters, e.g. s = "Ukázka_možnosti_využití_programu_OpenJUMP_v_SOA" I would like to convert this string to plain ascii (using some lookup table for latin2) to get -> Ukazka_moznos

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

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: 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: 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

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: 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

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: 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: 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

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: 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

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: 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... > > > >

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: 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: 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: 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

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: 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 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: 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

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: 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

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: 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: 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

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: 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 > >

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: 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 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 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: 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

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

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

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

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

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: 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

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: 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: 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: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: 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: 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

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: 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: 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

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: 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: 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: 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 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: 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 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: 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 > ...

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: 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

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: 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

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: 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

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: 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

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 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

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: 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

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

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

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

  1   2   >