Byte wrote:
> Now what do I do if Func1() has multiple outputs and Func2() requires
> them all to give its own output, as follows:
>
> import random
>
> def Func1():
> choice = ('A', 'B', 'C')
> output = random.choice(choice)
> output2 = random.choice(choice)
> return output
>
James Stroud wrote:
> Try this (I think its called "argument expansion", but I really don't
> know what its called, so I can't point you to docs):
>
> def Func1():
> choice = ('A', 'B', 'C')
> output = random.choice(choice)
> output2 = random.choice(choice)
> return output, outpu
nikie napisal(a):
> I'm a little bit stuck with NumPy here, and neither the docs nor
> trial&error seems to lead me anywhere:
> I've got a set of data points (x/y-coordinates) and want to fit a
> straight line through them, using LMSE linear regression. Simple
> enough. I thought instead of looking
In <[EMAIL PROTECTED]>, Terry Hancock
wrote:
>> Epydoc seems to be "dead" and pudge not yet alive:
>
> What leads you to this conclusion? Works pretty well for
> me. Maybe it's just "stable"?
But Docutils is a moving target and now and then the combination of both
breaks and Epydoc doesn't get
Hi
I have python cgi script, but when I call it I got server internal
error. The log in my apache is
[Sat Mar 18 04:17:14 2006] [error] [client 127.0.0.1] (13)Permission
denied: exec of '/srv/www/cgi-bin/helo.cgi' failed
[Sat Mar 18 04:17:14 2006] [error] [client 127.0.0.1] Premature end of
scrip
[EMAIL PROTECTED] wrote:
> I have this python code:
> print >> htmlFile, " style=\"width: 200px; height:18px;\">";
>
>
> But that caues this error, and I can't figure it out why. Any help is
> appreicate
> File "./run.py", line 193, in ?
> print >> htmlFile, " style=\"width: 200px; height:18
Ravi Teja wrote:
> Yes! XPath is a good bet.
> You can also try some Pythonic XML libraries like Amara. You need not
> learn any special language even.
>
> There are good database approaches to XML too, especially if you are
> going to query a document collection as a whole rather than file by
> fi
Steve R. Hastings wrote:
> I have written some Python library modules to help with creating Atom
> syndication feeds. Originally, I had a single module called "PyAtom"; now
> I have split it up into three modules: xmlelements.py, atomfeed.py, and
> feedutils.py.
FWIW, see also Sylvain Hellegouar
Andrew Gwozdziewycz <[EMAIL PROTECTED]> writes:
> Douglas Alan wrote:
>> Ruby didn't start catching on until Ruby on Rails came out. If
>> Python has a naming problem, it's with the name of Django, rather
>> than Python. Firstly, Django doesn't have "Python" in the name, so
>> it doesn't popula
Hello,
I have developped a XMLRPC server, which runs under Gnu/Linux with
python2.3.
This server receives method calls from Windows client. The server got some
parameters which are string, which contains carriage return characters,
just after the line feed character; like "bla\n\rbla".
The probl
John Salerno wrote:
> James Stroud wrote:
>
>> Try this (I think its called "argument expansion", but I really don't
>> know what its called, so I can't point you to docs):
>>
>> def Func1():
>> choice = ('A', 'B', 'C')
>> output = random.choice(choice)
>> output2 = random.choice(choi
"Russ" <[EMAIL PROTECTED]> writes:
> Ben Cartwright wrote:
>> Russ wrote:
>
>> > Does "pow(x,2)" simply square x, or does it first compute logarithms
>> > (as would be necessary if the exponent were not an integer)?
>>
>>
>> The former, using binary exponentiation (quite fast), assuming x is an
>>
Robert Kern wrote:
> vbgunz wrote:
>> I believe I understand now. the yield keyword is sort of like a cousin
>> to return. return will bring back an object I can work with and so does
>> yield *but* yield's object will most likely support the .next() method.
>
> No, that's not really how it works.
"Roedy Green" <[EMAIL PROTECTED]> wrote in
message news:[EMAIL PROTECTED]
> On 17 Mar 2006 00:58:55 -0800, "Fuzzyman" <[EMAIL PROTECTED]> wrote,
> quoted or indirectly quoted someone who said :
>
>>Hmmm... it displays fine via google groups. Maybe it's the reader which
>>is 'non-compliant' ?
> I
I'm using OS X 10.4.5. I have an easy problem that I can't solve:
I have two versions of python installed. 2.3 came with the OS and 2.4 I
installed via fink.
When I call python from the command-line it calls 2.4.
When I just call a *.py file like test.py, it calls 2.3.
1. How do I make both thes
[EMAIL PROTECTED] wrote:
>
> 1. How do I make both these kinds of calls work with 2.4.
Try "/sw/bin/python foo.py" in the terminal and "#!/sw/bin/python" in
your scripts.
> 2. How do I uninstall v. 2.3 completely.
Don't do that. It will break stuff in the OS that depends on Python.
--
Kevin
[EMAIL PROTECTED] wrote:
> I'm using OS X 10.4.5. I have an easy problem that I can't solve:
> I have two versions of python installed. 2.3 came with the OS and 2.4 I
> installed via fink
> 2. How do I uninstall v. 2.3 completely.
Probably not the greatest idea, because pieces of OS X may actu
I was wondering if anyone has written an apache config file parser in
python. There seem to be a number of perl mods to do this. But I don't seem
to be able to find anything in python.
--
David Bear
-- let me buy your intellectual property, I want to own your thoughts --
--
http://mail.python.or
Thanks for the fast responses.>mp
--
http://mail.python.org/mailman/listinfo/python-list
Steven Bethard wrote:
> Colin J. Williams wrote:
>
>> Doc strings provide us with a great opportunity to illuminate our code.
>>
>> In the example below, __init__ refers us to the class's documentation,
>> but the class doc doesn't help much.
>
>
> It doesn't?
>
> >>> print list.__doc__
> list
[EMAIL PROTECTED] wrote:
> Hi
>
> I have python cgi script, but when I call it I got server internal
> error. The log in my apache is
>
> [Sat Mar 18 04:17:14 2006] [error] [client 127.0.0.1] (13)Permission
> denied: exec of '/srv/www/cgi-bin/helo.cgi' failed
> [Sat Mar 18 04:17:14 2006] [error]
[EMAIL PROTECTED] schrieb:
> I'm using OS X 10.4.5. I have an easy problem that I can't solve:
>
> I have two versions of python installed. 2.3 came with the OS and 2.4 I
> installed via fink.
That isn't the "proper" version. While it works, you certainly want the
python 2.4 framework build. Tha
QOTW: "Generally, you should always go for whatever is clearest/most easily
read (not just in Python, but in all languages)." - Timothy Delaney
"You will find as your programming experience increases that the different
languages you learn are appropriate for different purposes, and have
differen
James Stroud wrote:
> Yours is better, after I wrote mine, I realized the asterisk was
> unnecessary for this particular example, except that it makes Func2 more
> general.
Yeah, I tested it. Func2 prints a tuple of a tuple when the asterisk is
used.
But your generator still wins. :)
--
http
>On a different tack, to avoid thinking about any db issues, consider
>subscribing
>to TC2000 (tc2000.com)... they already have all that data,
>in a database which takes about 900Mb when fully installed.
That is an interesting option also. I had actually looked for ready
made databases and didn't
John Salerno wrote:
> James Stroud wrote:
>
> Try this (I think its called "argument expansion", but I really
don't
> know what its called, so I can't point you to docs):
>
> def Func1():
> choice = ('A', 'B', 'C')
> output = random.choice(choice)
> output2 = random.choice(choice)
> return output
I still don't get it...
My data looks like this:
x = [0,1,2,3]
y = [1,3,5,7]
The expected output would be something like (2, 1), as y[i] = x[i]*2+1
(An image sometimes says more than 1000 words, so to make myself clear:
this is what I want to do:
http://www.statistics4u.info/fundstat_eng/cc_regr
nikie wrote:
> I still don't get it...
> My data looks like this:
> x = [0,1,2,3]
> y = [1,3,5,7]
> The expected output would be something like (2, 1), as y[i] = x[i]*2+1
>
> (An image sometimes says more than 1000 words, so to make myself clear:
> this is what I want to do:
> http://www.statist
On Thu, 16 Mar 2006 13:34:14 +0100, "Méta-MCI"
<[EMAIL PROTECTED]> wrote:
>Après, vous pourrez aussi fréquenter le newsgroup :
>fr.comp.lang.python
>qui a l'avantage d'être en français.
But perhaps he's a Flemish speaker - are you trying to start a riot?
DaveM
--
http://mail.python.org/
Using OSX 10.4.5
This is more of a unix/tcsh question than a python question.
Somehow I got to the point where I have two files 'a.py' and 'b.py'
which have identical contents and permissions, but one refuses to
execute:
[blah:/Library/WebServer/CGI-Executables] me% a.py
tcsh: a.py: Command not f
Hi!
I have been trying to figure this out, and need help...
How do I compute an orthogonal complement of a matrix using SVD?
Is there a python lib function or code that does this?
Thanks!
--
http://mail.python.org/mailman/listinfo/python-list
John Salerno wrote:
> After reading the PEP, I'm still not quite sure if there is a
> recommended (or widely preferred) method of naming variables. Here are
> the relevant bits:
>
>> Global Variable Names
>>
>> (Let's hope that these variables are meant for use inside one
>> module
>>
[EMAIL PROTECTED] wrote:
> Hi!
> I have been trying to figure this out, and need help...
> How do I compute an orthogonal complement of a matrix using SVD?
On the chance that this is homework, I will only point out that Golub and van
Loan's book _Matrix Computations_ is essential reading if you ar
Dhanyavaad (thank you)
--
http://mail.python.org/mailman/listinfo/python-list
OK. I hope my understanding of the yield keyword and generators in a
general sense are now better understood. When a generator function is
assigned to an identifier, no code is executed and a generator is
immediately returned. When the next() method is called on the new
generator, code from top to
If I get time I'll expand my thoughts and experiences but for now,
Don't know what Ruby on Rails is but it's catchy and current high volume of
interest makes me think - I should look into it. Django, skip reading this
thread before and I had not even picked up it was a Python product (still
don'
On 17 Mar 2006 12:15:28 -0800
"Byte" <[EMAIL PROTECTED]> wrote:
> Probably a stupid question, but I'm a newbie and this
> really pisses me off. Run this script:
>
> import random
>
> def Func1():
> choice = ('A', 'B', 'C')
> output = random.choice(choice)
>
> def Func2():
> print out
hi
is there a string method to insert characters into a string?
eg
str = "abcdef"
i want to insert "#" into str so that it appears "abc#def"
currently what i did is convert it to a list, insert the character
using insert() and then join them back as string..
thanks
--
http://mail.python.org/mai
Em Sex, 2006-03-17 às 17:32 -0800, [EMAIL PROTECTED] escreveu:
> is there a string method to insert characters into a string?
As far as I know, no. Strings are immutable in Python. That said, the
following method may do what you want:
def insert(original, new, pos):
'''Inserts new inside
"Byte" <[EMAIL PROTECTED]> writes:
> Probably a stupid question, but I'm a newbie and this really pisses me
> off. Run this script:
>
> import random
>
> def Func1():
> choice = ('A', 'B', 'C')
> output = random.choice(choice)
>
> def Func2():
> print output
>
> Func1()
> Func2()
Y
Hi Robert!
Oh! Its not a homework problem...
I read the Golub book, it tells me what an orthogonal complement is,
however, I cannot understand how I can code it.
I know about svd from numpy's mlab, but I what I want to know is how
can I compute an orthogonal complement, using SVD or otherwise.
Than
[EMAIL PROTECTED] wrote:
> The wildcard exclusion problem is interesting enough to have many
> distinct, elegant solutions in as many languages.
In that case, you should have crossposted to comp.lang.python also.
Your program looks like a dog's breakfast.
--
http://mail.python.org/mailman/listi
HI
I am creating a tkinter app.
example
tkMessageBox.showinfo("Window Text", "A short message")
print "blah"
The execution of the application halts when the message box is
displayed until the user clicks OK, then "blah is printed.
However I want the program to display message box and continue
[EMAIL PROTECTED] wrote:
> It would seem that your program is just filtering the full cartesian
> product, right? The solution I'm looking for generates the elements
> one-by-one so that it could be used in a loop.
One advantage of a generator over filtering the full product is that I,
as the user
[EMAIL PROTECTED] wrote:
> Hi Robert!
> Oh! Its not a homework problem...
> I read the Golub book, it tells me what an orthogonal complement is,
> however, I cannot understand how I can code it.
> I know about svd from numpy's mlab, but I what I want to know is how
> can I compute an orthogonal com
I plan to use python parallel and -- fortunately or unfortunately --
there are several implementations. At the moment I'm aware of
http://datamining.anu.edu.au/~ole/pypar/
http://pympi.sourceforge.net/
http://www.fysik.dtu.dk/~schiotz/comp/PythonAndSwig/pythonMPI.html
and wondered if anyone had e
[EMAIL PROTECTED] wrote:
> Using OSX 10.4.5
>
> This is more of a unix/tcsh question than a python question.
> Somehow I got to the point where I have two files 'a.py' and 'b.py'
> which have identical contents and permissions, but one refuses to
> execute:
>
> [blah:/Library/WebServer/CGI-Execut
Julien Fiore wrote:
> Hi,
> I wrote a function to compute openness (a digital elevation model
> attribute). The function opens the gdal-compatible input raster and
> reads the values in a square window around each cell. The results are
> stored in a "1 line buffer". At the end of the line, the buff
Is there an effcient way (more so than cgi) of using Python
with Microsoft IIS? Something equivalent to Perl-ISAPI?
--
http://mail.python.org/mailman/listinfo/python-list
Bill wrote:
> I've written a small program that, in part, reads in a file and parses
> it. Sometimes, the file is gzipped. The code that I use to get the
> file object is like so:
>
> if filename.endswith(".gz"):
> file = GzipFile(filename)
> else:
> file = open(filename)
>
> Then I par
>
> assuming you are running this python script the standard cgi way and not
> through modpython or fastcgi.
yes I'm running it in standard cgi way coz my provider only allow me
that way.
And it's really just simple script. Sorry for the dumb question, I know
modpython but what do you mean by fast
Bill wrote:
> Is there something that can be improved in the Python version?
Seems like GzipFile.readlines is not optimized, file.readline works
better:
C:\py>python -c "file('tmp.txt', 'w').writelines('%d This is a test\n'
% n for n in range(1))"
C:\py>python -m timeit "open('tmp.txt').read
hi
i have a filen with a funny name like \177\177. I guess someone hit
backspace or something before saving it.
It's hidden and it shows when i type ls with the -b switch on unix.
How can i remove this file using python?
thanks
--
http://mail.python.org/mailman/listinfo/python-list
hi
i have a filen with a funny name like \177\177. I guess someone hit
backspace or something before saving it.
It's hidden and it shows when i type ls with the -b switch on unix.
How can i remove this file using python?
--
http://mail.python.org/mailman/listinfo/python-list
I'm also a programmer, as working in front of computer day and day, my
right hand is so tired and ached. So I tried to mouse in both hands. I
find that it is really an efficient way to release pains. At first I
switched the mouse buttons in windows control panel, but it taked me
several steps to fi
vbgunz wrote:
> OK. I hope my understanding of the yield keyword and generators in a
> general sense are now better understood. When a generator function is
> assigned to an identifier, no code is executed and a generator is
> immediately returned. When the next() method is called on the new
> gene
James Stroud wrote:
> Try this (I think its called "argument expansion", but I really don't
> know what its called, so I can't point you to docs):
>
> def Func1():
> choice = ('A', 'B', 'C')
> output = random.choice(choice)
> output2 = random.choice(choice)
> return output, outp
"funkyj" <[EMAIL PROTECTED]> writes:
> One advantage of a generator over filtering the full product is that I,
> as the user of the generator, am not obligated to iterate over the
> entire solution space.
>
> Are there other _practical_ advantages of generators over mapping &
> filtering complete
Out of curiosity, are you also Texas Longhorn JCDenton in another
online life?
--
http://mail.python.org/mailman/listinfo/python-list
For more details about the plan for Python 2.5, see:
http://www.python.org/doc/peps/pep-0356/
The highlights are that we are hoping to put out the first alpha Real
Soon Now, hopefully in a week or two. If there's something you really
think just must be in 2.5 and can't wait until 2.6, now is
Jonathan Ballet wrote:
> The problem is, xmlrpclib "eats" those carriage return characters when
> loading the XMLRPC request, and replace it by "\n". So I got "bla\n\nbla".
>
> When I sent back those parameters to others Windows clients (they are
> doing some kind of synchronisation throught the X
101 - 161 of 161 matches
Mail list logo