Re: Python Generators

2008-03-16 Thread Matt Nordhoff
mpc wrote: > def concatenate(sequences): > for seq in sequences: > for item in seq: > yield item You should check out itertools.chain(). It does this. You call it like "chain(seq1, seq2, ...)" instead of "chain(sequences)" though, which may be a problem for you. The res

Re: app runs fine with interpreter, but not under py2exe

2008-03-16 Thread GHUM
Doug, > as I quickly noticed that "library.zip" does NOT contain ANY .pyd files. > I'm guessing that they can't be in library.zip for a reason (i.e., they are > DLL files, essentially, and thus must be readily available to be loaded > into memory). .dll and .pyd files CAN be within library.zip an

Re: Spaces in path name

2008-03-16 Thread Tim Golden
Tim Golden wrote: > joep wrote: >> On Mar 15, 5:42 pm, joep <[EMAIL PROTECTED]> wrote: http://timgolden.me.uk/python/win32_how_do_i/run-a-command-with-a-spa... >>> Note: this works for subprocess.call but for subprocess.Popen this >>> does not work if there are two arguments in the command lin

ANN: EasyExtend 3.0 - second beta

2008-03-16 Thread Kay Schluehr
The second beta of EasyExtend 3.0 has been released today. This release is mostly about bugfixes and the reintegration of the fun langlet Teuton and the code coverage langlet. The code coverage langlet has been enhanced s.t. it can detect uncovered branches in boolean operations now. ---

Re: call by reference howto????

2008-03-16 Thread Terry Reedy
"Steven D'Aprano" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | On Sat, 15 Mar 2008 11:50:17 -0700, Dennis Lee Bieber wrote: | | > Small integers are cached in Python, so they always have a fixed ID | > (address). | | Small integers are cached in CPython, making it an implementati

Re: 'join' in the wrong word for the method in class Thread.

2008-03-16 Thread castironpi
On Mar 16, 1:43 am, Erik Max Francis <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > 'join' in the wrong word for the method in class Thread. > > That's the standard term in threading.  If it's not familiar to you, > well, bummer, but there's not much more that can be done about that than

Re: 'join' in the wrong word for the method in class Thread.

2008-03-16 Thread Torsten Bronger
Hallöchen! [EMAIL PROTECTED] writes: > [...] > *** English is SVO, subject-verb-object. French is too, unless the > object is direct: subject- direct-object -verb. Really? I thought this is only the case for pronouns. Tschö, Torsten. -- Torsten Bronger, aquisgrana, europa vetus

Re: find string in file

2008-03-16 Thread Lie
On Mar 14, 8:25 pm, [EMAIL PROTECTED] wrote: > Hi friends !! > > I'm neophite about python, my target is to create a programa that > find  a specific string in text file. > How can do it? > > Thanks > fel I'd recommend regular expression (import re) if the string you're searching is in a complex f

Re: app runs fine with interpreter, but not under py2exe

2008-03-16 Thread Doug Morse
Hi Harald, Bond here, James Bond. I accepted your mission. :) Unfortunately, the mission failed. Creating a "testapp.py" as you described (i.e., with the suggested import statements) runs just fine with the interpreter. again, however, py2exe does the same thing as the original problem -- that

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

2008-03-16 Thread Peter Bulychev
Hello. I use standard module Compiler to build ASTs of Python code. Given AST subtree I want to restore coordinates of substring in the input, which is covered by the subtree. Example: Suppose, the input is 'a+(b+c)'. It is parsed to the tree ADD(a, ADD(b,c)) by module Compiler. I want to have a

Re: Convert int to float

2008-03-16 Thread Lie
On Mar 16, 4:43 am, Guido van Brakel <[EMAIL PROTECTED]> wrote: > Hello > > I have this now: > > > def gem(a): > >     g = sum(a) / len(a) > >     return g > > > print gem([1,2,3,4]) > > print gem([1,10,100,1000]) > > print gem([1,-2,3,-4,5]) > > It now gives a int, but i would like to see floats.

Re: List mutation method gotcha - How well known?

2008-03-16 Thread Lie
On Mar 15, 1:01 pm, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > On Fri, 14 Mar 2008 11:32:41 -0700, Lie wrote: > > No, there is no need for "void" return type, what I meant is that > > everything that's not said in the documentation should be assumed to > > be an implementation detail, a

Re: Unicode/UTF-8 confusion

2008-03-16 Thread Tom Stambaugh
I want to thank this community -- especially Carsten Haese -- for your patience with my confusion and for your several suggestions about how to resolve the issue. As a newcomer to python-list, I appreciate your willingness to respond to my request and your graciousness in helping me see the con

Re: 'join' in the wrong word for the method in class Thread.

2008-03-16 Thread castironpi
On Mar 16, 3:42 am, Torsten Bronger <[EMAIL PROTECTED]> wrote: > Hallöchen! > > [EMAIL PROTECTED] writes: > > [...] > > *** English is SVO, subject-verb-object.  French is too, unless the > > object is direct: subject- direct-object -verb. > > Really?  I thought this is only the case for pronouns.

Re: app runs fine with interpreter, but not under py2exe

2008-03-16 Thread Thomas Heller
Doug Morse schrieb: > Peter, > > Genius! You nailed it -- thanks! > > py2exe is apparently getting confused by the fact that packages "Numeric" and > "numpy" both have files multiarray.pyd and umath.pyd. It copies just one of > each -- from $PYTHONHOME/Lib/site-packages/numpy/core -- and puts b

Pycon disappointment

2008-03-16 Thread Bruce Eckel
If the following seems unnecessarily harsh, it was even more harsh for me to discover that the time and money I had spent to get to my favorite conference had been sold to vendors, presenting me as a captive audience they could pitch to. I believe that this year's Pycon organizers suffered from in

ANN: OpenOpt 0.17 (free numerical optimization framework)

2008-03-16 Thread dmitrey
Greetings, We're pleased to announce: OpenOpt 0.17 (release), free (license: BSD) optimization framework for Python language programmers, is available for download. Brief introduction to numerical optimization problems and related software: http://scipy.org/scipy/scikits/wiki/OOIntroduction Chan

Re: Pycon disappointment

2008-03-16 Thread Ben Finney
Bruce Eckel <[EMAIL PROTECTED]> writes: > My trust has been violated. I paid a lot, in both money and time, to > be at this conference just to be herded into a room and have my > eyeballs sold to the highest bidder. Hear hear. Conference organisers, past and future, take note: Attention of atten

Regular Expression Help

2008-03-16 Thread santhosh kumar
Hi all, I have text like , STRINGTABLE BEGIN ID_NEXT_PANE"Cambiar a la siguiente sección de laventana \nSiguiente sección" ID_PREV_PANE"Regresar a la sección anterior de laventana\nSección anterior" END STRINGTABLE BEGIN ID_VIEW_TOOLBAR "Mostrar u oculta

Re: Python for BlackBerry

2008-03-16 Thread Mike Driscoll
On Mar 15, 9:52 pm, "Sandipan Gangopadhyay" <[EMAIL PROTECTED]> wrote: > Thanks, Mike. > This one seems to be for Nokia, particularly S60 and Symbian in general. > Does BlackBerry work on Symbian? Let me check. > Thanks. > Sandipan > > -Original Message- > From: [EMAIL PROTECTED] > > [mailt

Re: Regular Expression Help

2008-03-16 Thread Duncan Booth
"santhosh kumar" <[EMAIL PROTECTED]> wrote: > I have text like , > STRINGTABLE > BEGIN > ID_NEXT_PANE"Cambiar a la siguiente sección de laventana > \nSiguiente sección" > ID_PREV_PANE"Regresar a la sección anterior de > laventana\nSección anterior" > END > STRI

Re: Spaces in path name

2008-03-16 Thread joep
Tim Golden wrote: > subprocess.call ([ > >r"C:\Program Files\Adobe\Acrobat 5.0\Reader\acro reader.exe", > > r"C:\Program Files\Adobe\Acr > obat 5.0\Reader\plug_ins.donotuse\Annotations\Stamps\abc def.pdf" > > ]) > > Can you confirm that something equivalent *doesn't* work on your > setup? Or

Re: Advantage of the array module over lists?

2008-03-16 Thread Arnaud Delobelle
Tobiah <[EMAIL PROTECTED]> writes: > I checked out the array module today. It claims that > arrays are 'efficient'. I figured that this must mean > that they are faster than lists, but this doesn't seem > to be the case: > > one.py ## > import array > > a = array.arr

Why doesn't xmlrpclib.dumps just dump an empty value instead of ?

2008-03-16 Thread martin f krafft
Hi, xmlrpclib.dumps((None,), allow_none=True) yields '\n\n\n\n' Why doesn't it just yield '\n\n\n\n' Or even just '\n\n\n' Those are valid XML and valid XML-RPC, but isn't. Thanks for any thoughts... -- martin | http://madduck.net/ | http://two.sentenc.es/ a farmer is a man outst

Re: Pycon disappointment

2008-03-16 Thread Mike Driscoll
> But it gets worse. The lightning talks, traditionally the best, newest > and edgiest part of the conference, were also sold like commercial air > time. Vendors were guaranteed first pick on lightning talk slots, and > we in the audience, expectantly looking forward to interesting and > entertain

Cannot build Python 2.4 SRPM on x64 platform

2008-03-16 Thread Eric B.
Hi, For those on several python lists, I appologize in advance for cross-posting, but I'm really not sure which list is best to ask for assistance with this. Currently, I am trying to build the python2.4 SRPM from Python.org on a RHEL4 x64 platform, but the build is failing with a very non-descri

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

2008-03-16 Thread Michael Wieher
2008/3/16, martin f krafft <[EMAIL PROTECTED]>: > > Hi, > > xmlrpclib.dumps((None,), allow_none=True) yields > > '\n\n\n\n' > > Why doesn't it just yield > > '\n\n\n\n' > > Or even just > > '\n\n\n' > > Those are valid XML and valid XML-RPC, but isn't. > > Thanks for any thoughts... > > > --

Re: Cannot build Python 2.4 SRPM on x64 platform

2008-03-16 Thread Michael Wieher
Sorry I don't have much of a better idea, but if I had this kind of problem with an RPM, I'd just grab the tarball and start hacking away at ./configure pre-requirements, trying to use --options to trim it down to the bare minimal and see if I can get it to load up. 2008/3/16, Eric B. <[EMAIL PROT

Re: Spaces in path name

2008-03-16 Thread Tim Golden
joep wrote: > > Tim Golden wrote: > >> subprocess.call ([ >> >>r"C:\Program Files\Adobe\Acrobat 5.0\Reader\acro reader.exe", >> >> r"C:\Program Files\Adobe\Acr >> obat 5.0\Reader\plug_ins.donotuse\Annotations\Stamps\abc def.pdf" >> >> ]) >> >> Can you confirm that something equivalent *doesn'

Re: Advantage of the array module over lists?

2008-03-16 Thread Michael Wieher
I believe the array module provides more functionality than lists. Perhaps this extra functionality comes with... overhead? C'est possible. For example, you can declare an array to contain all items of a type, ie: >>array.array('f')#array of floats So, they might be efficient, in that they'r

Re: Pycon disappointment

2008-03-16 Thread Aahz
In article <[EMAIL PROTECTED]>, Bruce Eckel <[EMAIL PROTECTED]> wrote: > >If the following seems unnecessarily harsh, it was even more harsh for >me to discover that the time and money I had spent to get to my >favorite conference had been sold to vendors, presenting me as a >captive audience they

Re: Advantage of the array module over lists?

2008-03-16 Thread bearophileHUGS
Their efficiency is mostly regarding the space. I think they aren't much speed-efficient because they require many conversions from-to Python types. You can gain speed efficiency too (sometimes a LOT), in some situations, using array with Psyco. Another advantage of arrays (better called "vector"s,

Re: Spaces in path name

2008-03-16 Thread Tim Golden
joep wrote: > I assume that there is some difference how subprocess.call and > subprocess.Popen handle and format the command. subprocess.Popen does > the correct formatting when only one file path has spaces and requires > double quoting, but not if there are two file paths with spaces in it. The

Re: Pycon disappointment

2008-03-16 Thread Aaron
> In my opinion, open spaces should have had greater status and billing, > with eyes-forward talks and vendor sessions offered only as possible > alternatives. Especially, vendor sessions should not be presented as > "keynotes" during plenary sessions. I think it took a little while > for people

Types, Cython, program readability

2008-03-16 Thread bearophileHUGS
It seems the development of Cython is going very well, quite differently from the dead-looking Pyrex. Hopefully Cython will become more user-friendly too (Pyrex is far from being user-friendly for Windows users, it doesn't even contain a compiler, I think. The ShedSkin Windows installer contains an

Re: Python and 3D

2008-03-16 Thread Python
On 15 mrt 2008, at 23:06, Mike Driscoll wrote: > On Mar 15, 3:09 pm, Eric von Horst <[EMAIL PROTECTED]> wrote: >> Hi, >> >> I am looking for Python modules that allow you to manipulate 3D >> objects, more specifically Alias Wavefront .OBJ objects. >> Also, a module that would allow you to vizuali

Re: Pycon disappointment

2008-03-16 Thread Michael Wieher
2008/3/16, Aaron <[EMAIL PROTECTED]>: > > > > In my opinion, open spaces should have had greater status and billing, > > with eyes-forward talks and vendor sessions offered only as possible > > alternatives. Especially, vendor sessions should not be presented as > > "keynotes" during plenary sessi

Re: Python and 3D

2008-03-16 Thread dave_mikesell
On Mar 15, 3:09 pm, Eric von Horst <[EMAIL PROTECTED]> wrote: > Hi, > > I am looking for Python modules that allow you to manipulate 3D > objects, more specifically Alias Wavefront .OBJ objects. > Also, a module that would allow you to vizualize these models and > rotate them etc.. > > The goal is

Re: Types, Cython, program readability

2008-03-16 Thread Tim Golden
[EMAIL PROTECTED] wrote: > It seems the development of Cython is going very well, quite > differently from the dead-looking Pyrex. I'll leave others to comment on how dead Pyrex is or isn't ... > Hopefully Cython will become > more user-friendly too (Pyrex is far from being user-friendly for > W

Re: Spaces in path name

2008-03-16 Thread Tim Golden
Tim Golden wrote: > What I haven't investigated yet is whether the additional flags > your example is passing (shell=True etc.) cause the main Popen > mechanism to take a different path. Sure enough, passing shell=True -- which is probably quite a rare requirement -- causes the code to change the

Re: Types, Cython, program readability

2008-03-16 Thread Stefan Behnel
Hi, [EMAIL PROTECTED] wrote: > It seems Cython is going to become an efficient and > general purpose language after all, with optional static typing (its > purpose: mostly for speed), and it may even gain some kind of macros > soon. So it may even end replacing Python itself in some situations > w

Re: Pycon disappointment

2008-03-16 Thread Fuzzyman
On Mar 16, 11:10 am, Bruce Eckel <[EMAIL PROTECTED]> wrote: [snip..] > But it gets worse. The lightning talks, traditionally the best, newest > and edgiest part of the conference, were also sold like commercial air > time. Vendors were guaranteed first pick on lightning talk slots, and > we in the

Re: Pycon disappointment

2008-03-16 Thread Fuzzyman
> "It is easier to optimize correct code than to correct optimized code." > --Bill Harlan That's a great quote that I had not heard before. :-) Michael Foord http://www.manning.com/foord -- http://mail.python.org/mailman/listinfo/python-list

Re: Types, Cython, program readability

2008-03-16 Thread sturlamolden
On 16 Mar, 15:32, [EMAIL PROTECTED] wrote: > It seems the development of Cython is going very well, quite > differently from the dead-looking Pyrex. Hopefully Cython will become > more user-friendly too (Pyrex is far from being user-friendly for > Windows users, it doesn't even contain a compiler,

Re: Pycon disappointment

2008-03-16 Thread Barry Hawkins
On Mar 16, 9:18 am, [EMAIL PROTECTED] (Aahz) wrote: > In article <[EMAIL PROTECTED]>, > Bruce Eckel  <[EMAIL PROTECTED]> wrote: > > >If the following seems unnecessarily harsh, it was even more harsh for > >me to discover that the time and money I had spent to get to my > >favorite conference had b

Re: Weight Problem

2008-03-16 Thread Gary Herron
Ravi Kumar wrote: > An Interesting problem, > """ > A man has only 4 bricks of different weights, lies between 1-40KG, > Also, the total weights of Brick A, B, C, D (ie A+B+C+D) is 40KG. > The man uses that brick to calculate every possible weight > from 1 KG to 40 KG in his shop. (only whole numb

Re: Cannot build Python 2.4 SRPM on x64 platform

2008-03-16 Thread Eric B.
"Michael Wieher" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Sorry I don't have much of a better idea, but if I had this kind of > problem > with an RPM, I'd just grab the tarball and start hacking away at > ./configure > pre-requirements, trying to use --options to trim it dow

Re: Spaces in path name

2008-03-16 Thread joep
Tim Golden wrote: > Tim Golden wrote: > > What I haven't investigated yet is whether the additional flags > > your example is passing (shell=True etc.) cause the main Popen > > mechanism to take a different path. > > Sure enough, passing shell=True -- which is probably quite > a rare requirement

Re: Types, Cython, program readability

2008-03-16 Thread Stefan Behnel
sturlamolden wrote: > On 16 Mar, 15:32, [EMAIL PROTECTED] wrote: >> It seems the development of Cython is going very well, quite >> differently from the dead-looking Pyrex. Hopefully Cython will become >> more user-friendly too (Pyrex is far from being user-friendly for >> Windows users, it doesn't

Re: Pycon disappointment

2008-03-16 Thread Jacob Kaplan-Moss
On Mar 16, 9:59 am, Fuzzyman <[EMAIL PROTECTED]> wrote: > This isn't new though. Last year (my only other PyCon) all the > sponsors gave lightning talks. The difference is that there were more > sponsors this year I guess... The difference (from my POV as the guy who helped plan and run the lightn

Re: Pycon disappointment

2008-03-16 Thread Jacob Kaplan-Moss
On Mar 16, 6:10 am, Bruce Eckel <[EMAIL PROTECTED]> wrote: > But it gets worse. The lightning talks, traditionally the best, newest > and edgiest part of the conference, were also sold like commercial air > time. Thanks for being harsh here, Bruce. I've been responsible for organizing the lightnin

Re: Types, Cython, program readability

2008-03-16 Thread bearophileHUGS
Tim Golden: > I'm not entirely sure why you think Pyrex should "contain a compiler". I think lot of Win users (computational biologists?), even people that know how to write good Python code, don't even know how to install a C compiler. >I'm fairly sure it's fine with MingW< (In the past?) I th

Re: Pycon disappointment

2008-03-16 Thread fumanchu
On Mar 16, 7:18 am, [EMAIL PROTECTED] (Aahz) wrote: > Bruce Eckel <[EMAIL PROTECTED]> wrote: > > If the following seems unnecessarily harsh, it was even more harsh for > > me to discover that the time and money I had spent to get to my > > favorite conference had been sold to vendors, presenting m

Re: Spaces in path name

2008-03-16 Thread Tim Golden
joep wrote: > > Tim Golden wrote: >> Tim Golden wrote: >>> What I haven't investigated yet is whether the additional flags >>> your example is passing (shell=True etc.) cause the main Popen >>> mechanism to take a different path. >> Sure enough, passing shell=True -- which is probably quite >> a r

Basics of Python,learning

2008-03-16 Thread Guido van Brakel
Hello Why is this not working,and how can I correct it? > #!/usr/bin/env python > #coding=utf-8 > > z = raw_input ('Give numbers') > y = z.split() > b=[] > > for i in y: > b.append(float(i)) > > def b(min,max,gem) > x=min(a) > x=gem(a) > x=max(a) > return a > > print

When file-like objects aren't file-like enough for Windows

2008-03-16 Thread William McBrine
This is proving to be a recurring problem for me. First, I used the save() method of a Python Imaging Library "Image" object to write directly to the "wfile" of a BaseHTTPRequestHandler- derived class: pic.save(self.wfile, 'JPEG') Worked great in Linux, barfed in Windows. I had to do this

Re: Basics of Python,learning

2008-03-16 Thread Mensanator
On Mar 16, 11:25 am, Guido van Brakel <[EMAIL PROTECTED]> wrote: > Hello > > Why is this not working, Why is _what_ not working? > and how can I correct it? Start over. > > > > > > > #!/usr/bin/env python > > #coding=utf-8 > > > z = raw_input ('Give numbers') > > y = z.split() > > b=[] > > > fo

Re: Pycon disappointment

2008-03-16 Thread lbonafide
On Mar 16, 6:10 am, Bruce Eckel <[EMAIL PROTECTED]> wrote: > I think a lot of people have been caught up in the idea that we need > to commercialize Python, and ride some kind of wave of publicity the > way that Java and C# and Rails seem to have done. This coming from someone who caught the Java

Re: Basics of Python,learning

2008-03-16 Thread D'Arcy J.M. Cain
On Sun, 16 Mar 2008 17:25:26 +0100 Guido van Brakel <[EMAIL PROTECTED]> wrote: > Hello > > Why is this not working,and how can I correct it? What are you expecting it to do? For one thing, you are acting on a variable 'a' but it is never defined. The only objects that you have is z, y, b and th

Re: Spaces in path name

2008-03-16 Thread Tim Golden
Tim Golden wrote: > Well I've got a patch ready to go (which basically just > wraps a shell=True command line with an *extra* pair of > double-quotes, the same as you do for an os.system call). > I'll try to put some time into the subprocess docs as well, > at least as far as a Win32-how-do-I on my

Re: Spaces in path name

2008-03-16 Thread joep
One more try (using popen instead of call is not necessary for these cases, but I want to see the behavior of popen): shell=True and executable and at least one argument with spaces does not work: -

Strange problem with structs Linux vs. Mac

2008-03-16 Thread jasonwiener
Hi- I am having a VERY odd problem with unpacking right now. I'm reading data from a binary file and then using a very simple struct.unpack to get a long. Works fine on my MacBook, but when I push it to a Linux box,it acts differently and ends up pewking. here's the code snippet:

Re: Strange problem with structs Linux vs. Mac

2008-03-16 Thread Michael Wieher
try twiddling the unpack prefix, they're probably stored in different binary formats on the disk... on the struct helppage, is a list of prefixes, can be like unpack('=HI',data) unpack('@HI',data) etc... find out which one works on each machine 2008/3/16, jasonwiener <[EMAIL PROTECTED]>: > > H

Re: Types, Cython, program readability

2008-03-16 Thread sturlamolden
On 16 Mar, 16:58, [EMAIL PROTECTED] wrote: > I think lot of Win users (computational biologists?), even people that > know how to write good Python code, don't even know how to install a C > compiler. If you don't know how to install a C compiler like Microsoft Visual Studio, you should not be pr

Re: Types, Cython, program readability

2008-03-16 Thread sturlamolden
On 16 Mar, 18:10, sturlamolden <[EMAIL PROTECTED]> wrote: > You don't click on compiled Python C extensions. You call it from your > Python code. By the way, disttools will invoke Pyrex and the C compiler, and produce the binary .pyd-file you can access from Python. It's not rocket science (not e

Re: Strange problem with structs Linux vs. Mac

2008-03-16 Thread Martin Blume
"jasonwiener" schrieb > > I am having a VERY odd problem with unpacking right now. > I'm reading data from a binary file and then using a very > simple struct.unpack to get a long. Works fine on my MacBook, > but when I push it to a Linux box,it acts differently and > ends up pewking. > [...]

Re: Basics of Python,learning

2008-03-16 Thread sturlamolden
On 16 Mar, 17:25, Guido van Brakel <[EMAIL PROTECTED]> wrote: > Why is this not working,and how can I correct it? [code skipped] There is no way of correcting that. Delete it and start over. -- http://mail.python.org/mailman/listinfo/python-list

Re: Strange problem with structs Linux vs. Mac

2008-03-16 Thread sturlamolden
On 16 Mar, 18:23, "Martin Blume" <[EMAIL PROTECTED]> wrote: > This seems to imply that the Mac, although running now on Intel > processors, is still big-endian. Or maybe the struct module thinks big-endian is native to all Macs? It could be a bug. -- http://mail.python.org/mailman/listinfo/p

Re: Strange problem with structs Linux vs. Mac

2008-03-16 Thread Michael Wieher
you can specifify which encoding when you unpack the struct, so just try them till it works, or read the specs on the mac.. i find it quicker to try, there's only 4-5 2008/3/16, sturlamolden <[EMAIL PROTECTED]>: > > On 16 Mar, 18:23, "Martin Blume" <[EMAIL PROTECTED]> wrote: > > > This seems to im

Re: Strange problem with structs Linux vs. Mac

2008-03-16 Thread Martin Blume
"sturlamolden" schrieb > > > This seems to imply that the Mac, although running now > > on Intel processors, is still big-endian. > > Or maybe the struct module thinks big-endian is native > to all Macs? It could be a bug. > Dunno, I'm on thin ice here. Never used a Mac. Maybe the underlying

Re: Converting a string to the most probable type

2008-03-16 Thread Lie
On Mar 11, 4:15 am, John Machin <[EMAIL PROTECTED]> wrote: > On Mar 11, 3:19 am, [EMAIL PROTECTED] wrote: > > > The trick in the case of when you do not want to guess, or the choices > > grow too much, is to ask the user to tell you in what format they want > > it and format according to their wish

Re: Strange problem with structs Linux vs. Mac

2008-03-16 Thread jasonwiener
Completely helped! Working as expected now. Thanks. You really got me out of a bind! J. On Mar 16, 10:23 am, "Martin Blume" <[EMAIL PROTECTED]> wrote: > "jasonwiener" schrieb > > > I am having a VERY odd problem with unpacking right now. > > I'm reading data from a binary file and then using a

Re: Socket Performance

2008-03-16 Thread Gabriel Genellina
En Sat, 15 Mar 2008 20:08:05 -0200, <[EMAIL PROTECTED]> escribi�: > On Mar 15, 8:18 am, Bryan Olson <[EMAIL PROTECTED]> wrote: >> [EMAIL PROTECTED] wrote: >> > Newbie question:  Can you write to the 'file-like object' a pickle, >> > and receive it intact-- as one string with nothing else? >> >> Ye

Re: When file-like objects aren't file-like enough for Windows

2008-03-16 Thread Tim Golden
William McBrine wrote: > Now, I have a similar problem with subprocess.Popen... The code that > works in Linux looks like this: > > source = urllib.urlopen(url) > child = subprocess.Popen(cmd, stdout=subprocess.PIPE, stdin=source) > try: > shutil.copyfileobj(child.stdout, self

Re: Advantage of the array module over lists?

2008-03-16 Thread sturlamolden
On 13 Mar, 20:40, Tobiah <[EMAIL PROTECTED]> wrote: > I checked out the array module today. It claims that > arrays are 'efficient'. I figured that this must mean > that they are faster than lists, but this doesn't seem > to be the case: > > one.py ## > import array >

Re: os.path.isdir question

2008-03-16 Thread MRAB
On Mar 16, 2:27 am, Benjamin <[EMAIL PROTECTED]> wrote: > On Mar 15, 8:12 pm, lampshade <[EMAIL PROTECTED]> wrote:> Hello, > > > I'm having some problems with os.path.isdir I think it is something > > simple that I'm overlooking. > > > #!/usr/bin/python > > import os > > > my_path = os.path.expan

Re: Creating a file with $SIZE

2008-03-16 Thread Gabriel Genellina
En Wed, 12 Mar 2008 09:37:58 -0200, k.i.n.g. <[EMAIL PROTECTED]> escribi�: > We use dd command in Linux to create a file with of required size. In > similar way, on windows I would like to use python to take the size of > the file( 50MB, 1GB ) as input from user and create a uncompressed > file

Re: Pycon disappointment

2008-03-16 Thread Robert Hicks
On Mar 16, 12:38 pm, [EMAIL PROTECTED] wrote: > On Mar 16, 6:10 am, Bruce Eckel <[EMAIL PROTECTED]> wrote: > > > I think a lot of people have been caught up in the idea that we need > > to commercialize Python, and ride some kind of wave of publicity the > > way that Java and C# and Rails seem to h

Which way to access Scintilla

2008-03-16 Thread Alex
There are several ways to use Scintilla in Python, the ones described at http://scintilla.sourceforge.net/ScintillaRelated.html are: -through wxPython -pyscintilla is the original Python binding for Scintilla's default GTK 1.x class. Includes some additional support, such as nativ

Re: Pycon disappointment

2008-03-16 Thread Pete Forde
> I know what the argument for the results of Pycon 2008 will be: we > needed the money. My answer: it's not worth it. If this is what you > have to do to grow the conference, then don't. If the choice is > between selling my experience to vendors and reducing the size of the > conference, then cut

Re: Using threads in python is safe ?

2008-03-16 Thread Gabriel Genellina
En Sat, 15 Mar 2008 11:57:44 -0200, Deepak Rokade <[EMAIL PROTECTED]> escribi�: > I want to use therads in my application. Going through the docs , I read > about GIL. > Now I am confused whether using threads in python is safe or not. > > One thing I know that if I am accessing global variables

Re: Pycon disappointment

2008-03-16 Thread Bill Mill
Tom Moertel organized a Perl conference with an interesting sponsorship policy, that may be worth considering. He posted about it on the reddit thread about this clp thread: http://reddit.com/info/6c9l6/comments/c03gli2 . (Disclaimer: I have no idea if that would work for pycon at all or in part,

Re: Pycon disappointment

2008-03-16 Thread Bruce Eckel
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 well: it's a single-track > event, no "keynotes", no sch

Re: Weight Problem

2008-03-16 Thread Gabriel Genellina
En Sat, 15 Mar 2008 18:57:36 -0200, Ravi Kumar <[EMAIL PROTECTED]> escribi�: > An Interesting problem, > """ > A man has only 4 bricks of different weights, lies between 1-40KG, > Also, the total weights of Brick A, B, C, D (ie A+B+C+D) is 40KG. > The man uses that brick to calculate every possibl

Re: Types, Cython, program readability

2008-03-16 Thread Ben Finney
sturlamolden <[EMAIL PROTECTED]> writes: > If you don't know how to install a C compiler like Microsoft Visual > Studio, you should not be programming computers anyway. Utter elitist nonsense. Programming should be made easier, and I see Python as a very good language for making programming easi

Re: Types, Cython, program readability

2008-03-16 Thread Jeff Schwab
Ben Finney wrote: > sturlamolden <[EMAIL PROTECTED]> writes: > >> If you don't know how to install a C compiler like Microsoft Visual >> Studio, you should not be programming computers anyway. > > Utter elitist nonsense. > > Programming should be made easier, and I see Python as a very good > la

Re: Pycon disappointment

2008-03-16 Thread Alaric Haag
In article <[EMAIL PROTECTED]>, Bruce Eckel <[EMAIL PROTECTED]> wrote: > If the following seems unnecessarily harsh, it was even more harsh for . As a relative noob to the Python world, (and lurker to the list :) ) I can't speak to differences from previous years. However, my impressions

RE: Python for BlackBerry

2008-03-16 Thread Sandipan Gangopadhyay
I checked; BlackBerry is not on Symbian. They provide a Java Dev Envt (whatever that may mean). Does that mean, we can try and implement JPython/Jython on it? Thanks. Sandipan -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Mike Driscoll Sent: Sunday, Marc

Re: BitVector read-from-file Question

2008-03-16 Thread Gabriel Genellina
En Mon, 10 Mar 2008 14:06:07 -0200, Michael Wieher <[EMAIL PROTECTED]> escribi�: > I'm trying to read in data from large binary files using BitVector > (thanks > btw, for whoever mentioned it on the list, its nice) > > I'll be reading the data in as requested by the user, in (relatively) > s

Re: Basics of Python,learning

2008-03-16 Thread Gabriel Genellina
En Sun, 16 Mar 2008 14:25:26 -0200, Guido van Brakel <[EMAIL PROTECTED]> escribi�: > Why is this not working,and how can I correct it? I guess you want to: a) read a single line containing many numbers separated by white space b) convert them to a list of floating point numbers c) print their m

Re: Advantage of the array module over lists?

2008-03-16 Thread Diez B. Roggisch
sturlamolden schrieb: > On 13 Mar, 20:40, Tobiah <[EMAIL PROTECTED]> wrote: >> I checked out the array module today. It claims that >> arrays are 'efficient'. I figured that this must mean >> that they are faster than lists, but this doesn't seem >> to be the case: >> >> one.py #

Re: Socket Performance

2008-03-16 Thread castironpi
On Mar 16, 1:29 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Sat, 15 Mar 2008 20:08:05 -0200, <[EMAIL PROTECTED]> escribi�: > > > > > > > On Mar 15, 8:18 am, Bryan Olson <[EMAIL PROTECTED]> wrote: > >> [EMAIL PROTECTED] wrote: > >> > Newbie question:  Can you write to the 'file-like obje

Re: Pycon disappointment

2008-03-16 Thread lbonafide
On Mar 16, 2:43 pm, Robert Hicks <[EMAIL PROTECTED]> wrote: > On Mar 16, 12:38 pm, [EMAIL PROTECTED] wrote: > > > On Mar 16, 6:10 am, Bruce Eckel <[EMAIL PROTECTED]> wrote: > > > > I think a lot of people have been caught up in the idea that we need > > > to commercialize Python, and ride some kind

PyCon Feedback and Volunteers (Re: Pycon disappointment)

2008-03-16 Thread Aahz
[warning: rant ahead] [[ Before starting my rant, I would like to encourage anyone who was at PyCon but has not provided formal feedback to use the following URLs: For the conference: http://tinyurl.com/2ara8u For the tutorials: http://tinyurl.com/2ew2pc ]] In article <[EMAIL PROTECTED]>, fuman

Re: Pycon disappointment

2008-03-16 Thread Michael Wieher
well, like, at least he left a free copy of his book on the web, that was kinda decent. 2008/3/16, [EMAIL PROTECTED] <[EMAIL PROTECTED]>: > > On Mar 16, 2:43 pm, Robert Hicks <[EMAIL PROTECTED]> wrote: > > On Mar 16, 12:38 pm, [EMAIL PROTECTED] wrote: > > > > > On Mar 16, 6:10 am, Bruce Eckel <[EM

stdout custom

2008-03-16 Thread castironpi
The code should have extra colons. >>> class ThreadedOut: ... def __init__( self, old ): ... self._old= old ... def write( self, s ): ... self._old.write( ':' ) ... return self._old.write( s ) ... def flush( self ): ... self._old.flush()

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

2008-03-16 Thread Paul Boddie
On 17 Mar, 01:09, [EMAIL PROTECTED] (Aahz) wrote: > > PyCon is what YOU make of it. If you want to change PyCon, propose a > presentation or join the conference committee (concom) -- the latter only > requires signing up for the pycon-organizers mailing list. > > This doesn't mean that we are unin

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

2008-03-16 Thread Ben Finney
[EMAIL PROTECTED] (Aahz) writes: > I would like to encourage anyone who was at PyCon but has not > provided formal feedback to use the following URLs: For those who don't like to follow opaque munged URLs from services that give no indication where you'll end up, here are the actual URLs you'll a

Re: Converting a string to the most probable type

2008-03-16 Thread castironpi
> > > The trick in the case of when you do not want to guess, or the choices > > > grow too much, is to ask the user to tell you in what format they want > > > it and format according to their wishes. > > > > Neatly avoids too much guessing and isn't much extra to add. > > > The plot is about under

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

2008-03-16 Thread Aahz
In article <[EMAIL PROTECTED]>, Ben Finney <[EMAIL PROTECTED]> wrote: >[EMAIL PROTECTED] (Aahz) writes: >> >> I would like to encourage anyone who was at PyCon but has not >> provided formal feedback to use the following URLs: > >For those who don't like to follow opaque munged URLs from services

  1   2   >