Re: python simply not scaleable enough for google?

2009-11-13 Thread sturlamolden
On 14 Nov, 08:39, Robert Brown wrote: > > Using Python 3 annotations, one can imagine a Python compiler that does the > > appropriate thing (shown in the comments) with the following code. > > I can imagine a lot too, but we're talking about Python as it's specified > *today*.  The Python languag

Re: python simply not scaleable enough for google?

2009-11-13 Thread Robert Brown
Vincent Manis writes: > On 2009-11-13, at 18:02, Robert Brown wrote: > >> Common Lisp and Scheme were designed by people who wanted to write >> complicated systems on machines with a tiny fraction of the horsepower of >> current workstations. They were carefully designed to be compiled >> effic

python-daemonize and upstart

2009-11-13 Thread Paul Rudin
I'm experimenting with the daemon module and upstart . There's something I don't understand, which may be more of an upstart issue than a python issue, but I thought I'd start by posting here. Here's a test script: #!/usr/bi

Re: the unicode saga continues...

2009-11-13 Thread Ulrich Eckhardt
Ethan Furman wrote: > Python 2.5.4 (r254:67916, Dec 23 2008, 15:10:54) [MSC v.1310 32 bit > (Intel)] on win32 > Type "help", "copyright", "credits" or "license" for more information. > >>> print u'\xed' > í > >>> print u'\xed'.encode('cp437') > í > >>> print u'\xed'.encode('cp850') > í > >>> pr

Re: python simply not scaleable enough for google?

2009-11-13 Thread Vincent Manis
On 2009-11-13, at 22:51, Alf P. Steinbach wrote: > It's sort of hilarious. It really is, see below. > So no, it's not a language that is slow, it's of course only concrete > implementations that may have slowness flavoring. And no, not really, they > don't, because it's just particular aspects

Re: python simply not scaleable enough for google?

2009-11-13 Thread Robert Brown
Vincent Manis writes: > On 2009-11-13, at 17:42, Robert Brown wrote, quoting me: >> ... Python *the language* is specified in a way that >> makes executing Python programs quickly very very difficult. > That is untrue. I have mentioned before that optional declarations integrate > well with

Re: python simply not scaleable enough for google?

2009-11-13 Thread Alf P. Steinbach
* Rami Chowdhury: On Thu, 12 Nov 2009 12:02:11 -0800, Alf P. Steinbach wrote: I think that was in the part you *snipped* here. Just fill in the mentioned qualifications and weasel words. OK, sure. I don't think they're weasel words, because I find them useful, but I think I see where you're

Re: the unicode saga continues...

2009-11-13 Thread Mark Tolonen
"Ethan Furman" wrote in message news:4afe4141.4020...@stoneleaf.us... So I've added unicode support to my dbf package, but I also have some rather large programs that aren't ready to make the switch over yet. So as a workaround I added a (rather lame) option to convert the unicode-ified dat

Re: python simply not scaleable enough for google?

2009-11-13 Thread Vincent Manis
On 2009-11-13, at 19:53, Paul Rubin wrote: > "Robert P. J. Day" writes: >> http://groups.google.com/group/unladen-swallow/browse_thread/thread/4edbc406f544643e?pli=1 >> thoughts? > > I'd bet it's not just about multicore scaling and general efficiency, > but also the suitability of the language

Re: 2.6.4 Mac x86_64 ?

2009-11-13 Thread Zvezdan Petkovic
On Nov 13, 2009, at 3:58 PM, chris grebeldinger wrote: > Hi All, > I've been having some trouble getting a x86_64/i386 universal > readline.so to build against libedit, on MacOS 10.5.6 as Apple does. > Does anyone have any pointers about what changes I need to make to > setup.py or readline.c to a

the unicode saga continues...

2009-11-13 Thread Ethan Furman
So I've added unicode support to my dbf package, but I also have some rather large programs that aren't ready to make the switch over yet. So as a workaround I added a (rather lame) option to convert the unicode-ified data that was decoded from the dbf table back into an encoded format. Here

Re: Choosing GUI Module for Python

2009-11-13 Thread Aahz
In article , Antony wrote: > > I just wanted to know which module is best for developing designing >interface in python . Haven't tried it, but a new release was just announced for this: http://www.cosc.canterbury.ac.nz/greg.ewing/python_gui/ -- Aahz (a...@pythoncraft.com) <*>

Re: Python & Go

2009-11-13 Thread Michele Simionato
On Nov 14, 4:38 am, Paul Rubin wrote: > It seems a little weird to me that they (Google) are concerned with > the speed of the compiler, indicating that they plan to write enormous > programs in the language.  I've heard they use a 1000-node cluster to > compile their

Re: python simply not scaleable enough for google?

2009-11-13 Thread Paul Rubin
"Robert P. J. Day" writes: > http://groups.google.com/group/unladen-swallow/browse_thread/thread/4edbc406f544643e?pli=1 > thoughts? I'd bet it's not just about multicore scaling and general efficiency, but also the suitability of the language itself for large, complex projects. It's just not p

Re: Writing an emulator in python - implementation questions (for performance)

2009-11-13 Thread greg
Santiago Romero wrote: Can the above be easily done with another already-existing application? (example: can m4 do this job)? The problem you're going to have with something like m4 is indentation. When you inline a function call, somehow the inserted code has to be shifted to the same indent

Re: Python & Go

2009-11-13 Thread Paul Rubin
Duncan Booth writes: > > Haskell handles lookups through its type system; dealing with > > lookup errors (say by chaining the Maybe type) is clean and elegant. > I said exceptions or any other method of error handling. I think the use of an option type (like Maybe) is pretty standard and works fi

Re: python simply not scaleable enough for google?

2009-11-13 Thread Paul Rubin
Vincent Manis writes: > 3. I'm on the python-list mailing list, reading this with Apple's > Mail application, which actually doesn't have convenient ways of > enforcing `Usenet practices' regarding message format. Oh, I see. Damn gateway. > Stephen asked me to wrap my posts. I'm happy to do it.

Re: python simply not scaleable enough for google?

2009-11-13 Thread Vincent Manis
On 2009-11-13, at 18:02, Robert Brown wrote: > Common Lisp and Scheme were designed by people who wanted to write complicated > systems on machines with a tiny fraction of the horsepower of current > workstations. They were carefully designed to be compiled efficiently, which > is not the case wi

Re: python simply not scaleable enough for google?

2009-11-13 Thread David Robinow
On Fri, Nov 13, 2009 at 3:32 PM, Paul Rubin wrote: > ...  This is Usenet so > please stick with Usenet practices.  If you want a web forum there are > plenty of them out there. Actually this is python-list@python.org I don't use usenet and I have no intention to stic

Re: tkFileDialog question

2009-11-13 Thread r
Opps, i see you answered your own question ;-) To save you more hours of Googling take a look at these two sites! #great reference http://infohost.nmt.edu/tcc/help/pubs/tkinter/ #more in-depth http://effbot.org/tkinterbook/ you'll want to keep them both under your pillow. -- http://mail.python

Re: python simply not scaleable enough for google?

2009-11-13 Thread Vincent Manis
On 2009-11-13, at 17:42, Robert Brown wrote, quoting me: > ... Python *the language* is specified in a way that > makes executing Python programs quickly very very difficult. That is untrue. I have mentioned before that optional declarations integrate well with dynamic languages. Apart from C

Re: tkFileDialog question

2009-11-13 Thread r
On Nov 13, 2:47 pm, "Matt Mitchell" wrote: > --- > The information contained in this electronic message and any attached > document(s) is intended only for the personal and confidential use of the > designated recipients named above. This message may be confidenti

Re: #define (from C) in Python

2009-11-13 Thread Rhodri James
On Fri, 13 Nov 2009 08:43:14 -, Ulrich Eckhardt wrote: Santiago Romero wrote: Well, In the above concrete example, that would work, but I was talking for multiple code lines, like: #define LD_r_n(reg) (reg) = Z80ReadMem(r_PC++) #define LD_rr_nn(reg) r_opl = Z80ReadMem(r_PC); r_PC++;

Re: python simply not scaleable enough for google?

2009-11-13 Thread Vincent Manis
On 2009-11-13, at 15:32, Paul Rubin wrote: > This is Usenet so > please stick with Usenet practices. Er, this is NOT Usenet. 1. I haven't, to the best of my recollection, made a Usenet post in this millennium. 2. I haven't fired up a copy of rn or any other news reader in at least 2 deca

Re: python simply not scaleable enough for google?

2009-11-13 Thread Vincent Manis
On 2009-11-13, at 12:46, Brian J Mingus wrote: > You're joking, right? Try purchasing a computer manufactured in this > millennium. Monitors are much wider than 72 characters nowadays, old timer. I have already agreed to make my postings VT100-friendly. Oh, wait, the VT-100, or at least some mode

Re: python simply not scaleable enough for google?

2009-11-13 Thread Robert Brown
J Kenneth King writes: > mcherm writes: >> I think you have a fundamental misunderstanding of the reasons why Python >> is slow. Most of the slowness does NOT come from poor implementations: the >> CPython implementation is extremely well-optimized; the Jython and Iron >> Python implementations

Re: query regarding file handling.

2009-11-13 Thread Rhodri James
On Thu, 12 Nov 2009 09:59:40 -, ankita dutta wrote: hi all, i have a file of 3x3 matrix of decimal numbers(tab separated). like this : 0.020.380.01 0.040.320.00 0.030.400.02 now i want to read 1 row and get the sum of a particular row. but when i am trying

Re: python simply not scaleable enough for google?

2009-11-13 Thread Robert Brown
Vincent Manis writes: > My point in the earlier post about translating Python into Common Lisp or > Scheme was essentially saying `look, there's more than 30 years experience > building high-performance implementations of Lisp languages, and Python > isn't really that different from Lisp, so we o

Re: python simply not scaleable enough for google?

2009-11-13 Thread Robert Brown
Vincent Manis writes: > On 2009-11-11, at 14:31, Alain Ketterlin wrote: > I'm having some trouble understanding this thread. My comments aren't > directed at Terry's or Alain's comments, but at the thread overall. > > 1. The statement `Python is slow' doesn't make any sense to me. Python is a > p

Re: Compiler malware rebutted

2009-11-13 Thread Aahz
In article , David M. Besonen wrote: >On 11/13/2009 3:26 PM, Aahz wrote: >> >> Ken Thompson's classic paper on bootstrapped malware >> finally gets a rebuttal: >> >> http://lwn.net/Articles/360040/ > >thanks for pointing this out. Actually, I found out about it on panix.chat ;-) -- Aahz (a...@

Re: ANN: esky 0.2.1

2009-11-13 Thread Aahz
In article , Ryan Kelly wrote: > >Out of curiosity, what freezer package did you settle on in the end? >I'm curious it see if esky could easily switch between different >freezers (although it currently depends on some rather deep details of >the bbfreeze format). We're currently using py2app and

Re: questions regarding stack size use for multi-threaded python programs

2009-11-13 Thread Andrew MacIntyre
Gabriel Genellina wrote: En Mon, 09 Nov 2009 16:05:31 -0300, Eyal Gordon escribió: background: we are using python 2.4.3 on CentOS 5.3 with many threads - and our shell's default stack size limit is set to 10240KB (i.e. ~10MB). we noticed that python's Threading module appears to create thr

Re: New syntax for blocks

2009-11-13 Thread r
On Nov 13, 3:20 pm, Bruno Desthuilliers wrote: (...snip...) > > I think because (like me) Carl > > put's the language before sewing circles. I think it's just personal > > like all the times before, > > Well, to be true, you did manage to make a clown of yourself more than > once, so don't be surp

Re: Compiler malware rebutted

2009-11-13 Thread David M. Besonen
On 11/13/2009 3:26 PM, Aahz wrote: > Ken Thompson's classic paper on bootstrapped malware > finally gets a rebuttal: > > http://lwn.net/Articles/360040/ thanks for pointing this out. -- david -- http://mail.python.org/mailman/listinfo/python-list

Re: A "terminators' club" for clp

2009-11-13 Thread r
On Nov 13, 5:29 pm, kj wrote: > This is "meta-question" about comp.lang.python.  I apologize in > advance if it has been already discussed.  Also, I don't know enough > about the underlying mechanics of comp.lang.python, so this may be > *totally unfeasible*, but how about giving a few bona fide *

Re: A "terminators' club" for clp

2009-11-13 Thread Paul Rubin
kj writes: > frequent* clp posters the ability to *easily* delete spam from the > comp.lang.python server? Um, this is usenet; there is no comp.lang.python server. Are you saying you want a moderated newsgroup? Hmm, maybe this group is busy enough that there is some merit to that idea. -- ht

Re: python simply not scaleable enough for google?

2009-11-13 Thread Paul Rubin
Tim Chase writes: > Or even just pipe to > your text editor of choice: vi, emacs, ed, cat, and even Notepad > has a "wrap long lines" sort of setting or does the right thing > by default (okay, so cat relies on your console to do the > wrapping, but it does wrap). No, auto wrapping long lines lo

A "terminators' club" for clp

2009-11-13 Thread kj
This is "meta-question" about comp.lang.python. I apologize in advance if it has been already discussed. Also, I don't know enough about the underlying mechanics of comp.lang.python, so this may be *totally unfeasible*, but how about giving a few bona fide *and frequent* clp posters the ability

Compiler malware rebutted

2009-11-13 Thread Aahz
Ken Thompson's classic paper on bootstrapped malware finally gets a rebuttal: http://lwn.net/Articles/360040/ -- Aahz (a...@pythoncraft.com) <*> http://www.pythoncraft.com/ [on old computer technologies and programmers] "Fancy tail fins on a brand new '59 Cadillac didn't mean

Re: ANN: esky 0.2.1

2009-11-13 Thread Ryan Kelly
> >> Recently I was looking into distribution mechanisms, and I passed over > >> bbfreeze because I saw no indication that Python 2.6 was supported. > > > >Not sure if it's officially supported, but I do most of my development > >on Python 2.6 and bbfreeze hasn't given me any problems as yet. > >

__import__ returns module without it's attributes?

2009-11-13 Thread Zac Burns
I've overloaded __import__ to modify modules after they are imported... but running dir(module) on the result only returns __builtins__, __doc__, __file__, __name__, __package__, and __path__. Why is this? More importantly, where can I hook in that would allow me to see the contents of the module?

Re: #define (from C) in Python

2009-11-13 Thread Santiago Romero
> Hey, I got 100% with ASM ZX Spectrum emulator on a low end 386 :-) (I do > not remember the CPU freqeuncy anymore, maybe 25MHz). Yes, in ASM a simple 25 or 33Mhz 386 computer was able to emulate the Spectrum. At least, under MSDOS, like did Warajevo, Z80, x128 and "Spectrum" from Pedro Gimeno.

Re: QuerySets in Dictionaries

2009-11-13 Thread Jerry Hill
On Fri, Nov 13, 2009 at 5:10 PM, scoopseven wrote: > I actually had a queryset that was dynamically generated, so I ended > up having to use the eval function, like this... > > d = {} > for thing in things: >query_name = 'thing_' + str(thing.id) >query_string = 'Thing.objects.filt

Re: bootstrapping on machines without Python

2009-11-13 Thread mmanns
On Fri, 13 Nov 2009 02:40:28 -0800 (PST) Jonathan Hartley wrote: > Even my very limited understanding of the issues is enough to see that > the idea is far from trivial. [...] > In the long run, to be useful for real projects, the bootstrapper > would need to manage some nasty details: > * diff

Re: New syntax for blocks

2009-11-13 Thread Bruno Desthuilliers
r a écrit : > On Nov 12, 2:37 pm, Bruno Desthuilliers > wrote: > >>> Oh i get it now! If i assign a valid value to a variable the variable >>> is also valid...thats...thats... GENUIS! *sarcasm* >> It's not about "assigning a valid value to a variable", it's about the >> name being created (or not

Re: QuerySets in Dictionaries

2009-11-13 Thread scoopseven
On Nov 12, 8:55 pm, Steven D'Aprano wrote: > On Thu, 12 Nov 2009 10:39:33 -0800, scoopseven wrote: > > I need to create a dictionary of querysets.  I have code that looks > > like: > > > query1 = Myobject.objects.filter(status=1) > > query2 = Myobject.objects.filter(status=2) > > query3 = Myobject

Re: The ol' [[]] * 500 bug...

2009-11-13 Thread Jon Clements
On 13 Nov, 21:26, kj wrote: > ...just bit me in the "fuzzy posterior".  The best I can come up with > is the hideous > >   lol = [[] for _ in xrange(500)] > > Is there something better?   That's generally the accepted way of creating a LOL. > What did one do before comprehensions > were availabl

Re: converting latitude and longitude

2009-11-13 Thread ezd
On Nov 13, 2:25 pm, MRAB wrote: > Ronn Ross wrote: > > > I'm attempting to convert latitude and longitude coordinates from ... > > Does anyone know of a library or some existing out their to help with > > this conversion? > Some time ago I saw file named LLUTM... for such conversions with more tha

Re: New syntax for blocks

2009-11-13 Thread Bruno Desthuilliers
r a écrit : > On Nov 12, 7:44 pm, Steven D'Aprano cybersource.com.au> wrote >> Oh, but those hundreds of thousands of man-hours lost to bugs caused by >> assignment-as-an-expression is nothing compared to the dozens of man- >> minutes saved by having one fewer line of code! > > OK, what *if* the

Re: python simply not scaleable enough for google?

2009-11-13 Thread Terry Reedy
Aaron Watters wrote: On Nov 11, 3:15 pm, Terry Reedy wrote: Robert P. J. Day wrote: I can imagine a day when code compiled from Python is routinely time-competitive with hand-written C. That time is now, in many cases. By routinely, I meant ***ROUTINELY***, as in "C become the province of s

Re: wsgi with separate css file

2009-11-13 Thread Aaron Watters
RE: serving static CSS files using WSGI > ...However, this method is fragile and very inefficient. If you want to   > eventually deploy this application somewhere, I would suggest starting   > with a different method. The WHIFF WSGI tools are meant to make this kind of thing easy. In fact the qu

Re: A beginner question about GUI use and development

2009-11-13 Thread CM
On Nov 13, 3:55 am, uap12 wrote: > Hi! > I have written som Python programs but no one with a GUI yet, > i have look around and found a lot of diffrent gui module. > > I will develop program that will use a small amout of GUI part > eg. program to show status about server etc. > > I have looked at

2.6.4 Mac x86_64 ?

2009-11-13 Thread chris grebeldinger
Hi All, I've been having some trouble getting a x86_64/i386 universal readline.so to build against libedit, on MacOS 10.5.6 as Apple does. Does anyone have any pointers about what changes I need to make to setup.py or readline.c to achive this? Has someone already done this and would like to share

Re: bootstrapping on machines without Python

2009-11-13 Thread Thomas Heller
M.-A. Lemburg schrieb: > Jonathan Hartley wrote: >> While examining py2exe et al of late, my thoughts keep returning to >> the idea of writing, in C or similar, a compiled stand-alone >> executable 'bootstrapper', which: >> 1) downloads and install a Python interpreter if none exists >> 2) runs the

RE: tkFileDialog question

2009-11-13 Thread Matt Mitchell
--- The information contained in this electronic message and any attached document(s) is intended only for the personal and confidential use of the designated recipients named above. This message may be confidential. If the reader of this message is not the in

Re: python simply not scaleable enough for google?

2009-11-13 Thread Brian J Mingus
On Fri, Nov 13, 2009 at 12:19 AM, Steven D'Aprano < st...@remove-this-cybersource.com.au> wrote: > On Thu, 12 Nov 2009 22:20:11 -0800, Vincent Manis wrote: > > > When I was approximately 5, everybody knew that higher level languages > were too slow for high-speed numeric computation (I actually di

Re: Psyco on 64-bit machines

2009-11-13 Thread Russ P.
On Nov 12, 12:06 pm, "Russ P." wrote: > I have a Python program that runs too slow for some inputs. I would > like to speed it up without rewriting any code. Psyco seemed like > exactly what I need, until I saw that it only works on a 32-bit > architecture. I work in an environment of Sun Ultras t

Re: python simply not scaleable enough for google?

2009-11-13 Thread Aaron Watters
On Nov 11, 3:15 pm, Terry Reedy wrote: > Robert P. J. Day wrote: > I can imagine a day when code compiled from Python is routinely > time-competitive with hand-written C. That time is now, in many cases. I still stand by my strategy published in Unix World ages ago: get it working in Python, pro

Re: run all scripts in sub-directory as subroutines?

2009-11-13 Thread Tobiah
> This works fine, but in the sub-modules the sys.path appropriately > returns the same as from the parent, I want them to know their own file > names. How?? I can pass it to them, but wondered if there is a more > self-sufficient way for a module to know from where it was invoked. I like the ide

Re: Vote on PyPI comments

2009-11-13 Thread Diez B. Roggisch
Michele Simionato schrieb: On Nov 13, 4:39 pm, Chris Withers wrote: PyPI grew a commenting and rating system a while back, apparently in response to requests from users. However, since it's been rolled out, there's been a backlash from package maintainers who already have mailing lists, bug tra

Re: Dynamic property names on class

2009-11-13 Thread Diez B. Roggisch
Bryan schrieb: On Nov 13, 9:34 am, "Diez B. Roggisch" wrote: Bryan schrieb: I have several properties on a class that have very similar behavior. If one of the properties is set, all the other properties need to be set to None. So I wanted to create these properties in a loop like: class T

Python 2.6.3 TarFile Module Add odd behavior

2009-11-13 Thread Tilson, Greg (IS)
In Windows Python 2.6.3 calling TarFile.add requires arcname= to be set to work with WinZIP or WinRAR Documentation reads: TarFile.add(name, arcname=None, recursive=True, exclude=None) Add the file name to the archive. name may be any type of file (directory, fifo, symbolic link, etc.). If given

Re: bootstrapping on machines without Python

2009-11-13 Thread M.-A. Lemburg
Jonathan Hartley wrote: > While examining py2exe et al of late, my thoughts keep returning to > the idea of writing, in C or similar, a compiled stand-alone > executable 'bootstrapper', which: > 1) downloads and install a Python interpreter if none exists > 2) runs the application's Python source c

Re: converting latitude and longitude

2009-11-13 Thread MRAB
Ronn Ross wrote: I'm attempting to convert latitude and longitude coordinates from degrees minutes and second to decimal form. I would like to go from: N39 42 36.3 W77 42 51.5 to: -77.739855,39.70 Does anyone know of a library or some existing out their to help with this conversion?

converting latitude and longitude

2009-11-13 Thread Ronn Ross
I'm attempting to convert latitude and longitude coordinates from degrees minutes and second to decimal form. I would like to go from: N39 42 36.3 W77 42 51.5 to: -77.739855,39.70 Does anyone know of a library or some existing out their to help with this conversion? -- http://mail.python.o

[no subject]

2009-11-13 Thread Ronn Ross
I'm attempting to convert latitude and longitude coordinates from degrees minutes and second to decimal form. I would like to go from: N39 42 36.3 W77 42 51.5 to: -77.739855,39.70 Does anyone know of a library or some existing out their to help with this conversion? -- http://mail.python

Re: Vote on PyPI comments

2009-11-13 Thread Daniel Fetchinson
>> PyPI grew a commenting and rating system a while back, apparently in >> response to requests from users. However, since it's been rolled out, >> there's been a backlash from package maintainers who already have >> mailing lists, bug trackers, etc for their packages and don't want to >> have to t

Re: object serialization as python scripts

2009-11-13 Thread Chris Rebert
On Fri, Nov 13, 2009 at 10:26 AM, King wrote: >> Why is it easier than the above mentioned - they are *there* (except the >> custom xml), and just can be used. What don't they do you want to do? >> >> Other than that, and even security issues put aside, I don't see much >> difference between pickl

Re: object serialization as python scripts

2009-11-13 Thread King
> Why is it easier than the above mentioned - they are *there* (except the > custom xml), and just can be used. What don't they do you want to do? > > Other than that, and even security issues put aside, I don't see much > difference between pickle and python code, except the latter being more > ve

Re: Unexpected python exception

2009-11-13 Thread Tino Wildenhain
Am 11.11.2009 15:29, schrieb Richard Purdie: On Wed, 2009-11-11 at 05:04 -0800, Chris Rebert wrote: On Wed, Nov 11, 2009 at 4:37 AM, Richard Purdie wrote: Is there a way to make the "global x" apply to all functions without adding it to each one? Thankfully, no. Hmm :(. What I'm trying

Re: Dynamic property names on class

2009-11-13 Thread Bryan
On Nov 13, 9:34 am, "Diez B. Roggisch" wrote: > Bryan schrieb: > > > > > I have several properties on a class that have very similar behavior. > > If one of the properties is set, all the other properties need to be > > set to None.  So I wanted to create these properties in a loop like: > > > cla

Re: object indexing and item assignment

2009-11-13 Thread John Posner
King wrote: class MyFloat(object): def __init__(self, value=0.): self.value = value def set(self, value): self.value = value def get(self): return self.value class MyColor(object): def __init__(self, value=(0,0,0)): self.value = (MyFloat(value[0

Re: Dynamic property names on class

2009-11-13 Thread Diez B. Roggisch
Bryan schrieb: I have several properties on a class that have very similar behavior. If one of the properties is set, all the other properties need to be set to None. So I wanted to create these properties in a loop like: class Test(object): for prop in ['foo', 'bar', 'spam']:

Re: object serialization as python scripts

2009-11-13 Thread Diez B. Roggisch
King schrieb: I have looked upon various object serialization de-serialization techniques. (shelve, pickle, anydbm, custom xml format etc.) What I personally feel that instead of all these methods for saving the objects it would be easier to save the data as python scripts itself. In this case, l

[ANN] pyOpenSSL 0.10

2009-11-13 Thread exarkun
I'm happy to announce the release of pyOpenSSL 0.10. pyOpenSSL 0.10 exposes several more OpenSSL APIs, including support for running TLS connections over in-memory BIOs, access to the OpenSSL random number generator, the ability to pass subject and issuer parameters when creating an X509Extens

Re: wsgi with separate css file

2009-11-13 Thread Rami Chowdhury
On Fri, 13 Nov 2009 08:55:33 -0800, Alena Bacova wrote: Hi, I'm using: from wsgiref import simple_server httpd = simple_server.make_server(HOST, PORT, Test) try: httpd.serve_forever() except KeyboardInterrupt: pass But I can use something else if needed. Application and htmk, css

Dynamic property names on class

2009-11-13 Thread Bryan
I have several properties on a class that have very similar behavior. If one of the properties is set, all the other properties need to be set to None. So I wanted to create these properties in a loop like: class Test(object): for prop in ['foo', 'bar', 'spam']: # Attribut

object serialization as python scripts

2009-11-13 Thread King
I have looked upon various object serialization de-serialization techniques. (shelve, pickle, anydbm, custom xml format etc.) What I personally feel that instead of all these methods for saving the objects it would be easier to save the data as python scripts itself. In this case, loading the data

Re: Adding methods to an object instance

2009-11-13 Thread Bruno Desthuilliers
lallous a écrit : Hello class __object(object): the convention for reusing reserved words as identifiers is to *suffix* them with a single underscore, ie: class object_(object): # def __getitem__(self, idx): return getattr(self, idx) class __dobject(object): pass x = __ob

Re: wsgi with separate css file

2009-11-13 Thread Rami Chowdhury
On Fri, 13 Nov 2009 08:34:57 -0800, Alena Bacova wrote: Hi all, I just wanted to know if anybody tried using wsgi as a web server that would be serving html file with separate css file. I managed to make my wsgi server display only on html file ( it has got the form tag, and I'm serving

Adding methods to an object instance

2009-11-13 Thread lallous
Hello class __object(object): def __getitem__(self, idx): return getattr(self, idx) class __dobject(object): pass x = __object() setattr(x, "0", "hello") print x["0"] y = __dobject(a=1,b=2) setattr(y, "0", "world") #print y["0"] How can I, given an object of instance "__dobject", a

wsgi with separate css file

2009-11-13 Thread Alena Bacova
Hi all, I just wanted to know if anybody tried using wsgi as a web server that would be serving html file with separate css file. I managed to make my wsgi server display only on html file ( it has got the form tag, and I'm serving do_get and do_post call to) but I would like to have formatting st

Re: ANN: esky 0.2.1

2009-11-13 Thread Aahz
In article , Ryan Kelly wrote: > >>>Esky is an auto-update framework for frozen python apps, built on top of >>>bbfreeze. It provides a simple API through which apps can find, fetch >>>and install updates, and a bootstrapping mechanism that keeps the app >>>safe in the face of failed or partial

Re: Vote on PyPI comments

2009-11-13 Thread Michele Simionato
On Nov 13, 4:39 pm, Chris Withers wrote: > > PyPI grew a commenting and rating system a while back, apparently in > response to requests from users. However, since it's been rolled out, > there's been a backlash from package maintainers who already have > mailing lists, bug trackers, etc for their

Vote on PyPI comments

2009-11-13 Thread Chris Withers
Hi All, Apologies for the cross post, but I'm not sure this has received the publicity it deserves... PyPI grew a commenting and rating system a while back, apparently in response to requests from users. However, since it's been rolled out, there's been a backlash from package maintainers wh

Re: Does turtle graphics have the wrong associations?

2009-11-13 Thread Jonathan Campbell
Alf P. Steinbach wrote: One reaction to http://preview.tinyurl.com/ProgrammingBookP3> has been that turtle graphics may be off-putting to some readers because it is associated with children's learning. Incidentally ... something you may wish to consider for inclusion in you book ... games p

tkFileDialog question

2009-11-13 Thread Matt Mitchell
Hi, This is my first attempt to write a script with any kind of gui. All I need the script to do is ask the user for a directory and then do stuff with the files in that directory. I used tkFileDialog.askdirectory(). It works great but it pops up an empty tk window. Is there any way to prevent

Re: bootstrapping on machines without Python

2009-11-13 Thread Martin P. Hellwig
Jonathan Hartley wrote: While examining py2exe et al of late, my thoughts keep returning to the idea of writing, in C or similar, a compiled stand-alone executable 'bootstrapper', which: 1) downloads and install a Python interpreter if none exists 2) runs the application's Python source code usin

Re: bus error in Py_Finalize with ctypes imported

2009-11-13 Thread Robin
On Nov 13, 2:14 pm, Robin wrote: > I am trying to embed Python in a MATLAB mex function. This is loaded > into the MATLAB interpreter - I would like the Python interpreter to > be initialized once and stay there for future calls. I added a call to > Py_Finalize as a mexAtExit handler which is call

Re: Does turtle graphics have the wrong associations?

2009-11-13 Thread BGB / cr88192
"Peter Nilsson" wrote in message news:ed7d74f6-c84d-40f1-a06b-642f988fb...@x25g2000prf.googlegroups.com... > "Alf P. Steinbach" wrote: >> One reaction to http://preview.tinyurl.com/ProgrammingBookP3> >> has >> been that turtle graphics may be off-putting to some >> readers because it is associ

bus error in Py_Finalize with ctypes imported

2009-11-13 Thread Robin
Hi, I am trying to embed Python in a MATLAB mex function. This is loaded into the MATLAB interpreter - I would like the Python interpreter to be initialized once and stay there for future calls. I added a call to Py_Finalize as a mexAtExit handler which is called when the library is unloaded in MA

Re: A beginner question about GUI use and development

2009-11-13 Thread Philip Semanchuk
On Nov 13, 2009, at 3:55 AM, uap12 wrote: Hi! I have written som Python programs but no one with a GUI yet, i have look around and found a lot of diffrent gui module. I will develop program that will use a small amout of GUI part eg. program to show status about server etc. I have looked att

Re: bootstrapping on machines without Python

2009-11-13 Thread Tim Golden
Jonathan Hartley wrote: While examining py2exe et al of late, my thoughts keep returning to the idea of writing, in C or similar, a compiled stand-alone executable 'bootstrapper', which: 1) downloads and install a Python interpreter if none exists 2) runs the application's Python source code usin

Re: #define (from C) in Python

2009-11-13 Thread garabik-news-2005-05
Santiago Romero wrote: > >> > #define STORE_nn_rr(dreg) \ >> >                         r_opl = Z80ReadMem(r_PC); r_PC++;\ >> >                         r_oph = Z80ReadMem(r_PC); r_PC++; \ >> >                         r_tmp = dreg; \ >> >                         Z80WriteMem((r_op),r_tmpl, regs); \

Re: Writing an emulator in python - implementation questions (for performance)

2009-11-13 Thread Bearophile
Try creation an extension module with ShedSkin. Bye, bearophile -- http://mail.python.org/mailman/listinfo/python-list

Re: object indexing and item assignment

2009-11-13 Thread Benjamin Kaplan
On Fri, Nov 13, 2009 at 7:57 AM, King wrote: > class MyFloat(object): >    def __init__(self, value=0.): >        self.value = value > >    def set(self, value): >        self.value = value > >    def get(self): >        return self.value > > class MyColor(object): >    def __init__(self, value=(0

Re: #define (from C) in Python

2009-11-13 Thread Bearophile
Santiago Romero: >Obviously, I prefer to write well structured code but I had to sacrifize SIZE >by SPEED< In C99 you have "inline" (and gcc/gcc-llvm usually inline small functions anyway) that helps avoid many macros. >  Now I'm porting the emulator to a scripted language, so I need > even mo

object indexing and item assignment

2009-11-13 Thread King
class MyFloat(object): def __init__(self, value=0.): self.value = value def set(self, value): self.value = value def get(self): return self.value class MyColor(object): def __init__(self, value=(0,0,0)): self.value = (MyFloat(value[0]),

Re: Writing an emulator in python - implementation questions (for performance)

2009-11-13 Thread Gabriel Genellina
En Thu, 12 Nov 2009 23:29:03 -0300, greg escribió: Carl Banks wrote: You can define constants to access specific registers: R1L = 1 R1H = 2 R1 = 1 breg[R1H] = 2 print wreg[R1] But keep in mind that named "constants" at the module level are really global variables, and therefore incur a dic

Re: Python & Go

2009-11-13 Thread Duncan Booth
Paul Rubin wrote: > Nah, exceptions are an ugly effect that gets in the way of > parallelism. Haskell handles lookups through its type system; dealing > with lookup errors (say by chaining the Maybe type) is clean and > elegant. Erlang handles it by crashing the pr

  1   2   >