Re: How can I speed this function up?

2006-11-18 Thread John Machin
On Nov 18, 2:05 pm, Chris [EMAIL PROTECTED] wrote: with this function I went from 8.04 s to 6.61 s. And your code became less understandable. Now running up against my limited knowledge of python. Any chance of getting faster? You have saved 1.4 *seconds*. What is the normal running time

Re: How can I speed this function up?

2006-11-18 Thread John Machin
On Nov 18, 4:23 pm, Gabriel Genellina [EMAIL PROTECTED] wrote: If you can assume that all items have 6 numbers, it appears best to unroll the inner iteration. Is this meant to be some kind of joke? If so, you should have festooned it with smilies. If not, please proceed straight to

Re: How can I speed this function up?

2006-11-18 Thread Gabriel Genellina
At Saturday 18/11/2006 05:09, John Machin wrote: If you can assume that all items have 6 numbers, it appears best to unroll the inner iteration. Is this meant to be some kind of joke? If so, you should have festooned it with smilies. If not, please proceed straight to

Re: How can I speed this function up?

2006-11-18 Thread DarkBlue
Just to show how much a system set up impacts these results: Result from suse10.1 64 , python 2.4 with AMD FX-55 cpu and about 12 active apps running in the background. 7200rpm sata drives. Preparing data... [write_data1] Preparing output file... [write_data1] Writing... [write_data1] Done in

Re: What do I look for in a shared Python host?

2006-11-18 Thread gabor
Gregor Horvath wrote: walterbyrd schrieb: What other gotchas would I look for? Maybe this is helpfull for you: http://docs.turbogears.org/1.0/Hosting and this: http://code.djangoproject.com/wiki/DjangoFriendlyWebHosts gabor -- http://mail.python.org/mailman/listinfo/python-list

Re: os.lisdir, gets unicode, returns unicode... USUALLY?!?!?

2006-11-18 Thread Leo Kislov
Martin v. Löwis wrote: Leo Kislov schrieb: How about returning two lists, first list contains unicode names, the second list contains undecodable names: files, troublesome = os.listdir(separate_errors=True) and make separate_errors=True by default in python 3.0 ? That would be quite

Re: How can I speed this function up?

2006-11-18 Thread John Machin
Gabriel Genellina wrote: At Saturday 18/11/2006 05:09, John Machin wrote: If you can assume that all items have 6 numbers, it appears best to unroll the inner iteration. Is this meant to be some kind of joke? If so, you should have festooned it with smilies. If not, please proceed

Re: basic python questions

2006-11-18 Thread Marc 'BlackJack' Rintsch
In [EMAIL PROTECTED], [EMAIL PROTECTED] wrote: def Xref(filename): try: fp = open(filename, r) lines = fp.readlines() fp.close() except: raise Couldn't read input file \%s\ % filename dict = {} for line_num in xrange(len(lines)): Instead

Re: Python v PHP for web, and restarting Apache?

2006-11-18 Thread gavino
On Nov 17, 4:46 pm, [EMAIL PROTECTED] wrote: On Nov 17, 12:07 pm, walterbyrd [EMAIL PROTECTED] wrote: I think I have read somewhere that using Python to develop web-applications requires some restarting of the Apache server, whereas PHP does not.It depends what you do. CGI's operate much

Re: lxml/ElementTree and .tail

2006-11-18 Thread Fredrik Lundh
Uche Ogbuji wrote: I certainly have never liked the aspects of the ElementTree API under present discussion. But that's not as important as the fact that I think the above statement is misleading. There has always been a battle in XML between the people who think the serialization is

Re: How can I speed this function up?

2006-11-18 Thread [EMAIL PROTECTED]
Chris wrote: This is just some dummy code to mimic what's being done in the real code. The actual code is python which is used as a scripting language in a third party app. The data structure returned by the app is more or less like the data list in the code below. The test for ELEMENT is

Re: basic python questions

2006-11-18 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: I have a simple assignment for school but am unsure where to go. The assignment is to read in a text file, split out the words and say which line each word appears in alphabetical order. I have the basic outline of the program done which is: looks like an excellent

Re: decompiler

2006-11-18 Thread Steven D'Aprano
On Fri, 17 Nov 2006 20:08:25 -0800, jim wrote: Is there such thing as a free decompile that I can run in windows xp Yes. -- Steven. -- http://mail.python.org/mailman/listinfo/python-list

Re: How can I speed this function up?

2006-11-18 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: Generally, don't create objects, don't perform repeated operations. In this case, batch up I/O. def write_data1(out, data): for i in data: if i[0] is 'ELEMENT': out.write(%s %06d % (i[0], i[1])) for j in i[2]:

Re: [SciPy-user] About alternatives to Matlab

2006-11-18 Thread Prabhu Ramachandran
Brian == Brian Blais [EMAIL PROTECTED] writes: Brian 3) 3D plotting requires yet-another library. luckily I Brian haven't had to use this much, but I hope that someday that Brian it will be part of matplotlib. I'd rather not say anything about this since I have strong opinions

Re: Which one is better for me , SIP or SWIG ?

2006-11-18 Thread Diez B. Roggisch
[EMAIL PROTECTED] schrieb: Hi all, I am going to generate a python wrapper of a C library, and I am wondering which one is a better tool for me, SIP or SWIG ? SWIG supports many scripting languages such as python, ruby, and perl, while SIP is specific to python, so I think maybe SIP is

Re: basic python questions

2006-11-18 Thread Paul McGuire
[EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I have a simple assignment for school but am unsure where to go. The assignment is to read in a text file, split out the words and say which line each word appears in alphabetical order. I have the basic outline of the program done

Re: lxml/ElementTree and .tail

2006-11-18 Thread Paul McGuire
Fredrik Lundh [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] (XML is a bit unusual in this respect, but that's probably just some variation of the bikeshed effect. it's just text, and everyone with a keyboard knows what that is, so we don't need to use established software

installing modules

2006-11-18 Thread kilnhead
I am sure this has been asked a gazillion times, but here it is again. When installing something like pyRTF, I extract the zip file to a folder called pyRTFtemp, and then run setup.py install in that folder. After that, can I get rid of the pyRTFtemp folder, or do I need to keep it? This question

Re: lxml/ElementTree and .tail

2006-11-18 Thread Fredrik Lundh
Paul McGuire wrote: maybe time to switch to decaf... :) do you disagree with my characterization of the state of the XML universe? /F -- http://mail.python.org/mailman/listinfo/python-list

Re: numpy magic: cast scalar returns auto to python types float int ?

2006-11-18 Thread robert
Robert Kern wrote: robert wrote: Didn't find the relevant reasoning within time. Yet guess the reason is isolated-module-centric. I gave you a brief rundown on this list already. http://mail.python.org/pipermail/python-list/2006-October/411145.html think I took this into account

Re: Secure Python

2006-11-18 Thread Stephan Kuhagen
Steve Holden wrote: Anyone with an interest in secure Python should take a look at what Brett Cannon is doing in his postgraduate work. There have been some discussions on the python-dev list. Can you some links to his work, the discussions or some other starting point? Stephan --

Re: installing modules

2006-11-18 Thread Fredrik Lundh
kilnhead wrote: I am sure this has been asked a gazillion times, but here it is again. When installing something like pyRTF, I extract the zip file to a folder called pyRTFtemp, and then run setup.py install in that folder. After that, can I get rid of the pyRTFtemp folder in general, yes.

Re: How can I speed this function up?

2006-11-18 Thread Peter Otten
Chris wrote: So my question is how can I speed up what's happening inside the function write_data()? Only allowed to use vanilla python (no psycho or other libraries outside of a vanilla python install). def write_data1(out, data): for i in data: if i[0] is 'ELEMENT':

Re: lxml/ElementTree and .tail

2006-11-18 Thread Paul McGuire
Fredrik Lundh [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Paul McGuire wrote: maybe time to switch to decaf... :) do you disagree with my characterization of the state of the XML universe? /F Thankfully, I'm largely on the periphery of that universe (except for being a

Having trouble converting popen2 to subprocess

2006-11-18 Thread Daniel Klein
Here's a c routine that prints a single line : #include stdio.h main() { printf (Hello World!\n); } And now the Python program (called 'po.py') that uses 'popen2' : import popen2 (fin, fout) = popen2.popen2(r'c:\home\hw.exe', -1, 't') print fin.readline() fin.close() fout.close() When this

numpy: frequencies

2006-11-18 Thread robert
I have an integer array with values limited to range(a,b) like: ia=array([1,2,3,3,3,4,...2,0,1]) and want to speedly count the frequencies of the integers into get a density matrix. Is this possible without looping? Question 2: is it possible to compute a moving maximum without python looping

Re: Having trouble converting popen2 to subprocess

2006-11-18 Thread tom
Daniel Klein wrote: Here's a c routine that prints a single line : #include stdio.h main() { printf (Hello World!\n); } And now the Python program (called 'po.py') that uses 'popen2' : import popen2 (fin, fout) = popen2.popen2(r'c:\home\hw.exe', -1, 't') print fin.readline()

Re: Having trouble converting popen2 to subprocess

2006-11-18 Thread Fredrik Lundh
Daniel Klein wrote: Now here is my attempt to use the 'subprocess' module : from subprocess import * p = Popen(r'c:\home\hw.exe', bufsize=-1, stdin=PIPE, stdout=PIPE, universal_newlines=True) fin = p.stdin p.stdin is the *other* process' stdin. if you want to read things it prints, read

Re: numpy: frequencies

2006-11-18 Thread Filip Wasilewski
robert wrote: I have an integer array with values limited to range(a,b) like: ia=array([1,2,3,3,3,4,...2,0,1]) and want to speedly count the frequencies of the integers into get a density matrix. Is this possible without looping? See numpy.bincount (for integers = 0) if you mean 'without

Re: Having trouble converting popen2 to subprocess

2006-11-18 Thread Daniel Klein
Thanks /F, that was it. Dan On Sat, 18 Nov 2006 15:03:30 +0100, Fredrik Lundh [EMAIL PROTECTED] wrote: [snip] p.stdin is the *other* process' stdin. if you want to read things it prints, read from p.stdout instead. print fin.readline() fin.close() /F --

Re: basic python questions

2006-11-18 Thread [EMAIL PROTECTED]
I am currently going to school at Utah Valley State College, the course that I am taking is analysis of programming languages. It's an upper division course but our teacher wanted to teach us python as part of the course, he spent about 2 - 3 weeks on python which has been good. I currently work

Re: lxml/ElementTree and .tail

2006-11-18 Thread Chas Emerick
On Nov 18, 2006, at 5:09 AM, Fredrik Lundh wrote: Uche Ogbuji wrote: I certainly have never liked the aspects of the ElementTree API under present discussion. But that's not as important as the fact that I think the above statement is misleading. There has always been a battle in XML

decompiler

2006-11-18 Thread jim
where can I find a free decompile that I can run in windows xp -- http://mail.python.org/mailman/listinfo/python-list

Free Decompiler

2006-11-18 Thread jim
where can I find a free decompile that I can run in windows xp -- http://mail.python.org/mailman/listinfo/python-list

Re: pyfits problem

2006-11-18 Thread Tommy Grav
On Nov 18, 2006, at 12:27 AM, Cygnus X-1 wrote: Have you opened the file? Which version of pyFITS? Consider: fimg=pyfits.open(datafile) self.header=fimg[0].header self.image=fimg[0].data Tom I found that installing the latest version of pyfits solved the problem. Seems like there

Re: Free Decompiler

2006-11-18 Thread hg
jim wrote: where can I find a free decompile that I can run in windows xp Hey Jim, where can you find a free decompile that you can run in windows xp ? hg -- http://mail.python.org/mailman/listinfo/python-list

Re: Has anyone generated Open Office Calc XML files from python

2006-11-18 Thread vasudevram
vj wrote: Isn't generating CSV output suitable to your needs? Python's CSV module makes that very simple - unless you want to include images, etc. in the XLS file? You cannot create multiple worksheets using this method, or apply any other form of formatting. VJ Ok, got it. --

Re: decompiler

2006-11-18 Thread skip
jim where can I find a free decompile that I can run in windows xp Kind of dated perhaps, but google for decompyle. Skip -- http://mail.python.org/mailman/listinfo/python-list

Re: lxml/ElementTree and .tail

2006-11-18 Thread Fredrik Lundh
Chas Emerick wrote: and keep patting our- selves on the back, while the rest of the world is busy routing around us, switching to well-understood XML subsets or other serialization formats, simpler and more flexible data models, simpler API:s, and more robust code. and Python ;-) That's

Re: Python v PHP for web, and restarting Apache?

2006-11-18 Thread walterbyrd
[EMAIL PROTECTED] wrote: Python is much better suited to writing and mainting large web applications though. I have to ask: why is that? Because Python is more readable? Because Python runs faster? Is Python more stable for large scale applications? Does this apply when using Python with

Re: basic python questions

2006-11-18 Thread [EMAIL PROTECTED]
I have taken the coments and think I have implemented most. My only question is how to use the enumerator. Here is what I did, I have tried a couple of things but was unable to figure out how to get the line number. def Xref(filename): try: fp = open(filename, r) except:

Re: basic python questions

2006-11-18 Thread tom
[EMAIL PROTECTED] wrote: I have taken the coments and think I have implemented most. My only question is how to use the enumerator. Here is what I did, I have tried a couple of things but was unable to figure out how to get the line number. Try this in the interpreter, l = [5,4,3,2,1]

Re: basic python questions

2006-11-18 Thread tom
tom wrote: [EMAIL PROTECTED] wrote: I have taken the coments and think I have implemented most. My only question is how to use the enumerator. Here is what I did, I have tried a couple of things but was unable to figure out how to get the line number. Try this in the

Re: Python v PHP for web, and restarting Apache?

2006-11-18 Thread Fredrik Lundh
walterbyrd wrote: Python is much better suited to writing and mainting large web applications though. I have to ask: why is that? modularity, modularity, and modularity. /F -- http://mail.python.org/mailman/listinfo/python-list

Re: basic python questions

2006-11-18 Thread Diez B. Roggisch
[EMAIL PROTECTED] schrieb: I have taken the coments and think I have implemented most. My only Unfortunately, no. question is how to use the enumerator. Here is what I did, I have tried a couple of things but was unable to figure out how to get the line number. def Xref(filename):

Re: lxml/ElementTree and .tail

2006-11-18 Thread Chas Emerick
On Nov 18, 2006, at 11:29 AM, Fredrik Lundh wrote: Chas Emerick wrote: and keep patting our- selves on the back, while the rest of the world is busy routing around us, switching to well-understood XML subsets or other serialization formats, simpler and more flexible data models, simpler

Re: numpy: frequencies

2006-11-18 Thread Tim Hochberg
Filip Wasilewski wrote: robert wrote: I have an integer array with values limited to range(a,b) like: ia=array([1,2,3,3,3,4,...2,0,1]) and want to speedly count the frequencies of the integers into get a density matrix. Is this possible without looping? See numpy.bincount (for integers

please help me choose a proper gui library.

2006-11-18 Thread krishnakant Mane
hello all. after finishing a project in record time using python we have taken up one more project. this time however, we need to do a gui based project which will run on windows xp and 2000. now My question is which gui toolkit should I choose? I had initially raised some doubt about

Re: basic python questions

2006-11-18 Thread Mark Peters
[EMAIL PROTECTED] wrote: dict = {} As a general rule you should avoid variable names which shadow built in types (list, dict, etc.). This can cause unexpected behavior later on. Also, variable names should be more descriptive of their contents. Try word_dict or some such variant --

Re: please help me choose a proper gui library.

2006-11-18 Thread Phil Thompson
On Saturday 18 November 2006 5:44 pm, krishnakant Mane wrote: hello all. after finishing a project in record time using python we have taken up one more project. this time however, we need to do a gui based project which will run on windows xp and 2000. now My question is which gui toolkit

Re: lxml/ElementTree and .tail

2006-11-18 Thread Fredrik Lundh
Chas Emerick wrote: Further, the fact that ET/lxml works the way that it does makes me think that there may be some other landmines in the underlying model that we might not have discovered until some days, weeks, etc., had passed so the real reason you posted your original post was to

Re: please help me choose a proper gui library.

2006-11-18 Thread krishnakant Mane
On 18/11/06, Phil Thompson [EMAIL PROTECTED] wrote: You have to install Qt first. You only need to install the run-time elements (ie. the DLLs) on the client's machine. Unless your application is licensed under the GPL (and you are using the GPL version of Qt and PyQt) then there are

Re: Python v PHP for web, and restarting Apache?

2006-11-18 Thread walterbyrd
Fredrik Lundh wrote: modularity, modularity, and modularity. Can't PHP be made to be just as modular? As a matter of popular practise, I suppose that is not done. I would think that it could be. My big problem with PHP is the lack of backward compatibility. My big problem with Python is

Re: About alternatives to Matlab

2006-11-18 Thread sturlamolden
Filip Wasilewski wrote: Actually you have not. The algorithm you presented gives completely wrong results. Have a look at quickdirty(TM) implementation bellow. God grief. I followed the implementation in Ingrid Daubechies' and Wim Sweldens' original wavelet lifting paper (J. Fourier Anal.

Re: [Zopyrus] A python IDE for teaching that supports cyrillic i/o

2006-11-18 Thread Oleg Broytmann
On Sat, Nov 18, 2006 at 09:01:04PM +0200, Kirill Simonov wrote: Could anyone suggest me a simple IDE suitable for teaching Python as a first programming language to high school students? Does it have to be an IDE? Wouldn't it be better to use a simple text editor + command line? Oleg. --

A python IDE for teaching that supports cyrillic i/o

2006-11-18 Thread Kirill Simonov
Hi, Could anyone suggest me a simple IDE suitable for teaching Python as a first programming language to high school students? It is necessary that it has a good support for input/output in Cyrillic. Unfortunately, most IDEs I tried failed miserably in this respect. My test was simple: I've

Re: What do I look for in a shared Python host?

2006-11-18 Thread Fuzzyman
walterbyrd wrote: For example: - If I want to use Django, I need either FastCGI or Apache 2.X/mod_python 3.x - if I want to use TurboGears, I need Python 2.4: not 2.3 and not 2.5 - I have just learned that some hosters have TCs that forbid long running processes. I am not sure exactly

Re: [Zopyrus] A python IDE for teaching that supports cyrillic i/o

2006-11-18 Thread tom
Oleg Broytmann wrote: On Sat, Nov 18, 2006 at 09:01:04PM +0200, Kirill Simonov wrote: Could anyone suggest me a simple IDE suitable for teaching Python as a first programming language to high school students which operating system would this concern? IDLE which you might find comes

A python IDE for teaching that supports cyrillic i/o

2006-11-18 Thread Kirill Simonov
On Sat, Nov 18, 2006 at 10:08:22PM +0300, Oleg Broytmann wrote: On Sat, Nov 18, 2006 at 09:01:04PM +0200, Kirill Simonov wrote: Could anyone suggest me a simple IDE suitable for teaching Python as a first programming language to high school students? Does it have to be an IDE? Wouldn't

Re: [Zopyrus] A python IDE for teaching that supports cyrillic i/o

2006-11-18 Thread Larry Bates
Oleg Broytmann wrote: On Sat, Nov 18, 2006 at 09:01:04PM +0200, Kirill Simonov wrote: Could anyone suggest me a simple IDE suitable for teaching Python as a first programming language to high school students? Does it have to be an IDE? Wouldn't it be better to use a simple text editor +

Re: About alternatives to Matlab

2006-11-18 Thread sturlamolden
sturlamolden wrote: God grief. I followed the implementation in Ingrid Daubechies' and Wim Sweldens' original wavelet lifting paper (J. Fourier Anal. Appl., 4: 247-269, 1998). If you look at the factorized polyphase matrix for D4 (which gives the inverse transform), their implementation of

Re: [Zopyrus] A python IDE for teaching that supports cyrillic i/o

2006-11-18 Thread Oleg Broytmann
On Sat, Nov 18, 2006 at 09:22:48PM +0200, Kirill Simonov wrote: On Sat, Nov 18, 2006 at 10:08:22PM +0300, Oleg Broytmann wrote: On Sat, Nov 18, 2006 at 09:01:04PM +0200, Kirill Simonov wrote: Could anyone suggest me a simple IDE suitable for teaching Python as a first programming language

Re: [Zopyrus] A python IDE for teaching that supports cyrillic i/o

2006-11-18 Thread Kirill Simonov
On Sat, Nov 18, 2006 at 07:20:49PM +, tom wrote: Oleg Broytmann wrote: On Sat, Nov 18, 2006 at 09:01:04PM +0200, Kirill Simonov wrote: Could anyone suggest me a simple IDE suitable for teaching Python as a first programming language to high school students which operating

Re: [Zopyrus] A python IDE for teaching that supports cyrillic i/o

2006-11-18 Thread Kirill Simonov
On Sat, Nov 18, 2006 at 10:52:35PM +0300, Oleg Broytmann wrote: On Sat, Nov 18, 2006 at 09:22:48PM +0200, Kirill Simonov wrote: Preferably. I believe that using a editor + command line will only make things worse because console and GUI have different encodings under Windows. Ouch! I

Re:A python IDE for teaching that supports cyrillic i/o

2006-11-18 Thread Kirill Simonov
On Sat, Nov 18, 2006 at 01:22:44PM -0600, Larry Bates wrote: Oleg Broytmann wrote: On Sat, Nov 18, 2006 at 09:01:04PM +0200, Kirill Simonov wrote: Could anyone suggest me a simple IDE suitable for teaching Python as a first programming language to high school students? Does it have

Re: numpy magic: cast scalar returns auto to python types float int ?

2006-11-18 Thread Robert Kern
robert wrote: There remains the argument, that (float64,int32) scalars coming out should - by default - support the array interface. How many people are there to expect and use this? I'd have never noticed it, if it wouldn't have been mentioned here. Have never seen such code nor seen

Re: please help me choose a proper gui library.

2006-11-18 Thread sturlamolden
krishnakant Mane wrote: now My question is which gui toolkit should I choose? It's a matter of taste. I would recommend PyGTK (yes it runs on Windows). You can design the GUI in a fly with GLADE, and import it as an XML resource in Python with one single line of code. It will save you an awful

Amazing !!!

2006-11-18 Thread youtube333
Priests Preachers Coming to Islam? Former American Priest tells his story : http://islamtomorrow.com -- http://mail.python.org/mailman/listinfo/python-list

print with variable justification (with *)

2006-11-18 Thread Why Tea
print format % values An optional minimum width of the conversion, specified using one or more digits or an asterisk (*), which means that the width is taken from the next item in values That's from one of O'reilly's books. But there is no example and I couldn't get it to work by trials and

Re: print with variable justification (with *)

2006-11-18 Thread tom
Why Tea wrote: print format % values An optional minimum width of the conversion, specified using one or more digits or an asterisk (*), which means that the width is taken from the next item in values That's from one of O'reilly's books. But there is no example and I couldn't get it to

Re: print with variable justification (with *)

2006-11-18 Thread Marc 'BlackJack' Rintsch
In [EMAIL PROTECTED], Why Tea wrote: print format % values An optional minimum width of the conversion, specified using one or more digits or an asterisk (*), which means that the width is taken from the next item in values That's from one of O'reilly's books. But there is no example and I

Re: [Zopyrus] A python IDE for teaching that supports cyrillic i/o

2006-11-18 Thread Gleb Kulikov
В сообщении от Воскресенье 19 Ноябрь 2006 01:01 Kirill Simonov написал: first programming language to high school students? It is necessary Unfortunately, most IDEs I tried failed miserably in this respect. My For the record, I've checked IDLE, PythonWin, Eric, DrPython, SPE, and Pardon,

Re: MAKE GOOD MONEY BY INTERNET

2006-11-18 Thread John Bokma
Paul McGuire [EMAIL PROTECTED] wrote: Congratulations, dumbfuck -- John MexIT: http://johnbokma.com/mexit/ personal page: http://johnbokma.com/ Experienced programmer available: http://castleamber.com/

Re: [Zopyrus] A python IDE for teaching that supports cyrillic i/o

2006-11-18 Thread Kirill Simonov
On Sun, Nov 19, 2006 at 02:49:43AM +0600, Gleb Kulikov wrote: В сообщении от Воскресенье 19 Ноябрь 2006 01:01 Kirill Simonov написал: first programming language to high school students? It is necessary Unfortunately, most IDEs I tried failed miserably in this respect. My For the

Re: print with variable justification (with *)

2006-11-18 Thread Why Tea
In [50]: '%*s' % (5, 'spam') Out[50]: ' spam' Marc, that's exactly what I need. Thanks! /Why Tea -- http://mail.python.org/mailman/listinfo/python-list

Overwrite only one function with property()

2006-11-18 Thread Kai Kuehne
Hi list! It is possible to overwrite only one function with the property-function? x = property(getx, setx, delx, 'doc') I just want to overwrite setx, but when I set the others to None, I can't read and del the member. Any ideas or is this not possible? Thank you! Kai --

syntax error in sum(). Please explicate.

2006-11-18 Thread Michael Press
I have not written python codes nor run any. I saw this code posted and decided to try it. It fails. I read the tutorial and the entry for the built in function sum, but still do not see the problem. The code was cut and paste. Please help. Thanks.

Re: Overwrite only one function with property()

2006-11-18 Thread George Sakkis
Kai Kuehne wrote: Hi list! It is possible to overwrite only one function with the property-function? x = property(getx, setx, delx, 'doc') I just want to overwrite setx, but when I set the others to None, I can't read and del the member. Any ideas or is this not possible? There are no

Re: syntax error in sum(). Please explicate.

2006-11-18 Thread tom
Michael Press wrote: I have not written python codes nor run any. I saw this code posted and decided to try it. It fails. I read the tutorial and the entry for the built in function sum, but still do not see the problem. The code was cut and paste. Please help. Thanks.

Re: syntax error in sum(). Please explicate.

2006-11-18 Thread Matt Moriarity
try surrounding your sum argument in brackets: sum([phi(x // ps[i+1], i) for i in range(a)]) instead of: sum(phi(x // ps[i+1], i) for i in range(a)) On Nov 18, 5:23 pm, Michael Press [EMAIL PROTECTED] wrote: I have not written python codes nor run any. I saw this code posted and decided to

Re: print with variable justification (with *)

2006-11-18 Thread John Machin
tom wrote: Why Tea wrote: print format % values An optional minimum width of the conversion, specified using one or more digits or an asterisk (*), which means that the width is taken from the next item in values That's from one of O'reilly's books. But there is no example and I

Re: syntax error in sum(). Please explicate.

2006-11-18 Thread Paul Rubin
Michael Press [EMAIL PROTECTED] writes: File /Users/mdp/source/prime_counter_python, line 6 return x - sum(phi(x // ps[i+1], i) for i in range(a)) ^ SyntaxError: invalid syntax Here are some lines from python -v: Python 2.3 (#1, Sep 13

Re: print with variable justification (with *)

2006-11-18 Thread tom
John Machin wrote: tom wrote: Why Tea wrote: print format % values An optional minimum width of the conversion, specified using one or more digits or an asterisk (*), which means that the width is taken from the next item in values That's from one of O'reilly's books. But there

Re: How can I speed this function up?

2006-11-18 Thread [EMAIL PROTECTED]
Peter Otten wrote: # Norvitz/Lundh def writelines_data(out, data, map=map, str=str): SPACE_JOIN = ' '.join out.writelines( ELEMENT %06d %s\n % (i1, SPACE_JOIN(map(str, i2))) for i0, i1, i2 in data if i0 == 'ELEMENT' ) def print_data(out,

Re: syntax error in sum(). Please explicate.

2006-11-18 Thread John Machin
Michael Press wrote: I have not written python codes nor run any. I saw this code posted and decided to try it. It fails. I read the tutorial and the entry for the built in function sum, but still do not see the problem. The code was cut and paste. I doubt it -- none should be None Please

Re: please help me choose a proper gui library.

2006-11-18 Thread Phil Thompson
On Saturday 18 November 2006 6:22 pm, krishnakant Mane wrote: On 18/11/06, Phil Thompson [EMAIL PROTECTED] wrote: You have to install Qt first. You only need to install the run-time elements (ie. the DLLs) on the client's machine. Unless your application is licensed under the GPL (and you

Re: Overwrite only one function with property()

2006-11-18 Thread gagsl-py
On 18 nov, 19:06, Kai Kuehne [EMAIL PROTECTED] wrote: It is possible to overwrite only one function with the property-function? x = property(getx, setx, delx, 'doc') I just want to overwrite setx, but when I set the others to None, I can't read and del the member. Any ideas or is this not

Re: print with variable justification (with *)

2006-11-18 Thread John Machin
tom wrote: John Machin wrote: Not quite so many folks come to Python with a background in C these days. Is anyone aware of a tutorial that covers % formatting from a standing start? If you're on a unix system you can probably do `man fprintf`, but it will mean wading through a lot of

Re: decompiler

2006-11-18 Thread Steven D'Aprano
On Sat, 18 Nov 2006 07:42:58 -0800, jim wrote: where can I find a free decompile that I can run in windows xp Here: http://catb.org/esr/faqs/smart-questions.html -- Steven. -- http://mail.python.org/mailman/listinfo/python-list

Re: What do I look for in a shared Python host?

2006-11-18 Thread dimitri pater
Hi, is there any reason for you wanting to use a shared host? Just asking.. Maybe you could use a VPS as this is not too expensive these days. Of course, it would require more work to set things up. But it's not too hard... (eg using apt-get,webmin,some basic Linux skills using the command line)

Re: syntax error in sum(). Please explicate.

2006-11-18 Thread Michael Press
In article [EMAIL PROTECTED] , Matt Moriarity [EMAIL PROTECTED] wrote: try surrounding your sum argument in brackets: sum([phi(x // ps[i+1], i) for i in range(a)]) instead of: sum(phi(x // ps[i+1], i) for i in range(a)) Thank you. That makes it work. -- Michael Press --

Re: syntax error in sum(). Please explicate.

2006-11-18 Thread Tim Peters
[Matt Moriarity] try surrounding your sum argument in brackets: sum([phi(x // ps[i+1], i) for i in range(a)]) instead of: sum(phi(x // ps[i+1], i) for i in range(a)) [Michael Press] Thank you. That makes it work. But is a wrong solution ;-) As others have suggested, it's almost

Re: decompiler

2006-11-18 Thread Fuzzyman
John Bokma wrote: jim [EMAIL PROTECTED] wrote: Is there such thing as a free decompile that I can run in windows xp You asked the same Q in comp.lang.perl.misc... That's terrible. You read comp.lang.perl.misc *as well* ? ;-) Fuzzyman http://www.voidspace.org.uk/index2.shtml --

Finding skilled pythonistas for micro-jobs?

2006-11-18 Thread darran
I'm a partner in a design and technology studio that creates large-scale interactive exhibits for museums. We are agile - by choice. For big 6-12 month projects, we try and secure exceptional python talent on contract. The python job board addresses this need. Every few weeks though I run up

Re: Finding skilled pythonistas for micro-jobs?

2006-11-18 Thread Paul Rubin
darran [EMAIL PROTECTED] writes: Any suggestions then for locating skilled Python/C++ programmers for these small (micro) jobs? I've taken a number of these and always regretted it. They've been far more hassle than they're worth. But maybe that's just me. --

Re: Finding skilled pythonistas for micro-jobs?

2006-11-18 Thread Beliavsky
I have gotten some Python tasks done at http://www.rentacoder.com. Progammers are cheaper outside the U.S. and Western Europe, and you can get a lot done for even $100. -- http://mail.python.org/mailman/listinfo/python-list

Re: Finding skilled pythonistas for micro-jobs?

2006-11-18 Thread Chuck Rhode
Paul Rubin wrote this on Sat, Nov 18, 2006 at 04:39:47PM -0800. My reply is below. darran [EMAIL PROTECTED] writes: Any suggestions then for locating skilled Python/C++ programmers for these small (micro) jobs? I've taken a number of these and always regretted it. They've been far more

Reloading after from adder import * ????

2006-11-18 Thread Seymour
I created a module with the DictAdder subclass as follows: class DictAdder(Adder): def add(self, x, y): new={} for k in x.keys(): new[k]=x[k] for k in y.keys(): new[k]=y[k] return new At the interactive prompt I then said: from Adder import * After defining

Re: Re:A python IDE for teaching that supports cyrillic i/o

2006-11-18 Thread PyScripter
Kirill Simonov wrote: PyScripter does, indeed, look nice, but unfortunately it appeared to have similar issues with cyrillic support. Thank you anyway for the suggestion. What are the issues? PyScripter offers full support for utf-8 encoded files and PEP-263. The editor internally is

  1   2   >