Re: basic python questions

2006-11-18 Thread Hendrik van Rooyen
<[EMAIL PROTECTED]> wrote: > 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 what does "upper division" mean in this context ? I

Re: MAKE GOOD MONEY BY INTERNET

2006-11-18 Thread Hendrik van Rooyen
"Paul McGuire" <[EMAIL PROTECTED]> wrote: > Is there no way to filter this kind of junk, short of going to a moderated > list? I don't think its an easy thing to do - short of forcing all new threads to go through some sort of portal, that is moderated, or having members with the privilege of st

How do I stop Python IDLE (GUI) from immediately exiting when I enter it?

2006-11-18 Thread John (Z R) L
Hi all, I am very new to programming, and I chose to study the Python language before C++. I am currently using the Wikibooks "Non-Programmer's Tutorial for Python", and am up to the section "Who goes there"? http://en.wikibooks.org/wiki/Non-Programmer%27s_Tutorial_for_Python/Who_Goes_There%3F Bu

Re: MAKE GOOD MONEY BY INTERNET

2006-11-18 Thread Fredrik Lundh
John Bokma wrote: > dumbfuck Is there no way to filter this kind of junk, short of going to a moderated list? -- http://mail.python.org/mailman/listinfo/python-list

Re: basic python questions

2006-11-18 Thread Paddy
John Machin wrote: > [Aside] How are you going to explain all this to your instructor, who > may be reading all this right now? > The instructor should be proud! He has managed to do his very first post to a this newsgroup, about a homework question, and do it in the right way. that is no mean

Re: cPickle problems

2006-11-18 Thread Paul McGuire
"Jeff Poole" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > So when something tries to retrieve .__getstate__, it returns an empty > string. If I tell it to raise an AttributeException instead, then I > get this message: > > TypeError: a class that defines __slots__ without definin

Re: basic python questions

2006-11-18 Thread John Machin
[EMAIL PROTECTED] wrote: > So I implemented the exception spcified and in testing it returns: > > DeprecationWarning: raising a string exception is deprecated > > I am not to worried about depreciation warning however, out of > curiosity, what would the better way be to handle this? Is there a way

Re: basic python questions

2006-11-18 Thread [EMAIL PROTECTED]
So I implemented the exception spcified and in testing it returns: DeprecationWarning: raising a string exception is deprecated I am not to worried about depreciation warning however, out of curiosity, what would the better way be to handle this? Is there a way that (web site, help documentation,

Re: basic python questions

2006-11-18 Thread [EMAIL PROTECTED]
So I implemented the exception spcified and in testing it returns: DeprecationWarning: raising a string exception is deprecated I am not to worried about depreciation warning however, out of curiosity, what would the better way be to handle this? Is there a way that (web site, help documentation,

Re: Reloading after from adder import * ????

2006-11-18 Thread John Machin
Seymour wrote: > 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

Re: please help me choose a proper gui library.

2006-11-18 Thread krishnakant Mane
On 18 Nov 2006 12:40:57 -0800, sturlamolden <[EMAIL PROTECTED]> wrote: > 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. I also have to consider the iss

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

2006-11-18 Thread Chas Emerick
On Nov 18, 2006, at 6:25 PM, dimitri pater wrote: > 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 us

Re: lxml/ElementTree and .tail

2006-11-18 Thread Chas Emerick
On Nov 18, 2006, at 1:12 PM, Fredrik Lundh wrote: > 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 >

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 uni

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 an

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

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 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. -- http://mail.python.org/ma

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 a

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 --

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 a

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: 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) r

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: 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 l

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 t

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 (a

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"

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

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'reil

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,

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

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 t

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: 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

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. _BEGIN_CODE__

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 -- http://mail.python.org

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

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

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 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: 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 exampl

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

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 errors

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

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

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: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? > > > >D

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. > >

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 > >> > whi

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

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

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 > ed

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? Wou

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

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 T&Cs that forbid long > running processes. I am not sure e

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 run

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. --

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 quick&dirty(TM) implementation bellow. God grief. I followed the implementation in Ingrid Daubechies' and Wim Sweldens' original wavelet lifting paper (J. Fourier Anal.

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: 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 com

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

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 too

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 -- htt

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 accessibilit

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.bincou

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

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: 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. -- http://mail.python.org/mailman/listinfo/python-list

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

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,

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: 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: 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 ;-) >

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: 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: 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: 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

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

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: 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 i

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 wi

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() > > -- http://mail.python.org/m

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 'w

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,

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 > 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()

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 loopin

Having trouble converting popen2 to subprocess

2006-11-18 Thread Daniel Klein
Here's a c routine that prints a single line : #include 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 is run

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? > > > Thankfully, I'm largely on the periphery of that universe (except for bei

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: 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,

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 -- http:/

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 a

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? -- http://mail.python.org/mailman/listinfo/python-list

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 questio

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 > softw

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: 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 S

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 op

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

  1   2   >