Re: matrix algebra

2008-09-23 Thread alain
On Sep 22, 11:32 am, "Tim Leslie" <[EMAIL PROTECTED]> wrote: > There is no need for a wrapper. Both numarray and Numeric have been > deprecated in favour of numpy, so numpy is the only one you need to > use. Numpy should have all the tools you need. If you find something > missing, there's a good c

PyRun_SimpleFile() crashes

2008-09-23 Thread lixinyi . 23
my code: main.cpp #include int main(int argc, char **argv) { Py_Initialize(); FILE *file_1 = fopen("a2l_reader.py","r+"); PyRun_SimpleFile(file_1,"a2l_reader.py"); Py_Finalize(); } compile under windows using MinGW: g++ main.cpp libpython25.a -o a no error was found. But when I run a.exe the

Re: python freeze help

2008-09-23 Thread Gabriel Rossetti
Mike Driscoll wrote: On Sep 23, 5:01 am, Gabriel Rossetti <[EMAIL PROTECTED]> wrote: Hello everyone, I'm trying to use python's freeze utility but I'm running into problems. I called it like this : python /usr/share/doc/python2.5/examples/Tools/freeze/freeze.py ~/Documents/Code/Python/src/j

Re: Python style: exceptions vs. sys.exit()

2008-09-23 Thread Asun Friere
On Sep 24, 8:10 am, Christian Heimes <[EMAIL PROTECTED]> wrote: > Side note: > > sys.exit() is just another way to write raise SystemExit. The function > is defined as: > As can be seen if you were ever silly enough to call sys.exit() in IDLE. ;) -- http://mail.python.org/mailman/listinfo/python-

Re: Python style: exceptions vs. sys.exit()

2008-09-23 Thread Steven D'Aprano
On Tue, 23 Sep 2008 13:25:26 -0700, Drake wrote: > I have a general question of Python style, or perhaps just good > programming practice. > > My group is developing a medium-sized library of general-purpose Python > functions, some of which do I/O. Therefore it is possible for many of > the libr

Re: Visualize class inheritance hierarchy

2008-09-23 Thread Rob Kirkpatrick
On Sep 23, 4:58 pm, Christian Heimes <[EMAIL PROTECTED]> wrote: > Rob Kirkpatrick wrote: > > I'm assuming this has been discussed before, but I'm lacking any > > Google keywords that bring up the appropriate discussion. > > You are looking for "mro" aka method resolution order. The inspect > module

python 3.x third party modules

2008-09-23 Thread km
Hi all, I would like to look at third party modules which are python 3.0 ready. could some one point me to such a resource ? If its not available, it would be useful to host a page regarding this on python.org ? any comments ? KM -- http://mail.python.org/mailman/listinfo/python-list

Re: Docstrings for class attributes

2008-09-23 Thread Steven D'Aprano
On Tue, 23 Sep 2008 15:23:35 +1000, Tom Harris wrote: > Greetings, > > I want to have a class as a container for a bunch of symbolic names for > integers, eg: > > class Constants: > FOO = 1 > BAR = 2 > > Except that I would like to attach a docstring text to the constants, so > that hel

Re: How do I use python object in C++

2008-09-23 Thread lixinyi . 23
On 9月24日, 午後1:15, "Aaron \"Castironpi\" Brady" <[EMAIL PROTECTED]> wrote: > On Sep 23, 11:06 pm, "Aaron \"Castironpi\" Brady" > > > > <[EMAIL PROTECTED]> wrote: > > On Sep 23, 9:30 pm, [EMAIL PROTECTED] wrote: > > > > If the PyObject is a PyList, and all list items are strings, > > > say a=['aaa','

Re: Comparing float and decimal

2008-09-23 Thread Marc 'BlackJack' Rintsch
On Tue, 23 Sep 2008 07:08:07 -0700, Michael Palmer wrote: >> > This seems to break the rule that if A is equal to B and B is equal >> > to C then A is equal to C. >> >> I don't see why transitivity should apply to Python objects in general. > > Well, for numbers it surely would be a nice touch, w

Re: How do I use python object in C++

2008-09-23 Thread Aaron "Castironpi" Brady
On Sep 23, 11:06 pm, "Aaron \"Castironpi\" Brady" <[EMAIL PROTECTED]> wrote: > On Sep 23, 9:30 pm, [EMAIL PROTECTED] wrote: > > > > > If the PyObject is a PyList, and all list items are strings, > > say a=['aaa','bbb','ccc'] > > > How can I have a > > myArray[0] = "aaa" > > myArray[1] = "bbb" > > m

Re: How do I use python object in C++

2008-09-23 Thread Aaron "Castironpi" Brady
On Sep 23, 9:30 pm, [EMAIL PROTECTED] wrote: > If the PyObject is a PyList, and all list items are strings, > say a=['aaa','bbb','ccc'] > > How can I have a > myArray[0] = "aaa" > myArray[1] = "bbb" > myArray[2] = "ccc" > in C++? > > Do I have to > use PyModule_GetDict() to get the dict first? > wh

Re: Detecting the first time I open/append to a file

2008-09-23 Thread Scott David Daniels
Terry Reedy wrote: [EMAIL PROTECTED] wrote: ...If I can sense that the file is being created in the first iteration, I can then use an if statement to decide whether or not I need to write the header. Question: how can I tell if the file is being created or if this its the first iteration? ...

Re: python syntax for conditional is unfortunate

2008-09-23 Thread Roy Smith
"Aaron \"Castironpi\" Brady" <[EMAIL PROTECTED]> wrote: > You're out of options. You have to express it somehow. How about: Assignith z the value of x if the value of b is such that it is true, else assignith it the value of y. Assignith z not the value of w, nor the value of v, lest you ra

Re: python syntax for conditional is unfortunate

2008-09-23 Thread namekuseijin
On 23 set, 22:50, Neal Becker <[EMAIL PROTECTED]> wrote: > I find I'm often tripped up by: > > x = Y (lots of  constructor arguments) if something ... > > on first glance, I don't notice the if. Nobody does. This peculiar syntax has much better usage in short expressions. dothis if this else

Re: How do I use python object in C++

2008-09-23 Thread lixinyi . 23
If the PyObject is a PyList, and all list items are strings, say a=['aaa','bbb','ccc'] How can I have a myArray[0] = "aaa" myArray[1] = "bbb" myArray[2] = "ccc" in C++? Do I have to use PyModule_GetDict() to get the dict first? what about the next? > > What do you know about the contents of 'ar

Re: python syntax for conditional is unfortunate

2008-09-23 Thread Aaron "Castironpi" Brady
On Sep 23, 8:50 pm, Neal Becker <[EMAIL PROTECTED]> wrote: > Aaron "Castironpi" Brady wrote: > > On Sep 23, 6:52 pm, Neal Becker <[EMAIL PROTECTED]> wrote: > >> In hindsight, I am disappointed with the choice of conditional syntax.  I > >> know it's too late to change.  The problem is > > >> y = so

Twisted vs. CherryPy vs. ??? for light-weight web servers

2008-09-23 Thread Michael Mabin
Is there any consensus on what the best lightweight web-server is? Or rather would Twisted be a better choice to choose as a framework that allows me to serve html or xml data for light webservices. Or is CherryPy just as good? -- | _ | * | _ | | _ | _ | * | | * | * | * | -- http://mail.python.o

Re: how to keep a window above all other OS windows?

2008-09-23 Thread Aaron "Castironpi" Brady
On Sep 23, 3:34 pm, dmitrey <[EMAIL PROTECTED]> wrote: > On Sep 23, 11:21 pm, dmitrey <[EMAIL PROTECTED]> wrote: > > > Hi all, > > how to keep a Tkinter window above all other OS windows (i.e. > > including those ones from other programs)? > > > Thank you in advance, > > Dmitrey > > I have put [Tki

Re: python syntax for conditional is unfortunate

2008-09-23 Thread Neal Becker
Aaron "Castironpi" Brady wrote: > On Sep 23, 6:52 pm, Neal Becker <[EMAIL PROTECTED]> wrote: >> In hindsight, I am disappointed with the choice of conditional syntax. I >> know it's too late to change. The problem is >> >> y = some thing or other if x else something_else >> >> When scanning this

Re: python syntax for conditional is unfortunate

2008-09-23 Thread namekuseijin
On 23 set, 20:52, Neal Becker <[EMAIL PROTECTED]> wrote: > In hindsight, I am disappointed with the choice of conditional syntax.  I > know it's too late to change.  The problem is > > y = some thing or other if x else something_else > > When scanning this my eye tends to see the first phrase and

Re: How do I use python object in C++

2008-09-23 Thread Aaron "Castironpi" Brady
On Sep 23, 7:50 pm, [EMAIL PROTECTED] wrote: > for example I have the following code: > > #include > > void exec_pythoncode( int arg, char**argv ) > { >     Py_Initialize(); >     Py_Main(argc,argv); >     Py_Finalize(); > > } > > What I would like to know is how can I get the variables I want > a

Re: python syntax for conditional is unfortunate

2008-09-23 Thread Aaron "Castironpi" Brady
On Sep 23, 6:52 pm, Neal Becker <[EMAIL PROTECTED]> wrote: > In hindsight, I am disappointed with the choice of conditional syntax.  I > know it's too late to change.  The problem is > > y = some thing or other if x else something_else > > When scanning this my eye tends to see the first phrase an

Property Function

2008-09-23 Thread AON LAZIO
Hi, In python code, class A: get(self): do something set(self): do something g=property(get,set) what is the good use of "property" function?, I do not understand clearly.. Thanks in advance -- http://mail.python.org/mailman/listinfo/py

Re: python syntax for conditional is unfortunate

2008-09-23 Thread Ben Finney
Cameron Simpson <[EMAIL PROTECTED]> writes: > A good coder will present things clearly. For trivial stuff the one > line form may be fine, and for longer stuff then this: > > y = some thing or other \ > if x \ > else something_else Parentheses are usually more robust for multi-line

How do I use python object in C++

2008-09-23 Thread lixinyi . 23
for example I have the following code: #include void exec_pythoncode( int arg, char**argv ) { Py_Initialize(); Py_Main(argc,argv); Py_Finalize(); } What I would like to know is how can I get the variables I want after Py_Main(argc,argv) say I have a=[1,2,'Hello World',0.1234] in th

How can I use a PyObject in C++?

2008-09-23 Thread lixinyi . 23
for example: #include void exec_python_code(int arg, char** argv) { Py_Initialize(); Py_Main(argc,argv); Py_Finalize(); } What I would like to know is: after Py_Main(argc,argv); How do I get every variable in python space, say a=[1,2,3,'Hello World',[2,3]] b=['xx','xxx','',0.12

Re: python syntax for conditional is unfortunate

2008-09-23 Thread Cameron Simpson
On 23Sep2008 19:52, Neal Becker <[EMAIL PROTECTED]> wrote: | In hindsight, I am disappointed with the choice of conditional syntax. | I know it's too late to change. The problem is | | y = some thing or other if x else something_else | | When scanning this my eye tends to see the first phrase an

Re: Visualize class inheritance hierarchy

2008-09-23 Thread Aaron "Castironpi" Brady
On Sep 23, 5:53 pm, Rob Kirkpatrick <[EMAIL PROTECTED]> wrote: > Hi All, > > I just finished debugging some code where I needed to determine why > one subclass had a bound method and another did not.  They had > different pedigree's but I didn't know immediately what the > differences were. > > I e

Re: Python is slow?

2008-09-23 Thread bearophileHUGS
sturlamolden: > It seems we have been implementing different algorithms. kd-trees are > not BK-trees. > http://www.scipy.org/Cookbook/KDTree Sorry for my silly mistake :-) Note: in your code I don't know if the collections.deque data structure may help (it's faster than list for appending), but I

Re: finding domain name

2008-09-23 Thread Gabriel Genellina
En Tue, 23 Sep 2008 09:37:44 -0300, Bobby Roberts <[EMAIL PROTECTED]> escribió: hi group. I'm new to python and need some help and hope you can answer this question. I have a situation in my code where i need to create a file on the server and write to it. That's not a problem if i hard cod

Re: Python is slow?

2008-09-23 Thread Robert Kern
Robert Kern wrote: J Peyret wrote: On Sep 23, 8:31 am, [EMAIL PROTECTED] wrote: Guys, this looks like a great data structure/algo for something I am working on. But... where do I find some definitions of the original BK-tree idea? Uh, actually we're talking about kd-trees, not BK-trees. kd-t

Re: Visualize class inheritance hierarchy

2008-09-23 Thread Aaron "Castironpi" Brady
On Sep 23, 5:53 pm, Rob Kirkpatrick <[EMAIL PROTECTED]> wrote: > Hi All, > > I just finished debugging some code where I needed to determine why > one subclass had a bound method and another did not.  They had > different pedigree's but I didn't know immediately what the > differences were. > > I e

Re: Visualize class inheritance hierarchy

2008-09-23 Thread Christian Heimes
Rob Kirkpatrick wrote: I'm assuming this has been discussed before, but I'm lacking any Google keywords that bring up the appropriate discussion. You are looking for "mro" aka method resolution order. The inspect module contains several helper functions to inspect a class hierarchy. The foll

Re: Regex Help

2008-09-23 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Support Desk wrote: > Anybody know of a good regex to parse html links from html code? The one I > am currently using seems to be cutting off the last letter of some links, > and returning links like > > http://somesite.co > > or http://somesite.ph > > the code I

python syntax for conditional is unfortunate

2008-09-23 Thread Neal Becker
In hindsight, I am disappointed with the choice of conditional syntax. I know it's too late to change. The problem is y = some thing or other if x else something_else When scanning this my eye tends to see the first phrase and only later notice that it's conditioned on x (or maybe not notice

Re: appending * to glob returns files with '*' !!

2008-09-23 Thread John [H2O]
No bug indeed, Erik was correct, in fact I had files with the * in the name... Thanks all for your replies! Erik Max Francis wrote: > > John [H2O] wrote: > >> I have a glob.glob search: >> >> searchstring = os.path.join('path'+'EN*') >> files = glob.glob(searchstring) >> for f in files: >>

detektei info detektei hessen in Gunzenhausen

2008-09-23 Thread somenewguy61
http://WWW.DETEKTEI-DETEKTIV.NET http://WWW.DETEKTEI-DETEKTIV.NET http://WWW.DETEKTEI-DETEKTIV.NET http://WWW.DETEKTEI-DETEKTIV.NET http://WWW.DETEKTEI-DETEKTIV.NET http://WWW.DETEKTEI-DETEKTIV.NET http://WWW.DETEKTEI-DETEKTIV.NET http://WWW.DETEKTEI-DETEKTIV.NET http://WWW.DETEKTEI-DETEKTIV.NET ht

Re: Docstrings for class attributes

2008-09-23 Thread George Sakkis
On Sep 23, 3:55 pm, Gerard flanagan <[EMAIL PROTECTED]> wrote: > George Sakkis wrote: > > On Sep 23, 1:23 am, "Tom Harris" <[EMAIL PROTECTED]> wrote: > > >> Greetings, > > >> I want to have a class as a container for a bunch of symbolic names > >> for integers, eg: > > >> class Constants: > >>

Re: Python is slow?

2008-09-23 Thread sturlamolden
On Sep 23, 8:52 pm, [EMAIL PROTECTED] wrote: > Is this a good or bad thing? ;-) It seems we have been implementing different algorithms. kd-trees are not BK-trees. http://www.scipy.org/Cookbook/KDTree -- http://mail.python.org/mailman/listinfo/python-list

Visualize class inheritance hierarchy

2008-09-23 Thread Rob Kirkpatrick
Hi All, I just finished debugging some code where I needed to determine why one subclass had a bound method and another did not. They had different pedigree's but I didn't know immediately what the differences were. I ended up walking the hierarchy, going back one class at a time through the cod

Re: Python is slow?

2008-09-23 Thread Robert Singer
On Tue, 23 Sep 2008 13:34:10 -0700 (PDT), sturlamolden <[EMAIL PROTECTED]> wrote: >1. gfortran is not Absoft. I find this comment absurd. What did you mean by it ? Yes, gfortran is not Absoft, just as red is not blue (?!). I also don't understand whether you're looking for a free or a commercial

Re: a short-cut command for globals().clear() ??

2008-09-23 Thread Ricardo Aráoz
Terry Reedy wrote: > MRAB wrote: >> >> How about something like this: >> >> def clear_workspace(): >> keep_set = set(['__builtins__', '__doc__', '__name__', >> 'clear_workspace']) > > For 2.6/3.0, add __package__ to the list to be kept. > >> for x in globals().keys(): >> if x not

Re: Python style: exceptions vs. sys.exit()

2008-09-23 Thread Christian Heimes
Drake wrote: I have a general question of Python style, or perhaps just good programming practice. My group is developing a medium-sized library of general-purpose Python functions, some of which do I/O. Therefore it is possible for many of the library functions to raise IOError Exceptions. The

Re: Python style: exceptions vs. sys.exit()

2008-09-23 Thread Terry Reedy
Drake wrote: I have a general question of Python style, or perhaps just good programming practice. My group is developing a medium-sized library of general-purpose Python functions, some of which do I/O. Therefore it is possible for many of the library functions to raise IOError Exceptions. The

Re: Detecting the first time I open/append to a file

2008-09-23 Thread Terry Reedy
[EMAIL PROTECTED] wrote: I have a simulation that runs many times with different parameters, and I want to aggregate the output into a single file with one rub: I want a header to be written only the first time. My program looks a bit like this: def main(): for param in range(10): s

Re: Python is slow?

2008-09-23 Thread Robert Kern
sturlamolden wrote: On Sep 23, 10:16 pm, Robert Kern <[EMAIL PROTECTED]> wrote: What's confusing? You do have to create a profile: How do I add a new page to the wiki? I'm only able to edit the front page of the cookbook. But it doesn't help to add link there if I have no page to link. (I may

Re: Python style: exceptions vs. sys.exit()

2008-09-23 Thread Craig Allen
> The > question is: should the library function be able to just dump to > sys.exit() with a message about the error (like "couldn't open this > file"), or should the exception propagate to the calling program which > handles the issue? > my view is that the exceptions are there precisely to tell

Re: Why are "broken iterators" broken?

2008-09-23 Thread Craig Allen
I'm interested what others think of this because at first I couldn't get it... I have an object which can iterate over its parts... and at first I thought, what? I'm supposed to create a new object every time the user needs to iterate the contents? In the end I interpreted that statement as if "un

Re: Python style: exceptions vs. sys.exit()

2008-09-23 Thread Grant Edwards
On 2008-09-23, Drake <[EMAIL PROTECTED]> wrote: > My group is developing a medium-sized library of general-purpose > Python functions, some of which do I/O. Therefore it is possible for > many of the library functions to raise IOError Exceptions. The > question is: should the library function be a

Re: What do you call a class not intended to be instantiated

2008-09-23 Thread Craig Allen
> > > Usegrammers? > usegrammers are just those that use grammars, but misspell it. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python style: exceptions vs. sys.exit()

2008-09-23 Thread Larry Bates
Drake wrote: I have a general question of Python style, or perhaps just good programming practice. My group is developing a medium-sized library of general-purpose Python functions, some of which do I/O. Therefore it is possible for many of the library functions to raise IOError Exceptions. The

Re: Not fully OO ?

2008-09-23 Thread Craig Allen
> if they want to, but it is *fully* OO in that it includes everything > required to do OO. But maybe the original blogger meant by "fully OO" > what I mean by "Pure OO"? it seems to me this is what was meant... pure OO, AND forced to use it. My personal feeling is that python is multiparadigmed

Re: Why no tailcall-optimization?

2008-09-23 Thread Rhamphoryncus
On Sep 22, 7:13 pm, process <[EMAIL PROTECTED]> wrote: > Why doesn't Python optimize tailcalls? Are there plans for it? > > I know GvR dislikes some of the functional additions like reduce and > Python is supposedly about "one preferrable way of doing things" but > not being able to use recursion p

Re: curses.setsyx()?

2008-09-23 Thread linkmaster032000
On Sep 23, 4:16 pm, [EMAIL PROTECTED] wrote: > On Sep 22, 11:24 pm, Tim Roberts <[EMAIL PROTECTED]> wrote: > > > > > [EMAIL PROTECTED] wrote: > > >On Sep 19, 6:42 pm, [EMAIL PROTECTED] wrote: > > >> On Sep 19, 1:24 am, Tim Roberts <[EMAIL PROTECTED]> wrote: > > > >> > [EMAIL PROTECTED] wrote: > > >

Re: finding domain name

2008-09-23 Thread Bobby Roberts
On Sep 23, 1:23 pm, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > Bobby Roberts a écrit : > > > hi group.  I'm new to python and need some help and hope you can > > answer this question.  I have a situation in my code where i need to > > create a file on the server and write to it.  That's not a

Re: Python is slow?

2008-09-23 Thread sturlamolden
On Sep 23, 10:16 pm, Robert Kern <[EMAIL PROTECTED]> wrote: > What's confusing? You do have to create a profile: How do I add a new page to the wiki? I'm only able to edit the front page of the cookbook. But it doesn't help to add link there if I have no page to link. (I may be incredibly stupid

Re: how to keep a window above all other OS windows?

2008-09-23 Thread dmitrey
On Sep 23, 11:21 pm, dmitrey <[EMAIL PROTECTED]> wrote: > Hi all, > how to keep a Tkinter window above all other OS windows (i.e. > including those ones from other programs)? > > Thank you in advance, > Dmitrey I have put [Tkinter] into topic of my message but somehow it has been removed. D. -- ht

Re: Python is slow?

2008-09-23 Thread sturlamolden
On Sep 23, 10:05 pm, Robert Singer <[EMAIL PROTECTED]> wrote: > May I ask what are your main objections to it ? 1. gfortran is not Absoft. 2. If I program the same in C99 and Fortran 95, and compile with gcc and gfortran, the C99 code runs a lot faster (I've only tested with wavelet transforms).

Python style: exceptions vs. sys.exit()

2008-09-23 Thread Drake
I have a general question of Python style, or perhaps just good programming practice. My group is developing a medium-sized library of general-purpose Python functions, some of which do I/O. Therefore it is possible for many of the library functions to raise IOError Exceptions. The question is: sh

[Tkinter] how to keep a window above all other OS windows?

2008-09-23 Thread dmitrey
Hi all, how to keep a Tkinter window above all other OS windows (i.e. including those ones from other programs)? Thank you in advance, Dmitrey -- http://mail.python.org/mailman/listinfo/python-list

Re: curses.setsyx()?

2008-09-23 Thread brad . at . school
On Sep 22, 11:24 pm, Tim Roberts <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > >On Sep 19, 6:42 pm, [EMAIL PROTECTED] wrote: > >> On Sep 19, 1:24 am, Tim Roberts <[EMAIL PROTECTED]> wrote: > > >> > [EMAIL PROTECTED] wrote: > > >> > >I tried curses.setsyx(2,3) in my script and it doesn't m

Re: Python is slow?

2008-09-23 Thread Kay Schluehr
On 23 Sep., 21:23, J Peyret <[EMAIL PROTECTED]> wrote: > On Sep 23, 8:31 am, [EMAIL PROTECTED] wrote: > > Guys, this looks like a great data structure/algo for something I am > working on. > > But... where do I find some definitions of the original BK-tree idea? *geometric data structures*. Just g

Re: Python is slow?

2008-09-23 Thread Robert Kern
sturlamolden wrote: On Sep 23, 9:17 pm, Robert Kern <[EMAIL PROTECTED]> wrote: You could also drop it on the scipy.org wiki in the Cookbook category. Yes, if I could figure out how to use it... What's confusing? You do have to create a profile: http://www.scipy.org/UserPreferences -- Ro

Re: Python is slow?

2008-09-23 Thread Robert Singer
On Tue, 23 Sep 2008 11:07:22 -0700 (PDT), sturlamolden <[EMAIL PROTECTED]> wrote: >On Sep 23, 3:44 pm, Robert Singer <[EMAIL PROTECTED]> wrote: > >> Well, python is not a number crunching language. However much we would >> like it to be (we would ? :-). > >> No scripting language is. > >Not even M

Does anybody use this web framework ?

2008-09-23 Thread Phil Cataldo
Hi, I just found this new? python web framework (http://pypi.python.org/pypi/nagare/0.1.0). Does anybody know or use it ? Regards, Phil -- http://mail.python.org/mailman/listinfo/python-list

Re: Docstrings for class attributes

2008-09-23 Thread Gerard flanagan
George Sakkis wrote: On Sep 23, 1:23 am, "Tom Harris" <[EMAIL PROTECTED]> wrote: Greetings, I want to have a class as a container for a bunch of symbolic names for integers, eg: class Constants: FOO = 1 BAR = 2 Except that I would like to attach a docstring text to the constants, so

Re: Python is slow?

2008-09-23 Thread Robert Kern
J Peyret wrote: On Sep 23, 8:31 am, [EMAIL PROTECTED] wrote: Guys, this looks like a great data structure/algo for something I am working on. But... where do I find some definitions of the original BK-tree idea? Uh, actually we're talking about kd-trees, not BK-trees. kd-trees are for search

Re: Python is slow?

2008-09-23 Thread sturlamolden
On Sep 23, 9:17 pm, Robert Kern <[EMAIL PROTECTED]> wrote: > You could also drop it on the scipy.org wiki in the Cookbook category. Yes, if I could figure out how to use it... -- http://mail.python.org/mailman/listinfo/python-list

Re: Python is slow?

2008-09-23 Thread J Peyret
On Sep 23, 8:31 am, [EMAIL PROTECTED] wrote: Guys, this looks like a great data structure/algo for something I am working on. But... where do I find some definitions of the original BK-tree idea? I looked through Amazon and only a few books mention something like BK-Tree and these are mostly conf

Re: finding domain name

2008-09-23 Thread Bruno Desthuilliers
Bobby Roberts a écrit : hi group. I'm new to python and need some help and hope you can answer this question. I have a situation in my code where i need to create a file on the server and write to it. That's not a problem if i hard code the path. However, the domain name needs to be dynamic s

Re: Detecting the first time I open/append to a file

2008-09-23 Thread Bruno Desthuilliers
Sean Davis a écrit : On Sep 23, 2:02 pm, [EMAIL PROTECTED] wrote: I have a simulation that runs many times with different parameters, and I want to aggregate the output into a single file with one rub: I want a header to be written only the first time. My program looks a bit like this: def mai

Re: Python is slow?

2008-09-23 Thread Robert Kern
[EMAIL PROTECTED] wrote: sturlamolden: Sure I could show you the code, Python and C++, if I had a place to post it.< I think the Python version suffices. If it's not too much private you may post the single minimal/reduced runnable Python module here, it will be deleted in some time (if you

Re: Twisted: Get Protected HTTPS Page via Proxy with Authentication

2008-09-23 Thread Robert Hancock
This works: # Proxy credentials proxyAuth = base64.encodestring('%s:%s' % (proxy_username, proxy_password)) proxy_authHeader = "Basic " + proxyAuth.strip() # Web site credentials basicAuth = base64.encodestring('%s:%s' % (username, password)) authHea

Re: Python is slow?

2008-09-23 Thread sturlamolden
On Sep 23, 8:52 pm, [EMAIL PROTECTED] wrote: > I think the Python version suffices. If it's not too much private you > may post the single minimal/reduced runnable Python module here, it > will be deleted in some time (if you want you can also use a private > paste):http://codepad.org/ http://cod

Re: Python is slow?

2008-09-23 Thread bearophileHUGS
sturlamolden: >F# and OCaml look promising though.< I bet on the future of D and Haskell (and maybe Fortress) instead :-) We'll see. >Sure I could show you the code, Python and C++, if I had a place to post it.< I think the Python version suffices. If it's not too much private you may post the

Re: Linq to Python

2008-09-23 Thread Terry Reedy
> Will LINQ be ported to Python ? I have three suggestions: 1. When starting a new thread, start a *new* thread. Don't tack a new, unrelated subject onto an existing thread. Your post will not be seen by people with readers that collapse thread and who do not happen to read the 'Python is s

Re: Linq to Python

2008-09-23 Thread sturlamolden
On Sep 23, 4:48 pm, hrishy <[EMAIL PROTECTED]> wrote: > Will LINQ be ported to Python ? No, because Python already has list comprehensions and we don't need the XML buzzword. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python is slow?

2008-09-23 Thread namekuseijin
On Sep 23, 10:57 am, Grant Edwards <[EMAIL PROTECTED]> wrote: > AFAICT, _everybody_ is bad at programming C++. Thankfully, at least Numpy developers are not bad at C programming. -- http://mail.python.org/mailman/listinfo/python-list

Re: Linq to Python

2008-09-23 Thread Thomas G. Willis
> But surely the idea behind it will eventually spread.  It's really > just comprehensions generalized over XML and relational datasets, a > noble goal.  Besides, it's main purpose for .NET was to bring > functional programming to it.  Python already has that, somewhat... it's really any object o

FREE INTERNATIONAL TRADE LEADS

2008-09-23 Thread [EMAIL PROTECTED]
http://groups.google.com/group/comp.lang.python/browse_thread/thread/33f3659cc4d30b22# http://groups.google.com/group/comp.lang.python/browse_thread/thread/33f3659cc4d30b22# http://groups.google.com/group/comp.lang.python/browse_thread/thread/33f3659cc4d30b22# http://groups.google.com/group/comp.la

Re: python timers and COM/directshow

2008-09-23 Thread Sayanan Sivaraman
You're right. Let me be more specific. Firstly, the reason I included c++ code is because I'm using Microsoft COM, which is natively in c++, and in fact, to access them through Python I use the comtypes module [import comtypes] and then GetModule('quartz.dll') to access the dll's. I am using the

Re: Docstrings for class attributes

2008-09-23 Thread Terry Reedy
Peter Pearson wrote: On Tue, 23 Sep 2008 15:23:35 +1000, Tom Harris <[EMAIL PROTECTED]> wrote: I want to have a class as a container for a bunch of symbolic names for integers, eg: class Constants: FOO = 1 BAR = 2 Except that I would like to attach a docstring text to the constants, so

Re: python timers and COM/directshow

2008-09-23 Thread Sayanan Sivaraman
On Sep 23, 4:24 am, Tim Golden <[EMAIL PROTECTED]> wrote: > Sayanan Sivaraman wrote: > > So I've written a simple video player using directshow/COM in VC++, > > and I'm in the process of translating it to python.  For example, when > > the avi starts playing, I have a call media_control.Run() , etc

Re: Comparing float and decimal

2008-09-23 Thread Terry Reedy
Gerhard Häring wrote: D'Arcy J.M. Cain wrote: I'm not sure I follow this logic. Can someone explain why float and integer can be compared with each other and decimal can be compared to integer but decimal can't be compared to float? from decimal import Decimal i = 10 f = 10.0 d = Decimal("10.

Re: Detecting the first time I open/append to a file

2008-09-23 Thread Arnaud Delobelle
On Sep 23, 7:02 pm, [EMAIL PROTECTED] wrote: > I have a simulation that runs many times with different parameters, > and I want to aggregate the output into a  single file with one rub: I > want a header to be written only the first time. My program looks a > bit like this: > > def main(): >     fo

Re: Detecting the first time I open/append to a file

2008-09-23 Thread Sean Davis
On Sep 23, 2:02 pm, [EMAIL PROTECTED] wrote: > I have a simulation that runs many times with different parameters, > and I want to aggregate the output into a  single file with one rub: I > want a header to be written only the first time. My program looks a > bit like this: > > def main(): >     fo

Re: Python is slow?

2008-09-23 Thread sturlamolden
On Sep 23, 5:31 pm, [EMAIL PROTECTED] wrote: > Well written C++ code is generally faster or much faster than similar > Python code, but programming in Python is often simpler, and it > generally requires less time. So it may happen that to solve a problem > a Python program that runs in 1 hour tha

Re: Python is slow?

2008-09-23 Thread sturlamolden
On Sep 23, 3:44 pm, Robert Singer <[EMAIL PROTECTED]> wrote: > Well, python is not a number crunching language. However much we would > like it to be (we would ? :-). > No scripting language is. Not even Matlab, R, IDL, Octave, SciLab, S-PLUS or Mathematica? > Before resorting to rewriting the

Re: adding in-place operator to Python

2008-09-23 Thread Terry Reedy
Arash Arfaee wrote: Hi All, Is there anyway to add new in-place operator to Python? Or is there any way to redefine internal in-place operators? Python does not have 'in-place operators'. It has 'augmented assignment statements' that combines a binary operation with an assignment. *If* th

Re: Linq to Python

2008-09-23 Thread namekuseijin
On Sep 23, 2:07 pm, Jason Scheirer <[EMAIL PROTECTED]> wrote: > On Sep 23, 7:48 am, hrishy <[EMAIL PROTECTED]> wrote: > > > Hi > > > Will LINQ be ported to Python ? > > > regards > > Hrishy > > I think this question is more appropriate to ask on an IronPython > development list -- LINQ is pretty so

Detecting the first time I open/append to a file

2008-09-23 Thread tkpmep
I have a simulation that runs many times with different parameters, and I want to aggregate the output into a single file with one rub: I want a header to be written only the first time. My program looks a bit like this: def main(): for param in range(10): simulate(param) def simulat

Re: Matrix programming

2008-09-23 Thread Gary Herron
A. Joseph wrote: I need an ebook or tutorial that teach matrix programming. Perhaps you should start here: http://www.catb.org/~esr/faqs/smart-questions.html#intro Gary Herron -- http://mail.python.org/mailman/listi

Re: Docstrings for class attributes

2008-09-23 Thread George Sakkis
On Sep 23, 1:23 am, "Tom Harris" <[EMAIL PROTECTED]> wrote: > Greetings, > > I want to have a class as a container for a bunch of symbolic names > for integers, eg: > > class Constants: > FOO = 1 > BAR = 2 > > Except that I would like to attach a docstring text to the constants, > so that

Matrix programming

2008-09-23 Thread A. Joseph
I need an ebook or tutorial that teach matrix programming. -- http://mail.python.org/mailman/listinfo/python-list

Re: Linq to Python

2008-09-23 Thread Jason Scheirer
On Sep 23, 7:48 am, hrishy <[EMAIL PROTECTED]> wrote: > Hi > > Will LINQ be ported to Python ? > > regards > Hrishy I think this question is more appropriate to ask on an IronPython development list -- LINQ is pretty solidly intertwined with .Net, and so you'll likely want to look at the .Net impl

Re: Not fully OO ?

2008-09-23 Thread Tim Rowe
2008/9/23 Craig Allen <[EMAIL PROTECTED]>: > So python may turn out to be pure OO I think that's the sort of thing the pedants would hang that hats on, too. Python isn't *pure* OO, in that it lets the programmers do non-OO if they want to, but it is *fully* OO in that it includes everything requi

Re: finding domain name

2008-09-23 Thread Tino Wildenhain
Hi, Bobby Roberts wrote: On Sep 23, 9:10 am, Tino Wildenhain <[EMAIL PROTECTED]> wrote: Bobby Roberts wrote: Depends on the technology/web framework. If you use WSGI, you should use something like: host_name = environ.get("HTTP_HOST", None) or environ["SERVER_NAME"] -- Gerhard Yeah i already

Re: how can I use a callable object as a method

2008-09-23 Thread Piotr Sobolewski
Hrvoje Niksic wrote: >> However, the second version does not work. I think I understand >> why. That's because "a" inside f1 is not a function (but an object). > > An object that defines __call__ is perfectly usable as a function. > Your problem is that it doesn't know how to convert itself to a

SPE restore defaults

2008-09-23 Thread Samuel Morhaim
Hi, I am sorry if this is a bit off topic... I downloaded SPE, but i changed the config option by mistake to a Skin only for Mac... so everytime i start SPE it crashes. I tried uninstalling, but it didnt work, it seems the value is in the registry, but i couldnt find it. Can anyone help? (Spe fo

  1   2   >