Executing python script in non-interactive mode on cygwin (windows)

2006-01-23 Thread Pankaj
I am facing a very basic problem as any new bie would face. I know perl and now i want to use python In perl, it is very simple , just "perl scriptname.pl" will execute the script. But i think python is worse than perl It takes to interactive mode , which i don;t want to use. "python scriptna

Re: Executing python script in non-interactive mode on cygwin (windows)

2006-01-23 Thread Fredrik Lundh
"Pankaj" wrote: > I know perl and now i want to use python > > In perl, it is very simple , just > "perl scriptname.pl" > will execute the script. > > But i think python is worse than perl > > It takes to interactive mode , which i don;t want to use. > > "python scriptname.py" > does not execute

Re: Executing python script in non-interactive mode on cygwin (windows)

2006-01-23 Thread Pankaj
Thanks it was my mistake -- http://mail.python.org/mailman/listinfo/python-list

Re: Executing python script in non-interactive mode on cygwin (windows)

2006-01-23 Thread Sybren Stuvel
Pankaj enlightened us with: > But i think python is worse than perl No it isn't. > It takes to interactive mode , which i don;t want to use. Then don't use it. > "python scriptname.py" > does not execute python script Yes it does. > 1. I placed these contents in a file named "1.py" > a,b=0,1

Re: calling python from C#...

2006-01-23 Thread Jens Theisen
There is IronPython which compiles to .NET. And there was another project bridging the .NET runtime with the standard Python interpreter of which I forgot the name. Jens -- http://mail.python.org/mailman/listinfo/python-list

Re: Decimal vs float

2006-01-23 Thread Bengt Richter
On Sat, 21 Jan 2006 14:28:20 +1100, Steven D'Aprano <[EMAIL PROTECTED]> wrote: >On Fri, 20 Jan 2006 04:25:01 +, Bengt Richter wrote: > >> On Thu, 19 Jan 2006 12:16:22 +0100, =?ISO-8859-1?Q?Gerhard_H=E4ring?= >> <[EMAIL PROTECTED]> wrote: >> [...] >>> >>>floating points are always imprecise, s

Re: Who is www.python.org for? (was Re: New Python.org website ?)

2006-01-23 Thread Tim Parkin
Terry Hancock wrote: > On 22 Jan 2006 14:18:18 -0800 > *I* don't want a "slick brochure" for Python as the website. > > For all the commercial value in Python (and there is plenty, > I am sure), it's not Java, and I don't want it to be. I'm > cool with suits loving it too, but I don't want to hav

Re: Redirecting standard out in a single namespace

2006-01-23 Thread Bengt Richter
On 20 Jan 2006 07:37:15 -0800, "Fuzzyman" <[EMAIL PROTECTED]> wrote: >Hello, > >I'm trying to redirect standard out in a single namespace. > >I can replace sys.stdout with a custom object - but that affects all >namespaces. > >There will be code running simultaneously that could import sys >afterw

Re: Read from Serial Port

2006-01-23 Thread Neil Benn
Casey Bralla wrote: >I'd like to read ASCII data from a serial port, but (once again) I'm having >trouble getting started. (Can't seem to find the basic level of docs to >get going ) > >I'd like to use only standard "built-in" modules if possible. > >Could somebody offer a simple code-snippet to

Re: OT: excellent book on information theory

2006-01-23 Thread Steven D'Aprano
On Sun, 22 Jan 2006 17:15:21 -0500, val bykoski wrote: > The existing (formal) language, being helpful, was created > hundreds years ago and of course needs an update. How does this follow? Why does something need to be updated *just* because it was created hundreds of years ago? Isn't it more l

CFP: IAENG International Workshop on Software Engineering (in IMECS 2006)

2006-01-23 Thread imecs_2006
Call for Papers From: International Association of Engineers (http://www.iaeng.org) Journal Engineering Letters (http://www.engineeringletters.com) The 2006 IAENG International Workshop on Software Engineering (Part of The International MultiConference of Engineers and Computer Scientists IMECS 2

Re: Some thougts on cartesian products

2006-01-23 Thread Bryan Olson
Christoph Zwerschke wrote: [...] > That may be the main problem to decide whether the cartesian product > should return a generator or a list. The Cartesion product is a set. [...] > That's the other problem. The uses cases (like the password cracker > example) are very limited and in these cas

CFP: IAENG International Workshop on Computer Science (in IMECS 2006)

2006-01-23 Thread imecs2006
Call for Papers From: International Association of Engineers (http://www.iaeng.org) Journal Engineering Letters (http://www.engineeringletters.com) The 2006 IAENG International Workshop on Computer Science (Part of The International MultiConference of Engineers and Computer Scientists IMECS 2006

Re: Python code written in 1998, how to improve/change it?

2006-01-23 Thread Bengt Richter
On Mon, 23 Jan 2006 08:53:59 +1300, Carl Cerecke <[EMAIL PROTECTED]> wrote: >Bengt Richter wrote: >> On Thu, 19 Jan 2006 23:16:57 -0500, Peter Hansen <[EMAIL PROTECTED]> wrote: > >> How about something like >> >> >>> actions = dict( >> ...a=compile('print "A"; state="b"','','exec'), >> ...

Re: Arithmetic sequences in Python

2006-01-23 Thread Steven D'Aprano
On Sun, 22 Jan 2006 16:40:48 -0800, Paul Rubin wrote: > Steve Holden <[EMAIL PROTECTED]> writes: >> > The current list function is supposed to be something like a >> > typecast: >> > >> list() isn't a function, it's a type. > > I'm not sure what the distinction is supposed to be. "list" is anywa

Re: Some thougts on cartesian products

2006-01-23 Thread Steven D'Aprano
On Mon, 23 Jan 2006 01:25:36 +, Bryan Olson wrote: >> Sometimes I was missing such a feature. >> What I expect as the result is the "cartesian product" of the strings. > > There's no such thing; you'd have to define it first. Are duplicates > significant? Order? Google "cartesian product" an

Re: Some thougts on cartesian products

2006-01-23 Thread Steven D'Aprano
On Mon, 23 Jan 2006 10:36:55 +, Bryan Olson wrote: > Christoph Zwerschke wrote: > [...] >> That may be the main problem to decide whether the cartesian product >> should return a generator or a list. > > The Cartesion product is a set. And the generalization of mathematical sets in Python c

Re: Redirecting standard out in a single namespace

2006-01-23 Thread Pan Menghan
Maybe you can use __name__ to determine which module the print statement is in:class out: def write(s,a): if __name__ =="myModule": mylog.write(a) else: sys.__stdout__.write(a)sys.stdout = out() -- http://mail.python.org/mailman/listinfo/python-list

Re: Some thougts on cartesian products

2006-01-23 Thread Erik Max Francis
Bryan Olson wrote: > Christoph Zwerschke wrote: > [...] >> That may be the main problem to decide whether the cartesian product >> should return a generator or a list. > > The Cartesion product is a set. Sets are iterable, so that isn't an answer. If it's a set, then it should either be a gen

Testing for the presence of input from stdin.

2006-01-23 Thread Will McDonald
Hi all. I'm writing a little script that operates on either stdin or a file specified on the command line when run. I'm trying to handle the situation where the script's run without any input gracefully but can't think how to test for stdin. I can test for a file argument on the command line usin

Pyro problems...

2006-01-23 Thread adam
I'm using Pyro to develop a distribuited system running my integration test suite I've found a strange behaviour it seems that whenever I have a failed resolve or unregister on a name server, the name server acts normally during its life span, but when I shut it down... something remains up...

Re: How to generate graphics dynamically on the web using Python CGI script?

2006-01-23 Thread paron
Steve Holden wrote: > Debashis Dey wrote: > > Hello, > > > > I have a python CGI program. I would like to show a graph within a HTML > > plage. I would like to dynamically generate the graph using the python > > CGI script on the web server side and send it to the browser. > > > > My question is ho

Re: Redirecting standard out in a single namespace

2006-01-23 Thread Fuzzyman
Bengt Richter wrote: > On 20 Jan 2006 07:37:15 -0800, "Fuzzyman" <[EMAIL PROTECTED]> wrote: > > >Hello, > > > >I'm trying to redirect standard out in a single namespace. > > > >I can replace sys.stdout with a custom object - but that affects all > >namespaces. > > > >There will be code running si

Re: Redirecting standard out in a single namespace

2006-01-23 Thread Fuzzyman
Bengt Richter wrote: > On 20 Jan 2006 07:37:15 -0800, "Fuzzyman" <[EMAIL PROTECTED]> wrote: > > >Hello, > > > >I'm trying to redirect standard out in a single namespace. > > > >I can replace sys.stdout with a custom object - but that affects all > >namespaces. > > > >There will be code running si

Re: Problem with running external process

2006-01-23 Thread ToMasz
This is the result of ulimit command on my machine: core file size(blocks, -c) 0 data seg size (kbytes, -d) unlimited file size (blocks, -f) unlimited max locked memory (kbytes, -l) unlimited max memory size (kbytes, -m) unlimited open files

Re: How to generate graphics dynamically on the web using Python CGI script?

2006-01-23 Thread Christophe
Steve Holden a écrit : > Debashis Dey wrote: > >> Hello, >> >> I have a python CGI program. I would like to show a graph within a >> HTML plage. I would like to dynamically generate the graph using the >> python CGI script on the web server side and send it to the browser. >> >> My question

Re: zipfile and file permissions

2006-01-23 Thread Pete Forman
Robert Kern <[EMAIL PROTECTED]> writes: > Pete Forman wrote: >> I'm trying to move the building of a zip file from a shell script into >> python. It is mostly working but when I unzip the files the UNIX >> permissions are not preserved. The zip program I've been using is the >> standard(?) one

Re: Testing for the presence of input from stdin.

2006-01-23 Thread Diez B. Roggisch
> I can get the script to behave as expected when content's piped to it > using sys.stdin but I'd like to know that there's data coming from > stdin or fail and print the useage again. Is there a simple way to > achieve this? There are more experienced UNIXers here, but from my POV I don't see how

Re: Testing for the presence of input from stdin.

2006-01-23 Thread Will McDonald
On 23/01/06, Diez B. Roggisch <[EMAIL PROTECTED]> wrote: > > I can get the script to behave as expected when content's piped to it > > using sys.stdin but I'd like to know that there's data coming from > > stdin or fail and print the useage again. Is there a simple way to > > achieve this? > > Ther

Re: Dominant color & PIL

2006-01-23 Thread Rinzwind
For example: getdata im.getdata() => sequence Returns the contents of an image as a sequence object containing pixel values. The sequence object is flattened, so that values for line one follow directly after the values of line zero, and so on. Note that the sequence object returned by this met

Dr. Dobb's Python-URL! - weekly Python news and links (Jan 23)

2006-01-23 Thread Magnus Lycka
QOTW: "The IEEE-754 standard doesn't wholly define output conversions, and explicitly allows that a conforming implementation may produce any digits whatsoever at and after the 18th signficant digit, when converting a 754 double to string. In practice, all implementations I know of that exploit t

Re: New Python.org website?

2006-01-23 Thread Sibylle Koczian
Tony Meyer schrieb: >>> But sheesh, if I objected to every picture of the moon I >>> see (or pictures that vaguely resemble a moon), I would be >>> in a very sad state. >> >> >> But you see Terry, the point is not that it is just a picture. And >> let's not forget that as far as we know the moon ha

HOWTO Send a string???

2006-01-23 Thread Sbaush
Hi all.In my application I have to do implement a lot of networking in pythonMy application can create with a GUI a XML file in a string.(and now my application can do it wow!!)This string has to be sended to another host. i need a python application that send this string via UDP. The packet of th

Re: Who is www.python.org for? (was Re: New Python.org website ?)

2006-01-23 Thread Magnus Lycka
Roy Smith wrote: > For the most part, I agree with Terry; I want a site that gives me the info > I need without any fluff getting in the way. But, at the same time, I > realize that there is a need for marketing to suits. I'll leave layout to others, but content-wise, I don't think this is very

Re: Problem with running external process

2006-01-23 Thread Dan Sommers
On 23 Jan 2006 04:33:17 -0800, "ToMasz" <[EMAIL PROTECTED]> wrote: > ... how much should I increase these values to allow infinite > executions of external process? That sounds like a bad idea. Long before you've run an infinite number of processes, a real resource will be exhausted. You are p

Re: Who is www.python.org for? (was Re: New Python.org website ?)

2006-01-23 Thread A.M. Kuchling
On Sun, 22 Jan 2006 22:43:45 -0600, Terry Hancock <[EMAIL PROTECTED]> wrote: > For me, the most important function of the python.org site > is as a quick-reference to deeper documentation that I > actually need in the process of writing Python code. docs.python.org is probably the site mo

wxPython or wxWidgets

2006-01-23 Thread py
i need to design a GUI for my python app. i heard of wxWidgets and was going to look into that, but then I saw wxPython. Why would I use wxPython over wxWidgets? thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: wxPython or wxWidgets

2006-01-23 Thread Lawrence Oluyede
"py" <[EMAIL PROTECTED]> writes: > i need to design a GUI for my python app. i heard of wxWidgets and was > going to look into that, but then I saw wxPython. Why would I use > wxPython over wxWidgets? wxPython is the Python porting of wxWidgets. -- Lawrence - http://www.oluyede.org/blog "Anyo

Re: wxPython or wxWidgets

2006-01-23 Thread py
Lawrence Oluyede wrote: > wxPython is the Python porting of wxWidgets. got it, thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: wxPython or wxWidgets

2006-01-23 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, py wrote: > i need to design a GUI for my python app. i heard of wxWidgets and was > going to look into that, but then I saw wxPython. Why would I use > wxPython over wxWidgets? wxPython are the Python bindings to wxWidgets which is a C++ library. Ciao, Marc 'Bl

Launch file based on association

2006-01-23 Thread Chris Cioffi
Q:  If I have a file called "spreadsheet.xls" how can I launch it in what ever program it is associated with?  I don't care if that program is Excel or OpenOffice Calc.  I just want to launch the file.Since I want to just launch the new process, naturally I looked at os.execl().  However, I can't

Re: HOWTO Send a string???

2006-01-23 Thread Martin Franklin
Sbaush wrote: > Hi all. > In my application I have to do implement a lot of networking in python > My application can create with a GUI a XML file in a string.(and now my > application can do it wow!!) > This string has to be sended to another host. i need a python application > that send this stri

Re: Dominant color & PIL

2006-01-23 Thread Terry Hancock
On 23 Jan 2006 05:47:58 -0800 "Rinzwind" <[EMAIL PROTECTED]> wrote: > For example: > > getdata > > im.getdata() => sequence > > Returns the contents of an image as a sequence object > containing pixel values. The sequence object is flattened, > so that values for line one follow directly after t

Backreferences in python ?

2006-01-23 Thread Pankaj
I have something like below in perl and i am searching for equivalent in python: ::: Perl ::: *** while( ) { line = $_; pattern = "printf\( \"$lineNo \" \),"; line =~ s/"for(.*)\((*.)\;(.*)/for$1\($pattern$2\;$3/g; } This is used to search for :for ( i = 0; i < 1

Re: Backreferences in python ?

2006-01-23 Thread Jean-Paul Calderone
On 23 Jan 2006 07:18:13 -0800, Pankaj <[EMAIL PROTECTED]> wrote: > > [snip] >What i tried in python was:: > >f = open( "./1.c", "r") >fNew = open( "./1_new.c", "w") >for l in f: >print l >lineno = lineno + 1 >strToFind = "for\((.*)\;(.*)" > >## For Converting int to

Re: Cross-module imports?

2006-01-23 Thread Ant
You are always likely to have problems of one sort or another if you are using circular references like this. It would be a much better situation redesigning your modules so that they didn't depend on each other. The interpreter is complaining, since it is trying to compile A, hits the line 'impor

Re: Backreferences in python ?

2006-01-23 Thread Gerhard Häring
Pankaj wrote: > [...] > > What i tried in python was:: > > > f = open( "./1.c", "r") > fNew = open( "./1_new.c", "w") > for l in f: > print l > lineno = lineno + 1 > strToFind = "for\((.*)\;(.

Re: ConfigParser: writes a list but reads a string?

2006-01-23 Thread Fuzzyman
Jeffrey Barish wrote: > funkyj wrote: > > > making the config file XML and using xml.dom is another option, > > although XML is a bit ugly to edit by hand. > > --jfc > > > I am seriously intrigued by ConfigObj. I am currently using an crude > improvisation involving tab-delimited fields to stor

Re: HOWTO Send a string???

2006-01-23 Thread Sbaush
oh thanks i read the howto.Why i should use pyro? What is in poor words?2006/1/23, Martin Franklin <[EMAIL PROTECTED] >:Sbaush wrote:> Hi all.> In my application I have to do implement a lot of networking in python > My application can create with a GUI a XML file in a string.(and now my> applicati

Re: Launch file based on association

2006-01-23 Thread Fredrik Lundh
Chris Cioffi wrote: > Q: If I have a file called "spreadsheet.xls" how can I launch it in what > ever program it is associated with? I don't care if that program is Excel > or OpenOffice Calc. I just want to launch the file. >>> import os >>> help(os.startfile) Help on built-in function startf

RE: Strange python behavior with modules on an emt64 box

2006-01-23 Thread Joshua Luben
To clarify this issue, I checked, DCOracle is compile such that sizeof(int) = 4, sizeof(long) = 8. I guess this is closer to what you are expecting. If a 'Python' int is a C long, then why is it passing in a 4 byte size? Digging deaper, I've found that this size is not passed in by Python, but

Re: Xah's Edu Corner: IT Industry Predicament

2006-01-23 Thread sszmidt
On Friday 20 January 2006 15:42, Keith Thompson wrote: > "Xah Lee" <[EMAIL PROTECTED]> writes: > [the usual] > > ___ > /| /| | | > > ||__|| | Please do | > >

Re: Some thougts on cartesian products

2006-01-23 Thread Christoph Zwerschke
Bryan Olson schrieb: > Christoph Zwerschke wrote: > [...] >> That may be the main problem to decide whether the cartesian product >> should return a generator or a list. > > The Cartesion product is a set. Of course it is a set. But if the factors of the product have a total order (as in the ca

Re: Cross-module imports?

2006-01-23 Thread Matthias Kaeppler
Ant wrote: > If you have to trick the compiler like this though, I'd take a good > look at *why* you want to couple the modules so tightly in the first > place! Yeah, you're right. I think loosening up the coupling by introducing a module which holds common shared data is probably a good idea any

Re: Launch file based on association

2006-01-23 Thread Paul Boddie
Fredrik Lundh wrote: > Chris Cioffi wrote: > > > Q: If I have a file called "spreadsheet.xls" how can I launch it in what > > ever program it is associated with? I don't care if that program is Excel > > or OpenOffice Calc. I just want to launch the file. > > >>> import os > >>> help(os.startfil

Re: wxPython or wxWidgets

2006-01-23 Thread Matthias Kaeppler
Marc 'BlackJack' Rintsch wrote: > wxPython are the Python bindings to wxWidgets which is a C++ library. Don't want to hijack the thread, but since it's answered already: Has wxWidgets finally arrived at migrating to GTK2? ^^ If so, I might consider using wxPython instead of pygtk for that small a

Re: Backreferences in python ?

2006-01-23 Thread Pankaj
My tries have with re have not yielded results:: { strToFind = 'for*;*' ## Converting int to string, i.e. line no. to string lineNoClone = lineno pattern = "printf(\"" + str( lineNoClone) + "\")," regObj = re.compile( strToFind) m = regObj.searc

Re: wxPython or wxWidgets

2006-01-23 Thread Grant Edwards
On 2006-01-23, Matthias Kaeppler <[EMAIL PROTECTED]> wrote: >> wxPython are the Python bindings to wxWidgets which is a C++ library. > > Don't want to hijack the thread, but since it's answered already: > Has wxWidgets finally arrived at migrating to GTK2? Yes. -- Grant Edwards

Re: Some thougts on cartesian products

2006-01-23 Thread Bryan Olson
Steven D'Aprano wrote: > Bryan Olson wrote: >>Christoph Zwerschke wrote: >>[...] >> >>>That may be the main problem to decide whether the cartesian product >>>should return a generator or a list. >> >>The Cartesion product is a set. > > And the generalization of mathematical sets in Python can be

Re: list comprehention

2006-01-23 Thread Mathijs
Op 19 jan 2006 vond "[EMAIL PROTECTED]" : > another approach: > > ref = [2,2,4,1,1] > lis = [2,2,5,2,4] > > len([ref.pop(ref.index(x)) for x in lis if x in ref]) > This is the type of solution I was hoping to see: one-liners, with no use of local variables. As Tim Chase already wrote, it has

Re: Backreferences in python ?

2006-01-23 Thread Pankaj
I got my answer if ( m != None ) : subStrPattern1_hasInitialization = m.group(1) subStrPattern2_hasRestTillEnd = m.group(2) str = subStrPattern1_hasInitialization + subStrPattern2_hasRestTillEnd strToReplace = "for(" + pattern + str This gave me my soluti

Re: list comprehention

2006-01-23 Thread Mathijs
Op 19 jan 2006 vond Peter Otten <[EMAIL PROTECTED]> : > sum(min(list.count(n), ref.count(n)) for n in set(ref)) > > Is that it? Seems like this is it! Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: Backreferences in python ?

2006-01-23 Thread Duncan Booth
Pankaj wrote: > Here problem is , i am not getting backreferences using \1 and \2 > You wrote: > subStrPattern1_hasInitialization = "\1" "\1" is the way to create a string containing a control-A character. What you actually wanted was a string containing a backslash and a "1", so you need e

Re: list comprehention

2006-01-23 Thread Mathijs
Op 19 jan 2006 vond "Paddy" <[EMAIL PROTECTED]>: answer = [ val for val in set(ref) for x in range(min(lst.count(val), ref.count(val)))] answer > [2, 2, 4] I don't think it's correct. Your algoritm with the ref and lst below gives 3 as answer. The answer should have been 2 (1,3). ref=

Re: list comprehention

2006-01-23 Thread Mathijs
Op 20 jan 2006 vond Duncan Booth <[EMAIL PROTECTED]>: > Or in other words, define a function to return a dictionary containing > a count of the number of occurrences of each element in the list (this > assumes that the list elements are hashable). Then you just add up the > values in the test list

Re: Some thougts on cartesian products

2006-01-23 Thread Bryan Olson
Steven D'Aprano wrote: > Bryan Olson wrote: > > [Christoph Zwerschke had written:] >>>What I expect as the result is the "cartesian product" of the strings. >> >>There's no such thing; you'd have to define it first. Are duplicates >>significant? Order? > > > Google "cartesian product" and hit "

Re: Problem with running external process

2006-01-23 Thread ToMasz
Yes, each time the process is created, it remains. os.waitpid(-1, os.WNOHANG) doesn't work before starting the process for the first time. I tried this: pid = os.fork() if pid == 0: os.execl('ext_script.py','ext_script.py') else: (pid,status) = os.waitpid(pid, 0) It seems to work w

Re: list comprehention

2006-01-23 Thread Duncan Booth
Mathijs wrote: > Op 20 jan 2006 vond Duncan Booth <[EMAIL PROTECTED]>: >> Or in other words, define a function to return a dictionary >> containing a count of the number of occurrences of each element in >> the list (this assumes that the list elements are hashable). Then you >> just add up the v

Re: Launch file based on association

2006-01-23 Thread Chris Cioffi
On 23/01/06, Fredrik Lundh <[EMAIL PROTECTED]> wrote: Chris Cioffi wrote:> Q:  If I have a file called "spreadsheet.xls" how can I launch it in what> ever program it is associated with?  I don't care if that program is Excel> or OpenOffice Calc.  I just want to launch the file. >>> import os>>> hel

Re: Dominant color & PIL

2006-01-23 Thread Sebastjan Trepca
Hehe, interesting. I'll try it out.Thanks, SebastjanOn 1/23/06, Terry Hancock <[EMAIL PROTECTED] > wrote:On 23 Jan 2006 05:47:58 -0800"Rinzwind" < [EMAIL PROTECTED]> wrote:> For example:>> getdata>> im.getdata() => sequence>> Returns the contents of an image as a sequence object> containing pixel v

Re: how to find not the next sibling but the 2nd sibling or findsibling "a" OR sinbling "b"

2006-01-23 Thread localpricemaps
well actually all i want it to do is find the first thing that shows up whether its class:food or class: drink so that works for me. only thing is that after it finds class:food i think it runs through the html again and finds the following class:drink and being that there is not class tag after t

Re: list comprehention

2006-01-23 Thread Peter Otten
Mathijs wrote: > Op 20 jan 2006 vond Duncan Booth <[EMAIL PROTECTED]>: >> Or in other words, define a function to return a dictionary containing >> a count of the number of occurrences of each element in the list (this >> assumes that the list elements are hashable). Then you just add up the >> va

Re: Numarray, numeric, NumPy, scpy_core ??!!

2006-01-23 Thread greg . landrum
Robert Kern wrote: > Sébastien Boisgérault wrote: > > > By the way, I tried numpy 0.9.4 10 minutes ago and guess > > what ? 'eigenvalue' is broken too ... (hangs forever) > > On what platform? Are you linking against an optimized BLAS? We can't fix > anything without details. I'll be happy to work

Re: Numarray, numeric, NumPy, scpy_core ??!!

2006-01-23 Thread Sébastien Boisgérault
Robert Kern wrote: > Sébastien Boisgérault wrote: > > > By the way, I tried numpy 0.9.4 10 minutes ago and guess > > what ? 'eigenvalue' is broken too ... (hangs forever) > > On what platform? Linux, Mandriva 2006 (gcc 4.0.1, etc.) > Are you linking against an optimized BLAS? Nope -- I tried the ba

Problems with import of modules

2006-01-23 Thread Ilias Lazaridis
I am within a directory \doc\template\ I launch script.py within this script.py, I like to import a module from the doc directory. this here does not work: form ..\..\module_name import this_one how do I go back in the directory hierarchy to import something? If this is not possible: How ca

Redirecting stdin/stdout to self

2006-01-23 Thread Jan Danielsson
Hello, I thought I'd write a program to collect information from pf (packet filter) and insert it into a postgresql database for review on a web page. First I checked if this has been done already, and found that it has.. Using Perl and SQLite in a program called "hatchet". Well, I want to do i

wxPython layout problem

2006-01-23 Thread py
I have the following code: [code] class MainFrame(wx.Frame): def __init__(self, parent, id, title): wx.Frame.__init__(self, parent, wx.ID_ANY, title, style=wx.DEFAULT_FRAME_STYLE |wx.NO_FULL_REPAINT_ON_RESIZE) # build top area topSizer = self.buildTopPanel() # bu

Loading a Python collection from an text-file

2006-01-23 Thread Ilias Lazaridis
within a python script, I like to create a collection which I fill with values from an external text-file (user editable). How is this accomplished the easiest way (if possible without the need of libraries which are not part of the standard distribution)? something like: text-file: {peter, 16

Re: Problems with import of modules

2006-01-23 Thread Farshid Lashkari
> How can I modify the python search-path from within the script, thus it > contains the doc directory? Hi, The sys.path variable is a list of strings that contains the current module search path. You can add your own path to this list: import sys sys.path.append('../') -Farshid -- http://ma

Re: how to find not the next sibling but the 2nd sibling orfindsibling "a" OR sinbling "b"

2006-01-23 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > well actually all i want it to do is find the first thing that shows up > whether its class:food or class: drink so that works for me. what makes you think that looking "food" only will find either "food" or "drink" ? -- http://mail.python.org/mailman/listinfo/pyt

Re: Numarray, numeric, NumPy, scpy_core ??!!

2006-01-23 Thread Robert Kern
Sébastien Boisgérault wrote: > Robert Kern wrote: > >>Sébastien Boisgérault wrote: >> >>>By the way, I tried numpy 0.9.4 10 minutes ago and guess >>>what ? 'eigenvalue' is broken too ... (hangs forever) >> >>On what platform? > > Linux, Mandriva 2006 (gcc 4.0.1, etc.) Okay, my answer then is, "D

Re: Backreferences in python ?

2006-01-23 Thread Paul McGuire
"Pankaj" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > I have something like below in perl and i am searching for equivalent > in python: > > ::: Perl ::: > *** > while( ) > { > > line = $_; > > pattern = "printf\( \"$lineNo \" \),"; > > line =~ s/"for(.*)

Re: converting wiki markup to html (or xml)

2006-01-23 Thread Jarek Zgoda
Tim Parkin napisał(a): > I'm trying to convert fragments of wiki markup into fragments of html > (specifically using moinmoin markup). I've managed to do this with > MoinMoin but I've had to create a data directory, config file and > underlay. Does anybody know if there a sane way of doing this wi

Oddities of Tkinter

2006-01-23 Thread Tuvas
I am building a tkinter program. A part of this program is to read data from an incoming interface, and depending on the data, will display a bit of text on the tk dialog, it decodes this data, so to speak. If one command is sent, everything's just fine. When multiple are sent, the program will sto

Re: Redirecting stdin/stdout to self

2006-01-23 Thread Grant Edwards
On 2006-01-23, Jan Danielsson <[EMAIL PROTECTED]> wrote: > And if I'm reading it correctly, the Perl > script's process starts tcpdump, but redirects its output to its own > input, and reads it line by line. [...] >...however, the Perl script solution looks interresting.. Is it > possible to d

Re: Problems with import of modules

2006-01-23 Thread Carl J. Van Arsdall
Ilias Lazaridis wrote: > I am within a directory > > \doc\template\ > > I launch script.py > > within this script.py, I like to import a module from the doc directory. > > this here does not work: > > form ..\..\module_name import this_one > Well, if you are in linux you can do this easily by ch

Re: Redirecting stdin/stdout to self

2006-01-23 Thread Grant Edwards
On 2006-01-23, Grant Edwards <[EMAIL PROTECTED]> wrote: > On 2006-01-23, Jan Danielsson <[EMAIL PROTECTED]> wrote: > >> And if I'm reading it correctly, the Perl >> script's process starts tcpdump, but redirects its output to its own >> input, and reads it line by line. > [...] >>...however, th

XML + Elementree + (ZODB or Durus) experiments?

2006-01-23 Thread News Reader
A year or so ago, there was a posting - I believe on someone's blog - which told of a unique experiment. The experimenter tried loading and searching a large XML document based on three strategies: 1. (I think) elementree directly 2. Store entire XML document in ZODB (or Durus, can't remember)

Re: Loading a Python collection from an text-file

2006-01-23 Thread James Stroud
Ilias Lazaridis wrote: > within a python script, I like to create a collection which I fill with > values from an external text-file (user editable). > > How is this accomplished the easiest way (if possible without the need > of libraries which are not part of the standard distribution)? > > s

Re: Oddities of Tkinter

2006-01-23 Thread James Stroud
Tuvas wrote: > I am building a tkinter program. A part of this program is to read data > from an incoming interface, and depending on the data, will display a > bit of text on the tk dialog, it decodes this data, so to speak. If one > command is sent, everything's just fine. When multiple are sent,

Re: Oddities of Tkinter

2006-01-23 Thread Tuvas
Nope, that's the oddest thing about it all... Perhaps the statement is called twice or something along those lines, but there again, I can't see how it would be... -- http://mail.python.org/mailman/listinfo/python-list

Re: Oddities of Tkinter

2006-01-23 Thread James Stroud
Tuvas wrote: > Nope, that's the oddest thing about it all... Perhaps the statement is > called twice or something along those lines, but there again, I can't > see how it would be... > Very strange behavior can occur if the same python process instantiates Tkinter.Tk more than once (either con

trying to use swig for the first time

2006-01-23 Thread Gary Wilson Jr
...I have some C code (foo.c and foo.h) that I would like to be able to access using python. I've written my interface file (foo.i) like so: %module foo %{ #include "foo.h" %} %include "foo.h" I then do the following on the command line: $ swig -python foo.i $ gcc -c foo.c foo_wrap.c -I /usr/inc

Re: Backreferences in python ?

2006-01-23 Thread Giovanni Bajo
Pankaj wrote: Perl ::: > *** > while( ) > { > > line = $_; > > pattern = "printf\( \"$lineNo \" \),"; > > line =~ s/"for(.*)\((*.)\;(.*)/for$1\($pattern$2\;$3/g; > } > > This is used to > > search for :for ( i = 0; i < 10; i++) > Replace with: for( printf( "10" ),

Re: ANN: Introduction to Event-Driven Programming

2006-01-23 Thread Carl Cerecke
Randall Parker wrote: > Steve, > > This is an aside: I'd love to see someone implement in Python a > framework similar to the Quantum Leaps Quantum Framework for > event-driven programming. I think Python has some features that lend > themselves to a neater implementation than what can be done in

Re: Numarray, numeric, NumPy, scpy_core ??!!

2006-01-23 Thread Sébastien Boisgérault
[EMAIL PROTECTED] wrote: > Robert Kern wrote: > > Sébastien Boisgérault wrote: > > > > > By the way, I tried numpy 0.9.4 10 minutes ago and guess > > > what ? 'eigenvalue' is broken too ... (hangs forever) > > > > On what platform? Are you linking against an optimized BLAS? We can't fix > > anythi

Re: Numarray, numeric, NumPy, scpy_core ??!!

2006-01-23 Thread Sébastien Boisgérault
Robert Kern wrote: > Sébastien Boisgérault wrote: > > Robert Kern wrote: > > > >>Sébastien Boisgérault wrote: > >> > >>>By the way, I tried numpy 0.9.4 10 minutes ago and guess > >>>what ? 'eigenvalue' is broken too ... (hangs forever) > >> > >>On what platform? > > > > Linux, Mandriva 2006 (gcc 4

Re: Some thougts on cartesian products

2006-01-23 Thread Kay Schluehr
Bryan Olson wrote: > There's no such thing; you'd have to define it first. Are duplicates > significant? Order? That's all trivial isn't it? A string is a set of pairs (i,c) where i is an integer number, the index, with 0<=ihttp://mail.python.org/mailman/listinfo/python-list

Re: Loading a Python collection from an text-file

2006-01-23 Thread Ken Starks
Ilias Lazaridis wrote: > within a python script, I like to create a collection which I fill with > values from an external text-file (user editable). > > How is this accomplished the easiest way (if possible without the need > of libraries which are not part of the standard distribution)? > > so

Re: Concurrency, I guess

2006-01-23 Thread Stormcoder
Using candygram you can send the sync thread a message telling it to reread the config file or you could send a message that changes the setting directly. Candygram is much better than the standard threading module which is designed after the Java threading library. Java recently added another thre

  1   2   >