Re: dynamic allocation file buffer

2008-09-10 Thread Fredrik Lundh
Steven D'Aprano wrote: You've created a solution to a problem which (probably) only affects a very small number of people, at least judging by your use-cases. Who has a 4GB XML file Getting 4GB XML files from, say, logging processes or databases that can render their output as XML is not tha

Re: Clearing a session and reload() problem (with repro error)

2008-09-10 Thread Gabriel Genellina
En Wed, 10 Sep 2008 00:56:43 -0300, Rafe <[EMAIL PROTECTED]> escribió: On Sep 9, 11:03 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: En Mon, 08 Sep 2008 05:37:24 -0300,Rafe<[EMAIL PROTECTED]> escribió: ... This dependency between modules, applied to all modules in your project, defines a "d

Re: wxpython ms-dos black window popping up in background

2008-09-10 Thread Ulrich Eckhardt
icarus top-posted: > one more question... ...deserves a separate thread. > how do I create a pythonw standalone executable that works on w32, > linux, mac, etc..? Either it is Python, then it is portable but no executable, or it is an executable, then it is standalone but not portable. I'm afrai

Re: XML-RPC "filter"

2008-09-10 Thread luigi . paioro
On 9 Set, 17:55, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > I would go for a slightly different approach: make your server have a > dispatch-method that delegates the calls to the underlying actual > implementation. But *before* that happens, extract the information as > above, and either > >

Re: Deflate with urllib2...

2008-09-10 Thread Gabriel Genellina
En Tue, 09 Sep 2008 16:38:54 -0300, Sam <[EMAIL PROTECTED]> escribió: I'm using urllib2 and accepting gzip and deflate. It turns out that almost every site returns either normal text or gzip. But I finally found one that returns deflate. Here's how I un-gzip: compressedstream = StringIO.St

I want to use a C++ library from Python

2008-09-10 Thread Anders Eriksson
Hello, I have a C++ library compiled as Windows DLL's. It consists of 32 .h and 1 .lib and 1 .dll files. I don't have the source code. How can I create a Python module from these files? // Anders -- English is not my first, or second, language so anything strange, or insulting, is due to the tr

Re: I want to use a C++ library from Python

2008-09-10 Thread Diez B. Roggisch
Anders Eriksson schrieb: Hello, I have a C++ library compiled as Windows DLL's. It consists of 32 .h and 1 .lib and 1 .dll files. I don't have the source code. How can I create a Python module from these files? Did you bother googling? http://www.google.de/search?q=python+c%2B%2B&ie=utf-8&oe

Re: XML-RPC "filter"

2008-09-10 Thread Richard Levasseur
On Sep 9, 8:53 am, Luigi <[EMAIL PROTECTED]> wrote: > Dear all, > > I'm writing an XML-RPC server which should be able to modify the > incoming request before dispatching it. In particular I wand to added > two fixed parameters to the method called: one is the client host > address, and the other i

Re: I want to use a C++ library from Python

2008-09-10 Thread kaer
On 10 sep, 10:00, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > Anders Eriksson schrieb: > > > Hello, > > > I have a C++ library compiled as Windows DLL's. It consists of 32 .h and 1 > > .lib and 1 .dll files. I don't have the source code. > > > How can I create a Python module from these files?

which of these 2 quicksorts is faster?

2008-09-10 Thread process
qsort can handle bigger lists it seems, making less recursive calls before finishing(quicksort blows the stack when sorting range(100,-1000,-1). qsort does more work though right? is there a way to speed up that? is the built-in sort not defined recursively? def quicksort(lista): if len(lista

Re: dynamic allocation file buffer

2008-09-10 Thread Steven D'Aprano
On Wed, 10 Sep 2008 09:26:20 +0200, Fredrik Lundh wrote: > Steven D'Aprano wrote: > >> You've created a solution to a problem which (probably) only affects a >> very small number of people, at least judging by your use-cases. Who >> has a 4GB XML file > > Getting 4GB XML files from, say, logging

Re: which of these 2 quicksorts is faster?

2008-09-10 Thread Fredrik Lundh
process wrote: qsort can handle bigger lists it seems, making less recursive calls before finishing(quicksort blows the stack when sorting range(100,-1000,-1). qsort does more work though right? is there a way to speed up that? is the built-in sort not defined recursively? what makes you thin

Re: Curious: 2134 2004-10-06 08:55:20Z fredrik

2008-09-10 Thread D'Arcy J.M. Cain
On Fri, 5 Sep 2008 04:13:28 +0100 "Akathorn Greyhat" <[EMAIL PROTECTED]> wrote: > I've already fix it, but I don't know what the hell does this line means: > > # $Id: __init__.py 2134 2004-10-06 08:55:20Z fredrik $ > It seens curious, isn't it? http://ximbiot.com/cvs/wiki/CVS--Concurrent%20Ve

Re: max(), sum(), next()

2008-09-10 Thread Luis Zarrabeitia
Quoting Mensanator <[EMAIL PROTECTED]>: > Actualy, I already get the behaviour I want. sum([1,None]) > throws an exception. I don't see why sum([]) doesn't throw > an exception also If you take a "start value" and add to it every element of a list, should the process fail if the list is empty?

Web shopping carts

2008-09-10 Thread Luke Hamilton
Hey People, I am wondering if there are any OS shopping cart application written in python? Regards, Luke Hamilton Solutions Architect RPM Solutions Pty. Ltd. Mobile: 0430 223 558 [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Long lines [was Re: __builtins__ magic behavior]

2008-09-10 Thread Gabriel Genellina
En Sun, 07 Sep 2008 19:30:07 -0300, Steven D'Aprano <[EMAIL PROTECTED]> escribió: Gabriel, could I please ask you to configure your news-reader software or editor to limit the length of each line of your posts to 70 characters wide, as per the common standard for email and Usenet? Your lines a

Re: List of modules available for import inside Python?

2008-09-10 Thread denisbz
> > A quick fix is to replace line 1854 in pydoc.py (ModuleScanner.run) with > > this one: > > >         for importer, modname, ispkg in > >         pkgutil.walk_packages(onerror=lambda name:None): > > > (the onerror argument makes it to ignore all errors) well not all, for example GLUT: Fatal Err

Re: which of these 2 quicksorts is faster?

2008-09-10 Thread process
On Sep 10, 12:29 pm, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > process wrote: > > qsort can handle bigger lists it seems, making less recursive calls > > before finishing(quicksort blows the stack when sorting > > range(100,-1000,-1). > > qsort does more work though right? is there a way to speed

Re: Catching subprocess stdout stream

2008-09-10 Thread Sean DiZazzo
On Sep 8, 8:37 am, Thomas Jansson <[EMAIL PROTECTED]> wrote: > Dear all > > I have tkinkter based frontend to a Fortran based program. I use > subprocess to launch the fortran program as a child process and I wish > to see the output of the fortran program as it is created in the > console. > > The

Re: which of these 2 quicksorts is faster?

2008-09-10 Thread Marc 'BlackJack' Rintsch
On Wed, 10 Sep 2008 03:17:30 -0700, process wrote: > qsort can handle bigger lists it seems, making less recursive calls > before finishing(quicksort blows the stack when sorting > range(100,-1000,-1). It just seems so because that `range()` list is the worst case for `quicksort()` but not for `

Re: which of these 2 quicksorts is faster?

2008-09-10 Thread Christian Heimes
Fredrik Lundh wrote: what makes you think you can write a better sort than the built-in algorithm by typing in some toy quick-sort implementations from a "sorting for dummies" article? Anybody who can FULLY understand Tim's text at http://svn.python.org/projects/python/branches/release25-maint

Re: Catching subprocess stdout stream

2008-09-10 Thread Fredrik Lundh
Sean DiZazzo wrote: while aThread.isAlive() or not aQueue.empty(): l = aQueue.get().rstrip() fo.write(l) print l fo.close() A bit of fun for a sleepless night... and unless you add a call to time.sleep somewhere in that loop, you'll keep your CPU up all night as well... -- http

Re: which of these 2 quicksorts is faster?

2008-09-10 Thread Christian Heimes
Fredrik Lundh wrote: what makes you think you can write a better sort than the built-in algorithm by typing in some toy quick-sort implementations from a "sorting for dummies" article? Anybody who can FULLY understand Tim's text at http://svn.python.org/projects/python/branches/release25-maint

Re: List of modules available for import inside Python?

2008-09-10 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: how can I list all modules that might be importable on my system, without actually importing them all ? I'm pretty sure I mentioned a way to do that back when this thread was opened. let's see, yes, here it is: ... there's a helper script in the 2.5 source c

Re: wxpython ms-dos black window popping up in background

2008-09-10 Thread James A. Donald
On Tue, 9 Sep 2008 14:35:13 -0700 (PDT), icarus <[EMAIL PROTECTED]> wrote: > Oh ok. Thanks. In windows xp I just renamed the file extension to .pyw > That did it. > > one more question... > > how do I create a pythonw standalone executable that works on w32, > linux, mac, etc..? I have noticed

Re: Web shopping carts

2008-09-10 Thread Tino Wildenhain
Luke Hamilton wrote: Hey People, I am wondering if there are any OS shopping cart application written in python? Yes there are. HTH Tino smime.p7s Description: S/MIME Cryptographic Signature -- http://mail.python.org/mailman/listinfo/python-list

ImportError: No module named zipextimporter on py2exe when { "compressed": 0 }

2008-09-10 Thread Barak, Ron
Hi, I'm trying to compile using py2exe, and am getting the following: $ python_win Setup.py py2exe running py2exe creating c:\Documents and Settings\rbarak\rbarak_devel\dpm09\build creating c:\Documents and Settings\rbarak\rbarak_devel\dpm09\build\bdist.win32 creating c:\Documents and Settings\r

Re: I want to use a C++ library from Python

2008-09-10 Thread Diez B. Roggisch
kaer wrote: > On 10 sep, 10:00, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: >> Anders Eriksson schrieb: >> >> > Hello, >> >> > I have a C++ library compiled as Windows DLL's. It consists of 32 .h >> > and 1 .lib and 1 .dll files. I don't have the source code. >> >> > How can I create a Python mo

Re: List of modules available for import inside Python?

2008-09-10 Thread Michele Simionato
On Sep 10, 1:45 pm, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > >    how can I list all modules that might be importable on my system, > >    without actually importing them all ? > > I'm pretty sure I mentioned a way to do that back when this thread was > opened.  let's s

Re: Web shopping carts

2008-09-10 Thread Luke Hamilton
Thanks... Do you happen to have anymore details? > From: Tino Wildenhain <[EMAIL PROTECTED]> > Date: Wed, 10 Sep 2008 06:52:40 -0500 > To: Luke Hamilton <[EMAIL PROTECTED]> > Cc: "python-list@python.org" > Subject: Re: Web shopping carts > > Luke Hamilton wrote: >> Hey People, >> >> I am wond

Re: Catching subprocess stdout stream

2008-09-10 Thread Michele Simionato
On Sep 8, 5:37 pm, Thomas Jansson <[EMAIL PROTECTED]> wrote: > Dear all > > I have tkinkter based frontend to a Fortran based program. I use > subprocess to launch the fortran program as a child process and I wish > to see the output of the fortran program as it is created in the > console. > > The

Re: List of modules available for import inside Python?

2008-09-10 Thread Fredrik Lundh
Michele Simionato wrote: I have just tried the following on my Ubuntu box with the system Python: ~$ python /usr/lib/python2.5/doc/tools/listmodules.py /usr/lib/python2.5/doc/tools/listmodules.py:99: DeprecationWarning: the rgbimg module is deprecated __import__(m) ** (process:24863): WARNIN

Re: Web shopping carts

2008-09-10 Thread Fredrik Lundh
Luke Hamilton wrote: Do you happen to have anymore details? Google says "Results 1 - 10 of about 869,000 for python shopping cart." http://www.google.com/search?q=python+shopping+cart Checking the first few pages might give you something that fits your requirements (whatever they are).

Re: I want to use a C++ library from Python

2008-09-10 Thread Christian Heimes
Diez B. Roggisch wrote: Which actually isn't really helpful, as a DLL itself says nothing about what language was used to create it - and sending the OP to e.g. ctypes makes no sense at all in the face of C++. The library - or more precisely the calling convention of the library - is related t

Adding further report options to unittest.py

2008-09-10 Thread Marco Bizzarri
Hi all. I would like to change the way test reports are generated, in a Zope environment. I'm playing with TextTestReport, TextTestRunner. Since things are getting to complicated, I'm afraid I'm following a non-pythonic way. Specifically, I would like to have an output like: package.subpackage.

Python extension, where am I going wrong

2008-09-10 Thread John Vines (CISD/HPCD)
All, I am trying to create an extension module and keep getting an error, "/usr/local/lib/python2.5/site-packages/mytest.so: undefined symbol: PyInitModule" thanks in advance, *Here is my source code and setup.py information: */* mytest.c */ #include #include #include #include static

Re: Adding further report options to unittest.py

2008-09-10 Thread Diez B. Roggisch
Marco Bizzarri wrote: > Hi all. > > I would like to change the way test reports are generated, in a Zope > environment. > > I'm playing with TextTestReport, TextTestRunner. Since things are > getting to complicated, I'm afraid I'm following a non-pythonic way. > > Specifically, I would like to

Re: universal unicode font for reportlab

2008-09-10 Thread Laszlo Nagy
Ross Ridge wrote: Terry Reedy <[EMAIL PROTECTED]> wrote: Sorry, I posted the wrong name. Ariel Unicode MS is the one that seems pretty complete. ... From the MS, I would guess that is a Windows font too ;-). It's made by Microsoft, but it's not a standard Windows font. I th

Re: Web shopping carts

2008-09-10 Thread Tino Wildenhain
Hi, Luke Hamilton wrote: Thanks... Do you happen to have anymore details? Yes well... you guess it was supposed to be a funny comment but would you happen to have anymore details on your requirements as well? Your simple question was just asking for making fun of it. (Other than that please

Re: Python extension, where am I going wrong

2008-09-10 Thread Fredrik Lundh
John Vines (CISD/HPCD) wrote: I am trying to create an extension module and keep getting an error, "/usr/local/lib/python2.5/site-packages/mytest.so: undefined symbol: PyInitModule" it's spelled Py_InitModule, not PyInitModule. -- http://mail.python.org/mailman/listinfo/python-list

PHP's str_replace ?

2008-09-10 Thread Anjanesh Lekshminarayanan
In PHP, if I do str_replace(array('a', 'e', 'i', 'o', 'u'), '-', $str) it'll replace all vowels with a hyphen in string $str. Is there some equivalent in Python ? Thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: Web shopping carts

2008-09-10 Thread Luke Hamilton
> From: Tino Wildenhain <[EMAIL PROTECTED]> > Date: Wed, 10 Sep 2008 08:40:42 -0500 > To: Luke Hamilton <[EMAIL PROTECTED]> > Cc: "python-list@python.org" > Subject: Re: Web shopping carts > > Hi, > > Luke Hamilton wrote: >> Thanks... >> >> Do you happen to have anymore details? > > Yes well

Re: PHP's str_replace ?

2008-09-10 Thread Grzegorz Staniak
On 10.09.2008, Anjanesh Lekshminarayanan <[EMAIL PROTECTED]> wroted: > In PHP, if I do > str_replace(array('a', 'e', 'i', 'o', 'u'), '-', $str) > it'll replace all vowels with a hyphen in string $str. > > Is there some equivalent in Python ? The .translate() method of strings? >>> import string

Re: PHP's str_replace ?

2008-09-10 Thread Matthias Huening
Anjanesh Lekshminarayanan (10.09.2008 15:50): In PHP, if I do str_replace(array('a', 'e', 'i', 'o', 'u'), '-', $str) it'll replace all vowels with a hyphen in string $str. Is there some equivalent in Python ? What about something like this: import re new_str = re.sub('([aeiou])-', r'\1', str)

[Fwd: Re: Python extension, where am I going wrong]

2008-09-10 Thread John Vines (CISD/HPCD)
Yes spelling things correctly does help, got it thanks for the help. --- Begin Message --- John Vines (CISD/HPCD) wrote: I am trying to create an extension module and keep getting an error, "/usr/local/lib/python2.5/site-packages/mytest.so: undefined symbol: PyInitModule" it's spelled Py_

Re: PHP's str_replace ?

2008-09-10 Thread Matthias Huening
Matthias Huening (10.09.2008 16:07): Anjanesh Lekshminarayanan (10.09.2008 15:50): In PHP, if I do str_replace(array('a', 'e', 'i', 'o', 'u'), '-', $str) it'll replace all vowels with a hyphen in string $str. Is there some equivalent in Python ? What about something like this: import re new_

Alternatives to traditional RDBMS

2008-09-10 Thread James Mills
Hi all, Are there any known alternatives to the traditional RDBMS (MySQL, PostgreSQL, SQLite, Oracle, etc0 / I know of 3 written in Python: * buzhug * kirbybase * PyDbLite buzhug - Although buzhug has a group membership size of ~60 or so it has not seen any activity in some time - an

Re: Web shopping carts

2008-09-10 Thread Fredrik Lundh
Luke Hamilton wrote: And unfortunately Google hasn't been much help... "You've got to be very careful if you don't know where you're going, because you might not get there." -- http://mail.python.org/mailman/listinfo/python-list

Re: Python-URL! - weekly Python news and links (Sep 9)

2008-09-10 Thread Pete Forman
"Gabriel Genellina" <[EMAIL PROTECTED]> writes: > QOTW: "So why am I supposed to care about SOAP again? Oh yes, the > wizards I can use to generate 'web service end-points' from > programming language code. My years in the SOAP trenches just > makes me laugh myself half to death at that noti

Re: universal unicode font for reportlab

2008-09-10 Thread Duncan Booth
Laszlo Nagy <[EMAIL PROTECTED]> wrote: > I need to use HTML anyway. I realized that universal unicode fonts are > above 5MB in size. The report would be a 10KB PDF, but I need to embed > the font before I can send it to anyone. Since some reports needs to be > sent in emails, I need to use some

Accessing __slots__ from C

2008-09-10 Thread Chris
Hi, I'd like to be able to access an attribute of a particular Python object as fast as possible from some C code. I wondered if using __slots__ to store the attribute would allow me to do this in a faster way. The reason I'd like to do this is because I need to access the attribute inside a loo

Re: Alternatives to traditional RDBMS

2008-09-10 Thread Tino Wildenhain
James Mills wrote: ... Are there any others out there ? Is anyone working on something ? I would like to continue my work on buzhug... I have so: * Fixed several bugs * Implemented a WSGI middleware layer I'd like to refactor a lot of it's code and make better use of more recent features of p

Re: PHP's str_replace ?

2008-09-10 Thread Grzegorz Staniak
On 10.09.2008, Anjanesh Lekshminarayanan <[EMAIL PROTECTED]> wroted: > In PHP, if I do > str_replace(array('a', 'e', 'i', 'o', 'u'), '-', $str) > it'll replace all vowels with a hyphen in string $str. > > Is there some equivalent in Python ? The .translate() method of strings? >>> import string

Refcount problem in ceval.c

2008-09-10 Thread Berthold Höllmann
I have a problem with my debug Python 2.5.2 executable with Py_REF_DEBUG and Py_TRACE_REFS set. With one of my scripts I get: ... Fatal Python error: Python/ceval.c:947 object at 0x2aa3f4d840 has negative ref count -2604246222170760230 Program received signal SIGABRT, Aborted. [Switching to Thre

dict slice in python (translating perl to python)

2008-09-10 Thread hofer
Hi, Let's take following perl code snippet: %myhash=( one => 1, two => 2, three => 3 ); ($v1,$v2,$v3) = @myhash{qw(one two two)}; # <-- line of interest print "$v1\n$v2\n$v2\n"; How do I translate the second line in a similiar compact way to python? Below is what I tried. I'm just in

Re: Refcount problem in ceval.c

2008-09-10 Thread Christian Heimes
Berthold Höllmann wrote: Is there any "common" reason to for such a strange object on the command stack, or is it more likely that any of my extension modules is causing havoc? It's very likely that your extension has a reference counting bug. It looks like you are either missing a Py_INCREF o

Re: Accessing __slots__ from C

2008-09-10 Thread Christian Heimes
Chris wrote: Hi, I'd like to be able to access an attribute of a particular Python object as fast as possible from some C code. I wondered if using __slots__ to store the attribute would allow me to do this in a faster way. The reason I'd like to do this is because I need to access the attribu

Re: Alternatives to traditional RDBMS

2008-09-10 Thread Diez B. Roggisch
James Mills wrote: > Hi all, > > Are there any known alternatives > to the traditional RDBMS (MySQL, > PostgreSQL, SQLite, Oracle, etc0 / > > I know of 3 written in Python: > * buzhug > * kirbybase > * PyDbLite ZODB. Without any problems usable without ZOPE, clusterable, ACID-conform and so

Re: dict slice in python (translating perl to python)

2008-09-10 Thread Wojtek Walczak
On Wed, 10 Sep 2008 08:28:43 -0700 (PDT), hofer wrote: > Hi, > > Let's take following perl code snippet: > > %myhash=( one => 1, two => 2, three => 3 ); > ($v1,$v2,$v3) = @myhash{qw(one two two)}; # <-- line of interest > print "$v1\n$v2\n$v2\n"; What about: >>> myhash={'one':1, 'two':

Re: dict slice in python (translating perl to python)

2008-09-10 Thread Jon Clements
On 10 Sep, 16:28, hofer <[EMAIL PROTECTED]> wrote: > Hi, > > Let's take following perl code snippet: > > %myhash=( one  => 1    , two   => 2    , three => 3 ); > ($v1,$v2,$v3) = @myhash{qw(one two two)}; # <-- line of interest > print "$v1\n$v2\n$v2\n"; > > How do I translate the second line in a s

md5 differences

2008-09-10 Thread Python
Hi there! I'm trying to match the results of an md5 checksum done in a tcsh shell. I keep getting different results and can't find anything on google... here's an example: [EMAIL PROTECTED]:~% echo "hello" | md5 b1946ac92492d2347c6235b4d2611184 [EMAIL PROTECTED]:~% python Python 2.5.1 (r251:54

Re: PHP's str_replace ?

2008-09-10 Thread Anjanesh Lekshminarayanan
Matthias Huening wrote: Matthias Huening (10.09.2008 16:07): Anjanesh Lekshminarayanan (10.09.2008 15:50): In PHP, if I do str_replace(array('a', 'e', 'i', 'o', 'u'), '-', $str) it'll replace all vowels with a hyphen in string $str. Is there some equivalent in Python ? What about something l

Re: md5 differences

2008-09-10 Thread Fredrik Lundh
Python wrote: I'm trying to match the results of an md5 checksum done in a tcsh shell. I keep getting different results and can't find anything on google... here's an example: [EMAIL PROTECTED]:~% echo "hello" | md5 b1946ac92492d2347c6235b4d2611184 [EMAIL PROTECTED]:~% python Python 2.5.1 (r2

Re: universal unicode font for reportlab

2008-09-10 Thread Ross Ridge
Duncan Booth <[EMAIL PROTECTED]> wrote: >I thought that usually when you embed a font in a PDF only the glyphs which >are actually used in the document get embedded. Unfortunately a quick test >with reportlab seems to show that it doesn't do that optimisation: it looks >as though it just embeds

Re: md5 differences

2008-09-10 Thread Richard Brodie
"Python" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > here's an example: > [EMAIL PROTECTED]:~% echo "hello" | md5 > b1946ac92492d2347c6235b4d2611184 > How do I get the same results? Checksum the same string. >>> md5.new("hello\n").hexdigest() 'b1946ac92492d2347c6235b4d2611184

Re: dict slice in python (translating perl to python)

2008-09-10 Thread B
for a long list, you could try: result = [mydict[k] for k in mydict] or [mydict[k] for k in mydict.keys()] or [mydict[k] for k in mydict.iterkeys()] this won't give you the same order as your code though, if you want them sorted you can use the sorted function: [mydict[k] fo

Generator functions and user interfaces

2008-09-10 Thread [EMAIL PROTECTED]
I'm trying to implement an interactive graph visualisation tool using matplotlib. I want to use a spring layout, where nodes repulse each other and edges act as springs to pull connected nodes together. Usually, this algorithm runs through a number of iterations of attraction/repulsion to allow th

Re: md5 differences

2008-09-10 Thread D'Arcy J.M. Cain
On Wed, 10 Sep 2008 18:25:19 +0200 Python <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED]:~% echo "hello" | md5 > b1946ac92492d2347c6235b4d2611184 > [...] > >>> md5.new("hello").hexdigest() > '5d41402abc4b2a76b9719d911017c592' > > How do I get the same results? Send the same thing. >>> md5.new("

Re: crack registration codes for pogo games

2008-09-10 Thread Jeff & Laura
your site won't come upDo you have the crack for operation mania on pogo.com?-- http://mail.python.org/mailman/listinfo/python-list

Re: dict slice in python (translating perl to python)

2008-09-10 Thread Fredrik Lundh
B wrote: for a long list, you could try: result = [mydict[k] for k in mydict] or [mydict[k] for k in mydict.keys()] or [mydict[k] for k in mydict.iterkeys()] and the point of doing that instead of calling mydict.values() is what? -- http://mail.python.org/mailman/listinfo/python-

Presenting calculation results

2008-09-10 Thread Vedran
Hello! I would like to present the results of the calculations on the web using Python and Apache. Currently I have java console applications that generate text files with results. Can somebody point me in the right direction from where to start? Thanks in advance! -- http://mail.python.org/ma

Re: dict slice in python (translating perl to python)

2008-09-10 Thread B
Fredrik Lundh wrote: B wrote: for a long list, you could try: result = [mydict[k] for k in mydict] or [mydict[k] for k in mydict.keys()] or [mydict[k] for k in mydict.iterkeys()] and the point of doing that instead of calling mydict.values() is what? It's more fun? Or if you

Re: md5 differences

2008-09-10 Thread Python
On 10 sep 2008, at 18:34, Fredrik Lundh wrote: Python wrote: I'm trying to match the results of an md5 checksum done in a tcsh shell. I keep getting different results and can't find anything on google... here's an example: [EMAIL PROTECTED]:~% echo "hello" | md5 b1946ac92492d2347c6235b4d2611

Re: md5 differences

2008-09-10 Thread Python
On 10 sep 2008, at 18:30, Richard Brodie wrote: "Python" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] here's an example: [EMAIL PROTECTED]:~% echo "hello" | md5 b1946ac92492d2347c6235b4d2611184 How do I get the same results? Checksum the same string. md5.new("hello\n").hex

Reading binary data

2008-09-10 Thread Aaron Scott
I've been trying to tackle this all morning, and so far I've been completely unsuccessful. I have a binary file that I have the structure to, and I'd like to read it into Python. It's not a particularly complicated file. For instance: signature char[3] "GDE" version uint32 2 attr_co

Re: md5 differences

2008-09-10 Thread D'Arcy J.M. Cain
On Wed, 10 Sep 2008 19:12:28 +0200 Python <[EMAIL PROTECTED]> wrote: > hmm and this then: > > [EMAIL PROTECTED]:~% echo "test" > test.txt > > [EMAIL PROTECTED]:~% md5 test.txt > MD5 (test.txt) = d8e8fca2dc0f896fd7cb4cb0031ba249 > > [EMAIL PROTECTED]:~% python > Python 2.5.1 (r251:54863, Jan 17 2

Re: Presenting calculation results

2008-09-10 Thread Marco Bizzarri
On Wed, Sep 10, 2008 at 6:46 PM, Vedran <[EMAIL PROTECTED]> wrote: > Hello! > > I would like to present the results of the calculations on the web using > Python and Apache. Currently I have java console applications that > generate text files with results. Can somebody point me in the right > dire

Re: PHP's str_replace ?

2008-09-10 Thread Christian Heimes
Anjanesh Lekshminarayanan wrote: import re new_str = re.sub('[aeiou]', '-', str) Wow - this is neat. Thanks But probably slower and definitely harder to understand. For simple problems the str methods are usually faster than a regular expression. Christian -- http://mail.python.org/mailman

Re: wxpython ms-dos black window popping up in background

2008-09-10 Thread Mike Driscoll
On Sep 10, 6:48 am, James A. Donald <[EMAIL PROTECTED]> wrote: > On Tue, 9 Sep 2008 14:35:13 -0700 (PDT), icarus <[EMAIL PROTECTED]> > wrote: > > > Oh ok. Thanks. In windows xp I just renamed the file extension to .pyw > > That did it. > > > one more question... > > > how do I create a pythonw stan

Re: Reading binary data

2008-09-10 Thread Jon Clements
On 10 Sep, 18:14, Aaron Scott <[EMAIL PROTECTED]> wrote: > I've been trying to tackle this all morning, and so far I've been > completely unsuccessful. I have a binary file that I have the > structure to, and I'd like to read it into Python. It's not a > particularly complicated file. For instance:

Re: Generator functions and user interfaces

2008-09-10 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : I'm trying to implement an interactive graph visualisation tool using matplotlib. I want to use a spring layout, where nodes repulse each other and edges act as springs to pull connected nodes together. Usually, this algorithm runs through a number of iterations of at

Re: Adding further report options to unittest.py

2008-09-10 Thread Marco Bizzarri
On Wed, Sep 10, 2008 at 3:25 PM, Diez B. Roggisch <[EMAIL PROTECTED]> wrote: > Marco Bizzarri wrote: > >> Hi all. >> >> I would like to change the way test reports are generated, in a Zope >> environment. >> > > Have you looked at nosetests? Nose is a test-discovery & running-framework > based upon

File operations

2008-09-10 Thread aditya shukla
Hello folks, I am using Python-2.5.2 on fedora 9 sulphur -2.6.25-14.fc9.i686.I am creating a temporary file , in which data is written by another program and then i am using that temporary file to do my computations.I am new to linux and i am facing two issues homedir = os.path.expanduser('~')

Re: md5 differences

2008-09-10 Thread Wojtek Walczak
On Wed, 10 Sep 2008 19:12:28 +0200, Python wrote: > [EMAIL PROTECTED]:~% echo "test" > test.txt > > [EMAIL PROTECTED]:~% md5 test.txt > MD5 (test.txt) = d8e8fca2dc0f896fd7cb4cb0031ba249 > >>> import md5 > >>> md5.new("/Volumes/data/Arno/test.txt").hexdigest() > '90364ed45b452d43378629c20543a81d'

Re: md5 differences

2008-09-10 Thread Grant Edwards
On 2008-09-10, Python <[EMAIL PROTECTED]> wrote: > > On 10 sep 2008, at 18:30, Richard Brodie wrote: > >> >> "Python" <[EMAIL PROTECTED]> wrote in message >> news:[EMAIL PROTECTED] >> >>> here's an example: >>> [EMAIL PROTECTED]:~% echo "hello" | md5 >>> b1946ac92492d2347c6235b4d2611184 >>> How do

Re: md5 differences

2008-09-10 Thread Grant Edwards
On 2008-09-10, Wojtek Walczak <[EMAIL PROTECTED]> wrote: > On Wed, 10 Sep 2008 19:12:28 +0200, Python wrote: >> [EMAIL PROTECTED]:~% echo "test" > test.txt >> >> [EMAIL PROTECTED]:~% md5 test.txt >> MD5 (test.txt) = d8e8fca2dc0f896fd7cb4cb0031ba249 > >> >>> import md5 >> >>> md5.new("/Volumes/data/

Re: Alternatives to traditional RDBMS

2008-09-10 Thread Daniel Fetchinson
>> Are there any known alternatives >> to the traditional RDBMS (MySQL, >> PostgreSQL, SQLite, Oracle, etc0 / >> >> I know of 3 written in Python: >> * buzhug >> * kirbybase >> * PyDbLite > > ZODB. Without any problems usable without ZOPE, clusterable, ACID-conform > and so forth. There is als

Re: Reading binary data

2008-09-10 Thread Jon Clements
On 10 Sep, 18:33, Jon Clements <[EMAIL PROTECTED]> wrote: > On 10 Sep, 18:14, Aaron Scott <[EMAIL PROTECTED]> wrote: > > > > > I've been trying to tackle this all morning, and so far I've been > > completely unsuccessful. I have a binary file that I have the > > structure to, and I'd like to read i

Re: Reading binary data

2008-09-10 Thread Aaron Scott
> signature, version, attr_count = struct.unpack('3cII', > yourfile.read(11)) > This line is giving me an error: Traceback (most recent call last): File "test.py", line 19, in signature, version, attr_count = struct.unpack('3cII', file.read(12)) ValueError: too many values to unpack -- htt

Re: md5 differences

2008-09-10 Thread Wojtek Walczak
On Wed, 10 Sep 2008 12:39:24 -0500, Grant Edwards wrote: >> The strange thing is that > md5.new("/Volumes/data/Arno/test.txt").hexdigest() >> returns '8dd66a1592e2a8c3ab160822fb237f4d' on my machine. > > Same here. I guess it will be the same for vast majority of us ;-) The question is why i

Re: Reading binary data

2008-09-10 Thread Aaron Scott
> CORRECTION: '3cII' should be '3sII'. Even with the correction, I'm still getting the error. -- http://mail.python.org/mailman/listinfo/python-list

Re: md5 differences

2008-09-10 Thread Grant Edwards
On 2008-09-10, Wojtek Walczak <[EMAIL PROTECTED]> wrote: > On Wed, 10 Sep 2008 12:39:24 -0500, Grant Edwards wrote: > >>> The strange thing is that >> md5.new("/Volumes/data/Arno/test.txt").hexdigest() >>> returns '8dd66a1592e2a8c3ab160822fb237f4d' on my machine. >> >> Same here. > > I guess i

Re: max(), sum(), next()

2008-09-10 Thread Mensanator
On Sep 7, 3:38 pm, Luis Zarrabeitia <[EMAIL PROTECTED]> wrote: > Quoting Mensanator <[EMAIL PROTECTED]>: > > > Actualy, I already get the behaviour I want. sum([1,None]) > > throws an exception. I don't see why sum([]) doesn't throw > > an exception also > > If you take a "start value" and add to i

removing text string

2008-09-10 Thread Ahmed, Shakir
I need to remove text string from the list of the numbers mentioned below: 080829-7_A 070529-5_c 080824-7_O 070405_6_p The output will be : 080829-7 070529-5 080824-7 070405-6 Any idea is

subprocess.Popen hangs at times?

2008-09-10 Thread Kenneth McDonald
When making calls of the form Popen(cmd, shell=True, stdout=subprocess.PIPE), we've been getting occasional, predictable hangs. Will Popen accumulate a certain amount of stdout and then block until its read? We don't want to use threads, so just want to read the entire stdout after the subp

Re: md5 differences

2008-09-10 Thread Python
On 10 sep 2008, at 19:39, Grant Edwards wrote: On 2008-09-10, Wojtek Walczak <[EMAIL PROTECTED]> wrote: On Wed, 10 Sep 2008 19:12:28 +0200, Python wrote: [EMAIL PROTECTED]:~% echo "test" > test.txt [EMAIL PROTECTED]:~% md5 test.txt MD5 (test.txt) = d8e8fca2dc0f896fd7cb4cb0031ba249 import

Gateway to python-list is generating bounce messages.

2008-09-10 Thread Grant Edwards
Could whoever is responsible for the gateway that is grabbing my postings off of Usenet and e-mailing them out please fix the headers in the mail messages so that I don't get the bounce messages? While you're at it, might as well fix it for everybody else too. ;) Its a bit rude to send out mass

Re: Reading binary data

2008-09-10 Thread Wojtek Walczak
On Wed, 10 Sep 2008 10:43:31 -0700 (PDT), Aaron Scott wrote: >> signature, version, attr_count = struct.unpack('3cII', >> yourfile.read(11)) >> > > This line is giving me an error: > > Traceback (most recent call last): > File "test.py", line 19, in > signature, version, attr_count = struct.

emulating read and readline methods

2008-09-10 Thread Sean Davis
I have a large file that I would like to transform and then feed to a function (psycopg2 copy_from) that expects a file-like object (needs read and readline methods). I have a class like so: class GeneInfo(): def __init__(self): #urllib.urlretrieve('ftp://ftp.ncbi.nih.gov/gene/DATA/ g

Re: Reading binary data

2008-09-10 Thread Jon Clements
On Sep 10, 6:45 pm, Aaron Scott <[EMAIL PROTECTED]> wrote: > > CORRECTION: '3cII' should be '3sII'. > > Even with the correction, I'm still getting the error. Me being silly... Quick fix: signature = file.read(3) then the rest can stay the same, struct.calcsize('3sII') expects a 12 byte string, w

  1   2   >