Pointers/References in Python?

2008-07-30 Thread [EMAIL PROTECTED]
Hello, I have a long list of memory-heavy objects that I would like to access in differently sorted order. Let's say I'd like to have lists called by_date or by_size that I can use to access the objects in the specified order. Of course I can just build those lists naively by creating copies of t

Re: working pylint anyone?

2008-07-31 Thread [EMAIL PROTECTED]
On Jul 31, 11:29 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > Hi, > > until yesterday I was a happy user of pylint. Then I upgraded to ubuntu > hardy heron - and the trouble began. > > The packaged version of pylint (0.13.2

Function References

2008-07-31 Thread [EMAIL PROTECTED]
Greetings, I'm trying to wrap a function in a C library as a compiled C Python module. Everything is going great, but I've hit a snag. There's a function in the form of this: First the typedef: typedef void(*FPtr_DeviceMessageHandler) (const DeviceMessage, const char*); Then the actual function

Re: Function References

2008-07-31 Thread [EMAIL PROTECTED]
Hello Diez. > May I suggest you move to ctypes for wrapping? It's easier, pure python and > callbacks are already built-in. I'm pretty new to extending Python in C, I don't understand what you're saying. Are there any examples or a brief explanation/URL you could point me to? -- http://mail.pyth

Re: working pylint anyone?

2008-07-31 Thread [EMAIL PROTECTED]
On Jul 31, 2:39 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > > Which version of python-logilab-common and python-logilab-astng are > > installed on your machine ? > > By now, pylint 0.14 with logilab.common 0.27 and astng 0.17.2 > > I was able to trac

Re: Function References

2008-07-31 Thread [EMAIL PROTECTED]
> Ctypes is a since python2.5 built-in module that allows to declare > interfaces to C-libraries in pure python. You declare datatypes and > function prototypes, load a DLL/SO and then happily work with it. No C, no > compiler, no refcounts, no nothing. > > And you can pass python-functions as call

Re: Need help in writing up a Python Syntax checker

2008-07-31 Thread [EMAIL PROTECTED]
On Jul 14, 8:22 am, Kinokunya <[EMAIL PROTECTED]> wrote: > Hi guys, > > My group and I will be working on our final year project, the scope to > do a program/web-based application similar areas of functionalities > like thePyLintand PyChecker; a Python syntax checker

Re: Function References

2008-07-31 Thread [EMAIL PROTECTED]
> How much more liberal can it get than MIT-licensed? Again, the licensing issue is everything to do with the original library distributor, NOT ctypes. > But then, if you insist, go down the hard road. Irrelevant and unnecessary. If you don't want to help, don't please don't reply. -- http://mai

Re: Function References

2008-07-31 Thread [EMAIL PROTECTED]
On Jul 31, 10:47 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > I take the freedom to do so as I see fit - this is usenet... Fine, then keep beating a dead horse by replying to this thread with things that do nobody any good. It seems like there are a lot better way to

Re: mapping a string to an instancemethod

2008-08-01 Thread [EMAIL PROTECTED]
On Aug 1, 11:22 am, [EMAIL PROTECTED] wrote: > The following bit of code will allow an instance member to > be called by reference. How can I map a string (e.g. > "hello1" or "Foo.hello1" to a the instance member? > > class Foo: > def hello1(self, p):

Continually check object status

2008-08-02 Thread [EMAIL PROTECTED]
Beginner, so please bare with me. I'm not sure what to call what it is I'm looking for. If I have an object class, let's call it "Creature": class Creature: def __init__(self, status): self.status = "happy" def change_status(self, new_status): self.status = new_status

Re: Continually check object status

2008-08-02 Thread [EMAIL PROTECTED]
On Aug 2, 12:58 pm, Gary Herron <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > Beginner, so please bare with me.  I'm not sure what to call what it > > is I'm looking for. > > > If I have an object class, let's call it "Creature":

Re: Continually check object status

2008-08-02 Thread [EMAIL PROTECTED]
On Aug 2, 1:05 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] schrieb: > > > > > Beginner, so please bare with me.  I'm not sure what to call what it > > is I'm looking for. > > > If I have an object class, let'

Re: scanf in python

2008-08-03 Thread [EMAIL PROTECTED]
On Jul 22, 2:00 pm, AMD <[EMAIL PROTECTED]> wrote: > Hello Fredrik, > > I didn't think my comment would offend anyone [...] I doubt that it offended anyone else. Having been the recipient of a few F-bombs :-) myself, I'd just let it go by... Mike -- http://mail.py

looking for IDE advice or workflow tips

2008-08-04 Thread [EMAIL PROTECTED]
I'm a novice developer at best and often work with the R statistical programming language. I use an editor called TINN-R which allows me to write a script, then highlight a few lines and send them to the interpreter. I am using pythonwin and it lacks this funtionality (that I can tell) and when I c

Re: interpreter vs. compiled

2008-08-05 Thread [EMAIL PROTECTED]
On Aug 3, 1:26 am, castironpi <[EMAIL PROTECTED]> wrote: > On Aug 2, 2:02 pm, Tim Roberts <[EMAIL PROTECTED]> wrote: > > > castironpi <[EMAIL PROTECTED]> wrote: > > > >And furthermore, I think I'm getting > > >confused about what exactly c

Is there a faster way to do this?

2008-08-05 Thread [EMAIL PROTECTED]
I have a csv file containing product information that is 700+ MB in size. I'm trying to go through and pull out unique product ID's only as there are a lot of multiples. My problem is that I am appending the ProductID to an array and then searching through that array each time to see if I've seen t

Re: interpreter vs. compiled

2008-08-05 Thread [EMAIL PROTECTED]
Regarding exploring processor instructions. Lets say you compile a C program targeting x86 architecture, with optimizations turned on for speed, and let the compiler automatic select MMX and SSE instructions for numeric code. I have now a program that executes very fast, and does what I want very

ANN: matplotlib-0.98.3 - plotting for python

2008-08-06 Thread [EMAIL PROTECTED]
matplotlib is a 2D plotting library for python for use in scripts, applications, interactive shell work or web application servers. matplotlib 0.98.3 is a major but stable release which brings many new features detailed below. Homepage: http://matplotlib.sourceforge.net/ Downloads: http://sou

Re: Find class of an instance?

2008-08-06 Thread [EMAIL PROTECTED]
On 6 août, 15:52, Bruno Desthuilliers wrote: > Heiko Wundram a écrit : > > > Am Mittwoch, den 06.08.2008, 08:44 -0400 schrieb Neal Becker: > >> Sounds simple, but how, given an instance, do I find the class? > > > .__class__ > > Works for new-style classes only. The "generic" way to go is to use >

Re: Locking around

2008-08-07 Thread [EMAIL PROTECTED]
On Aug 6, 8:33 pm, Nikolaus Rath <[EMAIL PROTECTED]> wrote: > Tobiah <[EMAIL PROTECTED]> writes: > > On Mon, 04 Aug 2008 15:30:51 +0200, Nikolaus Rath wrote: > > Do you think you could use an SQL database on the network to > > handle the locking? > > Yea

[EMAIL PROTECTED]

2008-08-09 Thread [EMAIL PROTECTED]
FLJ. -- http://mail.python.org/mailman/listinfo/python-list

Re: for x,y in word1, word2 ?

2008-08-11 Thread [EMAIL PROTECTED]
On Aug 10, 11:14 pm, ssecorp <[EMAIL PROTECTED]> wrote: > On Aug 11, 6:40 am, Mensanator <[EMAIL PROTECTED]> wrote: > > > > > On Aug 10, 11:18 pm, ssecorp <[EMAIL PROTECTED]> wrote: > > > > Is there a syntax for looping through 2 iterables at the

formatting number of bytes to human readable format

2008-08-12 Thread [EMAIL PROTECTED]
is there any library / function that prints number of bytes in human readable format? for example a=XX(1048576) print a should output 1 MB thanks! -- http://mail.python.org/mailman/listinfo/python-list

Re: formatting number of bytes to human readable format

2008-08-12 Thread [EMAIL PROTECTED]
On Tue, Aug 12, 2008 at 7:31 PM, Rob Weir <[EMAIL PROTECTED]> wrote: > On 13 Aug 2008, rkmr wrote: > > is there any library / function that prints number of bytes in human > > readable format? > > for example > > > > a=XX(1048576) > > pr

The python not starting under cmd.exe

2008-08-13 Thread [EMAIL PROTECTED]
Hi! My problem is that: The "test.py" is working in every machine that I use except in my home machine. Formerly it worked but now not. I don't know what happened, I searching for some solution. The errormessage is this (after I tried to start test.py under cmd.exe): Microsoft Windows XP

Re: getting full exception information from an xmlrpc server

2008-08-13 Thread [EMAIL PROTECTED]
On Aug 13, 3:31 pm, Scott <[EMAIL PROTECTED]> wrote: > What I would like is the full stack trace of what went wrong on the > server (i.e. the junk python usually dumps to the console when an > exception occurs). I don't care which side I see the dump on (client > or server)

i want to control python using keyboard

2008-08-14 Thread [EMAIL PROTECTED]
hi i want to play alarm sound when i press a particular key in keyboard.so someone help me in doing it. Thanks and Regards Sasil.G -- http://mail.python.org/mailman/listinfo/python-list

Formatting input text file

2008-08-14 Thread [EMAIL PROTECTED]
Hi, it's me again with tons of questions. I hava an input file structured like this: X XYData-1 1. 3.08333 2. 9.05526 3. 3.13581 ...

problem with logic in reading a binary file

2008-03-29 Thread [EMAIL PROTECTED]
Hello, I am having trouble writing the code to read a binary string. I would like to extract the values for use in a calculation. Any help would be great. Here is my function that takes in a string. def parseSequence(data, start): group_num = data[start:start+2] element_num = data[sta

What motivates all unpaid volunteers at Pycon?

2008-03-29 Thread [EMAIL PROTECTED]
I was impressed and humbled by all the unpaid volunteers at Pycon. I was wondering what motivated so many people to give so much to the Python community. (I have my guesses but I'd rather listen than assume I know.) Any ideas? Chris -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie Question - Overloading ==

2008-03-31 Thread [EMAIL PROTECTED]
On 31 mar, 20:09, Duncan Booth <[EMAIL PROTECTED]> wrote: > xkenneth <[EMAIL PROTECTED]> wrote: > > Now obviously, if I test an instance of either class equal to each > > other, an attribute error will be thrown, how do I handle this? I > > could rewrite every __

Re: Looking for indent advice howto in emacs python-mode

2008-03-31 Thread [EMAIL PROTECTED]
On 31 mar, 18:32, "Steven W. Orr" <[EMAIL PROTECTED]> wrote: > Here's what I want to do: > > if ( ( v == 1 ) >or ( v == 2 ) >or ( v == 3 ) ): > pass Why the parens ? if a == 1 \ or b == 2 \ or c == 3: pass -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem with method overriding from base class

2008-03-31 Thread [EMAIL PROTECTED]
On 31 mar, 11:05, <[EMAIL PROTECTED]> wrote: > Hello everyone > > I have defined some sort of 'interface class' and a factory function that > creates instance objects of specific classes, which implement that interfa

bsddb3 thread problem

2008-04-01 Thread [EMAIL PROTECTED]
In my application I am trying to access(read) a DB thru a thread while my main thread is adding data to it and it gives following error(s) bsddb._db.DBRunRecoveryError: (-30974, 'DB_RUNRECOVERY: Fatal error, run database recovery -- PANIC: Permission denied') and sometimes bsddb._db.DBRunRecovery

Re: What motivates all unpaid volunteers at Pycon?

2008-04-01 Thread [EMAIL PROTECTED]
On Mar 31, 7:35 pm, [EMAIL PROTECTED] (Aahz) wrote: > There really isn't any simple answer. Most people seem to be motivated > to help out their communities, I still think all this unselfishness is noteworthy and curious. Chris -- http://mail.python.org/mailman/listinfo/python-list

Re: What motivates all unpaid volunteers at Pycon?

2008-04-01 Thread [EMAIL PROTECTED]
On Apr 1, 11:45 am, Ed Leafe <[EMAIL PROTECTED]> wrote: Assuming that people get nothing back by participating in a > community, yes, it would be curious. My experience, though, is that I > get a lot more out of it than I could ever contribute. IOW, it's a > great example of s

Re: bsddb3 thread problem

2008-04-01 Thread [EMAIL PROTECTED]
> Using threads with bsddb3.  I spent weeks trying to get it to behave > when threading.  I gave up in the end and changed to sqlite :-( > So does it mean that I will have to use threading locks around access methods? or that will also fail mysteriously :) -- http://mail.python.org/mailman/listin

Re: bsddb3 thread problem

2008-04-01 Thread [EMAIL PROTECTED]
On Apr 1, 9:02 pm, Rhamphoryncus <[EMAIL PROTECTED]> wrote: > It's my understanding that the connection is NOT thread-safe.  Your > thread should be using an entirely separate connection.- Hide quoted text - > Can you please explain that, which connection you are talking abo

Re: april fools email backfires

2008-04-02 Thread [EMAIL PROTECTED]
On 2 avr, 19:23, Paul Rubin <http://[EMAIL PROTECTED]> wrote: > Aaron Watters <[EMAIL PROTECTED]> writes: > > Grapevine says that an architect/bigot at a java/spring shop sent > > out an April Fools email saying they had decided to port everything > > to Django AS

Re: class / module introspection?

2008-04-02 Thread [EMAIL PROTECTED]
On 2 avr, 18:03, Brian Munroe <[EMAIL PROTECTED]> wrote: > I'm struggling with an architectural problem and could use some > advice. > > I'm writing an application that will gather statuses from disparate > systems. Because new systems show up all the time,

Re: Prototype OO

2008-04-02 Thread [EMAIL PROTECTED]
On 2 avr, 16:52, sam <[EMAIL PROTECTED]> wrote: > Bruno Desthuilliers napisał(a): > > > Don't misunderstand me : I'm not saying that class-based is better (or > > worse) than prototype, I'm not saying that Python is perfect, I'm not > > saying tha

Re: class / module introspection?

2008-04-02 Thread [EMAIL PROTECTED]
On 2 avr, 21:07, Brian Munroe <[EMAIL PROTECTED]> wrote: > On Apr 2, 11:04 am, "[EMAIL PROTECTED]" > > <[EMAIL PROTECTED]> wrote: > > > More seriously: the answer is in the > > doc.http://www.python.org/doc/2.3.5/lib/built-in-funcs.html > > >

Re: function call - default value & collecting arguments

2008-04-02 Thread [EMAIL PROTECTED]
On 2 avr, 21:03, "Primoz Skale" <[EMAIL PROTECTED]> wrote: > Hello! > > I am fairly new to Python, so I apologise if this is a 'newbie' question. > > First define a simple function: > > def f(a=0): > print a > > >> f(1) > 1 >

Re: Prototype OO

2008-04-02 Thread [EMAIL PROTECTED]
On 2 avr, 20:46, Paul Rubin <http://[EMAIL PROTECTED]> wrote: > "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > > Here the problem is more philosophical than anything else. Python's > > philosophy is that most programmers are responsible and normally

Re: Prototype OO

2008-04-02 Thread [EMAIL PROTECTED]
On 2 avr, 22:23, Paul Rubin <http://[EMAIL PROTECTED]> wrote: > "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > > Fine. But totally irrelevant here - this is comp.lang.python, not > > comp.lang.c, and we *do not* (I repeat : we *do not*) face the same >

Re: class / module introspection?

2008-04-02 Thread [EMAIL PROTECTED]
On 2 avr, 22:04, Brian Munroe <[EMAIL PROTECTED]> wrote: > On Apr 2, 12:33 pm, "[EMAIL PROTECTED]" > > <[EMAIL PROTECTED]> wrote: > > > Why not do the import here, so you store a real module instead of a > > name ? > > Right now I'm st

Re: function call - default value & collecting arguments

2008-04-02 Thread [EMAIL PROTECTED]
On 2 avr, 22:32, "Primoz Skale" <[EMAIL PROTECTED]> wrote: > >> I also understand (fairly) how to collect arguments. For example, let's > >> define another function: > > >> def f(*a): > >>print a > > > This means that f

Re: Nested try...except

2008-04-02 Thread [EMAIL PROTECTED]
On 2 avr, 15:22, [EMAIL PROTECTED] wrote: > On 2 Apr, 15:15, [EMAIL PROTECTED] wrote: > > > > > On 2 Apr, 15:12, [EMAIL PROTECTED] wrote: > > > > On Apr 2, 3:06 pm, [EMAIL PROTECTED] wrote: > > > > > Hi, > > > > > I found the following

Re: Nested try...except

2008-04-02 Thread [EMAIL PROTECTED]
On 2 avr, 15:12, [EMAIL PROTECTED] wrote: > On Apr 2, 3:06 pm, [EMAIL PROTECTED] wrote: > > > > > Hi, > > > I found the following code on the net - > > > http://mail-archives.apache.org/mod_mbox/httpd-python-cvs/200509.mbox/[EMAIL > > PROTECTED]

Re: Nested try...except

2008-04-02 Thread [EMAIL PROTECTED]
On 2 avr, 18:25, Nanjundi <[EMAIL PROTECTED]> wrote: > On Apr 2, 9:22 am, [EMAIL PROTECTED] wrote: > > > > > On 2 Apr, 15:15, [EMAIL PROTECTED] wrote: > > > > On 2 Apr, 15:12, [EMAIL PROTECTED] wrote: > > > > > On Apr 2, 3:06 pm, [EMAIL PROTEC

Re: Efficient way of testing for substring being one of a set?

2008-04-03 Thread [EMAIL PROTECTED]
On Apr 3, 1:37 pm, [EMAIL PROTECTED] wrote: > What's the neatest and/or most efficient way of testing if one of a > set of strings (contained in a dictionary, list or similar) is a > sub-string of a given string? > [...] You could use the Aho-Corasick algorithm <http://en.wik

Bug in shlex??

2008-04-03 Thread [EMAIL PROTECTED]
I'm trying to use shlex.split to simulate what would happen in the shell. The docs say that it should be as close as possible to the posix shell parsing rules. If you type the following into a posix compliant shell echo '\?foo' you get back: \?foo (I've tested this in dash, bash and zsh---all

Re: Bug in shlex??

2008-04-03 Thread [EMAIL PROTECTED]
Gabriel... I feel foolish...(and wish I had the two hours back I spent on this). :) Thank you so much! > The result is a list containing a single string. The string contains 5 > characters: a single backslash, a question mark, three letters. The > backslash is the escape character, as in '\n'

Re: Any fancy grep utility replacements out there?

2008-04-03 Thread [EMAIL PROTECTED]
page, not just being buried in an svn repository. I spent a lot of time looking for a tool like this that was written in python. I imagine others have as well, and have simply given up. On Mar 18, 7:16 pm, Robert Kern <[EMAIL PROTECTED]> wrote: > I have agrep-like utility I call &quo

Re: In Tkinter - having an input and an entry

2008-04-05 Thread [EMAIL PROTECTED]
Traceback (most recent call last): File "F:\Programming\python and database\access_db8.2.py", line 129, in ? Tkwindow() File "F:\Programming\python and database\access_db8.2.py", line 88, in Tkwindow title = stringVar() NameError: global name 'stringVar' is not defined Here is the TKw

Re: In Tkinter - having an input and an entry

2008-04-05 Thread [EMAIL PROTECTED]
On Apr 5, 12:55 pm, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > Traceback (most recent call last): > > File "F:\Programming\python and database\access_db8.2.py", line 129, > > in ? > > Tkwindow() > > File &q

Implementation of Crockford's Base32 Encoding?

2008-04-06 Thread [EMAIL PROTECTED]
Anyone know of a Python implementation of this: http://www.crockford.com/wrmg/base32.html Google shows a Perl library. I'm sure someone must have a Python library somewhere? :) Thanks [And yes...I know it won't be that hard to do... I will do it if it doesn't already exist, but I'd much rath

Re: Presumably an import is no faster or slower than opening a file?

2008-04-06 Thread [EMAIL PROTECTED]
On 6 avr, 15:41, [EMAIL PROTECTED] wrote: > I'm trying to minimise the overheads of a small Python utility, I'm > not really too fussed about how fast it is but I would like to > minimise its loading effect on the system as it could be called lots > of times (and, no, I don&#

Re: Implementation of Crockford's Base32 Encoding?

2008-04-06 Thread [EMAIL PROTECTED]
is different. :) On Apr 6, 7:15 am, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Sun, 06 Apr 2008 06:07:18 -0300, Petite Abeille > <[EMAIL PROTECTED]> escribió: > > > On Apr 6, 2008, at 9:20 AM, [EMAIL PROTECTED] wrote: > > >> Anyone know

Re: Implementation of Crockford's Base32 Encoding?

2008-04-06 Thread [EMAIL PROTECTED]
Sorry to reply to myself. By reading the whole document I see he does give a few different ways one can hadle the lack of padding (including adding it back in.) Both the specs. seem to fudge a bit on this...I'll have to think more about it. On Apr 6, 5:40 pm, "[EMAIL PROTECTED

Re: while-loops enter the last time after condition is filled?

2008-04-07 Thread [EMAIL PROTECTED]
On 6 avr, 01:53, [EMAIL PROTECTED] wrote: > it seems to me from my results that when i use a while-loop it will > execute once after the condition is met. > > ie the conditions is met the code executes one time more and then > quits. The problem is obviously in your code, but sinc

Re: First Python project - comments welcome!

2008-04-07 Thread [EMAIL PROTECTED]
On 7 avr, 10:03, Paul Scott <[EMAIL PROTECTED]> wrote: > I have started, and made some progress (OK it works, but needs some > love) on my first real Python application. > > http://cvs2.uwc.ac.za/trac/python_tools/browser/podder > > I would love some feedback on what I have

Re: Learning curve for new database program with Python?

2008-04-07 Thread [EMAIL PROTECTED]
On 7 avr, 07:34, CM <[EMAIL PROTECTED]> wrote: > On Apr 5, 11:50 am, Jetus <[EMAIL PROTECTED]> wrote: > > > I have a need for a database program. I downloaded the db2 from ibm, > > and reviewed some of the documentation. > > > My question is, what is the ea

Re: Learning curve for new database program with Python?

2008-04-07 Thread [EMAIL PROTECTED]
On 5 avr, 17:50, Jetus <[EMAIL PROTECTED]> wrote: > I have a need for a database program. I downloaded the db2 from ibm, > and reviewed some of the documentation. > > My question is, what is the easiest program for me to try to learn. I > will be creating a database of abo

Re: Is there an official way to add methods to an instance?

2008-04-08 Thread [EMAIL PROTECTED]
On 8 avr, 11:39, méchoui <[EMAIL PROTECTED]> wrote: > On Apr 4, 5:25 pm, John Nagle <[EMAIL PROTECTED]> wrote: > > > > > Bruno Desthuilliers wrote: > > > Paul Rubin a écrit : > > >> Brian Vanderburg II <[EMAIL PROTECTED]> writes: > >

Re: Is the Python for statement the same as for each in other languages?

2008-04-08 Thread [EMAIL PROTECTED]
On 8 avr, 19:55, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > jmDesktop schrieb: > > > Thank you. It looks like it is, but I wanted to make sure I > > understood. Also, I didn't see a "regular" for loop construct either > > (i=0;i<=10;

Re: Basic optimization of python.

2008-04-09 Thread [EMAIL PROTECTED]
On Apr 7, 7:30 am, "甜瓜" <[EMAIL PROTECTED]> wrote: > Howdy, > I wonder whether python compiler does basic optimizations to .py. > Eg: > t = self.a.b > t.c = ... > t.d = ... > .vs. > self.a.b.c = ... > self.a.b.d = ... > which one is more effecti

Re: tkinter, overwrite Label-text?

2008-04-10 Thread [EMAIL PROTECTED]
On Apr 10, 2:35 pm, [EMAIL PROTECTED] wrote: > using python And tkinter. > > i have a GUI that outputs a text among other things. after input form > user i want this text to be *)cleared and/or > *)overwritten. > > what is the best way to achieve that? > [...] Which

Re: tkinter, overwrite Label-text?

2008-04-10 Thread [EMAIL PROTECTED]
On Apr 10, 3:47 pm, [EMAIL PROTECTED] wrote: > [...] > i use the Label-widget. Then you should be able to connect a variable to your widget like I wrote in my previous post. Just try out the example from the Python documentation. Of course in your case entrythingy would be the Label-widget

Re: tkinter, overwrite Label-text?

2008-04-10 Thread [EMAIL PROTECTED]
On Apr 10, 4:37 pm, [EMAIL PROTECTED] wrote: > [...] > i know how to do this already. the problem is i want the text to stay > in the windowa nd not start overwriting "Answer:". > i have solved this by using an Entry for the answer as well but id > prefer using a Label.

get array element

2008-04-10 Thread [EMAIL PROTECTED]
I have an array, and I would like to get the indice value. a = array([13,14,15,16]) I would like something like a.getindice(15) If I want 15 it would return 2 -- http://mail.python.org/mailman/listinfo/python-list

from __future__ import print

2008-04-10 Thread [EMAIL PROTECTED]
Am I the only one that thinks this would be useful? :) I'd really like to be able to use python 3.0's print statement in 2.x. Is this at least being considered as an option for 2.6? It seems like it would be helpful with transitioning. -- http://mail.python.org/mailman/listinfo/python-list

Re: from __future__ import print

2008-04-12 Thread [EMAIL PROTECTED]
On Apr 10, 3:06 pm, "Andrii V. Mishkovskyi" <[EMAIL PROTECTED]> wrote: > 2008/4/10, [EMAIL PROTECTED] <[EMAIL PROTECTED]>: > > > Am I the only one that thinks this would be useful? :) > > > I'd really like to be able to use python 3.0'

Re: Where is the function of 'apply' always used?

2008-04-13 Thread [EMAIL PROTECTED]
楼主,为何不用中英又语呢?这里也有其它中国人的. -- http://mail.python.org/mailman/listinfo/python-list

有中国人乎?

2008-04-13 Thread [EMAIL PROTECTED]
Python这种语言有前途吗?在下想学他一学. -- http://mail.python.org/mailman/listinfo/python-list

Py2exe Json

2008-04-14 Thread [EMAIL PROTECTED]
I want to use json with py2exe but when I execute the program I have this errors : "Runtime Error : maximun recursion depth exceeded" Here is my code : import json jsonstr='{"toto":"toto"}' print json.read(jsonstr) and my setup #!/usr/bin/env python # -*- coding: latin-1 -*- import sys, os,

Re: Rounding a number to nearest even

2008-04-14 Thread [EMAIL PROTECTED]
On Apr 11, 4:14 am, bdsatish <[EMAIL PROTECTED]> wrote: > I'm interested in rounding numbers of the form "x.5" depending upon > whether x is odd or even. Any idea about how to implement it ? Side note: A specialized use for this is in the US Field Artillery, w

python memory leak only in x86 64 linux

2008-04-15 Thread [EMAIL PROTECTED]
the memory usage of a python app keeps growing in a x86 64 linux continuously, whereas in 32 bit linux this is not the case. Python version in both 32 bit and 64 bit linux - 2.6.24.4-64.fc8 Python 2.5.1 (r251:54863, Oct 30 2007, 13:45:26) i isolated the memory leak problem to a function that uses

Re: python memory leak only in x86 64 linux

2008-04-16 Thread [EMAIL PROTECTED]
This is the code that is causing memory leak in 64 bit python [but not in 32 bit python].. is something wrong in the code? now = datetime.datetime.now() oneday = datetime.timedelta(days=1) def birthdaycompare(a, b): if a is None and b: return 1 if a and b is None: return -1

Re: py3k s***s

2008-04-16 Thread [EMAIL PROTECTED]
On Apr 16, 2:52 pm, Aaron Watters <[EMAIL PROTECTED]> wrote: > I disagree. You can add lots of cool > stuff without breaking the existing code base, mostly. > For example the minor changes to the way ints will work will > effect almost no programs. Wow, I'd venture th

Newbie question about for...in range() structure

2008-04-17 Thread [EMAIL PROTECTED]
Hi there, I'm new to Python and I've been writing a rudimentary exercise in Deitel's Python: How to Program, and I found that this code exhibits a weird behavior. When I run the script, the for...range(1,11) structure always starts with zero--and I've tried plugging other values as well! >From the

Re: Metaprogramming Example

2008-04-17 Thread [EMAIL PROTECTED]
On 17 avr, 04:27, andrew cooke <[EMAIL PROTECTED]> wrote: > Hi, > > Thanks for the help a couple of days ago. I completed what I was > doing and wrote a summary which I've posted > athttp://acooke.org/cute/PythonMeta0.html > (it's kind of long to post he

Re: Metaprogramming Example

2008-04-17 Thread [EMAIL PROTECTED]
On 17 avr, 14:25, andrew cooke <[EMAIL PROTECTED]> wrote: > On Apr 17, 7:12 am, "[EMAIL PROTECTED]"<[EMAIL PROTECTED]> wrote: > > [...] > > Thanks very much! > > These are useful pointers. I'll update my code accordingly. > > At one point you

Re: why function got dictionary

2008-04-17 Thread [EMAIL PROTECTED]
On 17 avr, 16:06, AlFire <[EMAIL PROTECTED]> wrote: > Hi, > > I am seeking an explanation for following: > > Python 2.5.2 (r252:60911, Apr 8 2008, 21:49:41) > [GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2 > Type "help", "copyright", "cred

Re: Newbie question about for...in range() structure

2008-04-17 Thread [EMAIL PROTECTED]
> My guess is that you want to initialize total to 1, not 0. > D'oh! Yes, you are right, thank you. -- http://mail.python.org/mailman/listinfo/python-list

Re: noobie question about mailman

2008-04-17 Thread [EMAIL PROTECTED]
On 17 avr, 20:04, lg <[EMAIL PROTECTED]> wrote: > Hello, > > I'm pretty new to usenet and totally new to python, so.. hopefully i > won't offend anyone with my naivete. I work at a non-profit > organization where we use mailman for our email lists, and i'v

get quote enclosed field in a line

2008-04-17 Thread [EMAIL PROTECTED]
tp://xahlee.org/Periodic_dosage_dir/lacru/manara2.html"; "Mozilla/ 5.0 (Windows; U; Windows NT 5.1; es-ES; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13" "-" I want the part: "Mozilla/5.0 (Windows; U; Windows NT 5.1; es-ES; rv: 1.8.1.13) Gecko/20080311 Firefox/2.0.0.13". Than

Re: Python for Series 40 Nokia?

2008-04-17 Thread [EMAIL PROTECTED]
On Apr 18, 8:46 am, "Dotan Cohen" <[EMAIL PROTECTED]> wrote: > I had once heard something about python running on a Series 40 Nokia, > but I am unable to google anything concrete. Might it have been > Jython? Is there a known implementation of Python for the series 40 &g

Re: I just killed GIL!!!

2008-04-18 Thread [EMAIL PROTECTED]
On Apr 17, 10:30 am, sturlamolden <[EMAIL PROTECTED]> wrote: > On 17 Apr, 15:21, "Martin P. Hellwig" <[EMAIL PROTECTED]> wrote: > > > If not, what is the advantage above already present solutions? > > Well... I like the processing module. Except that Wint

Re: Metaprogramming Example

2008-04-19 Thread [EMAIL PROTECTED]
On 19 avr, 16:34, andrew cooke <[EMAIL PROTECTED]> wrote: > On Apr 18, 4:48 am, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > > [...] > > > Practically, this means that (amongst other niceties) : > > - you can define functions outside classes and use t

Re: why function got dictionary

2008-04-19 Thread [EMAIL PROTECTED]
On 19 avr, 19:39, sturlamolden <[EMAIL PROTECTED]> wrote: > On Apr 17, 4:06 pm, AlFire <[EMAIL PROTECTED]> wrote: > > > Q: why function got dictionary? What it is used for? > > As previously mentioned, a function has a __dict__ like (most) other > objects. > &g

Re: I just killed GIL!!!

2008-04-19 Thread [EMAIL PROTECTED]
On Apr 18, 9:29 pm, sturlamolden <[EMAIL PROTECTED]> wrote: > On 18 Apr, 21:28, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > > > Passing a NULL SectionHandle to NTCreateProcess/CreateProcessEx > > results in a fork-style copy-on-write duplicate

Re: Alternate indent proposal for python 3000

2008-04-20 Thread [EMAIL PROTECTED]
On 20 avr, 17:35, Eric Wertman <[EMAIL PROTECTED]> wrote: > I was considering putting together a proposal for an alternate block > syntax for python, and I figured I'd post it here and see what the > general reactions are. I did some searching, and while I found a lot > of

dynamically importing a module and function

2008-04-21 Thread [EMAIL PROTECTED]
Hi I have a function data['function'], that I need to import from a file data['module'], in the directory data['cwd'] If I do this from python interactive shell (linux fedora core 8) from dir /home/mark it works fine: cwd = data['cwd'] os.chdir(cwd) print os.ge

Re: dynamically importing a module and function

2008-04-21 Thread [EMAIL PROTECTED]
quot;, line 5, in > import abcde > ImportError: No module named abcde On Mon, Apr 21, 2008 at 2:46 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Hi > I have a function data['function'], that I need to import from a file > data['module'], in t

Problems replacing \ with \\

2008-04-21 Thread [EMAIL PROTECTED]
Hi... Here's a weird problem...I'm trying to escape a bunch of data to put into a database. Here's what I have: def escape(string): """ Escape both single quotes and blackslashes >>> x = r"fun\fun" >>> escape(x) 'funfun' """ string = string.replace('\\', '')

Re: dynamically importing a module and function

2008-04-21 Thread [EMAIL PROTECTED]
On Mon, Apr 21, 2008 at 3:39 PM, John Machin <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > data['module'], in the directory data['cwd'] > OT: Any good reason for using a dictionary instead of a class instance > (data.functiom, data.module, et

Re: Problems replacing \ with \\

2008-04-21 Thread [EMAIL PROTECTED]
HTH -- Thank you for the response. I'm not sure I understand the last sentence, although I think I get the idea. How do I create a proper doctest? Thanks On Apr 21, 9:08 pm, MRAB <[EMAIL PROTECTED]> wrote: > On Apr 21, 11:48 pm, "[EMAIL PROTECTED]" <[EMAIL PROTEC

SWIG C++ std::cout do not output to interactive interpreter IDLE

2008-04-22 Thread [EMAIL PROTECTED]
Dear All, I have some functions written in C++, which I try to approach from python using swig. In the C++ functions I use std::cout to print stuff to output. Everything works fine, but the only problem that I have is that when I start IDLE and use the functions what std::cout should print to the

<    41   42   43   44   45   46   47   48   49   50   >