Re: Turtle Graphics are incompatible with gmpy

2009-08-05 Thread Ethan Furman
Mensanator wrote: What does this mean? import turtle tooter = turtle.Turtle() *tooter*.tracer Traceback (most recent call last): File "", line 1, in tooter.tracer AttributeError: 'Turtle' object has no attribute 'tracer' tooter.hideturtle() tooter.speed('fast') turtle.update() *

Re: Printing with colors in a portable way

2009-08-05 Thread Aahz
In article <19e16923-b200-498b-9ab2-f7d316b56...@d32g2000yqh.googlegroups.com>, r wrote: >On Aug 2, 9:52=A0pm, a...@pythoncraft.com (Aahz) wrote: > >> Much as I hate to say, use a cross-platform GUI -- Tkinter comes with >> Python, > >Why is Tkinter such a whipping boy of the Python community?

Re: http access produces 503

2009-08-05 Thread Piet van Oostrum
> Rog (R) wrote: >R> I am porting a simple code from Perl, the website asks for usr/pwd and >R> the server's side Perl script makes atemp ftp dir for file upload. >R> The original Perl script connects okay, does its job. The same URL >R> stuffed into FF3 performs the same way. >R> My Python

Re: trouble with complex numbers

2009-08-05 Thread Dr. Phillip M. Feldman
I am using Python 2.5, and most of the cmath functions are not yet available in this version. Thanks! Phillip P.S. In your code, that should be x+= 0J P.P.S. I wish that the documentation indicated anything that is new. Christian Heimes-2 wrote: > > > > phase() has been added to Python 2.

Re: Python configuration question when python scripts are executed using Appweb as web server.

2009-08-05 Thread Gabriel Genellina
En Tue, 04 Aug 2009 10:15:24 -0300, IronyOfLife escribió: On Aug 3, 8:42 pm, "Gabriel Genellina" wrote: En Mon, 03 Aug 2009 11:04:07 -0300, IronyOfLife escribió: > I have installed python 2.6.2 in windows xp professional machine. I > have set the following environment variables -- PYTHONPA

Re: trouble with complex numbers

2009-08-05 Thread Robert Kern
On 2009-08-05 15:16, Dr. Phillip M. Feldman wrote: I am using Python 2.5, and most of the cmath functions are not yet available in this version. Thanks! Phillip P.S. In your code, that should be x+= 0J P.P.S. I wish that the documentation indicated anything that is new. It does. http://doc

Error on Attaching to the process while debugging

2009-08-05 Thread MalC0de
Hello there, I'm writting a debugger, the problem is there no good interpretation ... here's the codes: my_debugger.py : #!/usr/bin/env python from ctypes import * from my_debugger_defines import * kernel32 = windll.kernel32 class debugger(): def __init__(self): self.h_process = No

Re: Is this a bug in multiprocessing or in my script?

2009-08-05 Thread Jesse Noller
On Aug 5, 3:40 pm, sturlamolden wrote: > On 5 Aug, 21:36, sturlamolden wrote: > > >http://svn.python.org/view/python/branches/release26-maint/Lib/multip... > > >http://svn.python.org/view/python/branches/release31-maint/Lib/multip... > > http://svn.python.org/view/python/trunk/Lib/multiprocessing

Web page data and urllib2.urlopen

2009-08-05 Thread Massi
Hi everyone, I'm using the urllib2 library to get the html source code of web pages. In general it works great, but I'm having to do with a financial web site which does not provide the souce code I expect. As a matter of fact if you try: import urllib2 res = urllib2.urlopen("http://www.marketwatc

Re: Is this a bug in multiprocessing or in my script?

2009-08-05 Thread sturlamolden
On 5 Aug, 22:07, Piet van Oostrum wrote: > Calling os.exit in a child process may be dangerous. It can cause > unflushed buffers to be flushed twice: once in the parent and once in > the child. I assume you mean sys.exit. If this is the case, multiprocessing needs a mechanism to chose between os

Re: How to combine regexps?

2009-08-05 Thread Carl Banks
On Aug 5, 1:09 pm, kj wrote: > One of the nice things one can do with Perl's regexp's is illustrated > in the following example: > > my $gly = qr/gg[ucag]/i > my $ala = qr/gc[ucag]/i; > my $val = qr/gu[ucag]/i; > my $leu = qr/uu[ag]|cu[ucag]/i; > my $ile = qr/au[uca]/i; > > my $aliphatic = qr/$gly

Re: How to combine regexps?

2009-08-05 Thread kj
In kj writes: >One of the nice things one can do with Perl's regexp's is illustrated >in the following example: >my $gly = qr/gg[ucag]/i >my $ala = qr/gc[ucag]/i; >my $val = qr/gu[ucag]/i; >my $leu = qr/uu[ag]|cu[ucag]/i; >my $ile = qr/au[uca]/i; >my $aliphatic = qr/$gly|$ala|$val|$leu|$ile/

Re: Parsing Binary Structures; Is there a better way / What is your way?

2009-08-05 Thread Jon Clements
On 5 Aug, 20:41, "Martin P. Hellwig" wrote: > Paul Rubin wrote: > > "Martin P. Hellwig" writes: > >> Is there an advantage using shifts and masks over my kitchen type solution? > > > Weren't you complaining about the 8-to-1 expansion from turning each bit > > to an ascii char? > > Yes you are (of

Re: Turtle Graphics are incompatible with gmpy

2009-08-05 Thread Mensanator
On Aug 5, 3:08 pm, Ethan Furman wrote: > Mensanator wrote: > > > > > > > > > > > What does this mean? > > import turtle > tooter = turtle.Turtle() > *tooter*.tracer > > > Traceback (most recent call last): > >   File "", line 1, in > >     tooter.tracer > > AttributeError: 'Turtle' o

Re: Is this a bug in multiprocessing or in my script?

2009-08-05 Thread sturlamolden
On 5 Aug, 22:28, Jesse Noller wrote: > http://bugs.python.org/issue6653 > > In the future please use the bug tracker to file and track bugs with, > so things are not as lossy. Ok, sorry :) Also see Piet's comment here. He has a valid case against sys.exit in some cases. Thus it appears that bot

[ATTN] Sr. Software Development Engineer

2009-08-05 Thread WordStream
Postion Title - Sr. Software Development Engineer Job Responsibilities The Sr. Software Development Engineer will be responsible for the design, development and implementation of the award-winning WordStream suite of products. Development is presently done primarily using Python on the server and

Re: Do anyone here use Python *embedded* in a database?

2009-08-05 Thread Roger Binns
Jonathan Fine wrote: > anyone here ever used the Python *embedded* in a database server. There is also the case of using SQLite where it shares the same process as your Python code (and nothing else) and is a standard part of the Python library. You can add your own functions and collations and i

Re: Is this a bug in multiprocessing or in my script?

2009-08-05 Thread Jesse Noller
On Aug 5, 4:41 pm, sturlamolden wrote: > On 5 Aug, 22:28, Jesse Noller wrote: > > >http://bugs.python.org/issue6653 > > > In the future please use the bug tracker to file and track bugs with, > > so things are not as lossy. > > Ok, sorry :) > > Also see Piet's comment here. He has a valid case ag

Re: Turtle Graphics are incompatible with gmpy

2009-08-05 Thread Mensanator
On Aug 5, 12:56 pm, Gregor Lingl wrote: > Mensanator schrieb: > > > > > > >> It didn't form 2.5 to 2.6 (at least not intentionally). But with the > >> indroduction of the TurtleScreen class and the Screen class/object > >> (singleton) a few of the turtle methods were also implemented as screen > >

Re: access string data from within cython

2009-08-05 Thread Diez B. Roggisch
Philip Semanchuk schrieb: On Aug 5, 2009, at 1:16 PM, Diez B. Roggisch wrote: Hi, I'm trying to wrap a C-API which has a call that takes a void* and a size_t as arguments. void foo(void *data, size_t length) The wrapper is supposed to be called with a python (byte)string instance, which

Re: Subclassing Python's dict

2009-08-05 Thread Xavier Ho
On Thu, Aug 6, 2009 at 5:23 AM, Joshua Kugler wrote: > Are you referring to Python 3.0? Python 2.6 does not have > collections.UserDict > > j > Yes, I was sometimes it's hard to keep track what's not in 2.6 and in 3.1 for me, sorry. And thanks. The ABC MutableMapping is still valid, though.

Re: access string data from within cython

2009-08-05 Thread Diez B. Roggisch
sturlamolden schrieb: On 5 Aug, 19:16, "Diez B. Roggisch" wrote: void foo(void *data, size_t length) The wrapper is supposed to be called with a python (byte)string instance, which might contain more than one '\0'-character. So how do I access the raw data of a string? cdef extern void foo

Re: access string data from within cython

2009-08-05 Thread Philip Semanchuk
On Aug 5, 2009, at 5:19 PM, Diez B. Roggisch wrote: Philip Semanchuk schrieb: On Aug 5, 2009, at 1:16 PM, Diez B. Roggisch wrote: Hi, I'm trying to wrap a C-API which has a call that takes a void* and a size_t as arguments. void foo(void *data, size_t length) The wrapper is supposed to

Google sitemap generator in python gone?

2009-08-05 Thread Xah Lee
google used to have a sitemap generator written in python, at: https://www.google.com/webmasters/tools/docs/en/sitemap-generator.html but the url is gone. It seems the current version is moved here: http://code.google.com/p/googlesitemapgenerator/ and is written in JavaScript. is the old python

Re: access string data from within cython

2009-08-05 Thread sturlamolden
On 5 Aug, 23:22, "Diez B. Roggisch" wrote: > And that gives me the *full* bytestring, not only until the first zero? > I can't try that right now (not at work anymore), but if it's that easy, > that would be great. It should, and if it does not it is a bug in Cython. The len() function should wo

Re: Google sitemap generator in python gone?

2009-08-05 Thread Jon Clements
On 5 Aug, 22:44, Xah Lee wrote: > google used to have a sitemap generator written in python, at: >  https://www.google.com/webmasters/tools/docs/en/sitemap-generator.html > > but the url is gone. It seems the current version is moved > here:http://code.google.com/p/googlesitemapgenerator/ > and i

Re: Google sitemap generator in python gone?

2009-08-05 Thread Martin P. Hellwig
Jon Clements wrote: Now please piddle off... I am guessing west-midlands? :-) -- MPH http://blog.dcuktec.com 'If consumed, best digested with added seasoning to own preference.' -- http://mail.python.org/mailman/listinfo/python-list

Re: How to combine regexps?

2009-08-05 Thread MRAB
kj wrote: In kj writes: One of the nice things one can do with Perl's regexp's is illustrated in the following example: my $gly = qr/gg[ucag]/i my $ala = qr/gc[ucag]/i; my $val = qr/gu[ucag]/i; my $leu = qr/uu[ag]|cu[ucag]/i; my $ile = qr/au[uca]/i; my $aliphatic = qr/$gly|$ala|$val|$

Re: Turtle Graphics are incompatible with gmpy

2009-08-05 Thread Mensanator
I fixed this to produce the actual image I'm looking for instead of that stupid black square. All I did was use up() & dowm() in place of penup(), pendown() and replace dot(2) with forward(1). I'll be posting a followup report later. import gmpy ## (even) hi| ##| ##

ANN: extprot 0.1.1

2009-08-05 Thread Ryan Kelly
Hi All, Sorry if you get this twice, it seems to have gotten lost on its way through python-announce. I'm pleased to announce the first release of the "extprot" python module. Extprot implements a compact, efficient, extensible and language-neutral object serialisation protocol. License:

Re: trouble with complex numbers

2009-08-05 Thread Steven D'Aprano
On Wed, 05 Aug 2009 15:27:51 -0500, Robert Kern wrote: > On 2009-08-05 15:16, Dr. Phillip M. Feldman wrote: >> I am using Python 2.5, and most of the cmath functions are not yet >> available in this version. Thanks! >> >> Phillip >> >> P.S. In your code, that should be x+= 0J >> >> P.P.S. I wish

using expy to extend python

2009-08-05 Thread Yingjie Lan
Hi, The expy project provides an express way to extend Python. After some careful considerations, I came up with some reasons for expy (this is not an exhaustive list): (I). WYSIWYG. The expy project enables you to write your module in Python the way your extension would be (WYSIWYG), and mea

Re: Install setup tools for 2.6

2009-08-05 Thread Ned Deily
In article <373cf0740908051131gacaf77apba48fa40e929f...@mail.gmail.com>, Jeremy Cowles wrote: > Ok, I feel like this is a really stupid question, but how do you install > setup tools for Python 2.6 under windows? > The only format is .egg which requires setup tools to install, doesn't it? http:

Two Dimensional Array + ctypes

2009-08-05 Thread Sparky
Hello! I am trying to call this method: long _stdcall AIBurst(long *idnum, long demo, long stateIOin, long updateIO, long ledOn, long numChannels, l

Re: Turtle Graphics are incompatible with gmpy

2009-08-05 Thread Mensanator
On Aug 5, 5:31 pm, Mensanator wrote: > I fixed this to produce the actual image I'm looking > for instead of that stupid black square. All I did was > use up() & dowm() in place of penup(), pendown() and > replace dot(2) with forward(1). > > I'll be posting a followup report later. > http://www.m

Programming by Contract

2009-08-05 Thread Ethan Furman
Greetings! I have seen posts about the assert statement and PbC (or maybe it was DbC), and I just took a very brief look at pycontract (http://www.wayforward.net/pycontract/) and now I have at least one question: Is this basically another way of thinking about unit testing, or is the idea of

remove last 76 letters from string

2009-08-05 Thread PeroMHC
Hi All, So here is the problem... I have a FASTA file (used for DNA analyses) that looks like this: ... >gnl|SRA|SRR019045.10.1 SL-XAY_956090708:2:1:0:1028.1 length=152 NCTTTATTGTATAAATGAAGTTTCACTATATCGGACGAGCGGTTCAGCAGTCATTCCGAGAC CGATATAGTGAAACTTCATTTCTACANTACCAAACGTCGCTCGGCAGAGCGTCG

Re: using expy to extend python

2009-08-05 Thread Wolfgang Rohdewald
On Thursday 06 August 2009, Yingjie Lan wrote: > For more information about expy, please visit its homepage at: > http://expy.sf.net/ looks very interesting, bookmarked. In your example class mate, def rename looks wrong: if malloc fails, the previous name should probably not be replaced by an em

String to valid Python identifier

2009-08-05 Thread Дамјан Георгиевски
Is there any easy function in the stdlib to convert any random string in a valid Python identifier .. possibly by replacing non-valid characters with _ ? Python 2.x only, so no need to do Unicode. -- дамјан ( http://softver.org.mk/damjan/ ) Religion ends and philosophy begins, just as alche

Re: remove last 76 letters from string

2009-08-05 Thread Jan Kaliszewski
Dnia 06-08-2009 o 01:54:46 PeroMHC wrote: This snippet represents 3 individual DNA sequences. Each sequences is identified by the line starting with > The complete file has about 10 million individual sequences. A simple enough problem, I want to read in this data, and cut out the last 76 lett

Re: remove last 76 letters from string [sorry, errata]

2009-08-05 Thread Jan Kaliszewski
Dnia 06-08-2009 o 01:54:46 PeroMHC wrote: This snippet represents 3 individual DNA sequences. Each sequences is identified by the line starting with > The complete file has about 10 million individual sequences. A simple enough problem, I want to read in this data, and cut out the last 76 lett

Re: String to valid Python identifier

2009-08-05 Thread MRAB
Дамјан Георгиевски wrote: Is there any easy function in the stdlib to convert any random string in a valid Python identifier .. possibly by replacing non-valid characters with _ ? Python 2.x only, so no need to do Unicode. Lookup the 'maketrans' function in the 'string' module and the 'trans

Re: remove last 76 letters from string

2009-08-05 Thread MRAB
PeroMHC wrote: Hi All, So here is the problem... I have a FASTA file (used for DNA analyses) that looks like this: ... gnl|SRA|SRR019045.10.1 SL-XAY_956090708:2:1:0:1028.1 length=152 NCTTTATTGTATAAATGAAGTTTCACTATATCGGACGAGCGGTTCAGCAGTCATTCCGAGAC CGATATAGTGAAACTTCATTTCTACANTACCAAACG

Re: using expy to extend python

2009-08-05 Thread Yingjie Lan
> From: Wolfgang Rohdewald > Subject: Re: using expy to extend python > To: python-list@python.org > Date: Thursday, August 6, 2009, 3:48 AM > On Thursday 06 August 2009, Yingjie > Lan wrote: > > For more information about expy, please visit its > homepage at: > > http://expy.sf.net/ > > looks v

Re: Install setup tools for 2.6

2009-08-05 Thread Gabriel Genellina
En Wed, 05 Aug 2009 15:31:38 -0300, Jeremy Cowles escribió: Ok, I feel like this is a really stupid question, but how do you install setup tools for Python 2.6 under windows? The only format is .egg which requires setup tools to install, doesn't it? I have no idea, and I try to stay as far

sqlite3 gui

2009-08-05 Thread NighterNet
This took a while to get a gui working. I am new at this coding. This work with sqlite3 Python Version: 3.1.0. The older version doesn't work. #!/usr/local/bin/python ''' This is for basic database access to view the information. Python version: 3.1.0 Features: -view database. -run script -u

Re: Datetime with float seconds

2009-08-05 Thread Gabriel Genellina
En Wed, 05 Aug 2009 09:50:04 -0300, kpal escribió: The standard datetime has 1 microsecond granularity. Note that this is the finest granularity a datetime object can store, NOT the precision of datetime.now() by example. My application needs finer time resolution, preferably float seconds.

Re: Turtle Graphics are incompatible with gmpy

2009-08-05 Thread Gregor Lingl
Mensanator schrieb: On Aug 5, 5:31 pm, Mensanator wrote: I fixed this to produce the actual image I'm looking for instead of that stupid black square. All I did was use up() & dowm() in place of penup(), pendown() and replace dot(2) with forward(1). I'll be posting a followup report later.

Re: unicode() vs. s.decode()

2009-08-05 Thread John Machin
Jason Tackaberry urandom.ca> writes: > On Wed, 2009-08-05 at 16:43 +0200, Michael Ströder wrote: > > These both expressions are equivalent but which is faster or should be used > > for any reason? > > u = unicode(s,'utf-8') > > u = s.decode('utf-8') # looks nicer > > It is sometimes non-obvious w

Re: Turtle Graphics are incompatible with gmpy

2009-08-05 Thread Mensanator
On Aug 5, 7:49 pm, Gregor Lingl wrote: > Mensanator schrieb: > > > On Aug 5, 5:31 pm, Mensanator wrote: > >> I fixed this to produce the actual image I'm looking > >> for instead of that stupid black square. All I did was > >> use up() & dowm() in place of penup(), pendown() and > >> replace dot(

access read / write violation with ctypes

2009-08-05 Thread DH
Hi all, I'm quite new to cytpes and am having some troubles I was hoping I could get a little help with. Before I get into the details this is what I'm trying to accomplish - I would like to read a dng with python pass it through either libraw.dll or dcraw.dll (notes on dcraw.dll version at the en

Re: merge two png pic

2009-08-05 Thread cocobear
On Aug 5, 3:44 pm, News123 wrote: > You didn't really tell us why you need one big file, which contains more > pixel, than you can probably store in RAM > In fact I do not need such a big image. I just want to know the solution. > Is it for printing? > Not knwoing your goal makes it difficult t

Re: Parsing Binary Structures; Is there a better way / What is your way?

2009-08-05 Thread Paul Rubin
"Martin P. Hellwig" writes: > Is there an advantage using shifts and masks over my kitchen type solution? Weren't you complaining about the 8-to-1 expansion from turning each bit to an ascii char? -- http://mail.python.org/mailman/listinfo/python-list

os.system in a service

2009-08-05 Thread Lawrence Wong
Hi, I wrote a program which runs a .bat file using os.system like: 'os.system(pathToBatFile)' and everything was good. Then I decided to turn my program into a service as opposed to being run with the command prompt showing. When my program became a service, I noticed that the os.system comm

Re: Subclassing Python's dict

2009-08-05 Thread alex23
Xavier Ho wrote: > You should subclass collections.UserDict, and not the default dict class. > Refer to the collections module. Xavier, why do you think that is the correct approach? The docs say "The need for this class has been largely supplanted by the ability to subclass directly from dict (a

Re: Python docs disappointing - group effort to hire writers?

2009-08-05 Thread r
On Aug 4, 12:55 am, David Lyon wrote: > It isn't totally about the writers... > Peoples egos are also at stake - it seems. > If "Fred X wrote Doc Y".. they don't want their name taken off.. So > they generally speaking don't want the docs changed. > If you talk too much about docs.. you can be tol

oNVDL validation docbook 5

2009-08-05 Thread Tim Arnold
Hi, I'm using the oNVDL java validator for my DocBook 5.0 documents. Otherwise, my doc system is python. I wonder if there is any work going on (or perhaps something I'm missing) to use python to validate DocBook 5 (using the rng files bundled with the DocBook5 distribution) I think the catch w

Re: Using Python to automate builds

2009-08-05 Thread Tim Arnold
"Kosta" wrote in message news:84d9ae10-3aee-40a8-97ac-05799da0d...@f18g2000prf.googlegroups.com... >I am a Python newbie, tasked with automating (researching) building > Windows drivers using the WDK build environment. I've been looking > into Python for this (instead of writing a bunch of batc

Re: Python docs disappointing - group effort to hire writers?

2009-08-05 Thread RayS
At 08:35 PM 8/5/2009 -0700, r wrote: """... Any real sense of community is undermined -- or even destroyed -- to be replaced by virtual equivalents that strive, unsuccessfully, to synthesize a sense of community.""" I've brought up the idea of the quasi-community doc that PHP uses to good effect

Re: Error on Attaching to the process while debugging

2009-08-05 Thread Dave Angel
MalC0de wrote: Hello there, I'm writting a debugger, the problem is there no good interpretation ... here's the codes: my_debugger.py : #!/usr/bin/env python from ctypes import * from my_debugger_defines import * kernel32 = windll.kernel32 class debugger(): def __init__(self): s

Re: Two Dimensional Array + ctypes

2009-08-05 Thread Gabriel Genellina
En Wed, 05 Aug 2009 20:12:09 -0300, Sparky escribió: Hello! I am trying to call this method: long _stdcall AIBurst(long *idnum, [...] long timeout, float (*voltages)[4], long *stateIOout, long *

Re: Web page data and urllib2.urlopen

2009-08-05 Thread Dave Angel
Massi wrote: Hi everyone, I'm using the urllib2 library to get the html source code of web pages. In general it works great, but I'm having to do with a financial web site which does not provide the souce code I expect. As a matter of fact if you try: import urllib2 res = urllib2.urlopen("http:/

Re: M2Crypto: How to generate subjectKeyIdentifier / authorityKeyIdentifier

2009-08-05 Thread Matthias Güntert
> M2Crypto has a couple of bugs open related that, with potential > workarounds that I haven't yet deemed polished enough to checkin, but > which might help you out: > > https://bugzilla.osafoundation.org/show_bug.cgi?id=7530 > https://bugzilla.osafoundation.org/show_bug.cgi?id=12151 Thanks, that

Re: os.system in a service

2009-08-05 Thread Gabriel Genellina
En Wed, 05 Aug 2009 13:07:39 -0300, Lawrence Wong escribió: I wrote a program which runs a .bat file using os.system like: 'os.system(pathToBatFile)' and everything was good. Then I decided to turn my program into a service as opposed to being run with the command prompt showing. When

Re: Parsing Binary Structures; Is there a better way / What is your way?

2009-08-05 Thread Gabriel Genellina
En Wed, 05 Aug 2009 11:46:13 -0300, Martin P. Hellwig escribió: On several occasions I have needed (and build) a parser that reads a binary piece of data with custom structure. For example (bogus one): BE +-+-+-+-+--++ | Version | Command

Re: access read / write violation with ctypes

2009-08-05 Thread Dave Angel
DH wrote: I'm using popen to capture dcraw stdout and want to pass it to magickwand. If I instead write the dcraw output to a file then read it with magickwand I get the same error. But if I comment out the dcraw protion and read the dcraw output file from the previous attempt, MagickWand opens

Re: Datetime with float seconds

2009-08-05 Thread Hendrik van Rooyen
On Wednesday 05 August 2009 14:50:04 kpal wrote: > Hello Everybody, > > The standard datetime has 1 microsecond granularity. My application > needs finer time resolution, preferably float seconds. Is there an > alternative to the out-of-the-box datetime? Timezone support is not > essential. I am c

Re: Re: Parsing Binary Structures; Is there a better way / What is your way?

2009-08-05 Thread Dave Angel
Paul Rubin wrote: "Martin P. Hellwig" writes: Is there an advantage using shifts and masks over my kitchen type solution? Weren't you complaining about the 8-to-1 expansion from turning each bit to an ascii char? One warning to Martin: If you want your code portable across syste

<    1   2