Re: Convert to binary and convert back to strings

2007-02-22 Thread Jussi Salmela
Harlin Seritt kirjoitti: > Hi... > > I would like to take a string like 'supercalifragilisticexpialidocius' > and write it to a file in binary forms -- this way a user cannot read > the string in case they were try to open in something like ascii text > editor. I'd also like to be able to read the

Re: f---ing typechecking

2007-02-22 Thread greg
Hendrik van Rooyen wrote: > I don't think its reasonable - its just an accident of implementation. There's nothing accidental about the implementation of the in-place operators. It was designed the way it is so that it would work in a reasonable way with both mutable and immutable objects. -- Gr

Re: Convert to binary and convert back to strings

2007-02-22 Thread Paul Rubin
Grant Edwards <[EMAIL PROTECTED]> writes: > > print base64.decodestring(open('sambleb.conf', 'r').read()) > It'll only remain obfuscated for about 30 seconds after even a > mildly curious user looks at the file. You could use the mult127 function, self-inverting like its better known but more easi

Finding a tuple in a tuple

2007-02-22 Thread bg_ie
Hi, Lists say I have the following tuple - t1 = ("ONE","THREE","SIX") and then the following tuples - t2 = ("ONE","TWO","THREE") t3 = ("TWO","FOUR","FIVE","SIX") t4 = ("TWO",) t5 = ("TWO","FIVE") What I want to do is return true if any member of tuple t1 is found in the remaining tuples. T

Re: outlook bar like widget

2007-02-22 Thread Mohammad Tayseer
I implemented this module using Tkinter --- from Tkinter import * class OutlookBar(Frame): def __init__(self, *args, **options): Frame.__init__(self, *args, **options) self.panes = {} def add_pane(self, name, pane): self.panes[name]

Re: outlook bar like widget

2007-02-22 Thread Mohammad Tayseer
This is a module that does what you want using Tkinter from Tkinter import * class OutlookBar(Frame): def __init__(self, *args, **options): Frame.__init__(self, *args, **options) self.panes = {} def add_pane(self, name, pane): self.panes[n

Re: Finding a tuple in a tuple

2007-02-22 Thread Paul Rubin
[EMAIL PROTECTED] writes: > Lists say I have the following tuple - > t1 = ("ONE","THREE","SIX") > t2 = ("ONE","TWO","THREE") > t3 = ("TWO","FOUR","FIVE","SIX") > t4 = ("TWO",) > t5 = ("TWO","FIVE") > > What I want to do is return true if any member of tuple t1 is found in > the remaining tuples.

Re: Convert to binary and convert back to strings

2007-02-22 Thread Steven D'Aprano
On Wed, 21 Feb 2007 16:46:19 -0800, Harlin Seritt wrote: >> WARNING: THIS IS NOT A STRONG ENCRYPTION ALGORITHM. It is just a >> nuisance for someone that really wants to decrypt the string. But >> it might work for your application. >> >> -Larry > > Thanks Larry! I was looking for something more

Re: Finding a tuple in a tuple

2007-02-22 Thread Paul McGuire
On Feb 22, 3:05 am, Paul Rubin wrote: > [EMAIL PROTECTED] writes: > > Lists say I have the following tuple - > > t1 = ("ONE","THREE","SIX") > > t2 = ("ONE","TWO","THREE") > > t3 = ("TWO","FOUR","FIVE","SIX") > > t4 = ("TWO",) > > t5 = ("TWO","FIVE") > > > What I want to d

Re: jython import search path

2007-02-22 Thread Diez B. Roggisch
Russ wrote: > On Feb 21, 4:15 pm, Larry Bates <[EMAIL PROTECTED]> wrote: >> Russ wrote: >> > I have a Python program that I want to run in Jython so I can get Java >> > bytecode output. The program runs fine in Python, but when I change >> > the first line of the main program to make it run in Jyt

Re: Pep 3105: the end of print?

2007-02-22 Thread Steven D'Aprano
On Thu, 22 Feb 2007 16:29:17 +1100, Peter Mayne wrote: > Why use print in the interactive interpreter? Just type the expression. Many reasons. Here are four: >>> print None None >>> None >>> print 0.1 0.1 >>> 0.1 0.10001 >>> print 'null = \0' null = >>> 'null = \0' 'null = \x00' >>>

Re: Finding a tuple in a tuple

2007-02-22 Thread Paul Rubin
"Paul McGuire" <[EMAIL PROTECTED]> writes: > A step further: use union to make a superset of t2-tN, then use & on > this superset. > > setlist = [t2,t3,t4,t5] > superset = reduce(set.union, map(set,setlist) ) > print bool(t1 & superset) Well you do have to convert them to sets. Also I thought ea

Local class variables? (mod_python problem)

2007-02-22 Thread Rory Campbell-Lange
We have a set of classes using static methods to retain reference variables between operations. The problem is that the static variables are not reset between operations when used through mod_python. Although it is possible to reset the class variables between invocations of the system, this has t

Re: PLY for standard library

2007-02-22 Thread Jakub Stolarski
On 21 Lut, 21:27, "Paul McGuire" <[EMAIL PROTECTED]> wrote: > Other candidates besides > PLY:http://www.nedbatchelder.com/text/python-parsers.htmlhttp://wiki.python.org/moin/LanguageParsing > > I'm not sure this is a "one size fits all" problem space. > > Personally I find PLY's use of docstrings

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

2007-02-22 Thread openopt
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 ... instead of while i print i

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

2007-02-22 Thread Diez B. Roggisch
[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: Convert to binary and convert back to strings

2007-02-22 Thread Jussi Salmela
Steven D'Aprano kirjoitti: > On Wed, 21 Feb 2007 16:46:19 -0800, Harlin Seritt wrote: > >>> WARNING: THIS IS NOT A STRONG ENCRYPTION ALGORITHM. It is just a >>> nuisance for someone that really wants to decrypt the string. But >>> it might work for your application. >>> >>> -Larry >> Thanks Larry

Re: Finding a tuple in a tuple

2007-02-22 Thread Philipp Pagel
[EMAIL PROTECTED] wrote: > t1 = ("ONE","THREE","SIX") > t2 = ("ONE","TWO","THREE") > t3 = ("TWO","FOUR","FIVE","SIX") > t4 = ("TWO",) > t5 = ("TWO","FIVE") > What I want to do is return true if any member of tuple t1 is found in > the remaining tuples. Another way to go instead of using sets, al

Informations about other computers in the network

2007-02-22 Thread ChuehBueb
Hi all. I search a way to get informations, like NetBios-Name, os,..., about other workstations in my network. I searched google and the documentation, but i found nothing... can you help me? -- http://mail.python.org/mailman/listinfo/python-list

Re: Finding a tuple in a tuple

2007-02-22 Thread Jussi Salmela
[EMAIL PROTECTED] kirjoitti: > Hi, > > Lists say I have the following tuple - > > t1 = ("ONE","THREE","SIX") > > and then the following tuples - > > t2 = ("ONE","TWO","THREE") > > t3 = ("TWO","FOUR","FIVE","SIX") > > t4 = ("TWO",) > > t5 = ("TWO","FIVE") > > What I want to do is return true

Re: outlook bar like widget

2007-02-22 Thread Jaime Casanova
On 2/21/07, Mohammad Tayseer <[EMAIL PROTECTED]> wrote: > I implemented this module using Tkinter > wow! i will try this, thanks -- regards, Jaime Casanova "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs and the universe trying to

plugin development best practices

2007-02-22 Thread Flavio
Hi, Nowadays the addition of functionality to programs by means of plugins is very frequent. I want to know the opinions of experienced Python developers about the best practices when it comes to developing a plugin system for a Python package. Should plugins be modules in a separate package? S

Re: plugin development best practices

2007-02-22 Thread Jean-Paul Calderone
On 22 Feb 2007 04:53:02 -0800, Flavio <[EMAIL PROTECTED]> wrote: >Hi, > >Nowadays the addition of functionality to programs by means of >plugins is very frequent. > >I want to know the opinions of experienced Python developers about the >best practices when it comes to developing a plugin system f

Re: plugin development best practices

2007-02-22 Thread Diez B. Roggisch
Flavio wrote: > Hi, > > Nowadays the addition of functionality to programs by means of > plugins is very frequent. > > I want to know the opinions of experienced Python developers about the > best practices when it comes to developing a plugin system for a > Python package. > > Should plugins

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

2007-02-22 Thread Flavio
On Feb 22, 9:49 am, [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

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

2007-02-22 Thread justme
On 22 Feb, 11:49, [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:

Re: Regex Speed

2007-02-22 Thread Szabolcs Nagy
> Well, just as an idea, there is a portable C library for this at > http://laurikari.net/tre/ released under LGPL. If one is willing to > give up PCRE extensions for speed, it might be worth the work to > wrap this library using SWIG. actually there is a python binding in the tre source with an

Re: network simulator in Python ?

2007-02-22 Thread peter rabinovitch
Have a look at simpy. Although it doesn't do the protocols you mention, it is a very good (imho)simulation toolkit in which it would be relatively easy to build whatever protocols you need. I am using it for a traffic management simulation project, and have found it very easy to get going and

Re: plugin development best practices

2007-02-22 Thread Flavio
On Feb 22, 11:00 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > Flavio wrote: > > Hi, > > > Nowadays the addition of functionality to programs by means of > > plugins is very frequent. > > > I want to know the opinions of experienced Python developers about the > > best practices when it come

Re: Local class variables? (mod_python problem)

2007-02-22 Thread Piet van Oostrum
> Rory Campbell-Lange <[EMAIL PROTECTED]> (RC) wrote: >RC> We have a set of classes using static methods to retain reference >RC> variables between operations. The problem is that the static variables >RC> are not reset between operations when used through mod_python. >RC> Although it is poss

Re: plugin development best practices

2007-02-22 Thread Diez B. Roggisch
> > I will search the archives. I am aware of the setuptools feature It is > quite nice. But the documentation is not very clear on how to define > "entry point groups" on the importing end, i.e. how to prepare a an > application to accept plugins it doesn't even now exist. The entry-points are j

Re: Creating a daemon process in Python

2007-02-22 Thread [EMAIL PROTECTED]
Thanks all, I understood there is no shortcut function like BSD daemon(). I'll do it manually using examples from cookbook... On 2月22日, 午前1:41, Benjamin Niemann <[EMAIL PROTECTED]> wrote: > Hello, > > Sakagami Hiroki wrote: > > What is the easiest way to create a daemon process in Python? Goo

Re: Local class variables? (mod_python problem)

2007-02-22 Thread Diez B. Roggisch
Rory Campbell-Lange wrote: > We have a set of classes using static methods to retain reference > variables between operations. The problem is that the static variables > are not reset between operations when used through mod_python. > > Although it is possible to reset the class variables between

Re: plugin development best practices

2007-02-22 Thread Flavio
On Feb 22, 11:01 am, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: > On 22 Feb 2007 04:53:02 -0800, Flavio <[EMAIL PROTECTED]> wrote: > > >Hi, > > >Nowadays the addition of functionality to programs by means of > >plugins is very frequent. > > >I want to know the opinions of experienced Python de

Reading mails from Outlook

2007-02-22 Thread beeswax
Hi, Does anyone knows how to read e-mails from a specific folders in outlook? I only found out how to read the mails from the inbox folder and how to list all available folder. I just don't found a way to access my mails from the other folders. Can anyone help me? Regards, Sam -- http://mail.

Re: plugin development best practices

2007-02-22 Thread Flavio
On Feb 22, 10:53 am, "Flavio" <[EMAIL PROTECTED]> wrote: > Hi, > > Nowadays the addition of functionality to programs by means of > plugins is very frequent. > > I want to know the opinions of experienced Python developers about the > best practices when it comes to developing apluginsystemfor a >

How to test whether a host is reachable?

2007-02-22 Thread Fabian Steiner
Hello! As the subject says I need to test whether a host computer in our network is reachable or not. At the moment I simply attempt to connect to a given port that is open when the machine is online: [...] sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) try: sock.connect(('192.16

Re: Convert to binary and convert back to strings

2007-02-22 Thread Neil Cerutti
On 2007-02-22, Jussi Salmela <[EMAIL PROTECTED]> wrote: > Steven D'Aprano kirjoitti: >> On Wed, 21 Feb 2007 16:46:19 -0800, Harlin Seritt wrote: >> WARNING: THIS IS NOT A STRONG ENCRYPTION ALGORITHM. It is just a nuisance for someone that really wants to decrypt the string. But it

Re: How to test whether a host is reachable?

2007-02-22 Thread Chris Mellon
On 2/22/07, Fabian Steiner <[EMAIL PROTECTED]> wrote: > Hello! > > As the subject says I need to test whether a host computer in our > network is reachable or not. At the moment I simply attempt to connect > to a given port that is open when the machine is online: > > [...] > sock = socket.socket(s

Re: plugin development best practices

2007-02-22 Thread Diez B. Roggisch
> Simple plugin system proposal: > > have a package (directory with __init__.py) called plugins where the > actual plugins are modules in this directory. > > When the main script imports the plugins package, all plugin modules > would be available as plugins.pluginA, plugins.pluginB , etc. > > A

Re: Reading mails from Outlook

2007-02-22 Thread Larry Bates
beeswax wrote: > Hi, > > Does anyone knows how to read e-mails from a specific folders in > outlook? > I only found out how to read the mails from the inbox folder and how > to list all available folder. > I just don't found a way to access my mails from the other folders. > > Can anyone help me?

Re: How to test whether a host is reachable?

2007-02-22 Thread Larry Bates
Fabian Steiner wrote: > Hello! > > As the subject says I need to test whether a host computer in our > network is reachable or not. At the moment I simply attempt to connect > to a given port that is open when the machine is online: > > [...] > sock = socket.socket(socket.AF_INET, socket.SOCK_STR

Re: plugin development best practices

2007-02-22 Thread Flavio
On Feb 22, 12:36 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > > Simple plugin system proposal: > > > have a package (directory with __init__.py) called plugins where the > > actual plugins are modules in this directory. > > > When the main script imports the plugins package, all plugin modul

Re: Convert to binary and convert back to strings

2007-02-22 Thread Grant Edwards
On 2007-02-22, Grant Edwards <[EMAIL PROTECTED]> wrote: > On 2007-02-22, Ganesan Rajagopal <[EMAIL PROTECTED]> wrote: > >>> I am hoping to have it show up some weird un-readable text. >>> And then of course be able to convert it right back to a >>> string. Is this even possible? >> >> Looks like yo

Re: Creating a daemon process in Python

2007-02-22 Thread Grant Edwards
On 2007-02-22, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > I understood there is no shortcut function like BSD daemon(). I'll do > it manually using examples from cookbook... Sure would be nice if somebody posted one. ;) -- Grant Edwards grante Yow! Oh, I get

Re: plugin development best practices

2007-02-22 Thread Flavio
On Feb 22, 12:51 pm, "Flavio" <[EMAIL PROTECTED]> wrote: > On Feb 22, 12:36 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > > > > > > Simple plugin system proposal: > > > > have a package (directory with __init__.py) called plugins where the > > > actual plugins are modules in this directory. >

Re: plugin development best practices

2007-02-22 Thread Jean-Paul Calderone
On Thu, 22 Feb 2007 15:36:42 +0100, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: >> Simple plugin system proposal: >> >> have a package (directory with __init__.py) called plugins where the >> actual plugins are modules in this directory. >> >> When the main script imports the plugins package, al

Re: How to test whether a host is reachable?

2007-02-22 Thread Diez B. Roggisch
> Just because you could ping with ICMP packets doesn't mean you could > do anything with the machine. I assume that you are connecting to > do something on the machine. Just wrap what you are trying to do > in try: block. It will either succeed or fail. Handle the exeption. And the other way

Re: plugin development best practices

2007-02-22 Thread Diez B. Roggisch
Jean-Paul Calderone wrote: > On Thu, 22 Feb 2007 15:36:42 +0100, "Diez B. Roggisch" > <[EMAIL PROTECTED]> wrote: >>> Simple plugin system proposal: >>> >>> have a package (directory with __init__.py) called plugins where the >>> actual plugins are modules in this directory. >>> >>> When the main s

list/get methods/attributes of a class?

2007-02-22 Thread bkamrani
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 has many predefined classes which I'm going to resue by

Re: How to test whether a host is reachable?

2007-02-22 Thread Fabian Steiner
Hello! Chris Mellon wrote: > On 2/22/07, 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. However, I don't

Re: Local class variables? (mod_python problem)

2007-02-22 Thread Rory Campbell-Lange
Apologies to Piet and Diez for the lack of clarity in my previous post (and the broken code). 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 =

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

2007-02-22 Thread Thomas Nelson
Check out the dir() function. It does what you want, I think. Tom On Feb 22, 9: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

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

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

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: 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

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 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: 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 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: 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: 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: 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: 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

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

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

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

[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

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

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: 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

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: 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

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: 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 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: 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: 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: 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: 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: 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: 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: 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

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 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

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: 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: 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: 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 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 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

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 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

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: 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: 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

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: 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

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

  1   2   >