Re: doctest with variable return value

2006-07-26 Thread 3KWA
Peter Otten wrote: You cannot test for an unknown value, but you can do some sanity checks: rate = get_rate('AUDEUR') rate 0 True isinstance(rate, float) True This will at least make sure that get_rate() does not throw an exception. Thanks a lot ... sanity

Re: Tkinter and exceptions

2006-07-26 Thread Peter Otten
Nick Craig-Wood wrote: I'm just starting out with Tkinter programming (using Programming Python as a reference), and I couldn't find the answer to this anywhere... How do you catch general exceptions in a Tkinter program. If you run the below and click the Exception or Callback Exception

Re: Which Pyton Book For Newbies?

2006-07-26 Thread Rob Sinclar
On Tuesday 25 July 2006 04:33, [EMAIL PROTECTED] wrote: Web programming is all about stdin stdout. Recommanded practice before going further. It's actually a little more (at least as far as CGI is concerned)...it bears some level of abstraction, namely, a decent CGI lib. Do you mean CGI

Re: HELP!!! How do I send an ACK packet in UDP?????

2006-07-26 Thread Rob Sinclar
On Wednesday 26 July 2006 00:48, [EMAIL PROTECTED] wrote: how do I send an ack packet UDP stands for User Datagram Protocol. Ther'es no ack like in TCP. Define your own protocol ie when machine1 sends the string ACK, machine2 has the acknowledge it wanted. Regards, Rob --

Re: Dive Into Python -- Still Being Updated?

2006-07-26 Thread cga2000
On Tue, Jul 25, 2006 at 11:32:23PM EDT, [EMAIL PROTECTED] wrote: Alan Franzoni wrote: Il 22 Jul 2006 15:48:36 -0700, [EMAIL PROTECTED] ha scritto: http://diveintopython.org/getting_to_know_python/indenting_code.html The function called fib (presumably short for Fibonacci) appears

Re: Need a compelling argument to use Django instead of Rails

2006-07-26 Thread Kay Schluehr
Ray wrote: David Cook wrote: On 2006-07-24, Sybren Stuvel [EMAIL PROTECTED] wrote: Jython isn't up to par with current Python versions either. But the last release is up to the level of C-Python 2.2 or so. I don't really feel like I'm missing that much with it. You mean the alpha?

Re: webbrowser open failing

2006-07-26 Thread John McMonagle
On Wed, 2006-07-26 at 17:09 +1200, Thomas wrote: Hi all, I am getting an error using webbrowser open on mac 10.3 using python 2.3.5 test=open(/Volumes/TINTZ;P3/DT Hot Folder test/Justin_Test.pDF,r) type(test) type 'file' webbrowser.open(/Volumes/TINTZ;P3/DT Hot Folder

Re: Missing rotor module

2006-07-26 Thread rony steelandt
Le Tue, 25 Jul 2006 12:22:26 -0700, Nick Vatamaniuc a écrit : Unfortunately rotor has been deprecated but it hasn't been replaced with anything reasonable as far as encryption goes -- there are just a bunch of hashing funtions (sha, md5) only. If you need to replace rotor all together I would

Re: doctest with variable return value

2006-07-26 Thread Duncan Booth
3KWA wrote: Peter Otten wrote: You cannot test for an unknown value, but you can do some sanity checks: rate = get_rate('AUDEUR') rate 0 True isinstance(rate, float) True This will at least make sure that get_rate() does not throw an exception. Thanks

Re: random shuffles

2006-07-26 Thread Boris Borcic
I wrote : ...in this sense, it is clear that quicksort for instance is optimal* It is easy to see, when you detail this algorithm, that never during its run is the result of a comparison it makes, preordained by comparisons already made; iow : it doesn't make superfluous or redundant

Re: Tkinter and exceptions

2006-07-26 Thread Nick Craig-Wood
Peter Otten [EMAIL PROTECTED] wrote: Nick Craig-Wood wrote: How do you catch general exceptions in a Tkinter program. Overriding report_callback_exception() seems to work: Thank you. That is exactly what I needed to know! -- Nick Craig-Wood [EMAIL PROTECTED] --

Re: Need a compelling argument to use Django instead of Rails

2006-07-26 Thread Bruno Desthuilliers
Joe Knapka wrote: (snip) Classes are effectively open in Python, too, at least where methods are concerned, since one can do klass.__dict__[myMethod]=myMethod. actually, klass.myMethod = myMethod is enough... -- bruno desthuilliers python -c print '@'.join(['.'.join([w[::-1] for w in

Re: Newbie Q: Class Privacy (or lack of)

2006-07-26 Thread Simon Brunning
On 7/26/06, Steve Jobless [EMAIL PROTECTED] wrote: If I was working on a large project with many engineers, I'd assume someone will do things like this sooner or later. I've seen many horrendous code in my life and I have no control over who I work with. If you work with cowboys, not

Re: Accessing files on a PocketPC device

2006-07-26 Thread LB
walterbyrd ha scritto: I want my python app to read a file from a pocketpc mobile device, if possible. Assume I am running windows-xp, and activesync 3.8. Assume I have exported the file. As I understand it, exported files are not really on the PC, even after syncing. You have to use

Re: Need a compelling argument to use Django instead of Rails

2006-07-26 Thread Paul Boddie
Joe Knapka wrote: Steve Yegge's Opinionated Elf is an example of a problem that is very easy and elegant to solve with open classes, and painful to solve when classes are closed: http://www.cabochon.com/~stevey/blog-rants/polymorphism-fails.html For some value of elegant, I suppose: But the

Re: can wxpython checkbox use the fill in marker instead of the check?

2006-07-26 Thread jean-michel bain-cornu
Hi, does anyone know if, for a 2-state checkbox, you can use the fill in marker from the 3-state checkbox, instead of a checkmark i just like the look of the fill-in instead of the checkmark Use a 3-state and change the state to 2 when you get the 1 state. Here is a working modification to

Re: list problem

2006-07-26 Thread bearophileHUGS
placid: This may be a solution: l1 = ['acXXX1', 'XXX2', 'wXXX3', 'kXXX5'] l2 = [ 'bXXX1', 'xXXX2', 'efXXX3', 'yXXX6', 'zZZZ9'] import re findnum = re.compile(r[0-9]+$) s1 = set(int(findnum.search(el).group()) for el in l1) s2 = set(int(findnum.search(el).group()) for el in l2) nmax =

Re: can wxpython checkbox use the fill in marker instead of the check?

2006-07-26 Thread jean-michel bain-cornu
i just like the look of the fill-in instead of the checkmark I'm just realizing it's a good idea ! I'm going to use it. Thanks ! -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie Q: Class Privacy (or lack of)

2006-07-26 Thread bearophileHUGS
Steve Jobless: I'm hearing that they are features, but don't use them. You can use them if you know why you are doing it. You can also take a look at PyChecker and PyLint, they may help you. Bye, bearophile -- http://mail.python.org/mailman/listinfo/python-list

pasting numpy array into bigger array

2006-07-26 Thread TG
hi. let's say I have : from numpy import * x = identity(5) y = zeros((7,7)) I want to paste x into y, starting at coordinates (1,1) in order to change y to something like this : 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 how would you do

Re: using names before they're defined

2006-07-26 Thread davehowey
do you mean 'configparser'? Yes. Does it generate objects from the config file automatically? It generates a representation of the config file as a Python object composed of sections and options. The documentation should get you started. Hiya, you might be interested in this

Re: Parsing Baseball Stats

2006-07-26 Thread Anthra Norell
- Original Message - From: Paul McGuire [EMAIL PROTECTED] Newsgroups: comp.lang.python To: python-list@python.org Sent: Wednesday, July 26, 2006 1:01 AM Subject: Re: Parsing Baseball Stats Anthra Norell [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] snip

Problem with readlines() and uml

2006-07-26 Thread wscrsurfdude
Ik have an uml file I want to read with readlines. I have the following code: infile = open(out2.txt,r) for line in infile.readlines(): print line The print statement just gives the data, not the uml headings. Is there a solution which also gives the uml headings. --

How to find difference in years between two dates?

2006-07-26 Thread thebjorn
For the purpose of finding someone's age I was looking for a way to find how the difference in years between two dates, so I could do something like: age = (date.today() - born).year but that didn't work (the timedelta class doesn't have a year accessor). I looked in the docs and the

Tkinter pack Problem

2006-07-26 Thread H J van Rooyen
Hi, I am struggling to get the pack method to do what I intend. I am trying to display user input in a seperate window, along with a little description of the field, something like this: Current entry Company : entered co. name First entry : entered stuff

Re: Need a compelling argument to use Django instead of Rails

2006-07-26 Thread Ray
Kay Schluehr wrote: Aren't they rushing for years? The last update of the Jython news page is from march 2005. This is not very encouraging even if there is a secret life of Jython. Yeah I know... but I've been subscribing to jython-dev for quite sometime, and the activity there is surely

Re: Problem with readlines() and uml

2006-07-26 Thread Bruno Desthuilliers
wscrsurfdude wrote: Ik have an uml file What is an uml file ? I want to read with readlines. I have the following code: infile = open(out2.txt,r) for line in infile.readlines(): print line The print statement just gives the data, You get what can be read from the file when opened

Re: Need a compelling argument to use Django instead of Rails

2006-07-26 Thread Ray
Damjan wrote: BTW I'd choose TurboGears for it's flexibility, but I guess Django could be nice when more rapid results are needed (and the problem doesn't fall too far from the Django sweet spot). Well actually I was thinking of exaclty the same thing, because our apps are mostly CRUD apps

Re: Need a compelling argument to use Django instead of Rails

2006-07-26 Thread Ray
John J. Lee wrote: I get that overall impression of Django too (as being more tightly coupled to itself, hence less flexible, when compared with TurboGears in particular). I haven't done much with it yet, though (and presumably the 'magic-removal' branch landing did some good). What do you

Re: Problem with readlines() and uml

2006-07-26 Thread wscrsurfdude
Sorry it is so hot in here, I make mistakes, I meant it to be an xml file. But still sthe same problem wscrsurfdude wrote: Ik have an xml file I want to read with readlines. I have the following code: infile = open(out2.txt,r) for line in infile.readlines(): print line The print

Re: Tkinter pack Problem

2006-07-26 Thread Eric Brunel
On Wed, 26 Jul 2006 12:46:39 +0200, H J van Rooyen [EMAIL PROTECTED] wrote: Hi, I am struggling to get the pack method to do what I intend. I am trying to display user input in a seperate window, along with a little description of the field, something like this: Current

Re: How to find difference in years between two dates?

2006-07-26 Thread John Machin
thebjorn wrote: For the purpose of finding someone's age I was looking for a way to find how the difference in years between two dates, so I could do something like: age = (date.today() - born).year but that didn't work (the timedelta class doesn't have a year accessor). I looked in

Re: Problem with readlines() and uml

2006-07-26 Thread Simon Brunning
On 26 Jul 2006 04:55:37 -0700, wscrsurfdude [EMAIL PROTECTED] wrote: Sorry it is so hot in here, I make mistakes, I meant it to be an xml file. But still sthe same problem Check out elementtree - http://effbot.org/zone/element-index.htm. -- Cheers, Simon B, [EMAIL PROTECTED],

Re: pasting numpy array into bigger array

2006-07-26 Thread Tim Heaney
TG [EMAIL PROTECTED] writes: let's say I have : from numpy import * x = identity(5) y = zeros((7,7)) I want to paste x into y, starting at coordinates (1,1) in order to change y to something like this : 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0

Re: local moduile acess from cgi-bin

2006-07-26 Thread noro
thanks bruno Bruno Desthuilliers wrote: noro wrote: hello all. I do some coding in python but this is my first attampt to write somthing for hte web. I need to write a cgi-bin script for a web-server, and i've got the access for it from our SYSTEM. the problem is that this script

Re: Parsing Baseball Stats

2006-07-26 Thread Ankit
Frederic, Thanks for posting the solution. I used the original solution you posted and it worked beautifully. Paul, I understand your concern for the site's TOS. Although, this may not mean anything, the reason I wanted this parser was because I wanted to get the Advanced, and Translated Stats

Re: pasting numpy array into bigger array

2006-07-26 Thread TG
Thanks, that's exactly what I needed. Tim Heaney wrote: You can use Python slice notation for each dimension y[1:6,1:6] = x -- http://mail.python.org/mailman/listinfo/python-list

Re: Need a compelling argument to use Django instead of Rails

2006-07-26 Thread gregarican
I would suggest trying to pick up Ruby. Knowing both Python and Ruby has helped me in that I can choose whichever tool is the best fit. There are certain cases where I have to abandon Ruby for a certain project because the library isn't mature enough or cross platform enough for my requirements.

pyOpenGL tom demo segmentation fault

2006-07-26 Thread matthew
Hi, I have Python 2-4-2, Numpy 24.2, and PyOpenGL-2.0.2.01 install, along with glut 3.7. The 1st 'funny' thing is that I always seem to get two pythons in /usr/local/bin, ie python and python2.4. These are exactly the same timestamp and size. The other problem is that the demos in

Re: Problem with readlines() and uml

2006-07-26 Thread Bruno Desthuilliers
wscrsurfdude wrote: Sorry it is so hot in here, I make mistakes, I meant it to be an xml file. But still sthe same problem Ik have an xml file I want to read with readlines. I have the following code: infile = open(out2.txt,r) for line in infile.readlines(): print line The print

Re: How to find difference in years between two dates?

2006-07-26 Thread Bruno Desthuilliers
thebjorn wrote: For the purpose of finding someone's age I was looking for a way to find how the difference in years between two dates, so I could do something like: age = (date.today() - born).year but that didn't work (the timedelta class doesn't have a year accessor). I looked in

Re: pyOpenGL tom demo segmentation fault

2006-07-26 Thread Steve Holden
matthew wrote: Hi, I have Python 2-4-2, Numpy 24.2, and PyOpenGL-2.0.2.01 install, along with glut 3.7. The 1st 'funny' thing is that I always seem to get two pythons in /usr/local/bin, ie python and python2.4. These are exactly the same timestamp and size. That's probably because

Re: xmlrpclib and methods declared at runtime

2006-07-26 Thread Brett g Porter
squid wrote: Based on having read the python tutorial and remembering the list of built-in functions, my guess would have been calling setattr in the constructor or after doing a listMethods operation against the XML-RPC server.. That is, assuming the XML-RPC service supports this api..

Re: How to find difference in years between two dates?

2006-07-26 Thread Roy Smith
thebjorn [EMAIL PROTECTED] wrote: def age(born): now = date.today() birthday = date(now.year, born.month, born.day) return now.year - born.year - (birthday now and 1 or 0) I don't get that last line. There's two things in particular that are puzzling me. 1) What does

a print bug?

2006-07-26 Thread Summercoolness
it seems that the behavior of print is that it will round off properly for any floating point imperfection, such as shown in the first two samples. The third sample seems to be a bug? It doesn't know how to handle the floating imperfection in this case. 1.2345 1.2344 print 1.2345

Re: list problem

2006-07-26 Thread zutesmog
placid wrote: Hi all, I have two lists that contain strings in the form string + number for example list1 = [ ' XXX1', 'XXX2', 'XXX3', 'XXX5'] the second list contains strings that are identical to the first list, so lets say the second list contains the following list1 = [ ' XXX1',

Re: Need a compelling argument to use Django instead of Rails

2006-07-26 Thread Jaroslaw Zabiello
On Mon, 24 Jul 2006 12:23:12 +0100, Steve Holden wrote: The impression I get is that Rails is relatively inflexible on database schemas, Django has the same problem. E.g. both Django ORM and ActiveRecord cannot work with complex primary keys. But for Rails there is a solution for even very

subprocess problem on WinXP

2006-07-26 Thread Wolfgang
Hi, I want to compress all files (also in subfolder). The code is working more or less, but I get a black popup window (command line window) for every file to compress. How do I cave to change my system call that nothing pops up? Wolfgang import os import subprocess dir=g:\\messtech for

Re: Need a compelling argument to use Django instead of Rails

2006-07-26 Thread Jaroslaw Zabiello
On Mon, 24 Jul 2006 13:22:33 +0200, Sybren Stuvel wrote: Nah, we're not interested in Python. Ask them why. I know why. In general Java guys can recognize Ruby as more friendly language than Python, more secured (there is almost no security in Python). There is also much more hype about Ruby

.dll and .pyd

2006-07-26 Thread pretoriano_2001
Please, confirm me one thing. According to Python documentation for Windows the objects .pyd and .dll have the same characteristics. I observed that in Python24 it does not produce errors when importing xx.dll or xx.pyd, however in python25b2, it only accepts nto import xx.pyd. Best regards. --

Re: Need a compelling argument to use Django instead of Rails

2006-07-26 Thread Jaroslaw Zabiello
On Mon, 24 Jul 2006 14:23:21 +0200, Sybren Stuvel wrote: Another reason for me not to use Ruby, is that there is no distinction between those two lines of code: x = somefunc x = somefunc() It has no meaning. Just use always () if you like. But sometimes it is better to avoid them to have

Re: How to find difference in years between two dates?

2006-07-26 Thread John Machin
Bruno Desthuilliers wrote: thebjorn wrote: For the purpose of finding someone's age I was looking for a way to find how the difference in years between two dates, so I could do something like: age = (date.today() - born).year but that didn't work (the timedelta class doesn't have

Re: Need a compelling argument to use Django instead of Rails

2006-07-26 Thread Jonathan Ellis
Jaroslaw Zabiello wrote: On Mon, 24 Jul 2006 12:23:12 +0100, Steve Holden wrote: The impression I get is that Rails is relatively inflexible on database schemas, Django has the same problem. E.g. both Django ORM and ActiveRecord cannot work with complex primary keys. But for Rails there

Re: Need a compelling argument to use Django instead of Rails

2006-07-26 Thread Bruno Desthuilliers
Jaroslaw Zabiello wrote: (snip) Ruby is more dynamic than Python Care to elaborate ? I played a bit with Ruby and failed to come to the same conclusion... (the two main differences I noticed are 1/ Ruby is expression-based and 2/ it has a more canonical object model - IOW, it mostly cloned

Re: How to find difference in years between two dates?

2006-07-26 Thread Bruno Desthuilliers
John Machin wrote: Bruno Desthuilliers wrote: thebjorn wrote: For the purpose of finding someone's age I was looking for a way to find how the difference in years between two dates, so I could do something like: age = (date.today() - born).year but that didn't work (the timedelta class

Re: Need a compelling argument to use Django instead of Rails

2006-07-26 Thread gregarican
Ray wrote: The lack of support for Oracle and SQL Server by Django is also a killer that'll prevent Django from being picked up by a LOT of companies (sadly, including mine :( ). Uh, yeah. I was aware of Django but haven't had the time to delve into it. If it doesn't support these larger

Changing a value for each folder while traversing a file system

2006-07-26 Thread PipedreamerGrey
I'm using the script below (originally from http://effbot.org, given to me here) to open all of the text files in a directory and its subdirectories and combine them into one Rich text file (index.rtf). Now I'm adapting the script to convert all the text files into individual html files. What I

Re: How to find difference in years between two dates?

2006-07-26 Thread John Machin
Bruno Desthuilliers wrote: John Machin wrote: Bruno Desthuilliers wrote: Which pieces of the following seem to be working to you? John, it seems you failed to notice the use of may and seems in my post. IIRC, both are supposed to strongly suggest a lack of certitude. I didn't fail

Re: Need a compelling argument to use Django instead of Rails

2006-07-26 Thread Jaroslaw Zabiello
On Wed, 26 Jul 2006 16:25:48 +0200, Bruno Desthuilliers wrote: I have difficulty imagining how a language could be more dynamic than Python... E.g. try to extends or redefine builtin Python classes on fly. Ruby is so flexible that it can be used to create Domain-specific Programming Languages.

wxpython: Timer object not working, or just me?

2006-07-26 Thread John Salerno
I'd be curious to know if this works any differently on other computers/platforms or while other things are happening in the background. I can't tell if it's the Timer object that isn't keep accurate time (although a test with time.time() seems to show that it is), or if I'm just messing up my

import from containing folder

2006-07-26 Thread David Isaac
Suppose I have inherited the structure PackageFolder/ __init__.py mod1.py mod2.py SubPackageFolder/ __init__.py mod3.py and mod3.py should really use a function in mod2.py. *Prior* to Python 2.5, what is the best way to access that? (Please

Re: How to find difference in years between two dates?

2006-07-26 Thread bearophileHUGS
Roy Smith: 2) I find the and 1 or 0 part very confusing. I can't remember all the minor rules about operator precedence, but I'm sure this works out to some clever hack involving boolean short-circuit evaluation to get around the lack of a ternary operator in python. If I need to pull out

Re: list problem

2006-07-26 Thread Simon Forman
placid wrote: But there may be other characters before XXX (which XXX is constant). A better example would be, that string s is like a file name and the characters before it are the absolute path, where the strings in the first list can have a different absolute path then the second list

Re: Python audio output switch

2006-07-26 Thread Ben Sizer
Pan Xingzhi wrote: Guys: Hi there. Recently I'll have to write a quite interesting program in Python on a Linux box. What I need is a function which allows the user to 'switch' the audio output from an audio file/microphone/line in. They are audio inputs, not audio outputs! I don't

Re: Need a compelling argument to use Django instead of Rails

2006-07-26 Thread aaronwmail-usenet
Jaroslaw Zabiello wrote: On Wed, 26 Jul 2006 16:25:48 +0200, Bruno Desthuilliers wrote: I have difficulty imagining how a language could be more dynamic than Python... E.g. try to extends or redefine builtin Python classes on fly. Ruby is so flexible that it can be used to create

Re: micro authoritative dns server

2006-07-26 Thread Jack
I was looking for something like that. I came across this: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/491264 It's not ready to use but you can modify it. [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi, I'm new in python. I know that there are several classes for

Re: wxpython: Timer object not working, or just me?

2006-07-26 Thread Steve Holden
John Salerno wrote: I'd be curious to know if this works any differently on other computers/platforms or while other things are happening in the background. I can't tell if it's the Timer object that isn't keep accurate time (although a test with time.time() seems to show that it is), or

Re: Need a compelling argument to use Django instead of Rails

2006-07-26 Thread Jean-Paul Calderone
On 26 Jul 2006 08:16:21 -0700, [EMAIL PROTECTED] wrote: Jaroslaw Zabiello wrote: On Wed, 26 Jul 2006 16:25:48 +0200, Bruno Desthuilliers wrote: I have difficulty imagining how a language could be more dynamic than Python... E.g. try to extends or redefine builtin Python classes on fly.

Re: self question

2006-07-26 Thread Chris Lambacher
On Tue, Jul 25, 2006 at 08:08:32PM +0200, Sch?le Daniel wrote: [EMAIL PROTECTED] schrieb: cnt = 1 def foo(): global cnt cnt += 1 return cnt def bar(x=foo()): print x bar() # 2 bar() # 2 bar() # 2 Looks to me like you want to use the

Re: simple question

2006-07-26 Thread Philippe Martin
Maxine Weill wrote: I need to install Python Imaging Library (PIL) - imaging-1.1.5.tar.gz (source ) onto Suse Linux 10.1 system in order for (latest) Scribus 1.3.3.2 to install and work. Plesae indicate how I perform PIL install (exact commands/procedures) in manner where files are

Re: Need a compelling argument to use Django instead of Rails

2006-07-26 Thread Jaroslaw Zabiello
On 26 Jul 2006 08:16:21 -0700, [EMAIL PROTECTED] wrote: E.g. try to extends or redefine builtin Python classes on fly. Ruby is so flexible that it can be used to create Domain-specific Programming Languages. This, of course, is really cool if you are working all by yourself on a

Re: Need a compelling argument to use Django instead of Rails

2006-07-26 Thread Ben Sizer
Ray wrote: Just that it's a big, huge, humongous pity to see Python keeps missing the big thing over and over again. Last time when biotechnology was hot, which language became The Language? Perl. Now simple web app is hot? It's Ruby. The problem is that Python is the 2nd best language for

Using iterators to write in the structure being iterated through?

2006-07-26 Thread Pierre Thibault
Hello! I am currently trying to port a C++ code to python, and I think I am stuck because of the very different behavior of STL iterators vs python iterators. What I need to do is a simple arithmetic operations on objects I don't know. In C++, the method doing that was a template, and all that

Re: import from containing folder

2006-07-26 Thread Simon Forman
David Isaac wrote: Suppose I have inherited the structure PackageFolder/ __init__.py mod1.py mod2.py SubPackageFolder/ __init__.py mod3.py and mod3.py should really use a function in mod2.py. *Prior* to Python 2.5, what is the best

Re: Tkinter pack Problem

2006-07-26 Thread Simon Forman
I find the Tkinter reference: a GUI for Python under Local links on this page http://infohost.nmt.edu/tcc/help/lang/python/tkinter.html to be very helpful. It has a decent discussion of the grid layout manager. HTH, ~Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: Need a compelling argument to use Django instead of Rails

2006-07-26 Thread Bruno Desthuilliers
Jaroslaw Zabiello wrote: On Wed, 26 Jul 2006 16:25:48 +0200, Bruno Desthuilliers wrote: I have difficulty imagining how a language could be more dynamic than Python... E.g. try to extends or redefine builtin Python classes on fly. Ok, this is one of the few restrictions - builtin types.

Re: Need a compelling argument to use Django instead of Rails

2006-07-26 Thread Jaroslaw Zabiello
On Wed, 26 Jul 2006 18:01:50 +0200, Bruno Desthuilliers wrote: I have difficulty imagining how a language could be more dynamic than Python... E.g. try to extends or redefine builtin Python classes on fly. Ok, this is one of the few restrictions - builtin types. Yeah. Have something more

Re: list problem

2006-07-26 Thread Gerard Flanagan
placid wrote: Hi all, I have two lists that contain strings in the form string + number for example list1 = [ ' XXX1', 'XXX2', 'XXX3', 'XXX5'] the second list contains strings that are identical to the first list, so lets say the second list contains the following list1 = [ ' XXX1',

Re: Need a compelling argument to use Django instead of Rails

2006-07-26 Thread Bruno Desthuilliers
Jaroslaw Zabiello wrote: On 26 Jul 2006 08:16:21 -0700, [EMAIL PROTECTED] wrote: E.g. try to extends or redefine builtin Python classes on fly. Ruby is so flexible that it can be used to create Domain-specific Programming Languages. This, of course, is really cool if you are working all by

extender method

2006-07-26 Thread davehowey
'Learning Python' by Lutz and Ascher (excellent book by the way) explains that a subclass can call its superclass constructor as follows: class Super: def method(self): # do stuff class Extender(Super): def method(self): Super.method(self) # call the method in super # do more

Re: Python audio output switch

2006-07-26 Thread Pan Xingzhi
Sorry maybe I didn't describe what I need clearly. Yes they're inputs. Actually I need a switch to 'hook' them to line out so when I switch, a mp3 file is played, or an external CD player is played, or what I'm talking is played. Thanks anyway. I'm checking ALSA, though maybe I'll have to

Re: Need a compelling argument to use Django instead of Rails

2006-07-26 Thread Bruno Desthuilliers
Jaroslaw Zabiello wrote: On Wed, 26 Jul 2006 18:01:50 +0200, Bruno Desthuilliers wrote: I have difficulty imagining how a language could be more dynamic than Python... E.g. try to extends or redefine builtin Python classes on fly. Ok, this is one of the few restrictions - builtin types.

Re: Tkinter pack Problem

2006-07-26 Thread Joe Knapka
H J van Rooyen wrote: Hi, I am struggling to get the pack method to do what I intend. I am trying to display user input in a seperate window, along with a little description of the field, something like this: Current entry Company : entered co. name First

Re: Tkinter pack Problem

2006-07-26 Thread H J van Rooyen
Eric Brunel [EMAIL PROTECTED] wrote: |On Wed, 26 Jul 2006 12:46:39 +0200, H J van Rooyen [EMAIL PROTECTED] |wrote: | | Hi, | | I am struggling to get the pack method to do what I intend. | I am trying to display user input in a seperate window, along with | a little description of the field,

Re: Need a compelling argument to use Django instead of Rails

2006-07-26 Thread Paul Rubin
Bruno Desthuilliers [EMAIL PROTECTED] writes: Ruby has nice security system (private, protected, public scopes for methods and attributes, This is not security, this is data-hiding. And IIRC, Ruby's attributes are always private - just like in Smalltalk FWIW. I don't know anything about

Re: pasting numpy array into bigger array

2006-07-26 Thread Robert Kern
Tim Heaney wrote: I think it's a shame there isn't any free documentation for numpy. Tosh. http://www.scipy.org/Tentative_NumPy_Tutorial http://www.scipy.org/Numpy_Example_List http://www.scipy.org/doc/numpy_api_docs/numpy.html -- Robert Kern I have come to believe that the whole world is

Re: How to find difference in years between two dates?

2006-07-26 Thread Bruno Desthuilliers
John Machin wrote: Bruno Desthuilliers wrote: John Machin wrote: Bruno Desthuilliers wrote: Which pieces of the following seem to be working to you? John, it seems you failed to notice the use of may and seems in my post. IIRC, both are supposed to strongly suggest a lack of certitude. I

Re: extender method

2006-07-26 Thread Bruno Desthuilliers
[EMAIL PROTECTED] wrote: 'Learning Python' by Lutz and Ascher (excellent book by the way) explains that a subclass can call its superclass constructor as follows: (snip) Now, this is fine using the above code. Where I'm struggling is with argument passing. The following, for example,

Re: How to force a thread to stop

2006-07-26 Thread Carl J. Van Arsdall
[EMAIL PROTECTED] wrote: Carl J. Van Arsdall wrote: I don't get what threading and Twisted would to do for you. The problem you actually have is that you sometimes need terminate these other process running other programs. Use spawn, fork/exec* or maybe one of the popens. I have a

Re: extender method

2006-07-26 Thread Chris Lambacher
On Wed, Jul 26, 2006 at 09:21:10AM -0700, [EMAIL PROTECTED] wrote: 'Learning Python' by Lutz and Ascher (excellent book by the way) explains that a subclass can call its superclass constructor as follows: class Super: def method(self): # do stuff class Extender(Super): def

Re: Need a compelling argument to use Django instead of Rails

2006-07-26 Thread Bruno Desthuilliers
Paul Rubin wrote: Bruno Desthuilliers [EMAIL PROTECTED] writes: Ruby has nice security system (private, protected, public scopes for methods and attributes, This is not security, this is data-hiding. And IIRC, Ruby's attributes are always private - just like in Smalltalk FWIW. I don't

Re: extender method

2006-07-26 Thread Simon Forman
[EMAIL PROTECTED] wrote: 'Learning Python' by Lutz and Ascher (excellent book by the way) explains that a subclass can call its superclass constructor as follows: class Super: def method(self): # do stuff class Extender(Super): def method(self): Super.method(self) # call

Re: Using iterators to write in the structure being iterated through?

2006-07-26 Thread Chris Lambacher
I think you are going to need to provide some python minimal code as an example of what is not working for you. -Chris On Wed, Jul 26, 2006 at 11:39:36AM -0400, Pierre Thibault wrote: Hello! I am currently trying to port a C++ code to python, and I think I am stuck because of the very

Re: list problem

2006-07-26 Thread Gerard Flanagan
Gerard Flanagan wrote: placid wrote: Hi all, I have two lists that contain strings in the form string + number for example list1 = [ ' XXX1', 'XXX2', 'XXX3', 'XXX5'] the second list contains strings that are identical to the first list, so lets say the second list contains the

Re: list problem

2006-07-26 Thread Paul Rubin
placid [EMAIL PROTECTED] writes: list1 = [ ' XXX1', 'XXX2', 'XXX3', 'XXX5'] the second list contains strings that are identical to the first list, so lets say the second list contains the following list1 = [ ' XXX1', 'XXX2', 'XXX3', 'XXX6'] I think you meant list2 for the second one.

builtin function compile exceptions thrown?

2006-07-26 Thread James Thiele
What exceptions (if any) can the python builtin compile() function throw besides SyntaxError? -- http://mail.python.org/mailman/listinfo/python-list

Re: Need a compelling argument to use Django instead of Rails

2006-07-26 Thread Paul Rubin
Bruno Desthuilliers [EMAIL PROTECTED] writes: Hopefully it's more secure than Java wrt/ attributes/methods access restriction. IIRC, accessing a 'private' attribute thru reflection is quite possible in Java. That's controlled by some flag you can set. Browser applet sandboxes depend on the

Re: How to force a thread to stop

2006-07-26 Thread Paul Rubin
Carl J. Van Arsdall [EMAIL PROTECTED] writes: The problem I have is a large distributed system, that's the reality of it. The short summary, I need to use and control 100+ machines in a computing farm. They all need to share memory or to actively communicate with each other via some other

Re: How to force a thread to stop

2006-07-26 Thread Carl J. Van Arsdall
Paul Rubin wrote: Carl J. Van Arsdall [EMAIL PROTECTED] writes: The problem I have is a large distributed system, that's the reality of it. The short summary, I need to use and control 100+ machines in a computing farm. They all need to share memory or to actively communicate with each

Re: Using iterators to write in the structure being iterated through?

2006-07-26 Thread Peter Otten
Pierre Thibault wrote: Hello! I am currently trying to port a C++ code to python, and I think I am stuck because of the very different behavior of STL iterators vs python iterators. What I need to do is a simple arithmetic operations on objects I don't know. In C++, the method doing that

  1   2   3   >