Re: signed vs unsigned int

2010-06-02 Thread Stefan Behnel
johnty, 02.06.2010 08:43: i'm reading bytes from a serial port, and storing it into an array. each byte represents a signed 8-bit int. currently, the code i'm looking at converts them to an unsigned int by doing ord(array[i]). however, what i'd like is to get the _signed_ integer value. whats t

Re: expat parsing error

2010-06-02 Thread kak...@gmail.com
On 2 Ιούν, 03:47, John Machin wrote: > On Jun 2, 1:57 am, "kak...@gmail.com" wrote: > > > > > > > On Jun 1, 11:12 am, "kak...@gmail.com" wrote: > > > > On Jun 1, 11:09 am, John Bokma wrote: > > > > > "kak...@gmail.com" writes: > > > > > On Jun 1, 10:34 am, Stefan Behnel wrote: > > > > >> kak.

Re: signed vs unsigned int

2010-06-02 Thread Steven D'Aprano
On Tue, 01 Jun 2010 23:43:33 -0700, johnty wrote: > i'm reading bytes from a serial port, and storing it into an array. An array or a list? > each byte represents a signed 8-bit int. > > currently, the code i'm looking at converts them to an unsigned int by > doing ord(array[i]). however, what

Re: signed vs unsigned int

2010-06-02 Thread Christian Heimes
> i'm reading bytes from a serial port, and storing it into an array. > > each byte represents a signed 8-bit int. > > currently, the code i'm looking at converts them to an unsigned int by > doing ord(array[i]). however, what i'd like is to get the _signed_ > integer value. whats the easiest way

Re: signed vs unsigned int

2010-06-02 Thread johnty
On Jun 2, 12:04 am, Christian Heimes wrote: > > i'm reading bytes from a serial port, and storing it into an array. > > > each byte represents a signed 8-bit int. > > > currently, the code i'm looking at converts them to an unsigned int by > > doing ord(array[i]). however, what i'd like is to get

Python Forum

2010-06-02 Thread pyDev
Hello, I would like to let the community know that there is a new web-based forum for Python enthusiasts over at PythonForum.org (http:// pythonforum.org). Web-based forums is a preferred method by Python newcomers to get help in exploring the world of Python and programming overall. The main goal

Mixing Decimal and float

2010-06-02 Thread B.V.
Hi, In order to solve some issues due to operations between Decimal and float, we wanted to implement a class that inherits from both float and Decimal. Typically, we wrote: class Float(Decimal, float): ... This can not be achieved because of a TypeError exception (with message "multiple bases h

Re: Python Forum

2010-06-02 Thread Simon Brunning
On 2 June 2010 09:04:56 UTC+1, pyDev wrote: > I hope here will be > someone ready to welcome and help newcomers to enter the beautiful > world of Python. Just send them here, or to . We'll be happy to help. -- Cheers, Simon B. -- http://mail.pytho

Re: plac, the easiest command line arguments parser in the world

2010-06-02 Thread Tim Golden
On 02/06/2010 05:37, Michele Simionato wrote: I would like to announce to the world the first public release of plac: http://pypi.python.org/pypi/plac Plac is a wrapper over argparse and works in all versions of Python starting from Python 2.3 up to Python 3.1. I like it. I'm a constant us

Re: Python Forum

2010-06-02 Thread Stefan Behnel
pyDev, 02.06.2010 10:04: I would like to let the community know that there is a new web-based forum for Python enthusiasts over at PythonForum.org (http:// pythonforum.org). Web-based forums is a preferred method by Python newcomers to get help in exploring the world of Python and programming ove

Re: plac, the easiest command line arguments parser in the world

2010-06-02 Thread Paul Rubin
Tim Golden writes: > pattern, which provides a minimally semi-self-documenting > approach for positional args, but I've always found the existing > offerings just a little too much work to bother with. > I'll give plac a run and see how it behaves. After using optparse a couple of times I got the

Re: Python Forum

2010-06-02 Thread Bruno Desthuilliers
pyDev a écrit : Hello, I would like to let the community know that there is a new web-based forum for Python enthusiasts over at PythonForum.org (http:// pythonforum.org). YetAnotherUselessWebForum :( Web-based forums is a preferred method by Python newcomers to get help Oh yeah ? Chapter

Re: Vote to Add Python Package "pubsub" to the Python Standard Library

2010-06-02 Thread Ben Finney
Daniel Fetchinson writes: > A good example for the first couple of stages of this process is PEP > 3143 concerning adding a daemon package to the stdlib: > http://www.python.org/dev/peps/pep-3143/ Thanks for the shout-out for PEP 3143. I can certainly say that the process Daniel describes was a

Re: plac, the easiest command line arguments parser in the world

2010-06-02 Thread Michele Simionato
On Jun 2, 10:43 am, Paul Rubin wrote: > Tim Golden writes: > > pattern, which provides a minimally semi-self-documenting > > approach for positional args, but I've always found the existing > > offerings just a little too much work to bother with. > > I'll give plac a run and see how it behaves.

Re: plac, the easiest command line arguments parser in the world

2010-06-02 Thread Jean-Michel Pichavant
Michele Simionato wrote: I would like to announce to the world the first public release of plac: http://pypi.python.org/pypi/plac Plac is a wrapper over argparse and works in all versions of Python starting from Python 2.3 up to Python 3.1. With blatant immodesty, plac claims to be the easie

Re: Drawing Multigraphs

2010-06-02 Thread Richard Brodie
"geremy condra" wrote in message news:mailman.825.1275414239.32709.python-l...@python.org... > On Tue, Jun 1, 2010 at 9:42 AM, Nima wrote: >> Hi there, >> Is it possible to draw an (undirected) multigraph using a python library? >> I need to write a program that finds an Eulerian circuit in a

Re: plac, the easiest command line arguments parser in the world

2010-06-02 Thread Stefan Behnel
Paul Rubin, 02.06.2010 10:43: Tim Golden writes: pattern, which provides a minimally semi-self-documenting approach for positional args, but I've always found the existing offerings just a little too much work to bother with. I'll give plac a run and see how it behaves. After using optparse a

Re: plac, the easiest command line arguments parser in the world

2010-06-02 Thread Michele Simionato
On Jun 2, 11:01 am, Stefan Behnel wrote: > I managed to talk a Java-drilled collegue of mine into > writing a Python script for a little command line utility, but he needed a > way to organise his argument extraction code when the number of arguments > started to grow beyond two. I told him that t

Re: Vote to Add Python Package "pubsub" to the Python Standard Library

2010-06-02 Thread Gabriele Lanaro
I definitvely vote for adding such a package to the stdlib (or at least a symilar publish/subscrive and observer implementation). It's useful in a wide range of programs. 2010/6/2 Carl Banks > On May 26, 4:26 am, Tom wrote: > > I vote for adding the Python package "pubsub" to the Python standa

Re: Python Forum

2010-06-02 Thread Adam Tauno Williams
On Wed, 2010-06-02 at 10:44 +0200, Bruno Desthuilliers wrote: > pyDev a écrit : > > Hello, > > I would like to let the community know that there is a new web-based > > forum for Python enthusiasts over at PythonForum.org (http:// > > pythonforum.org). > YetAnotherUselessWebForum :( +1 Yuck; no b

Re: Mixing Decimal and float

2010-06-02 Thread Mark Dickinson
On Jun 2, 9:24 am, "B.V." wrote: > Hi, > > In order to solve some issues due to operations between Decimal and > float, we wanted to implement a class that inherits from both float > and Decimal. > > Typically, we wrote: > > class Float(Decimal, float): Can you explain exactly what issues you wan

optional optional args vs optional positional options

2010-06-02 Thread Antoine Pitrou
On Wed, 2 Jun 2010 01:49:18 -0700 (PDT) Michele Simionato wrote: > > Notice that optparse is basically useless in the use case Tim is > considering (positional arguments) since it only manages options. By the way, could you stop naming these "optional arguments", since positional arguments can b

Re: optional optional args vs optional positional options

2010-06-02 Thread Tim Golden
On 02/06/2010 11:42, Antoine Pitrou wrote: On Wed, 2 Jun 2010 01:49:18 -0700 (PDT) Michele Simionato wrote: Notice that optparse is basically useless in the use case Tim is considering (positional arguments) since it only manages options. By the way, could you stop naming these "optional arg

Re: signed vs unsigned int

2010-06-02 Thread John Machin
On Jun 2, 4:43 pm, johnty wrote: > i'm reading bytes from a serial port, and storing it into an array. > > each byte represents a signed 8-bit int. > > currently, the code i'm looking at converts them to an unsigned int by > doing ord(array[i]). however, what i'd like is to get the _signed_ > inte

Opinion On Best Way...

2010-06-02 Thread Victor Subervi
Hi; I have a script in which I currently pass a number of variables to another script through the url in a meta http-equiv tag. This seems both awkward and hackable. I think it would be best to create a temporary mysql table, insert them there, and pull them from the following script. The situation

Re: Mixing Decimal and float

2010-06-02 Thread B.V.
On Jun 2, 12:22 pm, Mark Dickinson wrote: > On Jun 2, 9:24 am, "B.V." wrote: > > > Hi, > > > In order to solve some issues due to operations between Decimal and > > float, we wanted to implement a class that inherits from both float > > and Decimal. > > > Typically, we wrote: > > > class Float(De

functools.wraps and help()

2010-06-02 Thread Ulrich Eckhardt
Hi! When I use help() on a function, it displays the arguments of the function, along with the docstring. However, when wrapping the function using functools.wraps it only displays the arguments that the (internal) wrapper function takes, which is typically "*args, **kwargs", which isn't very usef

Re: functools.wraps and help()

2010-06-02 Thread Michele Simionato
On Jun 2, 2:20 pm, Ulrich Eckhardt wrote: > Hi! > > When I use help() on a function, it displays the arguments of the function, > along with the docstring. However, when wrapping the function using > functools.wraps it only displays the arguments that the (internal) wrapper > function takes, which

Re: optional optional args vs optional positional options

2010-06-02 Thread J. Cliff Dyer
+1 Options are options, arguments are arguments. An optional argument is not an option. It is an argument that can be left out. On Wed, 2010-06-02 at 12:42 +0200, Antoine Pitrou wrote: > On Wed, 2 Jun 2010 01:49:18 -0700 (PDT) > Michele Simionato wrote: > > > > Notice that optparse is bas

Re: plac, the easiest command line arguments parser in the world

2010-06-02 Thread Michele Simionato
On Jun 2, 6:37 am, Michele Simionato wrote: > With blatant immodesty, plac claims to be the easiest to use command > line arguments parser module in the Python world It seems I have to take that claim back. A few hours after the announce I was pointed out to http://pypi.python.org/pypi/CLIArgs wh

Re: Mixing Decimal and float

2010-06-02 Thread Terry Reedy
On 6/2/2010 8:17 AM, B.V. wrote: A contributor filed an issue on the bug tracker (https:// bugs.tryton.org/roundup/issue1575) and because he's a nice guy (ok it's a friend of mine), he made a patch proposal (http:// codereview.appspot.com/1387041). The end of the story is in the comments of the

Re: python and filter design: calculating "s" optimal transform

2010-06-02 Thread cassiope
On Jun 1, 2:58 pm, Terry Reedy wrote: > On 6/1/2010 2:18 PM, robert somerville wrote: > > > Hi; > > this is an airy question. > > > does anybody have some code or ideas on how to calculate the optimal "S" > > transform of user specified order (wanting the coefficients)  for a > > published filter

Properly posting links (was Re: Python Forum)

2010-06-02 Thread Terry Reedy
On 6/2/2010 4:04 AM, pyDev wrote: forum for Python enthusiasts over at PythonForum.org (http:// pythonforum.org). Web-based forums is a preferred method by Python This is the second time today I have read a post with a useless link wrapped over two lines. Email lists and newsgroups (this is b

Re: Mixing Decimal and float

2010-06-02 Thread B.V.
On 2 juin, 17:08, Terry Reedy wrote: > On 6/2/2010 8:17 AM, B.V. wrote: > > > A contributor filed an issue on the bug tracker (https:// > > bugs.tryton.org/roundup/issue1575) and because he's a nice guy (ok > > it's a friend of mine), he made a patch proposal (http:// > > codereview.appspot.com/13

decorating a memberfunction

2010-06-02 Thread Ulrich Eckhardt
Hi! I have a class that maintains a network connection, which can be used to query and trigger Things(tm). Apart from "normal" errors, a broken network connection and a protocol violation from the peer are something we can't recover from without creating a new connection, so those errors should "s

Re: decorating a memberfunction

2010-06-02 Thread MRAB
Ulrich Eckhardt wrote: Hi! I have a class that maintains a network connection, which can be used to query and trigger Things(tm). Apart from "normal" errors, a broken network connection and a protocol violation from the peer are something we can't recover from without creating a new connection,

Simple hack to get $500 to your home.

2010-06-02 Thread money mania
Simple hack to get $500 to your home at http://dailyupdatesonly.tk Due to high security risks,i have hidden the cheque link in an image. in that website on left side below search box, click on image and enter your name and address where you want to receive your cheque.please dont tell to anyone.

Syntax question

2010-06-02 Thread pmz
Dear Group, It's really rookie question, but I'm currently helping my wife in some python-cases, where I'm non-python developer and some of syntax-diffs make me a bit confused. Could anyone give some light on line, as following: "ds = d[:]" ### where 'd' is an array Let me guess, is it a declar

Re: Syntax question

2010-06-02 Thread Chris Rebert
On Wed, Jun 2, 2010 at 10:40 AM, pmz wrote: > Dear Group, > > It's really rookie question, but I'm currently helping my wife in some > python-cases, where I'm non-python developer and some of syntax-diffs > make me a bit confused. > > Could anyone give some light on line, as following: > "ds = d[:

Re: Syntax question

2010-06-02 Thread geremy condra
On Wed, Jun 2, 2010 at 10:40 AM, pmz wrote: > Dear Group, > > It's really rookie question, but I'm currently helping my wife in some > python-cases, where I'm non-python developer and some of syntax-diffs > make me a bit confused. > > Could anyone give some light on line, as following: > "ds = d[:

Re: Syntax question

2010-06-02 Thread pmz
On 2 Cze, 19:56, geremy condra wrote: > On Wed, Jun 2, 2010 at 10:40 AM, pmz wrote: > > Dear Group, > > > It's really rookie question, but I'm currently helping my wife in some > > python-cases, where I'm non-python developer and some of syntax-diffs > > make me a bit confused. > > > Could anyone

Re: Syntax question

2010-06-02 Thread Matteo Landi
Anyway I suggest you to use a syntax like: >>>b = list(a) in order to copy a list, it should be better than slicing. On Wed, Jun 2, 2010 at 7:56 PM, geremy condra wrote: > On Wed, Jun 2, 2010 at 10:40 AM, pmz wrote: >> Dear Group, >> >> It's really rookie question, but I'm currently helping my

Re: Syntax question

2010-06-02 Thread Matteo Landi
Yes it is; d[i:j] is equal to "give me the array from the d[i] to d[j - 1]", and if you omit i and j then the i and j are respectively assumed as 0 and len(d) - 1. On Wed, Jun 2, 2010 at 8:01 PM, pmz wrote: > On 2 Cze, 19:56, geremy condra wrote: >> On Wed, Jun 2, 2010 at 10:40 AM, pmz wrote: >

Re: Syntax question

2010-06-02 Thread pmz
On 2 Cze, 20:07, Matteo Landi wrote: > Anyway I suggest you to use a syntax like: > > >>>b = list(a) > > in order to copy a list, it should be better than slicing. > > > > > > On Wed, Jun 2, 2010 at 7:56 PM, geremy condra wrote: > > On Wed, Jun 2, 2010 at 10:40 AM, pmz wrote: > >> Dear Group, >

See and Enjoy Indian Girls Gallery.

2010-06-02 Thread preety preety
http://www.teluguscope.com/allfiles/galleryfiles/actressfiles/kajole/1.html http://www.teluguscope.com/allfiles/galleryfiles/actressfiles/aishwaryarai/33.html http://www.teluguscope.com/allfiles/galleryfiles/actressfiles/mallikasherawat/2.html http://www.teluguscope.com/allfiles/galleryfiles/act

Re: multiprocessing and accessing server's stdout

2010-06-02 Thread Bryan
Tim Arnold wrote: > Hi, This is the setup I was asking about. > I've got users using a python-written command line client. They're > requesting services from a remote server that fires a LaTeX process. I > want them to see the stdout from the LaTeX process. So what you really need is to capture th

Re: MySQLDB - server has gone on blob insertion...

2010-06-02 Thread Rami Chowdhury
On Tuesday 01 June 2010 12:46:40 John Nagle wrote: > durumdara wrote: > >>> When I tried to start this, I got error: > >>> _mysql_exceptions.OperationalError: (2006, 'MySQL server has gone > >>> away') > > Are you by any chance trying to do this on a HostGator account? > HostGator servers run

Re: Mixing Decimal and float

2010-06-02 Thread I V
On Wed, 02 Jun 2010 05:17:11 -0700, B.V. wrote: > But trying to be open to other languages, the server implements also an > XMLRPC interface (and also a JSONRPC-like interface). That's the key > point: Decimal is python specific. So in an application, you can't rely > on the value received from a c

Embedding Python in a C extension

2010-06-02 Thread Paul
I have a problem with embedding Python into a C extension in Windows Vista. I have implemented a timer routine in C as an extension, which I can import into Python 2.6.5 and run. Each timer interval, the extension calls a C CALLBACK function. I want to be able to have this CALLBACK function call a

Re: Mixing Decimal and float

2010-06-02 Thread Nathan Rice
My apologies if someone already mentioned this and I missed it but... class.__instancecheck__(self, instance) - Return true if instance should be considered a (direct or indirect) instance of class. If defined, called to implement isinstance(instance, class). class.__subclasscheck__(self, subclas

Re: Converting a pickle to python3

2010-06-02 Thread Paulo da Silva
Em 02-06-2010 04:48, Paulo da Silva escreveu: > Hi! > > I have a big data structure cpickled into a datafile, by python2. > I tried to unpickle it using python3 but got the followin message: > File "/usr/lib64/python3.1/pickle.py", line 1372, in loads > encoding=encoding, errors=errors).load()

Re: multiprocessing and accessing server's stdout

2010-06-02 Thread Bryan
I wrote: > So what you really need is to capture the output of a command, in this > case LaTeX, so you can copy it back to the client. You can do that > with the subprocess module in the Python standard library. > > If the command generated so much output so fast that you felt the need > to avoid t

Re: Mixing Decimal and float

2010-06-02 Thread Steven D'Aprano
On Wed, 02 Jun 2010 17:17:11 -0400, Nathan Rice wrote: > My apologies if someone already mentioned this and I missed it but... > > class.__instancecheck__(self, instance) - Return true if instance should > be considered a (direct or indirect) instance of class. If defined, > called to implement i

Re: Properly posting links

2010-06-02 Thread Ben Finney
Terry Reedy writes: > On 6/2/2010 4:04 AM, pyDev wrote: > > > forum for Python enthusiasts over at PythonForum.org (http:// > > pythonforum.org). Web-based forums is a preferred method by Python > > This is the second time today I have read a post with a useless link > wrapped over two lines. Ema

Re: Mixing Decimal and float

2010-06-02 Thread Chris Rebert
On Wed, Jun 2, 2010 at 4:11 PM, Steven D'Aprano wrote: > On Wed, 02 Jun 2010 17:17:11 -0400, Nathan Rice wrote: >> My apologies if someone already mentioned this and I missed it but... >> >> class.__instancecheck__(self, instance) - Return true if instance should >> be considered a (direct or indi

Re: Embedding Python in a C extension

2010-06-02 Thread MRAB
p...@mail.python.org wrote: I have a problem with embedding Python into a C extension in Windows Vista. I have implemented a timer routine in C as an extension, which I can import into Python 2.6.5 and run. Each timer interval, the extension calls a C CALLBACK function. I want to be able to have

Re: plac, the easiest command line arguments parser in the world

2010-06-02 Thread alex23
Michele Simionato wrote: > It seems I have to take that claim back. A few hours after the > announce I was pointed out tohttp://pypi.python.org/pypi/CLIArgs > which, I must concede, is even easier to use than plac. It seems > everybody has written its own command line arguments parser! I think I

Re: Embedding Python in a C extension

2010-06-02 Thread Carl Banks
On Jun 2, 1:46 pm, Paul Grunau wrote: > I have a problem with embedding Python into a C extension in Windows > Vista. I have implemented a timer routine in C as an extension, which > I can import into Python 2.6.5 and run. Each timer interval, the > extension calls a C CALLBACK function. I want to