Re: Slicing matrix

2006-04-17 Thread James Stroud
Anthony Liu wrote: > I figure it out, too. NumArray is so flexible, it's > like cutting the cheese. Some idioms do not translate so well. -- James Stroud UCLA-DOE Institute for Genomics and Proteomics Box 951570 Los Angeles, CA 90095 http://www.jamesstroud.com/ -- http://mail.python.org/mai

Re: Slicing matrix

2006-04-17 Thread Alex Martelli
Robert Kern <[EMAIL PROTECTED]> wrote: ... > array([[ 0, 1, 2, 3, 4], >[ 5, 6, 7, 8, 9], >[10, 11, 12, 13, 14], >[15, 16, 17, 18, 19], >[20, 21, 22, 23, 24]]) > > > How do I easily slice out [0,1,2] > > In [7]: p[0, :3] > Out[7]: array([0, 1, 2]) > > >

Re: Slicing matrix

2006-04-17 Thread Anthony Liu
Hi, James, I just realized that my English is so good that I can joke with slangs. Hopefully it isn't that offensive. Otherwise, I am sorry. --- James Stroud <[EMAIL PROTECTED]> wrote: > Anthony Liu wrote: > > I figure it out, too. NumArray is so flexible, > it's > > like cutting the cheese.

Re: Ironpython book?

2006-04-17 Thread BartlebyScrivener
I'll let somebody jump in and say, "You're crazy!" But it seems to me the interest in IronPython on this list is pretty subdued. Maybe because most people are running on Linux or Macs? Here's a thread http://groups.google.com/group/comp.lang.python/browse_thread/thread/2762f6dfc5f72651/ I would

Re: Missing interfaces in Python...

2006-04-17 Thread Alex Martelli
Jonathan Daugherty <[EMAIL PROTECTED]> wrote: > # "parser"...?! If you have an 'Object o', say one just received as an > # argument, and cast it to IBlahble, a la > # > # IBlahble blah = (IBlahble) o; > # > # ...what can the parser ever say about it? > > Maybe you didn't read the "I think"

Re: Ironpython book?

2006-04-17 Thread Alex Martelli
<[EMAIL PROTECTED]> wrote: > Anyone know if there is a book for Ironpython in the works? A good > knowledge of .NET and Python is enough to get started but just poking > around Ironpython homepage it seems like there are some new language > features added to handle some quirks with working within

Re: PEP 359: The "make" Statement

2006-04-17 Thread Tim Hochberg
Carl Banks wrote: > Mike Orr wrote: > >>>I think this PEP is going off the rails. It's primary virtue was that it >> >>was a simpler, clearer way to write: >> >> class Foo(args): >>__metaclass__ = some_metaclass >>#... >> >>And it doesn't even do that. What's wrong with "class

Re: Missing interfaces in Python...

2006-04-17 Thread Jonathan Daugherty
# My real-world experience with Java is very dated -- nowadays, I'm # told, the NEED to cast is vastly reduced by Java 1.5's "generics" (I # haven't yet written one line of Java 1.5, not even for "play" # purposes, much less "real world" ones;-). Interesting; thanks. # So much for "compiler enfor

Re: Ironpython book?

2006-04-17 Thread Jay Parlar
On Apr 17, 2006, at 8:58 PM, Alex Martelli wrote: > > I don't know of any such books, but if M$ is willing to slip me a > suitable sweetener (to make it worth my while to install Windows again > after years of blissfully Windows-free existence: it must at least > cover > the expense of the extra

Re: Ironpython book?

2006-04-17 Thread BartlebyScrivener
Alex: So is the ruling hierarchy all using the UNIX command line on Mac OSX? Free BSD? Linux? I'm a struggling novice. I'm just curious. rick -- http://mail.python.org/mailman/listinfo/python-list

Re: PEP 359: The "make" Statement

2006-04-17 Thread Carl Banks
Tim Hochberg wrote: > Carl Banks wrote: > > Mike Orr wrote: > > > >>>I think this PEP is going off the rails. It's primary virtue was that it > >> > >>was a simpler, clearer way to write: > >> > >> class Foo(args): > >>__metaclass__ = some_metaclass > >>#... > >> > >>And it doe

Re: Ironpython book?

2006-04-17 Thread Heiko Wundram
Am Dienstag 18 April 2006 05:03 schrieb [EMAIL PROTECTED]: > it seems like there are some new language > features added to handle some quirks with working within the CLR. > Although I could be wrong. I'm no Microsoft friend (let me begin by saying that), but I don't think I'm very paranoid if I c

Re: PEP 359: The "make" Statement

2006-04-17 Thread Tim Hochberg
Carl Banks wrote: > Tim Hochberg wrote: > >>Carl Banks wrote: >> >>>Mike Orr wrote: >>> >>> >I think this PEP is going off the rails. It's primary virtue was that it was a simpler, clearer way to write: class Foo(args): __metaclass__ = some_metaclass

How do you guys print out a binary tree?

2006-04-17 Thread Anthony Liu
There are many ways to represent a binary tree on an ascii screen. 1 / \ 2 3 / \ / \ 4 5 6 7 or 4---2---1 | | 56- 3 | 7 Suppose I have a function that takes a matrix like this one:

Re: Ironpython book?

2006-04-17 Thread Alex Martelli
BartlebyScrivener <[EMAIL PROTECTED]> wrote: > Alex: > > So is the ruling hierarchy all using the UNIX command line on Mac OSX? > Free BSD? Linux? I'm a struggling novice. I'm just curious. Uh? Who's "the ruling hierarchy"? If you're talking about the PSF, I guess Linux, overall, may hold the

Re: Ironpython book?

2006-04-17 Thread Alex Martelli
Jay Parlar <[EMAIL PROTECTED]> wrote: ... > > I don't know of any such books, but if M$ is willing to slip me a > > suitable sweetener (to make it worth my while to install Windows again ... > Q: "So Alex, what are you doing with your 20% time at Google right now?" > A: "Working for Microsoft

Re: Ironpython book?

2006-04-17 Thread BartlebyScrivener
>> Who's "the ruling hierarchy"? I guess I just meant the congnoscenti. Them that knows what's what. >> I'm a Mac fan, with Linux a close second I suspected. I've played with Linux distros, but never a Mac. That takes more $$ than M$, and Apple is even more proprietary than MS, if you ask me. It

Re: passing string from one file to another

2006-04-17 Thread Ant
I assume that you are trying to pass data from one 'standalone' cgi script to another cgi script (mail.py). Depending on what exactly you are trying to do, you could either set the information in a cookie, or simply have a hidden input () element in the HTML which gets populated by the initial cgi

Re: How to pass variable to test class

2006-04-17 Thread Peter Otten
Podi wrote: > Newbie question about unittest. I am having trouble passing a variable > to a test class object. > > MyCase class will potentially have many test functions. By default a unittest.TestCase has only one test function called "runTest". Therefore you have to add multiple instances of y

ANN: pyplusplus - v0.7.2

2006-04-17 Thread Roman Yakovenko
Hi. The next version of pyplusplus is available. Download page: http://www.language-binding.net/pyplusplus/download.html What is it? pyplusplus is an object-oriented framework for creating a code generator for boost.python library. Project home page: http://www.language-binding.net/pyplusplus/

ANN: pygccxml - 0.7.2

2006-04-17 Thread Roman Yakovenko
Hi. The next version of pygccxml is available. Download page: http://www.language-binding.net/pygccxml/download.html What is it? "...The purpose of the GCC-XML extension is to generate an XML description of a C++ program from GCC's internal representation. Since XML is easy to parse, other devel

Re: Async Sleep?

2006-04-17 Thread Tim Head
If your task is indeed to watch a directory for "activity" and thenact upon this activity then you would be much better of doing what Lawrence suggests. For linux there is the inotify bit in the kernel. As you are using win32com I'll assume you are using windows. This snippet in the cookbook seems

Re: passing string from one file to another

2006-04-17 Thread Lawrence D'Oliveiro
In article <[EMAIL PROTECTED]>, Kun <[EMAIL PROTECTED]> wrote: >I have a python-cgi form whose sole purpose is to email. > >It has the fields 'to', 'from', 'subject', 'body', etc. and if the user >fills them out and clicks submit, it will invoke another file called >mail.py which uses smtplib t

Re: filling today's date in a form

2006-04-17 Thread Lawrence D'Oliveiro
In article <[EMAIL PROTECTED]>, Kun <[EMAIL PROTECTED]> wrote: >... but i am >wondering if there is a way to create a button which would automatically >insert today's date in the date form field if the user chooses to use >today's date. If you're going to have a button to do it, then the butt

Re: __getattribute__ and __slots__

2006-04-17 Thread Peter Otten
[EMAIL PROTECTED] wrote: Python has both __getattribute__() and __getattr__(). While __getattribute__() will always be called if you ask for an attribute __getattr__() serves only as fallback if the attribute if not found by other means. > I try to define a (new-style) class who: > - have a __slo

Re: XML-RPC server via xinetd

2006-04-17 Thread Nick Craig-Wood
Jos Vos <[EMAIL PROTECTED]> wrote: > I'm trying to figure out how to implement a XML-RPC server that > is called by xinetd i.s.o. listening on a TCP socket itself. > > I already have implemented a stand-alone XML-RPC server using > SimpleXMLRPCServer, but I now want something similar, that is

Re: Validate XML against DTD and/or XML Schema?

2006-04-17 Thread Ravi Teja
http://xmlstar.sourceforge.net/ Not Python, but just the tool for the job. For Python, 4Suite has some validators. But parts of it were written in C and might not be helpful if you want to look at the Python source code. You might want to check http://www.leuthe.homepage.t-online.de/minixsv/minixs

Re: Tkinter

2006-04-17 Thread Ravi Teja
Documentation isn't his only contribution, BTW. He wrote a whole bunch of highly useful modules for Python as well. http://effbot.org/downloads/ -- http://mail.python.org/mailman/listinfo/python-list

Re: attaching an excel file using MIME in smtp

2006-04-17 Thread Serge Orlov
Kun wrote: > does anyone know how to attach an excel file to send out using smtplib > and MIME? There is an example in the python documentation how to send entire content of a directory: http://docs.python.org/lib/node597.html -- http://mail.python.org/mailman/listinfo/python-list

Re: Override on terminal

2006-04-17 Thread fivestars
ops..yes overwrite is what i would say!! thanks to all!! -- http://mail.python.org/mailman/listinfo/python-list

[newbie] help on audioop.rms()

2006-04-17 Thread Matte
Hi, I'm quite new to Python and I'm in need of help! I need to open an audio file, divide it into frame-based intervals and for each of those interval I have to analyze the sound level. audioop.rms() should do the trick, but I can't find a way to convert a frame interval (taken via readframes()

Re: XML-RPC server via xinetd

2006-04-17 Thread Jos Vos
On Mon, Apr 17, 2006 at 02:07:37AM +0200, Martin P. Hellwig wrote: > If I understood it correctly you want the python server bind be > depending on whatever is configured in xinetd.conf and not be defined in > the your program itself? > > I tested a bit around with my FreeBSD machine but indeed

Re: Python certification/training

2006-04-17 Thread Kent Johnson
Richard Marsden wrote: > Aahz wrote: >> Then may I suggest that you subscribe to the tutor list? That will give >> you a good place to ask questions; as you learn Python, answering other >> people's questions will give you a good way to hone your own knowledge. > > > Which is? :-) http://mail.

Re: XML-RPC server via xinetd

2006-04-17 Thread Brian Quinlan
Jos Vos wrote: > The problem is that I do not see how to let an SimpleXMLRPCServer > instance *not* bind to a port or what other class I can use to just > build a XML-RPC request handler reading/writing from stdin/stdout, > i.s.o. carrying all the server class stuff with it. I think that the prob

Re: XML-RPC server via xinetd

2006-04-17 Thread Jos Vos
On Mon, Apr 17, 2006 at 12:10:15PM +0200, Brian Quinlan wrote: > If you take a look at CGIXMLRPCRequestHandler > (http://docs.python.org/lib/node564.html), you will see an example of > how to write an XMLRPCRequestHandler without HTTP. Thanks, this might work for me, will try it. -- --Jos

Re: XML-RPC server via xinetd

2006-04-17 Thread Jos Vos
On Mon, Apr 17, 2006 at 03:30:04AM -0500, Nick Craig-Wood wrote: > UTSL ;-) > > Look at /usr/lib/python2.4/SimpleXMLRPCServer.py (adjust as per your > distro) and in particular the definition of the CGIXMLRPCRequestHandler class. I did this before posting my question, in fact, but I did not look

Re: XML-RPC server via xinetd

2006-04-17 Thread Brian Quinlan
Jos Vos wrote: > On Mon, Apr 17, 2006 at 03:30:04AM -0500, Nick Craig-Wood wrote: > >> UTSL ;-) >> >> Look at /usr/lib/python2.4/SimpleXMLRPCServer.py (adjust as per your >> distro) and in particular the definition of the CGIXMLRPCRequestHandler >> class. > > I did this before posting my questio

Re: XML-RPC server via xinetd

2006-04-17 Thread Fredrik Lundh
Nick Craig-Wood wrote: > Look at /usr/lib/python2.4/SimpleXMLRPCServer.py (adjust as per your > distro) and in particular the definition of the CGIXMLRPCRequestHandler class. > > That looks as thought it almost, or maybe completely, does what you > want, ie an XMLRPC subclass which reads from stdi

Re: XML-RPC server via xinetd

2006-04-17 Thread Jos Vos
On Mon, Apr 17, 2006 at 12:36:18PM +0200, Brian Quinlan wrote: > I don't know exactly what your usage pattern is, but you might be able > to use SimpleXMLRPCDispatcher directly e.g. > > >>> s = SimpleXMLRPCDispatcher() > >>> s.register_function(pow) > >>> s._marshaled_dispatch(' ' --X/OS

CGI scripts

2006-04-17 Thread Jay
Can I use Python for CGI scripts. It is telling me to use Perl and I don't know any To be honest I don't really no what CGI scripts are (soz) I have purchased a domain name of my ISP PIPEX and 100MB space And I don't know what I can do with it now OPPs Jay Dee -- http://mail.python.org/mailm

installation of jython program

2006-04-17 Thread Jan Gregor
Hello, I've done database console in jython called jydbconsole. It's now available on sourceforge. As you can guess console needs jdbc drivers. The script that runs jython itself doesn't public -cp option to add another classpaths. Yes I need to add jdbc drivers to classpath ... Of course I see

Re: XML-RPC server via xinetd

2006-04-17 Thread Jos Vos
On Mon, Apr 17, 2006 at 12:42:00PM +0200, Fredrik Lundh wrote: > except that if the OP's expecting the other end to use an ordinary XML-RPC > library, he needs to implement some minimal HTTP handling as well. Which makes me wondering why the classes (this also applies to BaseHTTPServer / BaseHTTP

Re: CGI scripts

2006-04-17 Thread Daniel Nogradi
> Can I use Python for CGI scripts. It is telling me to use Perl and I > don't know any > > To be honest I don't really no what CGI scripts are (soz) > > I have purchased a domain name of my ISP PIPEX and 100MB space > > And I don't know what I can do with it now Will your pages be served by your

Re: CGI scripts

2006-04-17 Thread Daniel Nogradi
> > Can I use Python for CGI scripts. It is telling me to use Perl and I > > don't know any > > > > To be honest I don't really no what CGI scripts are (soz) > > > > I have purchased a domain name of my ISP PIPEX and 100MB space > > > > And I don't know what I can do with it now I just realized th

Re: locale, format monetary values

2006-04-17 Thread deelan
Rares Vernica wrote: > Hi, > > Can I use locale to format monetary values? If yes, how? If no, is there > something I can use? > > E.g., > I have 1 and I want to get "$10,000". try something like: >>> import locale >>> locale.setlocale(locale.LC_ALL, "en-US") 'English_United States.1252'

Re: Python certification/training

2006-04-17 Thread aum
On Sun, 16 Apr 2006 06:13:51 -0700, chrisBrat wrote: > Are there any certifications that are available for developers learning > Python? Where? > I'm specifically looking for distance/on-line courses or certifications > but welcome any information available. Makes me wonder, just out of curiosit

something similar to LWP::Simple mirror function

2006-04-17 Thread jnair
from the perl man pages of LWP::Simple mirror($url, $file) Get and store a document identified by a URL, using If-modified- since, and checking the Content-Length. Returns the HTTP response code. is there something similar in python regards jitya -- http://ma

How do I use Code Context under Options in IDLE?

2006-04-17 Thread Phoe6
Hi all, I have this Code Context feature under Options in the IDLE. How should I use it? Are there folks here who use it regularly and find it useful. Please guide me. Thanks! Senthil -- http://mail.python.org/mailman/listinfo/python-list

Re: XML-RPC server via xinetd

2006-04-17 Thread Jean-Paul Calderone
On Mon, 17 Apr 2006 14:17:51 +0200, Jos Vos <[EMAIL PROTECTED]> wrote: >On Mon, Apr 17, 2006 at 12:42:00PM +0200, Fredrik Lundh wrote: > >> except that if the OP's expecting the other end to use an ordinary XML-RPC >> library, he needs to implement some minimal HTTP handling as well. > >Which makes

Translate Cpp into python code

2006-04-17 Thread Fulvio
Hi there, I'd like to ask if is there any tool that's able to parse C++ code and convert it into Python script? Probalby entirely would be difficult, but a good percentage I think it would be possible and the remain asking to the user what to do. F -- http://mail.python.org/mailman/listinfo/py

Re: Python certification/training

2006-04-17 Thread Richard Marsden
Thanks Kent and Dan. I've just joined to see what it is like. It looks like it might be aimed more for people new to computer/programming science. In contrast, I'm new to Python and actually have quite a bit of programming experience! Perhaps I'll be able to help answer questions, as well as s

Re: Translate Cpp into python code

2006-04-17 Thread Ravi Teja
If you are looking for ways to access C++ code in Python, there are several (Boost, SIP, CXX, SWIG, Weave etc). Unless your needs are somehow unique, this is the preferred approach. People usually convert higher level languages to lower level languages for performance (For example Python to C+

Re: Using Python To Create An Encrypted Container

2006-04-17 Thread John Hunter
> "Michael" == Michael Sperlle <[EMAIL PROTECTED]> writes: Michael> Is it possible? Bestcrypt can supposedly be set up on Michael> linux, but it seems to need changes to the kernel before Michael> it can be installed, and I have no intention of going Michael> through whatever h

<    1   2