parse HTML by class rather than tag

2007-02-22 Thread lorean2007
Hello, i'm would be interested in parsing a HTML files by its corresponding opening and closing tags but by taking into account the class attributes and its values, ... ... ... ... ... in this example, i will need all content inside div with class="two", or only class="one", so i wonde

Re: Pep 3105: the end of print?

2007-02-22 Thread I V
On Tue, 20 Feb 2007 10:46:31 -0800, Beliavsky wrote: > I think the C and C++ committees also take backwards compatibility > seriously, in part because they know > that working programmers will ignore them if they break too much old > code. While that's true, C++ compiler vendors, for example, take

connection pool in python?

2007-02-22 Thread Eric CHAO
Connection Pool is necessary in web applications with Java and JDBC. So does python have something like that? Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: network simulator in Python ?

2007-02-22 Thread John D Salt
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > On Feb 21, 12:26 pm, "DanielJohnson" <[EMAIL PROTECTED]> wrote: >> I was wondering if anyblody can suggest me a network simulator [Snips] >> I am looking for a simulator [Snips] > Google for Scapy I don't think Scapy is

Re: Convert to binary and convert back to strings

2007-02-22 Thread Paul Rubin
"Hendrik van Rooyen" <[EMAIL PROTECTED]> writes: > s = 'some string that needs a bcc appended' > ar = array.array('B',s) > bcc = 0 > for x in ar[:]: > bcc ^= x > ar.append(bcc) > s=ar.tostring() Untested: import operator s = 'some string that needs a bcc appended' ar = array.array('B',s) s +=

Re: Convert to binary and convert back to strings

2007-02-22 Thread Hendrik van Rooyen
"Steven D'Aprano" <[EMAIL PROTECTED]> wrote: > On Thu, 22 Feb 2007 08:18:07 +0200, Hendrik van Rooyen wrote: > > > I would xor each char in it with 'U' as a mild form of obfuscation... > > I've often wished this would work. > > >>> 'a' ^ 'U' > Traceback (most recent call last): > File "", line

Re: is it possible to remove the ':' symbol in the end of linesstarting with 'if', 'while' etc?

2007-02-22 Thread Hendrik van Rooyen
"Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: 8< request to remove colon -- > Won't happen. There have been plenty of discussions about this, and while > technically not necessary, the colon is usually considered "optically > pleas

Re: What is the best queue implemetation in Python?

2007-02-22 Thread bearophileHUGS
John: > I want to write a code for Breadth First Traveral for Graph, which needs a > queue to implement. For that purpose I have used the good deque that you can find in collections in the standard library. It's very good for queues, and it's a bit faster than regular lists for stacks too. Bye, b

Re: pylab, integral of sinc function

2007-02-22 Thread Fernando Perez
Schüle Daniel wrote: > Hello, > > In [19]: def simple_integral(func,a,b,dx = 0.001): > : return sum(map(lambda x:dx*x, func(arange(a,b,dx > : > > In [20]: simple_integral(sin, 0, 2*pi) > Out[20]: -7.5484213527594133e-08 > > ok, can be thought as zero > > In [21]: simple

Re: What is the best queue implemetation in Python?

2007-02-22 Thread James Stroud
John Machin wrote: > On Feb 23, 11:24 am, "John" <[EMAIL PROTECTED]> wrote: > >>Than C or PASCAL >>I mean, list or dictionary in Python are so powerful than the traditional >>array. Maybe I can make use of it? > > > Well, you could wite your own queue manager using Python lists, > but ... > > Y

Re: export an array of floats to python

2007-02-22 Thread Peter Wuertz
Thank you! Thats the complete solution *g* -- http://mail.python.org/mailman/listinfo/python-list

Re: is it possible to remove the ':' symbol in the end of lines starting with 'if', 'while' etc?

2007-02-22 Thread Grant Edwards
On 2007-02-22, tac-tics <[EMAIL PROTECTED]> wrote: > Tip: don't try learning perl. > > I agree the colon is largely redundant, but it's not > unreasonable. A certain amount of redundancy in languages (artificial or natrual) is a good thing. It makes error detection and correction far easier. --

Re: CherryPy/Turbogears on server not controlled by me

2007-02-22 Thread Jeff McNeil
Can you use mod_rewrite and include a proxy back to a different port? Assuming mod_proxy has been enabled, run your app server on port 8080 and then do something like this in a .htaccess file: RewriteEngine on RewriteRule ^/(.*)$ http://localhost:8080/$1 [P] This of course assumes you want to

Re: Convert to binary and convert back to strings

2007-02-22 Thread Paul Rubin
Steven D'Aprano <[EMAIL PROTECTED]> writes: > For a short string like "Python", using an array is a tiny bit slower, at > the cost of more complex code if you're converting a long string, > using array is faster. If it is a short string, it doesn't make much > difference. I modified your array

Re: Convert to binary and convert back to strings

2007-02-22 Thread Steven D'Aprano
On Thu, 22 Feb 2007 14:29:13 -0800, Paul Rubin wrote: > Steven D'Aprano <[EMAIL PROTECTED]> writes: >> Arrays don't support XOR any more than strings do. What's the advantage to >> using the array module if you still have to jump through hoops to get it >> to work? > > It's a lot faster. Sometim

Re: Python Threads

2007-02-22 Thread Sick Monkey
I think that I found a solution to my thread issues, however I know it is not the most efficient method possible. Just to give you a little information on what this project is all about I have 3 lists of email addresses. (1) "host email address" = contains a list of all of my emails a

Re: CherryPy/Turbogears on server not controlled by me

2007-02-22 Thread Brian Blais
Jorge Vargas wrote: > On 2/20/07, Brian Blais <[EMAIL PROTECTED]> wrote: >> I was wondering if there is a way to run CherryPy/Turbogears on a >> server that I don't >> have root access to. > > I have never run ANY webapp as root. you should follow that advice. in > fact don't run any server as ro

Re: python not returning true

2007-02-22 Thread agent-s
Wow. I didn't realize you guys took this so seriously. -- http://mail.python.org/mailman/listinfo/python-list

Re: What is the best queue implemetation in Python?

2007-02-22 Thread Duncan Smith
John wrote: > I want to write a code for Breadth First Traveral for Graph, which needs a > queue to implement. > > I wonder that for such a powerful language as Python, whether there is a > better and simpler implementation for a traditional FIFO queue? > For a BFS I coded up a while back iterat

Re: What is the best queue implemetation in Python?

2007-02-22 Thread hg
hg wrote: > f u "f o" of course -- http://mail.python.org/mailman/listinfo/python-list

Re: What is the best queue implemetation in Python?

2007-02-22 Thread hg
John Machin wrote: > On Feb 23, 11:12 am, "John" <[EMAIL PROTECTED]> wrote: >> I want to write a code for Breadth First Traveral for Graph, which needs >> a queue to implement. >> >> I wonder that for such a powerful language as Python, whether there is a >> better and simpler implementation for a

Re: How to covert ASCII to integer in Python?

2007-02-22 Thread hg
Some people spend many buck bying guessing games ... be nice ! hg -- http://mail.python.org/mailman/listinfo/python-list

Re: What is the best queue implemetation in Python?

2007-02-22 Thread John Machin
On Feb 23, 11:24 am, "John" <[EMAIL PROTECTED]> wrote: > Than C or PASCAL > I mean, list or dictionary in Python are so powerful than the traditional > array. Maybe I can make use of it? Well, you could wite your own queue manager using Python lists, but ... You have this strange reluctance to lo

Re: What is the best queue implemetation in Python?

2007-02-22 Thread John
Than C or PASCAL I mean, list or dictionary in Python are so powerful than the traditional array. Maybe I can make use of it? "John Machin" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Feb 23, 11:12 am, "John" <[EMAIL PROTECTED]> wrote: > > I want to write a code for Breadth F

Re: What is the best queue implemetation in Python?

2007-02-22 Thread John Machin
On Feb 23, 11:12 am, "John" <[EMAIL PROTECTED]> wrote: > I want to write a code for Breadth First Traveral for Graph, which needs a > queue to implement. > > I wonder that for such a powerful language as Python, whether there is a > better and simpler implementation for a traditional FIFO queue? >

Re: How to covert ASCII to integer in Python?

2007-02-22 Thread John Machin
On Feb 23, 5:23 am, "John" <[EMAIL PROTECTED]> wrote: > I just found ord(c), which convert ascii to integer. ord('\xff') -> 255 ord(unichr(666)) -> 666 What ascii? What is stopping you from reading the documentation section on built- in functions (http://docs.python.org/lib/built-in-funcs.html)?

What is the best queue implemetation in Python?

2007-02-22 Thread John
I want to write a code for Breadth First Traveral for Graph, which needs a queue to implement. I wonder that for such a powerful language as Python, whether there is a better and simpler implementation for a traditional FIFO queue? Thanks! -- http://mail.python.org/mailman/listinfo/python-lis

Europe Tests Established Chemicals on Millions of Animals

2007-02-22 Thread TONY
Tony Nottingham England 22 February 2007 TO: All People Who Care I am a private individual posting this message to help Laboratory Animals and us all. I apologize if this seems out of place in this group but I think you need to know this. A new European Chemical TestingPol

Re: is it possible to remove the ':' symbol in the end of lines starting with 'if', 'while' etc?

2007-02-22 Thread tac-tics
Tip: don't try learning perl. I agree the colon is largely redundant, but it's not unreasonable. -- http://mail.python.org/mailman/listinfo/python-list

Re: Local class variables? (mod_python problem)

2007-02-22 Thread greg
Rory Campbell-Lange wrote: > class Part (object): > totalgia = 0 > def __init__(self, gia): > self.gia = gia # gross internal area > self.giaratio = 0 > Part.totalgia += self.gia > > if __name__ == '__main__': > p1 = Part(20) >

Re: Convert to binary and convert back to strings

2007-02-22 Thread Paul Rubin
Steven D'Aprano <[EMAIL PROTECTED]> writes: > Arrays don't support XOR any more than strings do. What's the advantage to > using the array module if you still have to jump through hoops to get it > to work? It's a lot faster. Sometimes that matters. -- http://mail.python.org/mailman/listinfo/pyt

RE: is it possible to remove the ':' symbol in the end of lines startingwith 'if', 'while' etc?

2007-02-22 Thread Delaney, Timothy (Tim)
[EMAIL PROTECTED] wrote: > I don't know to which forum should I post the message > I hope someone related to the Python kernel development will read & > consider the idea It has been considered and rejected. http://www.python.org/doc/faq/general/#why-are-colons-required-for-the-i f-while-def-cla

Scrolled frame for Tkinter & Python Wrapper for Tile

2007-02-22 Thread moustikitos
I wrote a scrolled frame for Tkinter : http://bruno.thoorens.free.fr/downloads/scrolled.py I also wrote a Tile wrapper for Python : http://bruno.thoorens.free.fr/downloads/ttk.html http://bruno.thoorens.free.fr/downloads/Ttk-src.zip Bruno -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie question: Install Tkinter with Python2.5

2007-02-22 Thread Paul Boddie
TK wrote: > > how can I install Tkinter with Python2.5? I can install Python2.5 > (tarball) in the usual way but there is no Tkinter? What's wrong? I see that Tcl/Tk detection has been moved in the Python source distribution (since the "good old days" when I last had to deal with this kind of thin

Re: Convert to binary and convert back to strings

2007-02-22 Thread Steven D'Aprano
On Thu, 22 Feb 2007 08:18:07 +0200, Hendrik van Rooyen wrote: > I would xor each char in it with 'U' as a mild form of obfuscation... I've often wished this would work. >>> 'a' ^ 'U' Traceback (most recent call last): File "", line 1, in ? TypeError: unsupported operand type(s) for ^: 'str' an

Re: How to covert ASCII to integer in Python?

2007-02-22 Thread MRAB
On Feb 22, 6:35 pm, Lloyd Zusman <[EMAIL PROTECTED]> wrote: > "John" <[EMAIL PROTECTED]> writes: > > I just found ord(c), which convert ascii to integer. > > > Anybody know what the reverse is? > > The inverse of "ord" is "chr": > > % python > Python 2.5 (r25:51908, Jan 5 2007, 00:12:45) > [

Re: Convert to binary and convert back to strings

2007-02-22 Thread Steven D'Aprano
On Thu, 22 Feb 2007 11:55:22 +, Jussi Salmela wrote: >> For extra security, you can encode the string with rot13 twice. >> >> >> > > Like this? ;) > > >>> s = "Python" ; u = unicode(s, "ascii") ; u > u'Python' > >>> u.encode('rot13') > 'Clguba' > >>> u.encode('rot13').encode('rot13')

Newbie question: Install Tkinter with Python2.5

2007-02-22 Thread TK
Hi there, how can I install Tkinter with Python2.5? I can install Python2.5 (tarball) in the usual way but there is no Tkinter? What's wrong? Traceback (most recent call last): File "mbox.py", line 12, in from Tkinter import * File "/usr/local/lib/python2.5/lib-tk/Tkinter.py", line 38, in impo

pyinstaller fails to create exe-File

2007-02-22 Thread DierkErdmann
Hi ! I am trying to create an exe file using pyinstaller. Running the created exe-File gives the error message "" Traceback (most recent call last): File "", line 8, in File "E:\Documents\mich\job\abs\backup_skript\buildbackup\out1.pyz/ email", lin e 79, in __getattr__ File "D:\Programme\py

HTTP proxy server for Motorola E815 phone in Python

2007-02-22 Thread Dan Lenski
Hi all, I've recently written an HTTP proxy server for the Motorola E815 cell phone, based on Suzuki Hisao's "Tiny HTTP Proxy" (http:// www.okisoft.co.jp/esc/python/proxy/). This cell phone allows free Internet access if you change the default proxy server, but it has a severely buggy HTTP client

Re: Creating a daemon process in Python

2007-02-22 Thread Joshua J. Kugler
Benjamin Niemann wrote: >> What is the easiest way to create a daemon process in Python? Google >> says I should call fork() and other system calls manually, but is >> there no os.daemon() and the like? > You could try > Also, more

Re: is it possible to remove the ':' symbol in the end of lines starting with 'if', 'while' etc?

2007-02-22 Thread James Stroud
[EMAIL PROTECTED] wrote: > I don't know to which forum should I post the message > I hope someone related to the Python kernel development will read & > consider the idea > I'm (a former? meanwhile not sure) MATLAB user & it's very annoing > typing each time for example > while i: > print i >

Re: metaclasses (beginner question)

2007-02-22 Thread James Stroud
Peter Otten wrote: > You determine the factory Python uses to > make a class by adding > > __metaclass__ = factory > > to the class body, so you'll probably end with something like > > class ProducerHandlerType(type): > # your code > > class A: > __metaclass__ = ProducerHandlerType >

Re: JIT (just-in-tme accelerator) for Python - exists or no?

2007-02-22 Thread Daniel Nogradi
> Or is any progress going on now? > > The JIT in MATLAB or Java seems to be very effective. This document describes the JIT situation in pypy: http://codespeak.net/pypy/dist/pypy/doc/jit.txt -- http://mail.python.org/mailman/listinfo/python-list

Re: How can I track/monitor an application and system resources.

2007-02-22 Thread Tim Golden
[EMAIL PROTECTED] wrote: > Hello All, > > I'm a newbie to Python! > > I am trying to develop a program that monitors the performance of an > application. The kind of information I am interested in is the CPU/ > Process/Thread and memory performance. Specifically, I would like to > track the foll

Re: jython import search path

2007-02-22 Thread Russ
Diez B. Roggisch wrote: > >> Maybe Jython expert has the perfect answer but til then. > >> > >> Did you try: > >> > >> sys.path.append('path to search') > >> > >> Usually this works if nothing else does. > >> > >> -Larry > > > > Thanks. That's a good workaround, but I would like to know the > > "

Re: Possible to set cpython heap size?

2007-02-22 Thread Martin v. Löwis
Andy Watson schrieb: > I have an application that scans and processes a bunch of text files. > The content I'm pulling out and holding in memory is at least 200MB. > > I'd love to be able to tell the CPython virtual machine that I need a > heap of, say 300MB up front rather than have it grow as ne

Re: Possible to set cpython heap size?

2007-02-22 Thread Chris Mellon
On 22 Feb 2007 11:28:52 -0800, Andy Watson <[EMAIL PROTECTED]> wrote: > On Feb 22, 10:53 am, a bunch of folks wrote: > > > Memory is basically free. > > This is true if you are simply scanning a file into memory. However, > I'm storing the contents in some in-memory data structures and doing > som

Re: Performance project for the SigEx Foundry

2007-02-22 Thread pierre_marie_durand
On Feb 21, 1:15 pm, [EMAIL PROTECTED] wrote: > have been testing performances of different scripting languages > fordatabase access, text processing and client application data > transfer. So far, I am getting better performance from PHP, but I > don't have any hard data to back it up compared to o

Quantum term project code- for interest and for help

2007-02-22 Thread rjtucke
Hello all, I have written a numerical simulation of a Bose Einstein Condensate in Python for a term project in my Quantum III class at Arizona State. You may find it at https://wiki.asu.edu/phy416/index.php/A_Simple_Bose-Einstein_Condensate_Simulation I post this for two reasons- first, as a matt

Re: Possible to set cpython heap size?

2007-02-22 Thread Andy Watson
On Feb 22, 10:53 am, a bunch of folks wrote: > Memory is basically free. This is true if you are simply scanning a file into memory. However, I'm storing the contents in some in-memory data structures and doing some data manipulation. This is my speculation: Several small objects per scanned

Re: Possible to set cpython heap size?

2007-02-22 Thread Jussi Salmela
Andy Watson kirjoitti: > I have an application that scans and processes a bunch of text files. > The content I'm pulling out and holding in memory is at least 200MB. > > I'd love to be able to tell the CPython virtual machine that I need a > heap of, say 300MB up front rather than have it grow as

Re: plugin development best practices

2007-02-22 Thread Flavio
On Feb 22, 2:04 pm, "Paul Boddie" <[EMAIL PROTECTED]> wrote: > On 22 Feb, 16:13, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > > > > > Darn. You're right of course - I just got the basic idea, and formed in my > > mind the "get the modules filename, thus the path, glob over it for *py, > > and th

Re: How to covert ASCII to integer in Python?

2007-02-22 Thread Paul Rubin
"John" <[EMAIL PROTECTED]> writes: > I just found ord(c), which convert ascii to integer. > Anybody know what the reverse is? chr(i) -- http://mail.python.org/mailman/listinfo/python-list

Re: Possible to set cpython heap size?

2007-02-22 Thread Chris Mellon
On 22 Feb 2007 09:52:49 -0800, Andy Watson <[EMAIL PROTECTED]> wrote: > > Why do you want that? And no, it is not possible. And to be honest: > I have > > no idea why e.g. the JVM allows for this. > > > > Diez > > The reason why is simply that I know roughly how much memory I'm going > to need, an

American Expertise in Science and China, amazing good life at the end

2007-02-22 Thread stj911
http://www.newsreview.com/sacramento/Content?oid=oid%3A16418 Google search for Robert Hanson accidentally led to the amazing story in the link above -- http://mail.python.org/mailman/listinfo/python-list

Re: export an array of floats to python

2007-02-22 Thread sturlamolden
On Feb 22, 7:36 pm, "sturlamolden" <[EMAIL PROTECTED]> wrote: > npy_int dim = {480, 640}; /* whatever the size of your data, in C- > order */ oops... npy_int dim[] = {480, 640}; -- http://mail.python.org/mailman/listinfo/python-list

Re: export an array of floats to python

2007-02-22 Thread sturlamolden
On Feb 22, 5:40 pm, Peter Wuertz <[EMAIL PROTECTED]> wrote: > I'm writing a C module for python, that accesses a special usb camera. > This module is supposed to provide python with data (alot of data). Then > SciPy is used to fit the data. > > My question is, how to make python read from a C arra

Re: How to covert ASCII to integer in Python?

2007-02-22 Thread Larry Bates
John wrote: > I just found ord(c), which convert ascii to integer. > > Anybody know what the reverse is? > > "John" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> Is there any built in function that converts ASCII to integer or vice > versa >> in Python? >> >> Thanks! >> >> > >

Re: How to covert ASCII to integer in Python?

2007-02-22 Thread Lloyd Zusman
"John" <[EMAIL PROTECTED]> writes: > I just found ord(c), which convert ascii to integer. > > Anybody know what the reverse is? The inverse of "ord" is "chr": % python Python 2.5 (r25:51908, Jan 5 2007, 00:12:45) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copy

JasperServer

2007-02-22 Thread batok
JasperServer is a report engine ( java based ). It has a soap interface. Does anybody has used Jasperserver via Soap ? An example would be appreciated. -- http://mail.python.org/mailman/listinfo/python-list

Re: How to covert ASCII to integer in Python?

2007-02-22 Thread John
I just found ord(c), which convert ascii to integer. Anybody know what the reverse is? "John" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Is there any built in function that converts ASCII to integer or vice versa > in Python? > > Thanks! > > -- http://mail.python.org/mailman

Re: Possible to set cpython heap size?

2007-02-22 Thread Irmen de Jong
Andy Watson wrote: > > Why do you want that? And no, it is not possible. And to be honest: > I have >> no idea why e.g. the JVM allows for this. >> >> Diez > > The reason why is simply that I know roughly how much memory I'm going > to need, and cpython seems to be taking a fair amount of time

Re: How to covert ASCII to integer in Python?

2007-02-22 Thread Jeff McNeil
Or perhaps... ord ("a") 97 chr (97) 'a' On 2/22/07, hg <[EMAIL PROTECTED]> wrote: John wrote: > Is there any built in function that converts ASCII to integer or vice > versa in Python? > > Thanks! >>> int('10') 10 >>> str(10) '10' >>> -- http://mail.python.org/mailman/listinfo/pytho

Re: Possible to set cpython heap size?

2007-02-22 Thread Diez B. Roggisch
Andy Watson wrote: > > Why do you want that? And no, it is not possible. And to be honest: > I have >> no idea why e.g. the JVM allows for this. > > The reason why is simply that I know roughly how much memory I'm going > to need, and cpython seems to be taking a fair amount of time > extending

Re: JIT (just-in-tme accelerator) for Python - exists or no?

2007-02-22 Thread bearophileHUGS
On Feb 22, 7:04 pm, [EMAIL PROTECTED] wrote: > Or is any progress going on now? > The JIT in MATLAB or Java seems to be very effective. Have you tried Psyco? Other progress is probably in the PyPy field too. Bye, bearophile -- http://mail.python.org/mailman/listinfo/python-list

Re: unicodedata implementation

2007-02-22 Thread Martin v. Löwis
James Abley schrieb: > So from my understanding of the Unicode (3.2.0) spec, the code point > 0x325F has a numeric property with a value of 35, but the python (2.3 > and 2.4 - I haven't put 2.5 onto my box yet) implementation of > unicodedata disagrees, presumably for good reason. > > I can't see

Re: when will python 2.5 take in mainstream?

2007-02-22 Thread Paul Rubin
"Martin v. Löwis" <[EMAIL PROTECTED]> writes: > > I haven't heard of other languages that seriously try to do that, > > though maybe some do. > Languages typically achieve this by specifying an ABI (in addition > to the API), and then sticking to that. Oh yes, at that level, it's reasonable and

JIT (just-in-tme accelerator) for Python - exists or no?

2007-02-22 Thread openopt
Or is any progress going on now? The JIT in MATLAB or Java seems to be very effective. -- http://mail.python.org/mailman/listinfo/python-list

Re: when will python 2.5 take in mainstream?

2007-02-22 Thread Paul Rubin
"Martin v. Löwis" <[EMAIL PROTECTED]> writes: > I think it should be possible to specify a Python API that then future > versions can guarantee. This would be a subset of what you can currently > do on the Python API, in particular, access to the structure layout of > Python objects would not be av

Re: when will python 2.5 take in mainstream?

2007-02-22 Thread Martin v. Löwis
Paul Rubin schrieb: > Laurent Pointal <[EMAIL PROTECTED]> writes: >> IMHO trying to have a binary compatibility with older compiled modules >> by maintaining an ad-hoc layer to switch between 2.4/2.5 engines make >> Python code more complex. And more complex code have generally more >> bugs. This i

Re: export an array of floats to python

2007-02-22 Thread Peter Wuertz
Travis Oliphant wrote: > Peter Wuertz wrote: >> Hi, >> >> I'm writing a C module for python, that accesses a special usb camera. >> This module is supposed to provide python with data (alot of data). >> Then SciPy is used to fit the data. >> > > Which version of scipy are you using? I'm using u

Re: How to covert ASCII to integer in Python?

2007-02-22 Thread hg
John wrote: > Is there any built in function that converts ASCII to integer or vice > versa in Python? > > Thanks! >>> int('10') 10 >>> str(10) '10' >>> -- http://mail.python.org/mailman/listinfo/python-list

Re: when will python 2.5 take in mainstream?

2007-02-22 Thread Martin v. Löwis
> Its simple to require changes, not so sure that doing these > modifications keep things simple. Maybe an internal Python hacker can > give us his advice on such a modification (ie. staying compatible with > legacy modules compiled for previous versions). I think it should be possible to specify

Re: Possible to set cpython heap size?

2007-02-22 Thread Andy Watson
> Why do you want that? And no, it is not possible. And to be honest: I have > no idea why e.g. the JVM allows for this. > > Diez The reason why is simply that I know roughly how much memory I'm going to need, and cpython seems to be taking a fair amount of time extending its heap as I read in co

Re: export an array of floats to python

2007-02-22 Thread Larry Bates
Peter Wuertz wrote: > Hi, > > I'm writing a C module for python, that accesses a special usb camera. > This module is supposed to provide python with data (alot of data). Then > SciPy is used to fit the data. > > My question is, how to make python read from a C array? By reading the > documentati

Re: How to covert ASCII to integer in Python?

2007-02-22 Thread keirr
On Feb 22, 5:43 pm, "John" <[EMAIL PROTECTED]> wrote: > Is there any built in function that converts ASCII to integer or vice versa > in Python? > > Thanks! Try int. ie. try: int_val = int(str_val) except ValueError: # conversion failed Keir. -- Keir Robinson Sometimes a scream is better

Re: How to covert ASCII to integer in Python?

2007-02-22 Thread Larry Bates
John wrote: > Is there any built in function that converts ASCII to integer or vice versa > in Python? > > Thanks! > > You probably should go through the tutorial ASAP that is located here: http://docs.python.org/tut/ Convert ascii string to integer: a='1' b=int(a) Convert integer to ascii

Re: How can I track/monitor an application and system resources.

2007-02-22 Thread Jordan
On Feb 22, 11:48 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Hello All, > > I'm a newbie to Python! > > I am trying to develop a program that monitors the performance of an > application. The kind of information I am interested in is the CPU/ > Process/Thread and memory performance. Speci

Re: export an array of floats to python

2007-02-22 Thread Travis Oliphant
Peter Wuertz wrote: > Hi, > > I'm writing a C module for python, that accesses a special usb camera. > This module is supposed to provide python with data (alot of data). Then > SciPy is used to fit the data. > Which version of scipy are you using? > My question is, how to make python read fr

How to covert ASCII to integer in Python?

2007-02-22 Thread John
Is there any built in function that converts ASCII to integer or vice versa in Python? Thanks! -- http://mail.python.org/mailman/listinfo/python-list

Re: Possible to set cpython heap size?

2007-02-22 Thread Diez B. Roggisch
Andy Watson wrote: > I have an application that scans and processes a bunch of text files. > The content I'm pulling out and holding in memory is at least 200MB. > > I'd love to be able to tell the CPython virtual machine that I need a > heap of, say 300MB up front rather than have it grow as nee

Re: Bug in time module - %z works in perl, not in python?

2007-02-22 Thread Paul Boddie
On 22 Feb, 17:29, [EMAIL PROTECTED] wrote: > On Feb 21, 9:50 pm, [EMAIL PROTECTED] wrote: > > > On Feb 21, 6:17 pm, [EMAIL PROTECTED] wrote: > ... > > > 2007-02-21 21:15:58 EST+ (iso localtime, python) > > Seems to be a bug. I can duplicate the > > problem here (Python 2.4.3, Red Hat Desktop

Re: Local class variables? (mod_python problem)

2007-02-22 Thread Rory Campbell-Lange
On 22/02/07, Rory Campbell-Lange ([EMAIL PROTECTED]) wrote: > In essence we use class variables as follows: > > class Part (object): > totalgia = 0 > def __init__(self, gia): > self.gia = gia # gross internal area > self.giaratio = 0 > Part

[ANN] MathTran project

2007-02-22 Thread Jonathan Fine
MathTran is a JISC funded project to provide translation of mathematical content as a web service. MathTran will be using TeX to provide mathematical typography, and will use Python as its main programming language. http://www.open.ac.uk/mathtran/ http://www.jisc.ac.uk/ http://www.jisc.a

Possible to set cpython heap size?

2007-02-22 Thread Andy Watson
I have an application that scans and processes a bunch of text files. The content I'm pulling out and holding in memory is at least 200MB. I'd love to be able to tell the CPython virtual machine that I need a heap of, say 300MB up front rather than have it grow as needed. I've had a scan through

How can I track/monitor an application and system resources.

2007-02-22 Thread [EMAIL PROTECTED]
Hello All, I'm a newbie to Python! I am trying to develop a program that monitors the performance of an application. The kind of information I am interested in is the CPU/ Process/Thread and memory performance. Specifically, I would like to track the following CPU usage Used Memory on Phone Fre

export an array of floats to python

2007-02-22 Thread Peter Wuertz
Hi, I'm writing a C module for python, that accesses a special usb camera. This module is supposed to provide python with data (alot of data). Then SciPy is used to fit the data. My question is, how to make python read from a C array? By reading the documentation, one could get the impression

Re: paths in modules

2007-02-22 Thread Brandon Mintern
On Thu, 22 Feb 2007 10:30:59 -0600, Larry Bates wrote: > Normally this would be: > > f = os.popen('./wrapper_dir/utility_dir/some_external_utility') > > -Larry Yes, but the problem with that solution is, let's say that I further abstract the whole thing and I add a directory outside of my toplev

Re: list/get methods/attributes of a class?

2007-02-22 Thread Jason
On Feb 22, 8:27 am, [EMAIL PROTECTED] wrote: > Hello, > Sorry guys for this newbie questions. But I wonder if there is a > standard or build-in method to know the methods of a class? > > I'm not originally a progrommer and I have worked with python/qt in a > basic level. Now I work a package which

Re: is it possible to remove the ':' symbol in the end of lines starting with 'if', 'while' etc?

2007-02-22 Thread openopt
> Think on the bright side: > > you have to type ":" at the beginning of loop and conditional blocks, > but you don't have to type "end" at the end... you are still saving > two strokes... > ;-)) No, there no profits: instead of 'end' I must type , ':' and backspace in the end of block - so 3 key

Re: paths in modules (solved)

2007-02-22 Thread Brandon Mintern
On Thu, 22 Feb 2007 08:28:50 -0800, Paul Boddie wrote: > And you really want to refer to utility_dir relative to some_wrapper. > What you can try is to split the __file__ attribute of some_wrapper - > it's a standard attribute on imported modules - in order to refer to > the module's parent directo

Re: paths in modules

2007-02-22 Thread Larry Bates
Brandon Mintern wrote: > I am developing a project in Python which uses several external utilities. > For convenience, I am wrapping these accesses in a module. The problem is > that I cannot be sure where these modules are imported from, so I am > trying to figure out how to reliably execute e.g.

Re: Bug in time module - %z works in perl, not in python?

2007-02-22 Thread bwooster47
On Feb 21, 9:50 pm, [EMAIL PROTECTED] wrote: > On Feb 21, 6:17 pm, [EMAIL PROTECTED] wrote: ... > > 2007-02-21 21:15:58 EST+ (iso localtime, python) > Seems to be a bug. I can duplicate the > problem here (Python 2.4.3, Red Hat Desktop release 4). I searched the bug database, found this iss

Re: paths in modules

2007-02-22 Thread Paul Boddie
On 22 Feb, 17:13, Brandon Mintern <[EMAIL PROTECTED]> wrote: > > toplevel_dir > +-main script > +-wrapper_dir > +-some_wrapper > +-utility_dir > +-some_external_utility [...] > And then in some_wrapper, I would have code like: > > import os > > def use_external_utility(): > f = os.popen

Re: How to test whether a host is reachable?

2007-02-22 Thread Bart Ogryczak
On Feb 22, 3:22 pm, Fabian Steiner <[EMAIL PROTECTED]> wrote: > Now I am wondering if there isn't any better method which would be more > general. In fact, I think of something like a python version of ping > which only tries to send ICMP packets. Server or a firewall in between most probably wil

Re: paths in modules

2007-02-22 Thread Brandon Mintern
On Thu, 22 Feb 2007 11:13:46 -0500, Brandon Mintern wrote: > Of course, the problem with that approach is that it fails because there > is no utility_dir in the CWD... ...and of course by CWD, I actually mean "current working directory", which should have actually been PWD or "present working dire

paths in modules

2007-02-22 Thread Brandon Mintern
I am developing a project in Python which uses several external utilities. For convenience, I am wrapping these accesses in a module. The problem is that I cannot be sure where these modules are imported from, so I am trying to figure out how to reliably execute e.g. a popen call. Example layout:

Re: Local class variables? (mod_python problem)

2007-02-22 Thread Piet van Oostrum
> Rory Campbell-Lange <[EMAIL PROTECTED]> (RC) wrote: >RC> totalgia keeps incrementing when this code is used under mod_python. And also when used outside of mod_python. It is because it is a class level variable. In fact I think under certain circumstances in mod_python it will not do that b

Re: plugin development best practices

2007-02-22 Thread Paul Boddie
On 22 Feb, 16:13, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > > Darn. You're right of course - I just got the basic idea, and formed in my > mind the "get the modules filename, thus the path, glob over it for *py, > and thus get the subsequent module names"-pattern. Which is trivial of > course

  1   2   >