Re: joining files

2010-05-17 Thread Dave Angel
mannu jha wrote: On Sun, 16 May 2010 13:52:31 +0530 wrote mannu jha wrote: Hi, I have few files like this: file1: 22 110.1 33 331.5 22.7 5 271.9 17.2 33.4 4 55.1 file1 has total 4 column but some of them are missing in few row. file2: 5 H 22

Re: Human word reader

2010-05-17 Thread Gregory Ewing
Dennis Lee Bieber wrote: And is it supposed to handle for london give the weather to me for the london weather give me Or Where can I buy some new weather boarding for my house in London? :-) -- Greg ... Do a search on "natural language p

Re: tone generation for motherboard and sound card speakers?

2010-05-17 Thread Gaby
It is amazing, the Ballon Bleu de Cartier Replica Watches at http://www.swizwatch.com/ are perfect, cheap and high quality. Ballon Bleu de Cartier Watches Collection: http://www.swizwatch.com/ballon-bleu-de-cartier-replica-watches.html Replica Cartier Ballon Bleu de Cartier Two-Tone Ladies Watc

Re: Updating values in a dictionary

2010-05-17 Thread Gregory Ewing
On 5/16/2010 1:36 PM, Thomas wrote: row = dict([(x,0) for x in range(3)]) matrix = dict([(x,row) for x in range(-3,4,1)]) matrix[2][1] += 1 matrix[-1][2] += 1 Another possibility is to use a single dict with tuples for the indexes. matrix = dict([((x, y), 0) for x in range(-3, 4) for y in r

Re: Global variables for python applications

2010-05-17 Thread Gregory Ewing
John Nagle wrote: Also, more compile-time arithmetic becomes possible. But only if their values can be computed at compile time. This leads to a huge can of worms if you want to be able to import named constants from other modules. A large part of what currently happens only at run time would h

Re: tone generation for motherboard and sound card speakers?

2010-05-17 Thread Gregory Ewing
Alex Hall wrote: Also, is there a module to generate tones in Python using the sound card? A module that can beep at a given frequency for a given time using the usual sine wave is okay, but the fancier the better (different waves, sweeping, and so on). My final question will likely hinge upon

Re: Re: joining files

2010-05-17 Thread mannu jha
On Sun, 16 May 2010 23:51:10 +0530 wrote >On 05/16/2010 05:04 PM, Dave Angel wrote: > (You forgot to include the python-list in your response. So it only > went to me. Normally, you just do reply-all to the message) > mannu jha wrote: >> On Sun, 16 May 2010 13:52:31 +0530 wrote >>> mannu jha wrot

reading XML file using python

2010-05-17 Thread shanti bhushan
Hi , i am new to python.i want to read the XML file using python it ,by using DOm or SAX any of them. I want to read the http://www.google.com(any hyper text) from XML and print that. please give me the sample program for this. regards Shanti Bhushan Bangalore,India -- http://mail.python.org/mailm

Re: reading XML file using python

2010-05-17 Thread Stefan Behnel
shanti bhushan, 17.05.2010 10:34: i am new to python.i want to read the XML file using python it ,by using DOm or SAX any of them. I want to read the http://www.google.com (any hyper text) from XML and print that. Note that web sites usually are HTML, not XML. Are you sure you want to read XML

Re: reading XML file using python

2010-05-17 Thread Franz Kelnreiter
2010/5/17 shanti bhushan : > Hi , > i am new to python.i want to read the XML file using python it ,by > using DOm or SAX any of them. > I want to read the http://www.google.com(any hyper text) from XML and > print that. > please give me the sample program for this. Hi Shanti, The question how to r

Re: reading XML file using python

2010-05-17 Thread Simon Brunning
On 17 May 2010 09:34:51 UTC+1, shanti bhushan wrote: > Hi , > i am new to python.i want to read the XML file using python it ,by > using DOm or SAX any of them. > I want to read the http://www.google.com(any hyper text) from XML and > print that. > please give me the sample program for this. Your

Fw: Re: Re: Re: joining files

2010-05-17 Thread mannu jha
Note: Forwarded message attached -- Original Message -- From: "mannu jha"mannu_0...@rediffmail.com To: mannu_0...@rediffmail.com Subject: Re: Re: Re: joining files--- Begin Message --- On Sun, 16 May 2010 23:51:10 +0530 wrote >On 05/16/2010 05:04 PM, Dave Angel wrote: > (You forgot to include the

Re: Global variables for python applications

2010-05-17 Thread Steven D'Aprano
On Mon, 17 May 2010 19:56:15 +1200, Gregory Ewing wrote: > John Nagle wrote: >> Also, more compile-time arithmetic becomes possible. > > But only if their values can be computed at compile time. John said "more", not "everything imaginable can be calculated at compile time" :) Python already d

Issue with PyUnicodeObject type variables

2010-05-17 Thread gmail
A variable whose data type is PyUnicodeObject checked whether it is a UnicodeObject type. Got output as false example : PyUnicodeObject *p; if (PyUnicode_Check(path)) { printf("\nTrue.\n"); } else { printf("\nfalse.\n"); } output: false Confused what went wrong. re

Re: reading XML file using python

2010-05-17 Thread superpollo
Simon Brunning ha scritto: On 17 May 2010 09:34:51 UTC+1, shanti bhushan wrote: Hi , i am new to python.i want to read the XML file using python it ,by using DOm or SAX any of them. I want to read the http://www.google.com(any hyper text) from XML and print that. please give me the sample progr

Re: Issue with PyUnicodeObject type variables

2010-05-17 Thread Stefan Behnel
gmail, 17.05.2010 11:24: A variable whose data type is PyUnicodeObject checked whether it is a UnicodeObject type. Got output as false example : PyUnicodeObject *p; if (PyUnicode_Check(path)) { printf("\nTrue.\n"); } else { printf("\nfalse.\n"); } output: false Doesn't su

Re: reading XML file using python

2010-05-17 Thread Stefan Behnel
superpollo, 17.05.2010 11:24: Simon Brunning ha scritto: On 17 May 2010 09:34:51 UTC+1, shanti bhushan wrote: i am new to python.i want to read the XML file using python it ,by using DOm or SAX any of them. I want to read the http://www.google.com(any hyper text) from XML and print that. please

Re: reading XML file using python

2010-05-17 Thread Simon Brunning
On 17 May 2010 10:43:06 UTC+1, Shanti Bhushan wrote: > Hi simon, > you are right in 2nd paragaraph. > i have a piece of XML with some URLs in it that i want to > extract. > I have no clue from where to get help on this. > Please atleast guide me for document or link where i can get such help > i c

Call for papers: SETP-10, USA, July 2010

2010-05-17 Thread James Heralds
It would be highly appreciated if you could share this announcement with your colleagues, students and individuals whose research is in software engineering, software testing, software quality assurance, software design and related areas. Call for papers: SETP-10, USA, July 2010 The 2010 Internat

Re: Issue with PyUnicodeObject type variables

2010-05-17 Thread mathan kumar
-- Forwarded message -- From: Stefan Behnel To: python-list@python.org Date: Mon, 17 May 2010 11:33:40 +0200 Subject: Re: Issue with PyUnicodeObject type variables gmail, 17.05.2010 11:24: > A variable whose data type is PyUnicodeObject checked whether it is a > UnicodeObject type

Re: platform-independent image copy/paste with Tkinter?

2010-05-17 Thread eb303
On May 15, 4:56 pm, technocake wrote: > Hi. > > Is there a good way to copy from or paste to the clipboard on all > systems running python using Tkinter? > started a small road too it here: > > #!/usr/bin/python > __author__="technocake" > __date__ ="$15.mai.2010 15:53:39$" > > from Tkinter import

Re: parsing XML

2010-05-17 Thread kak...@gmail.com
On May 16, 10:52 am, Stefan Behnel wrote: > Jake b, 16.05.2010 09:40: > > > Check out Amara:http://www.xml3k.org/Amara/QuickRef > > > It looks promising. For a pythonic solution over sax / dom. > > > >>> Iter(doc.team.player) > > # or > > >>> doc.team.player[0].name > > Ah, right, and there's also

Re: Issue with PyUnicodeObject type variables

2010-05-17 Thread Stefan Behnel
mathan kumar, 17.05.2010 12:16: From: Stefan Behnel Doesn't surprise me at all. Could you make sure this is the code you are using? Especially the names 'p' and 'path'? And that you are initialising neither of the two in your code? Tat was a typo mistake instead of *p pls consider *path as fol

Re: an element from a set

2010-05-17 Thread Bryan
Carl Banks wrote: [...] > Random element from a set is such a natural idea. > > Even if we were to modify the set type at the C level to support it, I > can't think of an easy way to get a random element without selection > bias.  For instance, if you start from a random hash code, some > elements

cmd with three arguments

2010-05-17 Thread kak...@gmail.com
Hi pythonistas, While playing with the Python Standard Library, i came across "cmd". So I'm trying to make a console application. Everything works fine, i created many function with do_(self, line) prefix, but when i tried to create a function with more arguments i can't make it work. e.g def

Re: cmd with three arguments

2010-05-17 Thread Tim Chase
On 05/17/2010 07:11 AM, kak...@gmail.com wrote: While playing with the Python Standard Library, i came across "cmd". So I'm trying to make a console application. Everything works fine, i created many function with do_(self, line) prefix, but when i tried to create a function with more argumen

python application question

2010-05-17 Thread a
I am trying to write an application that takes two files from over the internet and plots one against the other i am getting the data ok. if i want to plot it i have to use something like matplotlib? but this doesn't come with the standard installation. so if i want someone else to use this app

Re: cmd with three arguments

2010-05-17 Thread kak...@gmail.com
On May 17, 4:12 pm, Tim Chase wrote: > On 05/17/2010 07:11 AM, kak...@gmail.com wrote: > > > While playing with the Python Standard Library, i came across "cmd". > > So I'm trying to make a console application. Everything works fine, i > > created many function with do_(self, line) prefix, but

Re: cmd with three arguments

2010-05-17 Thread Peter Otten
kak...@gmail.com wrote: > Hi pythonistas, > While playing with the Python Standard Library, i came across "cmd". > So I'm trying to make a console application. Everything works fine, i > created many function with do_(self, line) prefix, but when i > tried to create a function with more argume

pythonic ssh

2010-05-17 Thread John Maclean
hi, pyssh, pexpect, paramiko or creating your your own sockets. what do you use to pythonically ssh to boxes? -- John Maclean MSc. (DIC) BSc. (Hons) Linux Systems and Applications 07739 171 531 -- http://mail.python.org/mailman/listinfo/python-list

Re: abc don't play well with private method

2010-05-17 Thread mouadino
Hello and thanx for your answer it's was very helpful but just to clear some thinks : > There's no such thing as a "private" attribute in Python. The > name-mangling mechanism invoked by "__name" is really meant to avoid > accidental redefinition of the attribute in a derived class. > In this ca

Re: abc don't play well with private method

2010-05-17 Thread mouadino
Hello and thanx for your answer it's was very helpful but just to clear some thinks : > There's no such thing as a "private" attribute in Python. The > name-mangling mechanism invoked by "__name" is really meant to avoid > accidental redefinition of the attribute in a derived class. > In this ca

Re: cmd with three arguments

2010-05-17 Thread kak...@gmail.com
On May 17, 4:34 pm, Peter Otten <__pete...@web.de> wrote: > kak...@gmail.com wrote: > > Hi pythonistas, > > While playing with the Python Standard Library, i came across "cmd". > > So I'm trying to make a console application. Everything works fine, i > > created many function with do_(self, lin

Re: abc don't play well with private method

2010-05-17 Thread mouadino
Hello and thanx for your answer it's was very helpful but just to clear some thinks : > There's no such thing as a "private" attribute in Python. The > name-mangling mechanism invoked by "__name" is really meant to avoid > accidental redefinition of the attribute in a derived class. > In this ca

Re: python application question

2010-05-17 Thread Adam Tauno Williams
On Mon, 2010-05-17 at 06:20 -0700, a wrote: > if i want to plot it i have to use something like matplotlib? but > this doesn't come with the standard installation. so if i want > someone else to use this application, do they have to install > matplotlib themselves or is there a better way? Use P

Re: imports and exec

2010-05-17 Thread Paul Carter
On May 16, 4:22 pm, Patrick Maupin wrote: > On May 16, 1:51 pm, Paul Carter wrote: > > > > > We are using python for our build system. Each subproject dir has a > > python script that builds it. Parent dirs have python scripts that > > recurse into their children and use exec to invoke the python

Re: python application question

2010-05-17 Thread Patrick Maupin
On May 17, 8:20 am, a wrote: > ps someone helped me with enumerate(), which works on the linux but > not on the windows? enumerate() works fine on windows. Perhaps your windows box has a really old Python? Regards, Pat -- http://mail.python.org/mailman/listinfo/python-list

[ANN] doit - automation tool 0.8 released

2010-05-17 Thread Eduardo Schettino
pypi: http://pypi.python.org/pypi/doit homepage: http://python-doit.sourceforge.net/ `doit` comes from the idea of bringing the power of build-tools to execute any kind of task. It will keep track of dependencies between "tasks" and execute them only when necessary. It was designed to be easy to

Re: Access to comp.lang.python

2010-05-17 Thread cjw
On 16-May-10 12:47 PM, Jim Byrnes wrote: Grant Edwards wrote: On 2010-05-16, cjw wrote: On 16-May-10 01:31 AM, James Mills wrote: On Sun, May 16, 2010 at 3:12 PM, Aahz wrote: It's also at least partly due to problems with mail<->news gateways and the differing fields used to maintain threadin

Re: pythonic ssh

2010-05-17 Thread Michael Crute
On Mon, May 17, 2010 at 9:37 AM, John Maclean wrote: > pyssh, pexpect, paramiko or creating your your own sockets. what do you use > to pythonically ssh to boxes? I think the answer to this depends on your goals. Paramiko is the best way to go if you want a pythonic API to ssh but you also will i

Pyserial and pysqlite data types, need advice

2010-05-17 Thread jon vs. python
Hi, I'm trying to store frames received via serial port (using Pyserial) into a sqlite database (using Pysqlite) in order to perform off-line processing. Thus I could use both SQL's power and Python's magic to make everything easier. I'd like my code to be generic and work both for binary and ascii

[jython] Problem with an huge dictionary

2010-05-17 Thread keobox
Hi, I apologize if this is not the right group for posting question related to jython. Please give me the right directions if this is the case. The question is: Is there a limit on the number of entries a dictionary can have i jython? I wrote a little app where my data is stored in a huge diction

[BarCamp] WebWorkersCamp BarCamp: NodeJS, NoSQL, Message Queues, Asynchronous programming, Web Sockets, Distributed Applications, Decentralized Social Networks, buzzword generators...

2010-05-17 Thread Pierre
Hello, AF83 will be holding a barcamp event on Saturday afternoon, July 3rd in Paris (in La Cantine, a famous Parisian tech place). We wanted to let you know about this event and tell you that you would be most welcome if you could join us on that day. In the ever-growing context of real-time web

Re: an element from a set

2010-05-17 Thread Raymond Hettinger
On May 14, 3:24 pm, gerardob wrote: > Hello, let S be a python set which is not empty > (http://docs.python.org/library/sets.html) > > i would like to obtain one element (anyone, it doesn't matter which one) and > assign it to a variable. > > How can i do this? x = next(iter(s)) or you can suppl

Re: [jython] Problem with an huge dictionary

2010-05-17 Thread Allan Davis
KeoBox, Can i look at the jython file you are executing? the ClassFormatException is not with the size of the dictionary. Jython is failing on an import. thanks, -- Allan Davis Member of NetBeans Dream Team http://wiki.netbeans.org/NetB

Installing Lightweight Python

2010-05-17 Thread Nima
I'd like to install python on an embedded system. It's a powerful x86- based computer with the only limitation of having a small-size flash ROM as its secondary storage. So there is no hard drive and the system is booted from the flash memory. The operating system, BusyBox (a flavor of Linux), and

Re: an element from a set

2010-05-17 Thread Terry Reedy
On 5/17/2010 12:53 AM, Carl Banks wrote: Even if we were to modify the set type at the C level to support it, I can't think of an easy way to get a random element without selection bias. At the C level, a (hashed) set is a list with empty slots. So the C function would have to pick random int

OT Pagina sobre programacion en paralelo

2010-05-17 Thread Miguel Beltran R.
Hola Lista, Disculpen el off-topic, pero creo que aqui fue donde una vez postearon un enlace sobre programación en paralelo y explica porque no es el doble de rapido que con 1 micro. Tambien hablaba de que si el algoritmo es log(n) o log(n2) o algo asi ya lo busque en el historial pero no lo enc

Re: A couple questions about classes and inheritance

2010-05-17 Thread Terry Reedy
On 5/16/2010 10:52 PM, Mark Young wrote: You can't subclass Ellipsis. You clipped what I believe you were responding to that I posted: "I believe that in 3.1, the builtin classes with builtin names can be subclassed and and those without cannot. (If you find any exceptionss, please post ;-).

Re: Installing Lightweight Python

2010-05-17 Thread geremy condra
On Mon, May 17, 2010 at 9:12 AM, Nima wrote: > I'd like to install python on an embedded system. It's a powerful x86- > based computer with the only limitation of having a small-size flash > ROM as its secondary storage. So there is no hard drive and the system > is booted from the flash memory. >

Re: OT Pagina sobre programacion en paralelo

2010-05-17 Thread Terry Reedy
On 5/17/2010 12:27 PM, Miguel Beltran R. wrote: Disculpen el off-topic, pero creo que aqui fue donde una vez postearon un enlace sobre programación en paralelo y explica porque no es el doble de rapido que con 1 micro. No me recuerdo algo como esto. Lo dudo mucho. -- http://mail.python.org/

Converting datetime.ctime() values to Unicode

2010-05-17 Thread python
I would like to convert datetime.ctime() values to Unicode. Using Python 2.6.4 running under Windows I can set my locale to Spanish like below: >>> import locale >>> locale.setlocale(locale.LC_ALL, 'esp' ) Then I can pass %a, %A, %b, and %B to ctime() to get day and month names and abbreviations

Re: Engineering numerical format PEP discussion

2010-05-17 Thread Eike Welk
Keith wrote: > I am considering writing a PEP for the inclusion of an engineering > format specifier, and would appreciate input from others. I think it's a good idea. I regularly type numbers into my pocket calculator just to do this conversion. Eike. -- http://mail.python.org/mailman/listi

Re: Converting datetime.ctime() values to Unicode

2010-05-17 Thread python
In researching a solution, I believe locale.getpreferredencoding() might be a better choice (than locale.getdefaultlocale()[ 1 ]) for determining a system's default encoding? In other words change: >>> codePage = locale.getdefaultlocale()[ 1 ] To this: >>> codePage = locale.getpreferredencoding

Re: Converting datetime.ctime() values to Unicode

2010-05-17 Thread Jerry Hill
On Mon, May 17, 2010 at 2:14 PM, wrote: > In researching a solution, I believe locale.getpreferredencoding() might > be a better choice (than locale.getdefaultlocale()[ 1 ]) for determining > a system's default encoding? I haven't used the locale module a lot, but it seems to me that if you're s

Python3 buffer extra byte??

2010-05-17 Thread Dodo
Let's consider this code: #!/usr/bin/python3 import cgi, sys print("Content-type:image/jpeg\n\n") f = open("img.jpg","rb") sys.stdout.flush() sys.stdout.buffer.write( f.read() ) f.close() I receive the file with one padding byte at the start of the file (0x0a) http://www.1pix.org/multi/images/wg

Re: Python3 buffer extra byte??

2010-05-17 Thread Antoine Pitrou
On Mon, 17 May 2010 20:34:21 +0200 Dodo wrote: > Let's consider this code: > > #!/usr/bin/python3 > import cgi, sys > print("Content-type:image/jpeg\n\n") print() adds an additional \n, so there's one too many. Also, HTTP headers should be separated with \r\n, not \n. (besides, under Windows \

Re: Installing Lightweight Python

2010-05-17 Thread Nima Mohammadi
Thanks Geremy :) The majority of installed files (56MB of data) reside in /lib/ python2.6/. So far, I took these steps to make it as compact as possible: 1. I deleted /lib/python2.6/test directory. This reduced the size by 20MB. 2. I deleted .py files (cause the corresponding pyc ones are there).

Re: Installing Lightweight Python

2010-05-17 Thread Nima
Well, I tried to run Python with -v option. It seems that python26.zip is partially loaded but can't be used, because zlib is "unavailable". n...@nima-desktop:~/py$ ./bin/*python -v* Could not find platform independent libraries Could not find platform dependent libraries Consider setting $PYTHO

Re: Installing Lightweight Python

2010-05-17 Thread Nima Mohammadi
Well, I tried to run Python with -v option. It seems that python26.zip is partially loaded but can't be used, because zlib is "unavailable". n...@nima-desktop:~/py$ ./bin/python -v Could not find platform independent libraries Could not find platform dependent libraries Consider setting $PYTHONH

classes and __init__ question

2010-05-17 Thread Alex Hall
Hi all, I am a bit confused about classes. What do you pass a class, since all the actual information is passed to __init__? For example, say you have a dog class. The dog object has a name, a size, and a color. I believe you would say this: class dog(): def __init__(self, name, size, color): s

Re: Installing Lightweight Python

2010-05-17 Thread geremy condra
On Mon, May 17, 2010 at 1:05 PM, Nima wrote: > Well, I tried to run Python with -v option. It seems that python26.zip is > partially loaded but can't be used, because zlib is "unavailable". is the zlib module among the files you've compressed? Geremy Condra -- http://mail.python.org/mailman/lis

Re: classes and __init__ question

2010-05-17 Thread Patrick Maupin
On May 17, 3:19 pm, Alex Hall wrote: > Hi all, > I am a bit confused about classes. What do you pass a class, since all > the actual information is passed to __init__? For example, say you > have a dog class. The dog object has a name, a size, and a color. I > believe you would say this: > > class

How to determine subprocess.Popen() failed when shell=True

2010-05-17 Thread python
Windows version of Python 2.6.4: Is there any way to determine if subprocess.Popen() fails when using shell=True? Popen() successfully fails when shell=False >>> import subprocess >>> p = subprocess.Popen( 'Nonsense.application', shell=False ) Traceback (most recent call last): File "", line 1,

Re: classes and __init__ question

2010-05-17 Thread Chris Rebert
On Mon, May 17, 2010 at 1:19 PM, Alex Hall wrote: > Hi all, > I am a bit confused about classes. What do you pass a class, since all > the actual information is passed to __init__? For example, say you > have a dog class. The dog object has a name, a size, and a color. I > believe you would say th

Re: classes and __init__ question

2010-05-17 Thread Alex Hall
On 5/17/10, Patrick Maupin wrote: > On May 17, 3:19 pm, Alex Hall wrote: >> Hi all, >> I am a bit confused about classes. What do you pass a class, since all >> the actual information is passed to __init__? For example, say you >> have a dog class. The dog object has a name, a size, and a color.

Re: How to determine subprocess.Popen() failed when shell=True

2010-05-17 Thread Chris Rebert
On Mon, May 17, 2010 at 1:45 PM, wrote: > Windows version of Python 2.6.4: Is there any way to determine if > subprocess.Popen() fails when using shell=True? > > Popen() successfully fails when shell=False > import subprocess p = subprocess.Popen( 'Nonsense.application', shell=False ) >

Re: Installing Lightweight Python

2010-05-17 Thread Nima Mohammadi
On May 18, 12:30 am, geremy condra wrote: > On Mon, May 17, 2010 at 1:05 PM, Nima wrote: > > Well, I tried to run Python with -v option. It seems that python26.zip is > > partially loaded but can't be used, because zlib is "unavailable". > > is the zlib module among the files you've compressed? >

Re: classes and __init__ question

2010-05-17 Thread Patrick Maupin
On May 17, 3:55 pm, Alex Hall wrote: > So what is a subclass compared to a class? Are you saying that what is > passed to the class, so what is in the parentheses of the class, is > really the superclass? If so, what is the advantage of doing this; why > not just create a class that is not a sub?

Re: Installing Lightweight Python

2010-05-17 Thread Nima Mohammadi
On May 18, 1:04 am, Nima Mohammadi wrote: > On May 18, 12:30 am, geremy condra wrote: > > > On Mon, May 17, 2010 at 1:05 PM, Nima wrote: > > > Well, I tried to run Python with -v option. It seems that python26.zip is > > > partially loaded but can't be used, because zlib is "unavailable". > > >

Re: Installing Lightweight Python

2010-05-17 Thread Stephen Hansen
On Mon, May 17, 2010 at 2:04 PM, Nima Mohammadi wrote: > On May 18, 12:30 am, geremy condra wrote: > > On Mon, May 17, 2010 at 1:05 PM, Nima wrote: > > > Well, I tried to run Python with -v option. It seems that python26.zip > is > > > partially loaded but can't be used, because zlib is "unavai

Some help needed with small multi-threaded program!

2010-05-17 Thread Oltmans
I've a small multi-threaded program that is written by keeping Producer-Consumer pattern in mind. In the Producer part of the program we create new users by doing a POST to a certain web URL whereas in the Consumer part of the program we try to login newly created users. Problem is that program sor

wxPython: How to get letter colour from TextCtrl

2010-05-17 Thread D. Schramm
Hello, I've got a problem getting the colour of a single letter within the TextCtrl widget: letterstyle = wx.TextAttr() self.p1.GetStyle(self.p1.XYToPosition(0,0),letterstyle) color = letterstyle.GetTextColour() print color This should display the colour value of the very first letter in the

Re: classes and __init__ question

2010-05-17 Thread Ethan Furman
Alex Hall wrote: Hi all, I am a bit confused about classes. What do you pass a class, since all the actual information is passed to __init__? For example, say you have a dog class. The dog object has a name, a size, and a color. I believe you would say this: class dog(): def __init__(self, name

Re: wxPython: How to get letter colour from TextCtrl

2010-05-17 Thread Stef Mientki
On 17-05-2010 23:29, D. Schramm wrote: > Hello, > > I've got a problem getting the colour of a single letter within the > TextCtrl widget: > > letterstyle = wx.TextAttr() > self.p1.GetStyle(self.p1.XYToPosition(0,0),letterstyle) > color = letterstyle.GetTextColour() > print color > > This should di

Re: Picking a license

2010-05-17 Thread Ben Finney
a...@pythoncraft.com (Aahz) writes: > Ben Finney wrote: > >[It is impractical to] sell free software like selling loaves of > >bread, but that's a much more limited case and a far cry from your > >claim [that it's impractical to sell free software]. Selling free > >software is quite practical an

Encoding troubles

2010-05-17 Thread JB
I'm working on the webapp of our company intranet and I had a question about proper handling of user input that's causing encoding issues. Some of the uesrs take notes in Microsoft Office and copy/paste these into textarea's of the webapp. Some of the characters from Word such as hypens (–) and ap

Can't find _sqlite3.so in lib-dynload

2010-05-17 Thread Peng Yu
I compiled python2.6.4 from source. But I can't find _sqlite3.so in the install directory. I thought that _sqlite3.so should be generated to the install directory. Would you please let me know how to fix it? -- Regards, Peng -- http://mail.python.org/mailman/listinfo/python-list

Re: reading XML file using python

2010-05-17 Thread Alessandro Molari
I can suggest you the lxml library at http://codespeak.net/lxml/ I've already used it and I think it works very well, it's more pythonic than the built-in xml library For a simple use of xml functionalities you can read http://codespeak.net/lxml/tutorial.html Alessandro Molari ---

Re: Global variables for python applications

2010-05-17 Thread Rhodri James
On Mon, 17 May 2010 05:29:20 +0100, Steven D'Aprano wrote: On Sun, 16 May 2010 18:57:15 -0700, John Nagle wrote: James Mills wrote: The only place global variables are considered somewhat "acceptable" are as constants in a module shared as a static value. Python really ought to have

Re: Encoding troubles

2010-05-17 Thread Neil Hodgson
JB: > as hypens (–) and apostrophes (’) are in an odd encoding. When passed > to the database using sqlalchemy they appear as – and other > characters. The encoding is UTF-8. Normally the best way to handle encodings is to convert to Unicode strings (unicode(s, "UTF-8")) as soon as possible

Re: Some help needed with small multi-threaded program!

2010-05-17 Thread Bryan
Oltmans wrote: > I've a small multi-threaded program that is written by keeping > Producer-Consumer pattern in mind. [...] > Problem is that program sort of runs fine, however, it never > terminates itself and, more importantly, it doesn't print last-three > lines of the program(which is important

Re: Global variables for python applications

2010-05-17 Thread Giampaolo Rodolà
2010/5/16 Chris Rebert : > On Sun, May 16, 2010 at 10:50 AM, AON LAZIO wrote: >> Hi, >>How can I set up global variables for the entire python applications? >> Like I can call and set this variables in any .py files. >>Think of it as a global variable in a single .py file but this is for t

Re: Can't find _sqlite3.so in lib-dynload

2010-05-17 Thread Aahz
In article , Peng Yu wrote: > >I compiled python2.6.4 from source. But I can't find _sqlite3.so in >the install directory. I thought that _sqlite3.so should be generated >to the install directory. > >Would you please let me know how to fix it? Only if you provide some relevant details. Such as,

Re: Can't find _sqlite3.so in lib-dynload

2010-05-17 Thread Peng Yu
On May 17, 6:38 pm, a...@pythoncraft.com (Aahz) wrote: > In article , > Peng Yu   wrote: > > > > >I compiled python2.6.4 from source. But I can't find _sqlite3.so in > >the install directory. I thought that _sqlite3.so should be generated > >to the install directory. > > >Would you please let me kn

Re: Global variables for python applications

2010-05-17 Thread Steven D'Aprano
On Mon, 17 May 2010 23:54:38 +0100, Rhodri James wrote: > On Mon, 17 May 2010 05:29:20 +0100, Steven D'Aprano > wrote: > >> On Sun, 16 May 2010 18:57:15 -0700, John Nagle wrote: >> >>> James Mills wrote: The only place global variables are considered somewhat "acceptable" are as consta

Re: abc don't play well with private method

2010-05-17 Thread Steven D'Aprano
On Mon, 17 May 2010 06:35:11 -0700, mouadino wrote: >> There's no such thing as a "private" attribute in Python. The >> name-mangling mechanism invoked by "__name" is really meant to avoid >> accidental redefinition of the attribute in a derived class. > >> In this case, your attribute is expecte

pickle unable to load collection

2010-05-17 Thread paragk
Hi, I am unable to figure out the cause of python pickle unable to find the collection module. I am getting __import__(module) ImportError: No module named collections when I try to load a pickled object. Details: Python version: Python 2.6 (r26:66721, Oct 2 2008, 11:35:03) [MSC v.1500

Re: pickle unable to load collection

2010-05-17 Thread Steven D'Aprano
On Mon, 17 May 2010 19:02:18 -0700, paragk wrote: > Hi, > > I am unable to figure out the cause of python pickle unable to find the > collection module. > > I am getting > > __import__(module) > ImportError: No module named collections What is the actual value of module? Here's an obvious

Re: Encoding troubles

2010-05-17 Thread Bryan
Neil Hodgson wrote: > JB: > > > as hypens (–) and apostrophes (’) are in an odd encoding. When passed > > to the database using sqlalchemy they appear as – and other > > characters. > >    The encoding is UTF-8. Normally the best way to handle encodings is > to convert to Unicode strings (unicode

getting attributes and methods of class without creating object

2010-05-17 Thread shuvro
Suppose I have a class like this - class myClass(object): def __init__(self): self.a = 10 self.b = 20 def my_method(self,var = 20): self.local_var = var I want to know about its method(__init__ and my_method) and variables(a,b, local_var) without creating the obj

PyCon Australia 2010 program announced

2010-05-17 Thread Richard Jones
Hi all, The program for PyCon Australia 2010, to be held at the Sydney Masonic Center over the weekend of June 26 and 27, has been posted. View the full list of presentations and the schedule at: http://pycon-au.org/2010/conference/ Register here: http://pycon-au.org/reg Richard Jone

Re: getting attributes and methods of class without creating object

2010-05-17 Thread Patrick Maupin
On May 17, 10:52 pm, shuvro wrote: > Suppose I have a class like this - > > class myClass(object): > >     def __init__(self): >         self.a = 10 >         self.b = 20 > >     def my_method(self,var = 20): >         self.local_var = var > > I want to know about its method(__init__ and my_method

url fetching from xml depending upon selection

2010-05-17 Thread shanti bhushan
I have a sample.XML file the code is like this My Podcasts Sun, 07 Mar 2010 15:53:26 GMT Sun, 07 Mar 2010 15:53:26 GMT http://first.co.jp"; /> http://www.google.com"; /> http://www.epaper.times.india.com"; /> http://second.co.jp"; /> http

Is this an ok thing to do in a class

2010-05-17 Thread Vincent Davis
Just wondering if there is a problem with mixing a dictionary into a class like this. Everything seems to work as I would expect. class foo(object): def __init__(self, x): self.letter = dict(a=1,b=2,c=3) self.A=self.letter['a'] self.x=self.letter[x] >>> afoo = foo('b')

Re: url fetching from xml depending upon selection

2010-05-17 Thread shanti bhushan
On May 18, 10:18 am, shanti bhushan wrote: > I have a sample.XML file > the code is like this > > > > >         My Podcasts >         Sun, 07 Mar 2010 15:53:26 > > GMT >         Sun, 07 Mar 2010 15:53:26 > > GMT > > >   >     http://first.co.jp"; /> >     http://www.google.com"; /> >     htt

Re: url fetching from xml depending upon selection

2010-05-17 Thread shanti bhushan
On May 18, 10:18 am, shanti bhushan wrote: > I have a sample.XML file > the code is like this > > > > >         My Podcasts >         Sun, 07 Mar 2010 15:53:26 > > GMT >         Sun, 07 Mar 2010 15:53:26 > > GMT > > >   >     http://first.co.jp"; /> >     http://www.google.com"; /> >     htt

Re: getting attributes and methods of class without creating object

2010-05-17 Thread shuvro
On May 18, 11:50 am, Patrick Maupin wrote: > On May 17, 10:52 pm, shuvro wrote: > > > > > Suppose I have a class like this - > > > class myClass(object): > > >     def __init__(self): > >         self.a = 10 > >         self.b = 20 > > >     def my_method(self,var = 20): > >         self.local_va