String To List

2008-03-17 Thread Girish
I have a string a = ['xyz', 'abc'].. I would like to convert it to a list with elements 'xyz' and 'abc'. Is there any simple solution for this?? Thanks for the help... -- http://mail.python.org/mailman/listinfo/python-list

Immutable and Mutable Types

2008-03-17 Thread Bernard Lim
Hi, I'm reading the Python Reference Manual in order to gain a better understanding of Python under the hood. On the last paragraph of 3.1, there is a statement on immutable and mutable types as such: paraphrase Depending on implementation, for immutable types, operations that compute new

Re: Pycon disappointment

2008-03-17 Thread Kay Schluehr
On 16 Mrz., 21:52, Bruce Eckel [EMAIL PROTECTED] wrote: On Mar 16, 2:48 pm, Pete Forde [EMAIL PROTECTED] wrote: My friends and I decided to stage a grassroots Ruby conference this summer; it will have no paid sponsors for exactly this reason. We're trying to change up the typical format as

writing to a binary file without intervening spaces

2008-03-17 Thread Larry
Dear all, I need to write integer values to a binary file that will be read by another application, specifically ENVI. I want to write these values without intervening spaces between values. For example: My data is a = [23, 45, 56, 255]. My desire output is: 234556255, of course in binary file

Re: Immutable and Mutable Types

2008-03-17 Thread Dan Bishop
Bernard Lim wrote: Hi, I'm reading the Python Reference Manual in order to gain a better understanding of Python under the hood. On the last paragraph of 3.1, there is a statement on immutable and mutable types as such: paraphrase Depending on implementation, for immutable types,

Re: String To List

2008-03-17 Thread Dan Bishop
On Mar 17, 1:15 am, Girish [EMAIL PROTECTED] wrote: I have a string a = ['xyz', 'abc'].. I would like to convert it to a list with elements 'xyz' and 'abc'. Is there any simple solution for this?? Thanks for the help... eval(a) will do the job, but you have to be very careful about using that

Re: Strange problem with structs Linux vs. Mac

2008-03-17 Thread Marc 'BlackJack' Rintsch
On Sun, 16 Mar 2008 18:45:19 +0100, Martin Blume wrote: I don't think this qualifies as a bug, but I am astonished that the struct module does not tell you whether you are big endian, you have to find out yourself with struct.unpack('@I', s)[0]==struct.unpack(I, s)[0] Maybe a little more

RE: Urgent : How to do memory leaks detection in python ?

2008-03-17 Thread Pradeep Rai
Thanks for your inputs !!! I have installed python v 2.5 on my Linux machine and executing the tool again. I would like to share the memory status( using free -m command ) before and after the execution of the tool. BEFORE EXECUTION total used

Re: Immutable and Mutable Types

2008-03-17 Thread Ben Finney
Bernard Lim [EMAIL PROTECTED] writes: paraphrase Depending on implementation, for immutable types, operations that compute new values may or may not actually return a reference to any existing object with the same type and value, while for mutable objects this is (strictly)? not allowed.

Re: Why doesn't xmlrpclib.dumps just dump an empty value instead of nil/?

2008-03-17 Thread Marc 'BlackJack' Rintsch
On Sun, 16 Mar 2008 14:21:40 +0100, martin f krafft wrote: Hi, xmlrpclib.dumps((None,), allow_none=True) yields 'params\nparam\nvaluenil//value/param\n/params\n' Why doesn't it just yield 'params\nparam\nvalue//param\n/params\n' Or even just 'params\nparam/\n/params\n'

Europython fees (was PyCon Disappointment)

2008-03-17 Thread Laura Creighton
Björn wrote: I haven't been to EuroPython even when it has been fairly nearby because the entrance fee was to high. But how do you help change something like that? Last year rates were: 100 Euros for early bird, 160 Euros for later registration, 65 Euros for early students and 85 Euros for

Re: PyCon Feedback and Volunteers ( Pycon disappointment)

2008-03-17 Thread Torsten Bronger
Hallöchen! Carl Banks writes: On Mar 16, 10:49 pm, Brian Jones [EMAIL PROTECTED] wrote: On Mar 16, 8:09 pm, [EMAIL PROTECTED] (Aahz) wrote: If you did not like the programming this year (aside from the sponsor talks) and you did not participate in organizing PyCon or in delivering

Re: About reading Python code

2008-03-17 Thread WaterWalk
On Mar 17, 1:54 pm, Stargaming [EMAIL PROTECTED] wrote: On Sun, 16 Mar 2008 20:54:01 -0700, WaterWalk wrote: Hello. I wonder what's the effective way of figuring out how a piece of python code works. If your Python code is well-written, it should be easy figuring out what it means by just

Re: Pycon disappointment

2008-03-17 Thread Paul Rubin
Stephan Deibel [EMAIL PROTECTED] writes: I have to admit, I'll keep coming to PyCon even if all the talks suck abysmally as long as there's good hallway time, open space, BoFs, and sprints. ;-) OK, so why not get rid of all the talks and other stuff, and just have a basically structureless

Re: String To List

2008-03-17 Thread Paul Rubin
Girish [EMAIL PROTECTED] writes: I have a string a = ['xyz', 'abc'].. I would like to convert it to a list with elements 'xyz' and 'abc'. Is there any simple solution for this?? Thanks for the help... Be careful about using eval, if the string came from a potentially hostile source. Maybe

Re: writing to a binary file without intervening spaces

2008-03-17 Thread Paul Rubin
Larry [EMAIL PROTECTED] writes: My data is a = [23, 45, 56, 255]. My desire output is: 234556255, of course in binary file representation already. I tried to make one using write after pack method of struct module, but because of spaces I got incorrect results. struct.pack works for me:

Re: Immutable and Mutable Types

2008-03-17 Thread cokofreedom
a = 1 b = 1 a is b True id(a) 10901000 id(b) 10901000 Isn't this because integers up to a certain range are held in a single memory location, thus why they are the same? -- http://mail.python.org/mailman/listinfo/python-list

Re: Types, Cython, program readability

2008-03-17 Thread Tom Stambaugh
I'm not entirely sure why you think Pyrex should contain a compiler. It certainly works well enough with the free [beer] MS VS 2008 Express and I'm fairly sure it's fine with MingW. Both of those are readily available and I don't imagine anyone who's going to use Pyrex / Cython / ShedSkin is

Re: About reading Python code

2008-03-17 Thread Ben C
On 2008-03-17, WaterWalk [EMAIL PROTECTED] wrote: Hello. I wonder what's the effective way of figuring out how a piece of python code works. With C I often find it very useful to be able to run the code in step mode and set breakpoints in a debugger so I can watch how the it executes, how the

Re: Pycon disappointment

2008-03-17 Thread Tom Stambaugh
But vendors often don't label themselves as vendors. And often, the researcher or individual in question, who has something worth saying, does have a professional job of sorts, which might be related to his or her work or speech. I've heard people give very long, detailed talks about

Re: [PyCON-Organizers] FWD: PyCon Feedback and Volunteers (Re: Pycon disappointment)

2008-03-17 Thread Steve Holden
Aahz wrote: FYI - Forwarded message from Aahz [EMAIL PROTECTED] - From: Aahz [EMAIL PROTECTED] Newsgroups: comp.lang.python Subject: PyCon Feedback and Volunteers (Re: Pycon disappointment) Date: 16 Mar 2008 17:09:02 -0700 Organization: The Cat Dragon [warning: rant ahead]

Re: About reading Python code

2008-03-17 Thread Nir
On Mar 17, 5:54 am, WaterWalk [EMAIL PROTECTED] wrote: Hello. I wonder what's the effective way of figuring out how a piece ofpythoncode works. With C I often find it very useful to be able to run the code in step mode and set breakpoints in adebuggerso I can watch how the it executes, how the

Re: Types, Cython, program readability

2008-03-17 Thread Tim Golden
Tom Stambaugh wrote: I'm not entirely sure why you think Pyrex should contain a compiler. It certainly works well enough with the free [beer] MS VS 2008 Express and I'm fairly sure it's fine with MingW. Both of those are readily available and I don't imagine anyone who's going to use Pyrex /

Re: String To List

2008-03-17 Thread George Sakkis
On Mar 17, 3:22 am, Paul Rubin http://[EMAIL PROTECTED] wrote: Girish [EMAIL PROTECTED] writes: I have a string a = ['xyz', 'abc'].. I would like to convert it to a list with elements 'xyz' and 'abc'. Is there any simple solution for this?? Thanks for the help... Be careful about using

Re: Immutable and Mutable Types

2008-03-17 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: a = 1 b = 1 a is b True id(a) 10901000 id(b) 10901000 Isn't this because integers up to a certain range are held in a single memory location, thus why they are the same? As the OP said: paraphrase Depending on implementation, for immutable types,

Re: About reading Python code

2008-03-17 Thread Roman Dodin
WaterWalk пишет: Hello. I wonder what's the effective way of figuring out how a piece of python code works. With C I often find it very useful to be able to run the code in step mode and set breakpoints in a debugger so I can watch how the it executes, how the data change and how the code

Re: Types, Cython, program readability

2008-03-17 Thread Duncan Booth
Tom Stambaugh [EMAIL PROTECTED] wrote: For example, the new (!) simplejson (v1.7.4) doesn't compile correctly (on my WinXP system, at least) with either any current MS or MinGW compiler. Oh, I know I can make it work if I spend enough time on it -- but the binary egg I eventually found seems

Image capture from Alacron FastFrame-CB

2008-03-17 Thread phishboh
Hi. I would like to perform some image processing using Python. Can someone please point me in the right direction on how to get images from the framegrabber (Alacron FastFrame-CB)? Is VideoCapture (http://videocapture.sourceforge.net/) the correct way to go? Thanks in advance. --

Re: Immutable and Mutable Types

2008-03-17 Thread Duncan Booth
Diez B. Roggisch [EMAIL PROTECTED] wrote: Which is exactly what happens - the actual implementation chose to cache some values based on heuristics or common sense - but no guarantees are made in either way. Here's a puzzle for those who think they know Python: Given that I masked out part of

Re: String To List

2008-03-17 Thread Iain King
On Mar 17, 6:56 am, Dan Bishop [EMAIL PROTECTED] wrote: On Mar 17, 1:15 am, Girish [EMAIL PROTECTED] wrote: I have a string a = ['xyz', 'abc'].. I would like to convert it to a list with elements 'xyz' and 'abc'. Is there any simple solution for this?? Thanks for the help... eval(a)

Re: Immutable and Mutable Types

2008-03-17 Thread Duncan Booth
[EMAIL PROTECTED] wrote: a = 1 b = 1 a is b True id(a) 10901000 id(b) 10901000 Isn't this because integers up to a certain range are held in a single memory location, thus why they are the same? Yes, in *some* implementations of Python this is exactly what happens. The exact

THE AMAZING GOOGLE NETWORK INVITES YOU TO MAKE MILLIONS OF DOLLARS BY DOING A SIMPLE ONLINE WORK.THE LINK IS BELOW

2008-03-17 Thread reginee
THE AMAZING GOOGLE NETWORK INVITES YOU TO MAKE MILLIONS OF DOLLARS BY DOING A SIMPLE ONLINE WORK.THE LINK IS BELOW www.jeeva235.blogspot.com IF YOU WORK LITTLE HARD YOU MAY EARN $3,00,000 IN A SINGLE PROJECT -- http://mail.python.org/mailman/listinfo/python-list

py2exe + pywinauto + sendkeys issue

2008-03-17 Thread hellt
Hi all i have a problem with this modules py2exe + pywinauto + sendkeys used together. In my script i'm using this expression app.window_(title=SJphone).Edit.TypeKeys(Test is running,with_spaces=True) TypeKeys is using SendKeys module i suppose. my setup.py looks like that: from distutils.core

Re: PyCon Feedback and Volunteers (Re: Pycon disappointment)

2008-03-17 Thread Paul Boddie
On 17 Mar, 02:39, BJörn Lindqvist [EMAIL PROTECTED] wrote: I haven't been to EuroPython even when it has been fairly nearby because the entrance fee was to high. But how do you help change something like that? You could join in and make your case. There was a more protracted discussion than

comtypes question

2008-03-17 Thread Jorgen Bodde
Hi All, I am trying to automate a 3rd party application, and all I have to work on is the type library and some documentation. I hope a Python / COM guru can answer this or put me on the right path because I don't know why it does not work. First I imported the typelib with comtypes like; from

Re: Spaces in path name

2008-03-17 Thread Gertjan Klein
joep wrote: * If shell=True is required, then the executable is a build-in shell command, which does not contain spaces, and, therefore, has no problems This is only true when you are referring to directly executable files. However, Shell=True is also required when you want to execute a file by

Re: String To List

2008-03-17 Thread Iain King
On Mar 17, 9:27 am, Iain King [EMAIL PROTECTED] wrote: On Mar 17, 6:56 am, Dan Bishop [EMAIL PROTECTED] wrote: On Mar 17, 1:15 am, Girish [EMAIL PROTECTED] wrote: I have a string a = ['xyz', 'abc'].. I would like to convert it to a list with elements 'xyz' and 'abc'. Is there any simple

Re: question about module compiler: line numbers and positions of substring, which are covered by AST nodes

2008-03-17 Thread Peter Bulychev
I will answer my own question. Maybe it will be useful for someone else in future. Compiler module just transforms parse trees into the abstract syntax trees. Parse trees are built using Parser module. Parser module is not pure Python module, it is written in C language and Python loads it as .so

Anomaly in time.clock()

2008-03-17 Thread Godzilla
Hello, I have been reading a thread about time.clock() going backward, which is exactly what I am seeing... the thread generally leaning toward the problem is caused by multi-processor machines. But I am seeing it at a single CPU computer, and running XP. The error I am seeing between two very

Re: Spaces in path name

2008-03-17 Thread Tim Golden
Gertjan Klein wrote: joep wrote: * If shell=True is required, then the executable is a build-in shell command, which does not contain spaces, and, therefore, has no problems This is only true when you are referring to directly executable files. However, Shell=True is also required when

Re: Pycon disappointment

2008-03-17 Thread Jonathan Ellis
On Mar 16, 10:20 am, Barry Hawkins [EMAIL PROTECTED] wrote: I shared the same perception as Bruce; most keynotes and lightning talks were anemic vendor pitches that really gutted the spirit of what I experienced last year.   I don't think you can lump the keynotes in with the lightning talks.

lists v. tuples

2008-03-17 Thread MartinRinehart
What are the considerations in choosing between: return [a, b, c] and return (a, b, c) # or return a, b, c Why is the immutable form the default? -- http://mail.python.org/mailman/listinfo/python-list

Re: PyCon Feedback and Volunteers (Re: Pycon disappointment)

2008-03-17 Thread Jarek Zgoda
Paul Boddie napisał(a): I haven't been to EuroPython even when it has been fairly nearby because the entrance fee was to high. But how do you help change something like that? You could join in and make your case. There was a more protracted discussion than usual last year about fees

Re: comtypes question

2008-03-17 Thread Thomas Heller
Jorgen Bodde schrieb: Hi All, I am trying to automate a 3rd party application, and all I have to work on is the type library and some documentation. I hope a Python / COM guru can answer this or put me on the right path because I don't know why it does not work. First I imported the

Re: About reading Python code

2008-03-17 Thread Gabriel Genellina
En Mon, 17 Mar 2008 01:54:01 -0200, WaterWalk [EMAIL PROTECTED] escribi�: Hello. I wonder what's the effective way of figuring out how a piece of python code works. With C I often find it very useful to be able to run the code in step mode and set breakpoints in a debugger so I can watch

Re: String To List

2008-03-17 Thread Tom Stambaugh
It's too bad your inner data items are delimited with an apostrophe (') instead a double-quote (). If they were double-quote, you could do something as simple as: Given: a = '[xyz, abc]' import simplejson answer = simplejson.loads(a) There may be an incantation to simplejson that allows you

wxPython graphics query (newbie)

2008-03-17 Thread Thomas G
I am exploring wxPython and would be grateful for some help. It is important to me to be able to slide words and shapes around by dragging them from place to place. I don't mean dragging them into a different window, which is what 'Drag and Drop' has come to mean, just moving them around

SAXReaderNotAvaiable after switching Python

2008-03-17 Thread mich1985
Hello all, after i have switched from python-2.4.2 to python-2.4.3 i get the following message if run my web configuration: parser = xml.sax.make_parser() . SAXReaderNotAvailable: No parsers found The files under /usr/lib/python2.4/xml/sax are the same as before. Any hints where i can start

Re: writing to a binary file without intervening spaces

2008-03-17 Thread castironpi
On Mar 17, 3:28 am, Paul Rubin http://[EMAIL PROTECTED] wrote: Larry [EMAIL PROTECTED] writes: My data is a = [23, 45, 56, 255]. My desire output is: 234556255, of course in binary file representation already. I tried to make one using write after pack method of struct module, but

Re: comtypes question

2008-03-17 Thread Jorgen Bodde
Hi Thomas, Thank you a lot for going through great lenghts to help me. I am relatively new to COM and to python, so using those two together is sometimes watching water burn and be totally amazed by it ;-) It's greatly aprpeciated that you installed the app and even checked out the typelib to

Re: String To List

2008-03-17 Thread castironpi
I have a string a = ['xyz', 'abc'].. I would like to convert it to a list with elements 'xyz' and 'abc'. Is there any simple solution for this?? Thanks for the help... eval(a) will do the job, but you have to be very careful about using that function.  An alternative is

Re: lists v. tuples

2008-03-17 Thread castironpi
On Mar 17, 6:49 am, [EMAIL PROTECTED] wrote: What are the considerations in choosing between:    return [a, b, c] and     return (a, b, c) # or return a, b, c Why is the immutable form the default? Using a house definition from some weeks ago, a tuple is a data structure such which

Re: pass float array(list) parameter to C

2008-03-17 Thread Gabriel Genellina
En Mon, 17 Mar 2008 01:17:31 -0200, zaley [EMAIL PROTECTED] escribi�: In my program, python is communicated with C use ctypes . I can't find a better way to pass float array(list) parameter to C function. Can someone give me a help? Use the array module to create an array of floats, like

Re: py2exe + pywinauto + sendkeys issue

2008-03-17 Thread Gabriel Genellina
En Mon, 17 Mar 2008 08:56:26 -0200, hellt [EMAIL PROTECTED] escribi�: i have a problem with this modules py2exe + pywinauto + sendkeys used together. In my script i'm using this expression app.window_(title=SJphone).Edit.TypeKeys(Test is running,with_spaces=True) TypeKeys is using

python-list Metaquestion

2008-03-17 Thread Tom Stambaugh
I continue to receive emails, addressed to [EMAIL PROTECTED], with subject: Re: Your message to Python-list awaits moderator approval, which read: Your mail to 'Python-list' with the subject (no subject) Is being held until the list moderator can review it for approval. The reason it

Re: lists v. tuples

2008-03-17 Thread Ninereeds
On Mar 17, 11:49 am, [EMAIL PROTECTED] wrote: What are the considerations in choosing between: return [a, b, c] and return (a, b, c) # or return a, b, c Why is the immutable form the default? My understanding is that the immutable form is not the default - neither form is a

Re: lists v. tuples

2008-03-17 Thread Ninereeds
On Mar 17, 12:28 pm, [EMAIL PROTECTED] wrote: Why is the immutable form the default? Using a house definition from some weeks ago, a tuple is a data structure such which cannot contain a refrence to itself. Can a single expression refer to itself ever? Can't imagine why that feature was

Re: py2exe + pywinauto + sendkeys issue

2008-03-17 Thread hellt
On 17 мар, 15:48, Gabriel Genellina [EMAIL PROTECTED] wrote: En Mon, 17 Mar 2008 08:56:26 -0200, hellt [EMAIL PROTECTED] escribi�: i have a problem with this modules py2exe + pywinauto + sendkeys used together. In my script i'm using this expression

Re: stdout custom

2008-03-17 Thread Gabriel Genellina
En Sun, 16 Mar 2008 22:27:28 -0200, [EMAIL PROTECTED] escribió: Specifically, before the prompts. Where does the prompt write come from; why doesn't it honor my settings of sys.stdout and sys.stderr? The interactive interpreter uses directly the C predefined streams stdout and stderr. --

Re: How to send a var to stdin of an external software

2008-03-17 Thread Benjamin Watine
[EMAIL PROTECTED] a écrit : I wrote: And here's a thread example, based on Benjamin's code: [...] Doh! Race condition. Make that: import subprocess import thread import Queue def readtoq(pipe, q): q.put(pipe.read()) cat = subprocess.Popen('cat',

Re: PyCon Feedback and Volunteers ( Pycon disappointment)

2008-03-17 Thread Aahz
In article [EMAIL PROTECTED], Torsten Bronger [EMAIL PROTECTED] wrote: Carl Banks writes: On Mar 16, 10:49 pm, Brian Jones [EMAIL PROTECTED] wrote: On Mar 16, 8:09 pm, [EMAIL PROTECTED] (Aahz) wrote: If you did not like the programming this year (aside from the sponsor talks) and you did

Re: finding euclidean distance,better code?

2008-03-17 Thread Gabriel Genellina
En Mon, 17 Mar 2008 03:04:16 -0200, [EMAIL PROTECTED] [EMAIL PROTECTED] escribi�: while trying to write a function that processes some numpy arrays and calculate euclidean distance ,i ended up with this code (though i used numpy ,i believe my problem has more to do with python coding

Re: Pycon disappointment

2008-03-17 Thread Aahz
In article [EMAIL PROTECTED], Paul Rubin http://[EMAIL PROTECTED] wrote: Stephan Deibel [EMAIL PROTECTED] writes: I have to admit, I'll keep coming to PyCon even if all the talks suck abysmally as long as there's good hallway time, open space, BoFs, and sprints. ;-) OK, so why not get rid of

Re: lists v. tuples

2008-03-17 Thread Steven D'Aprano
On Mon, 17 Mar 2008 05:28:19 -0700, castironpi wrote: a tuple is a data structure such which cannot contain a refrence to itself. a = [] # a list b = (a, None) # a tuple a.append(b) print b ([([...], None)], None) b[0][0] is b True So, yes tuples can contain a reference to

Entry point not found error

2008-03-17 Thread Kaan Tuna
Hi, I am using cygwin on a Windows Xp machine. I used to have python2.3 working without problems, but when i install v2.5.1 via cygwin setup, python.exe and python2.5.exe are giving Entry point not found - Exception processing message - Parameters 18ef error box, while python2.3.exe still runs

Re: lists v. tuples

2008-03-17 Thread Duncan Booth
[EMAIL PROTECTED] wrote: What are the considerations in choosing between: return [a, b, c] and return (a, b, c) # or return a, b, c A common explanation for this is that lists are for homogenous collections, tuples are for when you have heterogenous collections i.e. related

Re: lists v. tuples

2008-03-17 Thread Robert Bossy
[EMAIL PROTECTED] wrote: On Mar 17, 6:49 am, [EMAIL PROTECTED] wrote: What are the considerations in choosing between: return [a, b, c] and return (a, b, c) # or return a, b, c Why is the immutable form the default? Using a house definition from some weeks ago, a tuple

Re: PyCon Feedback and Volunteers ( Pycon disappointment)

2008-03-17 Thread Torsten Bronger
Hallöchen! Aahz writes: In article [EMAIL PROTECTED], Torsten Bronger [EMAIL PROTECTED] wrote: [...] I see no reason why the fault for parts of the rest being sub-optimal, too, must necessarily be on the attendee's side. (Just hypothetically; I wasn't at PyCon.) Let's suppose you have

Re: Immutable and Mutable Types

2008-03-17 Thread Steven D'Aprano
On Mon, 17 Mar 2008 10:40:43 +, Duncan Booth wrote: Here's a puzzle for those who think they know Python: Given that I masked out part of the input, which version(s) of Python might give the following output, and what might I have replaced by asterisks? There's too many variables -- at

Re: Urgent : How to do memory leaks detection in python ?

2008-03-17 Thread Sean Allen
On Mar 17, 2008, at 3:21 AM, Pradeep Rai wrote: Thanks for your inputs !!! I have installed python v 2.5 on my Linux machine and executing the tool again. I would like to share the memory status( using free -m command ) before and after the execution of the tool. BEFORE EXECUTION

Re: wxPython graphics query (newbie)

2008-03-17 Thread Mike Driscoll
On Mar 17, 7:03 am, Thomas G [EMAIL PROTECTED] wrote: I am exploring wxPython and would be grateful for some help. It is important to me to be able to slide words and shapes around by dragging them from place to place. I don't mean dragging them into a different window, which is what 'Drag

Re: Pycon disappointment

2008-03-17 Thread VanL
Bruce, I can't speak to your issues with the normal sessions, but your bad experience with the lightning talks was my fault. And, in apologizing to you, I hope that all the others on this thread who have expressed similar sentiments hear me too. Ultimately, we miscalculated in certain

Python 3 and PEP238 division

2008-03-17 Thread Ninereeds
Is the PEP238 change to division going into Python 3 as planned? I realise that the new integer division semantics have been available in from __future__ for quite a few years now, but a warning might be appropriate now that Python 3 is in alpha. A lot of people have probably either forgotten, or

Re: lists v. tuples

2008-03-17 Thread Ninereeds
On Mar 17, 1:31 pm, Duncan Booth [EMAIL PROTECTED] wrote: A common explanation for this is that lists are for homogenous collections, tuples are for when you have heterogenous collections i.e. related but different things. I interpret this as meaning that in a data table, I should have a list

Re: PyCon Feedback and Volunteers ( Pycon disappointment)

2008-03-17 Thread Aahz
In article [EMAIL PROTECTED], Torsten Bronger [EMAIL PROTECTED] wrote: Aahz writes: In article [EMAIL PROTECTED], Torsten Bronger [EMAIL PROTECTED] wrote: I see no reason why the fault for parts of the rest being sub-optimal, too, must necessarily be on the attendee's side. (Just

Apache binary error?

2008-03-17 Thread Michael Wieher
have simple webpage running apache, mod_python the error is binary ...binary as in every other time I load the page, Firefox keeps telling me I'm downloading a python script, and asks to open it in WINE, which is really strange. then, alternately, it loads the page just fine. any clues as

Re: pass float array(list) parameter to C

2008-03-17 Thread marek . rocki
You can also do it with ctypes only; too bad it's not really well documented. c_float is a type of a floating point number and it has * operator defined, so that c_float*4 is a type of a 4-element array of those numbers. So if you want to construct an array of floats from a list of floats, you can

Re: wxPython graphics query (newbie)

2008-03-17 Thread Chris Mellon
On Mon, Mar 17, 2008 at 7:03 AM, Thomas G [EMAIL PROTECTED] wrote: I am exploring wxPython and would be grateful for some help. It is important to me to be able to slide words and shapes around by dragging them from place to place. I don't mean dragging them into a different window, which

Missing PyObject definition

2008-03-17 Thread James Whetstone
I'm trying to access a PyObject directly from C++ for the purpose of calling method on a Python object that is an intance of a derived C++ class. My problem is that the compiler is complaining about not PyObject not being defined. Has anyone run into the problem? Where is PyObject defined?

Re: Missing PyObject definition

2008-03-17 Thread Michael Wieher
2008/3/17, James Whetstone [EMAIL PROTECTED]: I'm trying to access a PyObject directly from C++ for the purpose of calling method on a Python object that is an intance of a derived C++ class. My problem is that the compiler is complaining about not PyObject not being defined. Has anyone run

Re: PyCon Feedback and Volunteers ( Pycon disappointment)

2008-03-17 Thread Mike Driscoll
On Mar 17, 8:16 am, [EMAIL PROTECTED] (Aahz) wrote: In article [EMAIL PROTECTED], Torsten Bronger [EMAIL PROTECTED] wrote: Carl Banks writes: On Mar 16, 10:49 pm, Brian Jones [EMAIL PROTECTED] wrote: On Mar 16, 8:09 pm, [EMAIL PROTECTED] (Aahz) wrote: If you did not like the

Re: Missing PyObject definition

2008-03-17 Thread Diez B. Roggisch
James Whetstone wrote: I'm trying to access a PyObject directly from C++ for the purpose of calling method on a Python object that is an intance of a derived C++ class. My problem is that the compiler is complaining about not PyObject not being defined. Has anyone run into the problem?

Re: String To List

2008-03-17 Thread Jeff Schwab
Girish wrote: I have a string a = ['xyz', 'abc'].. I would like to convert it to a list with elements 'xyz' and 'abc'. Is there any simple solution for this?? Do you want: (1) Specifically to vivify lists formatted as in your example? If so, why? (2) To save and restore arbitrary python

Re: python-list Metaquestion

2008-03-17 Thread Jeff Schwab
Tom Stambaugh wrote: I continue to receive emails, addressed to [EMAIL PROTECTED], with subject: Re: Your message to Python-list awaits moderator approval, which read: Your mail to 'Python-list' with the subject (no subject) Is being held until the list moderator can review it for

Re: Missing PyObject definition

2008-03-17 Thread Jeff Schwab
James Whetstone wrote: I'm trying to access a PyObject directly from C++ for the purpose of calling method on a Python object that is an intance of a derived C++ class. My problem is that the compiler is complaining about not PyObject not being defined. Has anyone run into the problem?

Re: Immutable and Mutable Types

2008-03-17 Thread Stargaming
On Mon, 17 Mar 2008 10:40:43 +, Duncan Booth wrote: Here's a puzzle for those who think they know Python: Given that I masked out part of the input, which version(s) of Python might give the following output, and what might I have replaced by asterisks? a = 1 b = if a is b:

Re: PyCon Feedback and Volunteers (Re: Pycon disappointment)

2008-03-17 Thread fumanchu
On Mar 16, 5:09 pm, [EMAIL PROTECTED] (Aahz) wrote: fumanchu [EMAIL PROTECTED] wrote: This is my third PyCon, and I've found a reasonably-sized cadre of people who come for the hallway conversations plus a Bof or two, having given up on hearing anything new, useful, or inspiring in the

Re: replace string in a file

2008-03-17 Thread joep
On Mar 16, 10:35 pm, sturlamolden [EMAIL PROTECTED] wrote: On 15 Mar, 21:54, Unknown [EMAIL PROTECTED] wrote: I was expecting to replace the old value (serial) with the new one (todayVal). Instead, this code *adds* another line below the one found... How can I just replace it? A file is

Re: lists v. tuples

2008-03-17 Thread Duncan Booth
Ninereeds [EMAIL PROTECTED] wrote: On Mar 17, 1:31 pm, Duncan Booth [EMAIL PROTECTED] wrote: A common explanation for this is that lists are for homogenous collections, tuples are for when you have heterogenous collections i.e. related but different things. I interpret this as meaning

Re: Immutable and Mutable Types

2008-03-17 Thread Duncan Booth
Steven D'Aprano [EMAIL PROTECTED] wrote: On Mon, 17 Mar 2008 10:40:43 +, Duncan Booth wrote: Here's a puzzle for those who think they know Python: Given that I masked out part of the input, which version(s) of Python might give the following output, and what might I have replaced by

Re: Immutable and Mutable Types

2008-03-17 Thread Duncan Booth
Stargaming [EMAIL PROTECTED] wrote: On Mon, 17 Mar 2008 10:40:43 +, Duncan Booth wrote: Here's a puzzle for those who think they know Python: Given that I masked out part of the input, which version(s) of Python might give the following output, and what might I have replaced by

Re: Regarding coding style

2008-03-17 Thread rockingred
On Mar 10, 11:30 am, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Fix that. That's usually something that's fairly easy to get done as a programmer (I've had to do it at 2 of the last 4 places I worked). Just go explain all the problems that can happen by not having VC and all the benefits it

Re: Why doesn't xmlrpclib.dumps just dump an empty value instead of nil/?

2008-03-17 Thread martin f krafft
also sprach martin f krafft [EMAIL PROTECTED] [2008.03.16.1421 +0100]: Why doesn't it just yield 'params\nparam\nvalue//param\n/params\n' Or even just 'params\nparam/\n/params\n' There's a difference between those two. The first one has an empty string value ('') while the second

Re: Missing PyObject definition

2008-03-17 Thread James Whetstone
Hi, Yeah, I've included python.h and object.h but the compiler still complain about not finding PyObject. It's weird.So I'm developing and App on windows using VS 8.0. I've intalled Python 2.5 and have added the include directory to my project's configuration. I'm also using

Re: Immutable and Mutable Types

2008-03-17 Thread Stargaming
On Mon, 17 Mar 2008 16:03:19 +, Duncan Booth wrote: For the answer I actually want each asterisk substitutes for exactly one character. Played around a bit and found that one: Python 3.0a3+ (py3k:61352, Mar 12 2008, 12:58:20) [GCC 4.2.3 20080114 (prerelease) (Debian 4.2.2-7)] on linux2

Question on using distutils.core.run_setup

2008-03-17 Thread Terry Jones
I'm trying to programmatically install something built using distutils. I found distutils.core.run_setup and can use it via dist = run_setup('setup.py', ['-q', 'install']) Is that the recommended way to do an install from inside Python (as opposed to doing it on the command line)? If so, how

Re: Pycon disappointment

2008-03-17 Thread DavidA
On Mar 16, 9:42 am, Mike Driscoll [EMAIL PROTECTED] wrote: Do you mean the official presentations or the lightning talks? I thought both were kind of bad. Jeff Rush was great in both of the sessions I saw and the gaming presenters were also good. But I saw a lot of people who had never

Re: py2exe + pywinauto + sendkeys issue

2008-03-17 Thread hellt
On 17 мар, 15:48, Gabriel Genellina [EMAIL PROTECTED] wrote: En Mon, 17 Mar 2008 08:56:26 -0200, hellt [EMAIL PROTECTED] escribi�: i have a problem with this modules py2exe + pywinauto + sendkeys used together. In my script i'm using this expression

Re: Apache binary error?

2008-03-17 Thread Sean Allen
On Mar 17, 2008, at 10:55 AM, Michael Wieher wrote: have simple webpage running apache, mod_python the error is binary ...binary as in every other time I load the page, Firefox keeps telling me I'm downloading a python script, and asks to open it in WINE, which is really strange.

Re: py2exe + pywinauto + sendkeys issue

2008-03-17 Thread hellt
On 17 мар, 20:22, hellt [EMAIL PROTECTED] wrote: On 17 мар, 15:48, Gabriel Genellina [EMAIL PROTECTED] wrote: En Mon, 17 Mar 2008 08:56:26 -0200, hellt [EMAIL PROTECTED] escribi�: i have a problem with this modules py2exe + pywinauto + sendkeys used together. In my script i'm

  1   2   3   4   5   6   >