Re: Distributing closed source modules

2005-03-29 Thread Fuzzyman
Dave Brueck wrote: > Fuzzyman wrote: > > Dave Brueck wrote: > > It's certainly something lot's of people are interested in. I guess it > > depends who your audience is. If ytour code isn't for *mass* > > distribution - the chances of people putting a lot of effort into > > breaking it are greatly

Re: Grouping code by indentation - feature or ******?

2005-03-29 Thread Antoon Pardon
Op 2005-03-25, Terry Reedy schreef <[EMAIL PROTECTED]>: > > "Antoon Pardon" <[EMAIL PROTECTED]> wrote in message > >> 1) It makes it hard to see how many levels are dedented at the end of >> a suite, and sometime makes it difficult to see where the end >> of a suite is. If e.g. you are looking

Re: convert user input to Decimal objects using eval()?

2005-03-29 Thread Raymond Hettinger
[Julian Hernandez Gomez] > This is maybe a silly question, but... > > is there a "easy way" to make eval() convert all floating > numbers to Decimal objects and return a Decimal? from decimal import Decimal import re number = re.compile(r"((\b|(?=\W))(\d+(\.\d*)?|\.\d+)([eE][+-]?\d{1,3})?)") deci

Re: Looking for Stephen Turner, maintainer of informixdb

2005-03-29 Thread Michael Husmann
Carsten Haese wrote: > Hello everybody: > > I have discovered that the functionality for connecting Python to an > Informix database is currently in a frustrating state of neglect. The > link to Kinfxdb is dead, and informixdb doesn't build on Python 2. I > couldn't find any usable workarounds to

Re: Python for a 10-14 years old?

2005-03-29 Thread Duncan Booth
Joal Heagney wrote: > Nice. I still have to download a version of pygame to try this out, but > the fact that you can't hide the turtle in python.turtle was bugging me > out with my version. (A fair bit of copy/paste in gimp, I can tell you!) What was wrong with hiding the turtle? 'turtle.trace

Re: Calling __init__ with multiple inheritance

2005-03-29 Thread Peter Otten
Axel Straschil wrote: > Thanks to all for the very interesting postings! You're welcome. > I came to the following: > > For single inheritance, super is a nice tool if you will recfactoring > the class later. Or if you start out with a diamond inheritance graph from the beginning. > For mul

Re: How to ensure Maximize button shows in Linux/Unix (Tkinter)

2005-03-29 Thread Eric Brunel
On 26 Mar 2005 08:19:07 -0800, Harlin Seritt <[EMAIL PROTECTED]> wrote: Diez, Thanks for the quick reply. I am running this under KDE. I actually haven't tried doing so under any other wm for the moment. Any ideas how to get it to show in KDE? This is a tk bug; see: http://sourceforge.net/tracker/i

Re: Save passwords in scripts

2005-03-29 Thread Serge Orlov
Florian Lindner wrote: > Serge Orlov wrote: > >> Florian Lindner wrote: >>> Paul Rubin wrote: >>> - sort of similar: have a separate process running that knows the password (administrator enters it at startup time). That process listens on a unix socket and checks the ID of the clie

Re: itertools to iter transition (WAS: Pre-PEP: Dictionary accumulator methods)

2005-03-29 Thread Raymond Hettinger
[Jack Diederich] > > itertools to iter transition, huh? I slipped that one in, I mentioned > > it to Raymond at PyCon and he didn't flinch. It would be nice not to > > have to sprinkle 'import itertools as it' in code. iter could also > > become a type wrapper instead of a function, so an it

Re: a program to delete duplicate files

2005-03-29 Thread alanwo
Why not try to use NoClone, it finds and deletes duplicate files by true byte-by-byte comparison. Smart marker filters duplicate files to delete. With GUI. http://noclone.net Xah Lee wrote: > here's a large exercise that uses what we built before. > > suppose you have tens of thousands of files i

Re: "static" variables in functions (was: Version Number Comparison Function)

2005-03-29 Thread Bengt Richter
On 29 Mar 2005 00:29:06 -0800, "El Pitonero" <[EMAIL PROTECTED]> wrote: >Christos TZOTZIOY Georgiou wrote: >> >> One of the previous related threads is this (long URL): >> >http://groups-beta.google.com/group/comp.lang.python/messages/f7dea61a92f5e792,5ce65b041ee6e45a,dbf695317a6faa26,192847697227

Re: "static" variables in functions (was: Version Number Comparison Function)

2005-03-29 Thread El Pitonero
Christos TZOTZIOY Georgiou wrote: > > One of the previous related threads is this (long URL): > http://groups-beta.google.com/group/comp.lang.python/messages/f7dea61a92f5e792,5ce65b041ee6e45a,dbf695317a6faa26,19284769722775d2,7599103bb19c7332,abc53bd83cf8f636,4e87b44745a69832,330c5eb638963459,e4c8d

Re: author index for Python Cookbook 2?

2005-03-29 Thread Fuzzyman
Andrew Dalke wrote: > Is there an author index for the new version of the > Python cookbook? As a contributor I got my comp version > delivered today and my ego wanted some gratification. > I couldn't find my entries. > > Andrew > [EMAIL

Re: author index for Python Cookbook 2?

2005-03-29 Thread Premshree Pillai
There's an index here: http://harvestman.freezope.org/cookbook/creds.html But dunno if all the recipes were finally included. Maybe somebody (Alex?) can confirm? On 29 Mar 2005 01:20:46 -0800, Fuzzyman <[EMAIL PROTECTED]> wrote: > > Andrew Dalke wrote: > > Is there an author index for the new v

Re: Calling __init__ with multiple inheritance

2005-03-29 Thread jfj
Peter Otten wrote: Child() child father mother parent # <-- parent only once <__main__.Child object at 0x402ad38c> D-uh? class Parent(object): def __init__(self): print "parent" super(Parent, self).__init__() class Father

Re: help with getting selection from wxChoice with out after it has changed

2005-03-29 Thread Gerrit Holl
'@'.join([..join(['fred', 'dixon']), ..join(['gmail', 'com'])]) wrote: > From: "'@'.join([..join(['fred', 'dixon']), ..join(['gmail', 'com'])])" > <[EMAIL PROTECTED]> This is a SyntaxError. You want to enclose the dots with '' marks as well, like this: '@'.join(['.'.join(['fred', 'dixon']), '.'.

Re: itertools to iter transition (WAS: Pre-PEP: Dictionary accumulator methods)

2005-03-29 Thread Ville Vainio
> "Raymond" == Raymond Hettinger <[EMAIL PROTECTED]> writes: Raymond> If the experience works out, then all you're left with is Raymond> the trivial matter of convincing Guido that function Raymond> attributes are a sure cure for the burden of typing Raymond> import statements.

Re: Connecting to a SQL Server

2005-03-29 Thread ttmi
Ok. Understood we can interface ADO from python and connect to MS SQL. But still not so clear where SSH comes in? Can elaborate more? Thanks. -- http://mail.python.org/mailman/listinfo/python-list

distance, angle restraint

2005-03-29 Thread HYUN-CHUL KIM
Hi, all I put more than 10,000 points in a box and then want to get one of many solutions that matches all angle restraints among any 3 points and all distance restraints between any 2 points.   How can I achieve this? Please recommend any packages or appropriate methods. Thanks

Re: help with getting selection from wxChoice with out after it has changed

2005-03-29 Thread Peter Otten
[..join(['fred','dixon'] wrote: > I want to get the selection of several wxChoice boxes. > But i do not want to have to catch the events for all the boxes > I should be able to access the current selection outside of an > event,but i am not seeing how to do this. > #def EvtChoice(self, event)

passing keyword args as a parameter

2005-03-29 Thread max(01)*
hi there! this post is somewhat a generalization of one previous question. i was wondering if it is possible to pass an argument list as a parameter to a function. example: def fun_con_pc(pc1 = "Ciao!", pc2 = 42): print pc1 print pc2 fun_con_pc() fun_con_pc(pc1 = "Addio...") fun_con_pc(pc2 = 66

tkinter destroy()

2005-03-29 Thread max(01)*
hi people. when i create a widget, such as a toplevel window, and then i destroy it, how can i test that it has been destroyed? the problem is that even after it has been destroyed, the instance still exists and has a tkinter name, so testing for None is not feasible: >>> import Tkinter >>> fin

Re: Queue.Queue-like class without the busy-wait

2005-03-29 Thread Antoon Pardon
Op 2005-03-25, Paul Rubin schreef : > Antoon Pardon <[EMAIL PROTECTED]> writes: >> Well maybe you could use an os.pipe as a timeout lock then. When the lock is >> instantiated you put one byte in it. Aquiring the lock is implemented by >> reading one byte, releasing the lock is implemented by writi

tksnack and socket to real time sampling and playing sound

2005-03-29 Thread didifouke
Hi, I try to sample and playback speech using snack. My idea is to have a socket based server that plays back the sound and a client that samples the input from the sound card and sends it to the server using the socket connection. On the snack page there is a tutorial showing a socket server imp

Re: Why tuple with one item is no tuple

2005-03-29 Thread Antoon Pardon
Op 2005-03-27, Joal Heagney schreef <[EMAIL PROTECTED]>: > Antoon Pardon wrote: > >> So python choose a non-deterministic direction. To me (2,3) + (4,5) >> equals (6,8). I don't dispute that having an operator to combine >> (2,3) and (4,5) in (2,3,4,5) is usefull, but they should never have >> used

Re: Queue.Queue-like class without the busy-wait

2005-03-29 Thread Paul Rubin
Antoon Pardon <[EMAIL PROTECTED]> writes: > Well have a look at what I have written over the weekend. It uses > a seperate thread with one pipe for a wakeup mechanisme. Thanks, I'll look at it. Why don't you use usleep instead of a pipe? I decided over the weekend that using a separate thread wit

Re: Little Q: how to print a variable's name, not its value?

2005-03-29 Thread TZOTZIOY
On 28 Mar 2005 22:06:44 -0800, rumours say that "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> might have written: Read about locals() and globals() in the Python documentation. These provide the information you request (ie what names are bound to what objects). -- TZOTZIOY, I speak England very best

Re: Queue.Queue-like class without the busy-wait

2005-03-29 Thread Antoon Pardon
Op 2005-03-29, Paul Rubin schreef : > Antoon Pardon <[EMAIL PROTECTED]> writes: >> Well have a look at what I have written over the weekend. It uses >> a seperate thread with one pipe for a wakeup mechanisme. > > Thanks, I'll look at it. Why don't you use usleep instead of a pipe? Because with th

Actor pattern in GUI

2005-03-29 Thread M Ali
Hi, I am trying to grok using actor patterns in a gui as explained here by Andrew Eland: http://www.andreweland.org/code/gui-actor.html The short article explains it using java with which i am not used to at all. But he does provide a python example using pygtk: http://www.andreweland.org/code/g

Re: Calling __init__ with multiple inheritance

2005-03-29 Thread Axel Straschil
Hello! >> Also, lool at that: >> class Mother(object): >> def __init__(self, param_mother='optional', **eat): >> print 'Mother' >> class Father(object): >> def __init__(self, param_father='optional', **eat): >> print 'Father' >> class Child(Mother, Father): >> def __init__(self, **ham): >> super(C

Re: Queue.Queue-like class without the busy-wait

2005-03-29 Thread Antoon Pardon
Op 2005-03-29, Antoon Pardon schreef <[EMAIL PROTECTED]>: > Op 2005-03-29, Paul Rubin schreef : >> Antoon Pardon <[EMAIL PROTECTED]> writes: >>> Well have a look at what I have written over the weekend. It uses >>> a seperate thread with one pipe for a wakeup mechanisme. >> >> Thanks, I'll look at

Re: Queue.Queue-like class without the busy-wait

2005-03-29 Thread Paul Rubin
Antoon Pardon <[EMAIL PROTECTED]> writes: > I'm not going to call my solution simple, but it wastes very few > cycles. if no thread is blocked on a lock, the select will just > block until that changes. No need for some kind of polling loop. I think I understand. My original idea was to use a hea

Re: tkinter destroy()

2005-03-29 Thread Eric Brunel
On Tue, 29 Mar 2005 10:37:10 GMT, max(01)* <[EMAIL PROTECTED]> wrote: hi people. when i create a widget, such as a toplevel window, and then i destroy it, how can i test that it has been destroyed? the problem is that even after it has been destroyed, the instance still exists and has a tkinter nam

Re: Dumb*ss newbie Q

2005-03-29 Thread Captain Dondo
On Mon, 28 Mar 2005 08:42:22 -0600, Larry Bates wrote: > Others have answered your specific question, I thought I > would add some suggestions (not tested): > > 1) You don't need a separate set_title method. You can > change the title attribute at any time by just saying > m.title="new title".

MAC changing

2005-03-29 Thread ias0nas
Hello, Is it possible to change the MAC address of a packet after I have builded it? I used impacket to build a packet that does not provide the function to change the MAC. Is it possible to set the bytes of the packet where the MAC is stored? I don't want to use system calls to bring the card dow

Re: Queue.Queue-like class without the busy-wait

2005-03-29 Thread Antoon Pardon
Op 2005-03-29, Paul Rubin schreef : > Antoon Pardon <[EMAIL PROTECTED]> writes: >> I'm not going to call my solution simple, but it wastes very few >> cycles. if no thread is blocked on a lock, the select will just >> block until that changes. No need for some kind of polling loop. > > I think I un

Secure scripts variables

2005-03-29 Thread Florian Lindner
Hello, given the following situation: I have a script which is readable and executable by a user, but not writable. The users executes the scripts, it reads in a value and based on this value it computes a result and stores it in a variable. Can the user read out the value of this variable? If yes

Finding attributes in a list

2005-03-29 Thread Ben
Hi In a list I have a number of soccer players. Each player has a different rating for attacking, defending, midfield fitness and goalkeeping. I have devised a while loop that goes through this list to find the best player at defending, attacking, midfield and goalkeeping. However there is more t

Re: [Newbie] How do I get better at Python programming?

2005-03-29 Thread Roy Smith
In article <[EMAIL PROTECTED]>, Paul Rubin wrote: > Anon <[EMAIL PROTECTED]> writes: > > I'd like to get to the next level, but I'm not sure how. Are there > > any suggestions for continuing to learn? How did you guys learn? > > I'd say look at some more general comp

Re: Trouble with RC2

2005-03-29 Thread Anthony Baxter
On Mon, 28 Mar 2005 21:32:07 +0200, Do Re Mi chel La Si Do <[EMAIL PROTECTED]> wrote: > Hi ! > > I have sevral problems with P4-RC2. > > Typical case, I have a script who run OK with P4 "standard" ; but, on a new > install, with P4-RC2, I obtain : > > Traceback (most recent call last): >

Re: Which is easier? Translating from C++ or from Java...

2005-03-29 Thread Roy Smith
[EMAIL PROTECTED] wrote: > There is a difference between theory and practice. You know the difference between theory and practice? Well, in theory, there is no difference :-) -- http://mail.python.org/mailman/listinfo/python-list

BF interpreter in Python

2005-03-29 Thread Will McGugan
Hi, Python is my favorite language, but I rarely get the opertunity to use it at work, so I find myself actively looking for problems to solve with it. Consequently while waiting for C++ build to finish, I wrote a BrainF*** interpreter. If you are not familiar with the BF language see the follo

Re: Grouping code by indentation - feature or ******?

2005-03-29 Thread Roy Smith
Antoon Pardon <[EMAIL PROTECTED]> wrote: > 1) The stuff doesn't has to be spread over multiple pages. One >can have 2 functions, each about three quarter of a page. >The second function will then cross a page boundary. The advice "don't write a function longer than a page" is as good advic

Re: passing keyword args as a parameter

2005-03-29 Thread Fredrik Lundh
"max(01)*" <[EMAIL PROTECTED]> wrote: > see what i mean? not really, but maybe arg = {"pc2": 666, "pc1": "Addio..."} fun_con_pc(**arg) is what you want? -- http://mail.python.org/mailman/listinfo/python-list

Re: Why tuple with one item is no tuple

2005-03-29 Thread Ville Vainio
> "Antoon" == Antoon Pardon <[EMAIL PROTECTED]> writes: Antoon> Op 2005-03-27, Joal Heagney schreef <[EMAIL PROTECTED]>: >> Antoon Pardon wrote: >> >>> So python choose a non-deterministic direction. To me (2,3) + (4,5) >>> equals (6,8). I don't dispute that having an oper

Re: Max files in unix folder from PIL process

2005-03-29 Thread Ivan Van Laningham
Hi All-- Rowdy wrote: > > FreeDB (CD database) stores one file per CD in one directory per > category. The "misc" category/directory on my FreeBSD 5.3 system > currently contains around 481,571 small files. The "rock" > directory/category contains 449,208 files. > > As some have said, ls is *v

good design & method calls

2005-03-29 Thread Charles Hartman
I know the answer to this is going to be "It depends . . .", but I want to get my mind right. In Fowler's *Refactoring* I read: "Older languages carried an overhead in subroutine calls, which deterred people from small methods" (followed by the basic "Extract Method" advice). In Skip Montanaro'

Re: convert user input to Decimal objects using eval()?

2005-03-29 Thread Julian Hernandez Gomez
On Tuesday 29 March 2005 03:04, Raymond Hettinger wrote: > from decimal import Decimal > import re > > number = re.compile(r"((\b|(?=\W))(\d+(\.\d*)?|\.\d+)([eE][+-]?\d{1,3})?)") > deciexpr = lambda s: number.sub(r"Decimal('\1')", s) > > for s in ('1.0001+0.111', >    '+21.3e-5*85-.1234/81.

Re: Why tuple with one item is no tuple

2005-03-29 Thread Ville Vainio
> "Ville" == Ville Vainio <[EMAIL PROTECTED]> writes: Ville> To me, nothing is more natural than "ab" + "cd" == Ville> "abcd". Also [1,2] + [3,4] == [1,2,3,4]. "Dot product" is Ville> not really too useful in real world (non-mathematical) Ville> apps. ... and of course by "dot

Optimisation Hints (dict processing and strings)

2005-03-29 Thread OPQ
Hi all, I'd happy to have you share some thougts about ultimate optimisations on those 2 topics: (1)- adding one caractere at the end of a string (may be long) (2)- in a dict mapping a key to a list of int, remove every entrie where the list of int have of length < 2 So far, my attempts are fo

Re: [Newbie] How do I get better at Python programming?

2005-03-29 Thread Larry Bates
1) If you write for MS Windows Get a copy of Python Programming on Win32. 2) Get a copy of Python Cookbook (2nd Edition just shipped). It has 100's of examples with detailed explanations of what the code does. It starts out with very simple recipes but by the end of the book you are covering ver

Re: Little Q: how to print a variable's name, not its value?

2005-03-29 Thread Ron_Adam
On 28 Mar 2005 23:01:34 -0800, "Dan Bishop" <[EMAIL PROTECTED]> wrote: def print_vars(vars_dict=None): >...if vars_dict is None: >... vars_dict = globals() >...for var, value in vars_dict.items(): >... print '%s = %r' % (var, value) >... myPlace = 'right here' my

Re: Secure scripts variables

2005-03-29 Thread Serge Orlov
Florian Lindner wrote: > Hello, > given the following situation: > > I have a script which is readable and executable by a user, but not > writable. > The users executes the scripts, it reads in a value and based on this > value it computes a result and stores it in a variable. > Can the user read

Re: Optimisation Hints (dict processing and strings)

2005-03-29 Thread Peter Hansen
OPQ wrote: I'd happy to have you share some thougts about ultimate optimisations on those 2 topics: (1)- adding one caractere at the end of a string (may be long) longone=longone + char # where len(char)== 1 I known that string concatenation is time consuming, but a small test on timeit seems to sh

Table of Python Packages, updated

2005-03-29 Thread Seo Sanghyeon
Hello, comp.lang.python, and catalog-sig, Some of you may remember my mail with the very same subject last year. :-) I have continued to maintain the table, and here's the updated result: http://sparcs.kaist.ac.kr/~tinuviel/pypackage/list.cgi 304 Python projects indexed, with links to PyPI, Free

Re: Optimisation Hints (dict processing and strings)

2005-03-29 Thread Daniel Dittmar
OPQ wrote: for (1): longone=longone + char # where len(char)== 1 I known that string concatenation is time consuming, but a small test on timeit seems to show that packing and creating an array for those 2 elements is equally time consuming - use cStringIO instead - or append all chars to a list

Re: good design & method calls

2005-03-29 Thread Peter Hansen
Charles Hartman wrote: I know the answer to this is going to be "It depends . . .", but I want to get my mind right. In Fowler's *Refactoring* I read: "Older languages carried an overhead in subroutine calls, which deterred people from small methods" (followed by the basic "Extract Method" advic

Retrieve Icons Associated To An Extension?

2005-03-29 Thread andrea . gavana
Hello NG, I have searched everyweher, and I am not able to find a solution... basically, I am constructing a GUI with wxPython, in which I have a list. In this list control, I have some file. I would like to associate (to every file) its icon (on Windows). I have searched about the use of Ma

Re: Table of Python Packages, updated

2005-03-29 Thread Skip Montanaro
Seo> Hello, comp.lang.python, and catalog-sig, Some of you may remember Seo> my mail with the very same subject last year. :-) I have continued Seo> to maintain the table, and here's the updated result: Seo> http://sparcs.kaist.ac.kr/~tinuviel/pypackage/list.cgi Very nice. I hav

Re: tkinter destroy()

2005-03-29 Thread max(01)*
Eric Brunel wrote: On Tue, 29 Mar 2005 10:37:10 GMT, max(01)* <[EMAIL PROTECTED]> wrote: hi people. when i create a widget, such as a toplevel window, and then i destroy it, how can i test that it has been destroyed? the problem is that even after it has been destroyed, the instance still exists an

Re: hiding a frame in tkinter

2005-03-29 Thread Fredrik Lundh
"faramarz yari" wrote: > def do_unpack(f): >f.pack_forget() > ... > b=Button(f3,text="hello",command=do_unpack(f3)) > > it does not work & the interpreter does not claim any error. it works perfectly fine, but it doesn't do what you want. do_unpack(f3) is a function call, so you're call

Re: passing keyword args as a parameter

2005-03-29 Thread max(01)*
Fredrik Lundh wrote: "max(01)*" <[EMAIL PROTECTED]> wrote: see what i mean? not really, but maybe arg = {"pc2": 666, "pc1": "Addio..."} fun_con_pc(**arg) is what you want? precisely! thanks a lot! macs -- http://mail.python.org/mailman/listinfo/python-list

Re: Retrieve Icons Associated To An Extension?

2005-03-29 Thread Will McGugan
[EMAIL PROTECTED] wrote: Hello NG, I have searched everyweher, and I am not able to find a solution... basically, I am constructing a GUI with wxPython, in which I have a list. In this list control, I have some file. I would like to associate (to every file) its icon (on Windows). I have sear

serial module NEWBE HELP!

2005-03-29 Thread Ron
Is this built into any of the python versions? Need it! Using 2.3.5 and doesn't seem to have it.Newbe needs help!email[EMAIL PROTECTED] Thanks Ron -- http://mail.python.org/mailman/listinfo/python-list

Re: Which is easier? Translating from C++ or from Java...

2005-03-29 Thread Patrick Useldinger
[EMAIL PROTECTED] wrote: Patrick Useldinger wrote: Depends on what language you know best. But Java is certainly easier to read than C++. There's certainly some irony in those last two sentences. However, I agree with the former. It depends on which you know better, the style of those who develope

Re: Table of Python Packages, updated

2005-03-29 Thread Seo Sanghyeon
http://sparcs.kaist.ac.kr/~tinuviel/pypackage/list.cgi On Tue, Mar 29, 2005 at 09:30:24AM -0600, Skip Montanaro wrote: > Very nice. I have a couple questions. What do the pink/grey cell > backgrounds mean? Pink background is "not packaged", grey background is "in progress". For "in progress"

Re: Table of Python Packages, updated

2005-03-29 Thread Skip Montanaro
>> Would it make sense to add a "distutils" column for those packages >> that can be installed from source using "python setup.py install" or >> do you assume that all the listed packages have that capability? Seo> Are you suggesting linking to the project's homepage, or upstream

Re: Optimisation Hints (dict processing and strings)

2005-03-29 Thread Aaron Bingham
Peter Hansen <[EMAIL PROTECTED]> writes: > You've misunderstood the comments about this area. > String concatenation is *not* "time consuming". > *Repeated* concatenations *will become very time > consuming*, along an exponential curve. That's > what the discussions about O(n^2) are referring > t

Re: Little Q: how to print a variable's name, not its value?

2005-03-29 Thread Bill Mill
On Tue, 29 Mar 2005 14:34:39 GMT, Ron_Adam <[EMAIL PROTECTED]> wrote: > On 28 Mar 2005 23:01:34 -0800, "Dan Bishop" <[EMAIL PROTECTED]> wrote: > > def print_vars(vars_dict=None): > >...if vars_dict is None: > >... vars_dict = globals() > >...for var, value in vars_dict.items():

Re: Numarray newbie question

2005-03-29 Thread ChinStrap
Are there no windows binaries for SciPy for python 2.4 yet? I try to run the installer and it complains that it can't find python 2.3. Besides that, vectorize is exactly what i want. -- http://mail.python.org/mailman/listinfo/python-list

truncating a file from the top down

2005-03-29 Thread rbt
Hi guys, I need to truncate a file from the top down. I imagine doing something like this: if os.stat says the file is too big: read the file trim = only keep the last 2008 bytes (This is where I get stuck) write trim back out to the original file Would someone demonstrate the *best*

Re: Numarray newbie question

2005-03-29 Thread Robert Kern
ChinStrap wrote: Are there no windows binaries for SciPy for python 2.4 yet? I try to run the installer and it complains that it can't find python 2.3. No, not yet. Besides that, vectorize is exactly what i want. -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high A

Re: truncating a file from the top down

2005-03-29 Thread Mike Rovner
rbt wrote: if os.stat says the file is too big: read the file trim = only keep the last 2008 bytes (This is where I get stuck) write trim back out to the original file Would someone demonstrate the *best* most efficient way of doing this? if os.stat says the_file is too big: fh = open

Re: [Catalog-sig] Table of Python Packages, updated

2005-03-29 Thread Ian Bicking
Seo Sanghyeon wrote: Hello, comp.lang.python, and catalog-sig, Some of you may remember my mail with the very same subject last year. :-) I have continued to maintain the table, and here's the updated result: http://sparcs.kaist.ac.kr/~tinuviel/pypackage/list.cgi 304 Python projects indexed, with l

Re: Numarray newbie question

2005-03-29 Thread ChinStrap
Oh well. I am downloading all the things to build it, but in the mean time I just did: def get_y_mat(x_ind,y_ind): return self.y_min + y_ind*self.dy def get_x_mat(x_ind,y_ind): return self.x_min + x_ind*self.dx self.x_mat=fromfunction(get_x_mat,m

Re: Max files in unix folder from PIL process

2005-03-29 Thread Kane
Yes I'm talking Linux not BSD so with any luck you won't have the same 'ls' issue; it is not a crash but painfully slow. The only other issue I recall is wildcards fail if they encompass too many files (presumably a bash/max command line size). I would expect the various GUI file managers may giv

Re: serial module NEWBE HELP!

2005-03-29 Thread Peter Hansen
Ron wrote: Is this built into any of the python versions? Need it! Using 2.3.5 and doesn't seem to have it.Newbe needs help!email[EMAIL PROTECTED] Thanks Ron PySerial has never been built in to any standard v distribution of Python, but it's an easy download and the web page is the first hit

Re: newbie question

2005-03-29 Thread shama . bell
Whats the file that has to be mapped? Can this be a list? Can this list be initialized to 512? Thanks, -SB -- http://mail.python.org/mailman/listinfo/python-list

Python performance tips page moved to wiki

2005-03-29 Thread Skip Montanaro
I dumped my old fastpython.html web page: http://manatee.mojam.com/~skip/python/fastpython.html in favor of a page on the Python wiki: http://www.python.org/moin/PythonSpeed/PerformanceTips Now everybody can help fix warts, add content, etc, etc, etc. References to the old page are red

Re: Finding attributes in a list

2005-03-29 Thread infidel
You can use the new 'sorted' built-in function and custom "compare" functions to return lists of players sorted according to any criteria: >>> players = [ ... {'name' : 'joe', 'defense' : 8, 'attacking' : 5, 'midfield' : 6, 'goalkeeping' : 9}, ... {'name' : 'bob', 'defense' : 5, 'attacking

Re: xml marshal of general (but non Python standard) class

2005-03-29 Thread syd
Thank you Martin. I had not considered pickle, and I've done my research. However, I'm still having problems: Your foo class (for pickle and xml dumps) works fine for me. >>> f=Foo() >>> f.thanksTo='Martin' >>> f.howMany=100 >>> pickle.dumps(f) "(i__main__\nFoo\np0\n(dp1\nS'thanksTo'\np2\nS'Mart

Re: good design & method calls

2005-03-29 Thread Charles Hartman
On Mar 29, 2005, at 10:36 AM, Peter Hansen wrote: Sorry for the rant... I didn't intend it to head that way when I started out, but I seem to be on a bit of an anti-optimization bent today. :-) No, that's very helpful; thanks. Charles Hartman -- http://mail.python.org/mailman/listinfo/python-list

problem with tkinter

2005-03-29 Thread max(01)*
hello. the following code: 1 from Tkinter import * 2 3 class MiaApp: 4 def __init__(self, genitore): 5 self.mioGenitore = genitore 6 self.i = IntVar() 7 self.i.set(42) 8 self.s = StringVar() 9 self.s.set("Baobab") 10

Re: truncating a file from the top down

2005-03-29 Thread Fredrik Lundh
Mike Rovner wrote: > if os.stat says the_file is too big: > fh = open(the_file, 'rb') > fh.seek(2008, 2) should be fh.seek(-2008, 2) right? > data = fh.read() > fh.close() > assert len(data)==2008 # you may want some error processing here > fh = open(the_file, 'wb') > fh.writ

problem with tkinter

2005-03-29 Thread max(01)*
hello. the following code: 1 from Tkinter import * 2 3 class MiaApp: 4 def __init__(self, genitore): 5 self.mioGenitore = genitore 6 self.i = IntVar() 7 self.i.set(42) 8 self.s = StringVar() 9 self.s.set("Baobab") 10

Wanted: New Python Success Stories

2005-03-29 Thread Stephan Deibel
Hi, O'Reilly Associates is going to be printing volume III of the Python Success Stories series in June and I'm looking for submissions of new stories. The stories have been quite valuable for people introducing Python to new users and companies. The deadline for me to receive stories for

Problem in designing a global directory in python

2005-03-29 Thread Tian
I want to create a object directory called Context in my program, which is based on a dict to save and retrieve values/objects by string-type name. I have the definition like this: utils.py global sysctx class Context: def __init__(self): def set(self, name, obj, over

Re: Distributing closed source modules

2005-03-29 Thread Dave Brueck
Fuzzyman wrote: Dave Brueck wrote: By "futile" I meant that, if the code ends up running on a user's machine, then a sufficiently motivated person could crack it wide open, regardless of implementation language - the only way to truly protect the code is to never let it out of your hands (i.e. it's

Re: Little Q: how to print a variable's name, not its value?

2005-03-29 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Bill Mill <[EMAIL PROTECTED]> wrote: . . . >(i.e. I respectfully disagree that mixing data with program code is a bad idea) . .

Re: Get document as normal text and not as binary data

2005-03-29 Thread Markus Franz
Diez B. Roggisch wrote: Addendum: If you give us the url you're fetching data from, we might be able to look at the delivered data ourselves. To guess my problem please have a look at the document title of Markus -- http://mail.python.org/mailman/l

Re: Get document as normal text and not as binary data

2005-03-29 Thread Markus Franz
Kent Johnson wrote: My guess is the html is utf-8 encoded - your sample looks like utf-8-interpreted-as-latin-1. Try contents = f.read().decode('utf-8') YES! That helped! I used the following: ... contents = f.read().decode('utf-8') contents = contents.encode('iso-8859-15') ... That was the perfec

Automatic response to your mail (Error)

2005-03-29 Thread Webmaster
The automatic reply to this e-mail which you should have received in response to your e-mail to [EMAIL PROTECTED] has not been defined. Please contact [EMAIL PROTECTED] for assistance. -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem in designing a global directory in python

2005-03-29 Thread F. Petitjean
Le 29 Mar 2005 09:50:46 -0800, Tian a écrit : > I want to create a object directory called Context in my program, which > is based on a dict to save and retrieve values/objects by string-type > name. I have the definition like this: > > utils.py > > global sysctx # you are in

Re: itertools to iter transition (WAS: Pre-PEP: Dictionary accumulator methods)

2005-03-29 Thread Steven Bethard
Ville Vainio wrote: "Raymond" == Raymond Hettinger <[EMAIL PROTECTED]> writes: Raymond> If the experience works out, then all you're left with is Raymond> the trivial matter of convincing Guido that function Raymond> attributes are a sure cure for the burden of typing Raymond> impo

Re: [Newbie] How do I get better at Python programming?

2005-03-29 Thread Tim Jarman
Roy Smith wrote: > keep in mind, however, that not all problems in life can be solved with > software. +1 QOTW -- Website: www DOT jarmania FULLSTOP com -- http://mail.python.org/mailman/listinfo/python-list

Re: Finding attributes in a list

2005-03-29 Thread Steven Bethard
infidel wrote: You can use the new 'sorted' built-in function and custom "compare" functions to return lists of players sorted according to any criteria: players = [ ... {'name' : 'joe', 'defense' : 8, 'attacking' : 5, 'midfield' : 6, 'goalkeeping' : 9}, ... {'name' : 'bob', 'defense'

Re: truncating a file from the top down

2005-03-29 Thread Mike Rovner
Right. Thanks for the correction. Fredrik Lundh wrote: Mike Rovner wrote: if os.stat says the_file is too big: fh = open(the_file, 'rb') fh.seek(2008, 2) should be fh.seek(-2008, 2) right? data = fh.read() fh.close() assert len(data)==2008 # you may want some error processing here fh =

Re: Little Q: how to print a variable's name, not its value?

2005-03-29 Thread Bill Mill
On Tue, 29 Mar 2005 18:08:04 GMT, Cameron Laird <[EMAIL PROTECTED]> wrote: > In article <[EMAIL PROTECTED]>, > Bill Mill <[EMAIL PROTECTED]> wrote: > . > . > . > >(i.e. I respectfully disagree that mixing data with program cod

Re: modes for AES encryption?

2005-03-29 Thread Chris Curvey
Chris Curvey wrote: I'm trying to use the AES module in the Python Cryptography Toolkit. I need to set the mode to "ECB/NoPadding", and there's a reference to a "Mode" parameter in the new() function, but no examples for AES. Who can point me in the right direction? Answering my own question f

Re: code for Computer Language Shootout

2005-03-29 Thread igouy
We've made it somewhat easier to contribute programs. No need to subscribe to the mailing-list. No need for a user-id or login. See the FAQ "How can I contribute a program?" http://shootout.alioth.debian.org/faq.php -- http://mail.python.org/mailman/listinfo/python-list

  1   2   3   >