Re: OS specific command in Python

2006-06-19 Thread Avell Diroll
[EMAIL PROTECTED] wrote: > I want to write a python program and call OS specific commands in it. > So basically, instead of typing in on the command line argument I want > to have it in a python program and let it do the action. There are several ways to do so : * os.system() if you just want to l

replacing choice.exe function with python script..

2006-06-19 Thread Blake Garner
Hi list,I'm looking for suggestions to replace choice.exe on windows with a python script. With choice.exe you can ask for input from the command line. Then choice.exe will set a variable that can later be used to do usefull things. The tricky part is that it allows you to set a default selection

Re: OS specific command in Python

2006-06-19 Thread stephanearnold
[EMAIL PROTECTED] a écrit : > So basically, instead of typing in on the command line argument I want > to have it in a python program and let it do the action. Try exec() and execfile() from the standard library (IIRC) > > for example. in my program I would want to call the ssh feature like > on

Re: OS specific command in Python

2006-06-19 Thread Robert Kern
[EMAIL PROTECTED] wrote: > I want to write a python program and call OS specific commands in it. > So basically, instead of typing in on the command line argument I want > to have it in a python program and let it do the action. > > for example. in my program I would want to call the ssh feature l

Re: Seeking regex optimizer

2006-06-19 Thread Kay Schluehr
[EMAIL PROTECTED] wrote: > Kay Schluehr wrote: > > I have a list of strings ls = [s_1,s_2,...,s_n] and want to create a > > regular expression sx from it, such that sx.match(s) yields a SRE_Match > > object when s starts with an s_i for one i in [0,...,n]. > > Why do you want to use a regex for th

OS specific command in Python

2006-06-19 Thread diffuser78
I want to write a python program and call OS specific commands in it. So basically, instead of typing in on the command line argument I want to have it in a python program and let it do the action. for example. in my program I would want to call the ssh feature like one does on the command line s

Re: What is Expressiveness in a Computer Language

2006-06-19 Thread Vesa Karvonen
In comp.lang.functional Chris Smith <[EMAIL PROTECTED]> wrote: [...] > Knowing that it'll cause a lot of strenuous objection, I'll nevertheless > interject my plea not to abuse the word "type" with a phrase like > "dynamically typed". If anyone considers "untyped" to be perjorative, > as some p

Re: code is data

2006-06-19 Thread Kay Schluehr
Ian Bicking wrote: > > I don't use Django and I made this up quickly, so please don't pick on > > subtleties. > > > > @Poll: > > question: char length 200 > > pub_date('date published'): date > > > > @Choice: > > poll -> Poll > > choice: char length 200 > > votes: int > > That

Re: can't find win32api from embedded pyrun call

2006-06-19 Thread Miki
Hello Jim, > // Py_Initialize(); > Py_InitializeEx(0); > PyRun_SimpleString("from win32com.client import *"); > > Here's what it does on the last line: > > File "D:\Python\Lib\site-packages\win32com\__init__.py", line 5, in ? > import win32api, sys, ok > ImportError: No mod

Re: interactive multi-file search and replace

2006-06-19 Thread James Stroud
Ryan Krauss wrote: > I need to do some searching and replacing in about 10 latex files. > Does anyone have an existing script that does this on an interactive > basis? I would like to show each match and ask whether or not it > should be replaced. > > This seems like a fairly common task and I do

Re: What is Expressiveness in a Computer Language

2006-06-19 Thread Ron Garret
In article <[EMAIL PROTECTED]>, "Marshall" <[EMAIL PROTECTED]> wrote: > The conversation I would *really* like to have is the one where we > discuss what all the differences are, functionally, between the two, > and what the implications of those differences are, without trying > to address which

Re: list of polynomial functions

2006-06-19 Thread Matteo
Josiah Manson wrote: > In the following program I am trying to learn how to use functional > programming aspects of python, but the following program will crash, > claiming that the recursion depth is too great. I am attempting to make > a list of polynomial functions such that poly[0](3) = 1, poly

Re: Newbie Question

2006-06-19 Thread Scott David Daniels
placid wrote: > Saint Malo wrote: >> Andrew Robert wrote: >>> Saint Malo wrote: >>> # Open a file for read >>> file=open(r'test.txt','r') >>> >>> # Read each line in file >>> for line in file >>> >>>#Search each line >>>if "A" in line: >>> >>> print "I found A" >>> >>> file.close()

Re: USB support

2006-06-19 Thread Tim Roberts
"rodmc" <[EMAIL PROTECTED]> wrote: > >Thanks for this, I have managed to build PyUSB and install it in the >relevant directory. However I get bus errors when I try the PlugUSB.py >example. Does anyone know why this is likely to be the case? > >I am using Macpython 2.4, Libusb 0.1.12 and PyUSB 0.3.

Re: Active Python versions

2006-06-19 Thread Tom Del Rosso
Thanks very much guys. -- Reply in group, but if emailing add another zero, and remove the last word. -- http://mail.python.org/mailman/listinfo/python-list

Re: What is Expressiveness in a Computer Language

2006-06-19 Thread Chris Smith
I <[EMAIL PROTECTED]> wrote: > Static type systems detect some bugs at compile time, whereas > dynamic type systems detect type violations at runtime. PS: In order to satisfy the Python group (among others not on the cross- post list), we'd need to include "duck typing," which fits neither

Re: What is Expressiveness in a Computer Language

2006-06-19 Thread Chris Smith
Joe Marshall <[EMAIL PROTECTED]> wrote: > They *do* have a related meaning. Consider this code fragment: > (car "a string") My feeling is that this code is obviously wrong. It is so obviously wrong, in fact, that the majority of automated error detection systems, if written for Lisp, would pro

Re: Active Python versions

2006-06-19 Thread Trent Mick
Tom Del Rosso wrote: > [EMAIL PROTECTED] <[EMAIL PROTECTED]> typed > in news://[EMAIL PROTECTED], > >> Maybe the OP is refering to PythonWin editor (as compared to IDLE) >> which is in ActiveState's release but not in the Python.org release... >> makes for a very different subject, and hopefully f

Re: Newbie Question

2006-06-19 Thread jmdeschamps
Saint Malo wrote: > BTW my program isn't about red blue yellow etc. I'm just using it as > an example. I guess i didn't asked the question correctly or am not > expressing myself correctly. Let me try one more. > > Ok. > > Contents of text file follow: > > red blue purble > yellow blue green >

Re: [OT] code is data

2006-06-19 Thread K.S.Sreeram
Fredrik Lundh wrote: > because lots of people know how to describe XML transformations, and > there are plenty of tools that implement such transformations efficiently ? > > why would XML be inefficient ? XML Transformations (XSLT) would *certainly* be an overkill here. They've invented a whole

Re: code is data

2006-06-19 Thread Ian Bicking
Ravi Teja wrote: > Fredrik Lundh wrote: > > Ravi Teja wrote: > > > > > Web frameworks, which seem to be the rage now in Python community could > > > have benefited tremendously from Macro capabilities since they have a > > > lot of boiler plate. > > > > they do? methinks you haven't done much web

Re: transfer rate limiting in socket.py

2006-06-19 Thread Alex Martelli
Peter Silva <[EMAIL PROTECTED]> wrote: > I looked at twisted briefly. It looks like it is server oriented. > Does it work in for clients initiating connections? Twisted supports clients, servers, and "middleware" (proxies etc) in equally wonderful and powerful ways. Alex -- http://mail.python

Re: Active Python versions

2006-06-19 Thread jmdeschamps
Tom Del Rosso wrote: > [EMAIL PROTECTED] <[EMAIL PROTECTED]> typed > in news://[EMAIL PROTECTED], > > > Maybe the OP is refering to PythonWin editor (as compared to IDLE) > > which is in ActiveState's release but not in the Python.org release... > > makes for a very different subject, and hopefull

Re: Newbie Question

2006-06-19 Thread Saint Malo
BTW my program isn't about red blue yellow etc. I'm just using it as an example. I guess i didn't asked the question correctly or am not expressing myself correctly. Let me try one more. Ok. Contents of text file follow: red blue purble yellow blue green Now lets imagine i wrote some code

Re: Newbie Question

2006-06-19 Thread jmdeschamps
placid wrote: > BartlebyScrivener wrote: > > Saint Malo wrote: > > > If the program searches for blue, i just want it to print blue > > > > Huh? Tell it to print whatever you want. > > > > for line in file: > > if 'blue' in line: > > print 'blue' > > > > for line in file: > > if 'br

Re: Active Python versions

2006-06-19 Thread Tom Del Rosso
[EMAIL PROTECTED] <[EMAIL PROTECTED]> typed in news://[EMAIL PROTECTED], > Maybe the OP is refering to PythonWin editor (as compared to IDLE) > which is in ActiveState's release but not in the Python.org release... > makes for a very different subject, and hopefully for very different > answer dir

Re: Active Python versions

2006-06-19 Thread jmdeschamps
Trent Mick wrote: > Tom Del Rosso wrote: > > Can I ask you about alternative environments? How do Active Python and IDLE > > from python.org compare? > > Both ActivePython and the Python installers from python.org install > IDLE. They should not differ at all (AFAIK). > > Trent > > -- > Trent Mic

Formatting practices (was: Passing data to system command)

2006-06-19 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Chris Hieronymus <[EMAIL PROTECTED]> wrote: . . . > msg = str(x)+" "+str(y)+"\n" > p1.stdin.write(msg) . . . While Py

Re: Simple script to make .png thumbnails from .zip archive...

2006-06-19 Thread K P S
Thanks everyone. One last thing (I hope). How can I get the name of just the first file in a zipfile? I see routines to list all the files in a zip archive, but I don't see any to list only the first, or only the second, etc. It doesn't look like zipfile is storing info in a useful array that I

Re: Function definition

2006-06-19 Thread forman . simon
aarondesk wrote: ... > > Now I've tried putting the function declaration after the call but the > program wouldn't work. Is there anyway to put function declarations at > the end of the program, rather than putting them at the beginning, > which is rather clunky? > > Thanks. > Aaron A function can

Re: Newbie Question

2006-06-19 Thread placid
BartlebyScrivener wrote: > Saint Malo wrote: > > If the program searches for blue, i just want it to print blue > > Huh? Tell it to print whatever you want. > > for line in file: > if 'blue' in line: > print 'blue' > > for line in file: > if 'brown' in line: > print 'brown'

Re: statically linked python

2006-06-19 Thread Serge Orlov
Ralph Butler wrote: > Serge Orlov wrote: > > Ralph Butler wrote: > >> Hi: > >> > >> I have searched the docs and google but have not totally figured > >> out how to accomplish my task: On a linux box, I want to compile > >> and link python so that it uses no shared libraries, but does support > >>

Re: Newbie Question

2006-06-19 Thread placid
Saint Malo wrote: > Thanks! That helped a lot! Now, lets say that I just want to display > one or just a few of the items and not the whole line. For example, > the text file contains the following: > > red blue yello > green purple brown > > > If the program searches for blue, i just want it t

Re: Newbie Question

2006-06-19 Thread BartlebyScrivener
Saint Malo wrote: > If the program searches for blue, i just want it to print blue Huh? Tell it to print whatever you want. for line in file: if 'blue' in line: print 'blue' for line in file: if 'brown' in line: print 'brown' for line in file: if 'red' in line:

can't find win32api from embedded pyrun call

2006-06-19 Thread Jim
I am trying to figure out how to embed Python in a little C++ Windows console app. Here's the code: // Py_Initialize(); Py_InitializeEx(0); PyRun_SimpleString("from win32com.client import *"); Here's what it does on the last line: File "D:\Python\Lib\site-packages\win32c

Re: wxPython GUI designer

2006-06-19 Thread Don Taylor
aum wrote: > On Sun, 18 Jun 2006 13:09:08 -0700, diffuser78 wrote: > >> I am newbie learning wxPython. I tried using GUI designer called >> wxGlade. When it generated code I couldnt get the same level of >> flexibility as writing the code by oneself. >> >> Any view on what you think about using GU

Re: What is Expressiveness in a Computer Language

2006-06-19 Thread Marshall
Joe Marshall wrote: > > They *do* have a related meaning. Consider this code fragment: > (car "a string") > [...] > Both `static typing' and `dynamic typing' (in the colloquial sense) are > strategies to detect this sort of error. The thing is though, that putting it that way makes it seems as if

Re: Need Help comparing dates

2006-06-19 Thread colincolehour
The program works great! It does everything I wanted it to do and now I'm already thinking about ways of making it more useful like emailing me the results of my program. Thanks everyone for the help and advice. Colin Tim Chase wrote: > > I kept getting a Python error for the following line: > >

europython room share

2006-06-19 Thread andrewdalke
Is anyone here going to Europython and would like a roommate to help split the cost? I'll be there for all three days of the conference plus a few extra days for sprints. I figure I can move elsewhere if need be for the sprints. It looks like the best choices are St. Genis (because it is about 2

Re: Active Python versions

2006-06-19 Thread Trent Mick
Tom Del Rosso wrote: > Can I ask you about alternative environments? How do Active Python and IDLE > from python.org compare? Both ActivePython and the Python installers from python.org install IDLE. They should not differ at all (AFAIK). Trent -- Trent Mick [EMAIL PROTECTED] -- http://mai

Re: a good programming text editor (not IDE)

2006-06-19 Thread jussij
[EMAIL PROTECTED] wrote: > Anyway, the only thing editplus doesn't do that I wish it > did is code folding. If you need a Python folding editor you could always take a look at Zeus: http://www.zeusedit.com/python.html > All the stuff you guys are talking about: line numbers, > syntax highlig

Re: What is Expressiveness in a Computer Language

2006-06-19 Thread Joe Marshall
Chris Smith wrote: > Joe Marshall <[EMAIL PROTECTED]> wrote: > > > > Chris Smith wrote: > > > > > > Knowing that it'll cause a lot of strenuous objection, I'll nevertheless > > > interject my plea not to abuse the word "type" with a phrase like > > > "dynamically typed". > > > > Allow me to strenu

Re: Seeking regex optimizer

2006-06-19 Thread andrewdalke
Replying to me Mirco Wahab wrote: > If you pull the strings into (?>( ... )) (atomic groups), > this would't happen. Given that Python's re engine doesn't support this feature it doesn't really help the original poster's problem. Even if some future Python did support it, the limit to 100 named g

Re: What is Expressiveness in a Computer Language

2006-06-19 Thread Chris F Clark
Chris Smith wrote: > Marshall <[EMAIL PROTECTED]> wrote: > > While I am quite sympathetic to this point, I have to say that > > this horse left the barn quite some time ago. > > I don't think so. Perhaps it's futile to go scouring the world for uses > of the phrase "dynamic type" and eliminating t

Re: Function definition

2006-06-19 Thread faulkner
no. python is not C. python is interpreted, not compiled, so if you want a function to exist when you call it, you need to define it before you call it. it isn't clunky, it's just how it's done. if you want to define a 'main' function at the top of your script/module, go for it. then you can use th

Missing fpconst?

2006-06-19 Thread Atul Wankhade
Hi All, I im searching for fpconst. I had gone thru both the links mentioned below. But both seem to be broken.. Can any body point me to correct one. Thanks in advance.. Atul phansen wrote: >I was trying to start some experiments with SOAP, but >fairly quickly discovered that SOAPpy (require

Re: Does Running Python modules dump stuff on "C" drive?

2006-06-19 Thread Larry Bates
Warren wrote: > I am running win2k pro and was wondering if writing python scripts or > running modules dumps anything in the "C" drive? I have 3 partitions > and run python on the 3rd one or "E"drive. > My "C" drive is almost full and keeps loading up with stuff I don't > want or need. Some of i

Function definition

2006-06-19 Thread aarondesk
I have a little .py file that has the format: def fxn(a): do stuff other stuff ... r = fxn(a) Now I've tried putting the function declaration after the call but the program wouldn't work. Is there anyway to put function declarations at the end of the program, rather than putting them

Re: wxPython GUI designer

2006-06-19 Thread aum
On Sun, 18 Jun 2006 13:09:08 -0700, diffuser78 wrote: > I am newbie learning wxPython. I tried using GUI designer called > wxGlade. When it generated code I couldnt get the same level of > flexibility as writing the code by oneself. > > Any view on what you think about using GUI designer tools. >

Re: ANN: pyfcp (URL correction)

2006-06-19 Thread aum
On Mon, 19 Jun 2006 16:24:41 +1200, aum wrote: > http://www.python.org/pyfcp Sorry, that should have been: http://www.freenet.org.nz/pyfcp -- Cheers aum -- http://mail.python.org/mailman/listinfo/python-list

Re: pyfcp

2006-06-19 Thread aum
On Mon, 19 Jun 2006 17:51:06 +0200, Marc 'BlackJack' Rintsch wrote: > In <[EMAIL PROTECTED]>, aum wrote: > >> On Mon, 19 Jun 2006 14:45:19 +0800, Thomas Moore wrote: >> http://www.python.org/pyfcp >>> >>> It gets me to Error 404. >> >> Apologies - that URL should have been: >> >>

logging module ValueError: I/O operation on closed file

2006-06-19 Thread emvee bhian
getting the following error  while using logging at random any idea what can cause this behaviour   Traceback (most recent call last): File    lib/python2.4/logging/__init__.py", line 737, in emitValueError: I/O operation on closed file         self.Log = logging.getLogger('MAIN')    sForm

Does Running Python modules dump stuff on "C" drive?

2006-06-19 Thread Warren
I am running win2k pro and was wondering if writing python scripts or running modules dumps anything in the "C" drive? I have 3 partitions and run python on the 3rd one or "E"drive. My "C" drive is almost full and keeps loading up with stuff I don't want or need. Some of it I can find some not. S

Re: What is Expressiveness in a Computer Language

2006-06-19 Thread Dimitri Maziuk
Yet Another Dan sez: ... Requiring an array index to be an integer is considered a typing > problem because it can be checked based on only the variable itself, > whereas checking whether it's in bounds requires knowledge about the array. You mean like subtype MyArrayIndexType is INTEGER 7 ..

Re: What is Expressiveness in a Computer Language

2006-06-19 Thread Marshall
Chris Smith wrote: > Marshall <[EMAIL PROTECTED]> wrote: > > While I am quite sympathetic to this point, I have to say that > > this horse left the barn quite some time ago. > > I don't think so. Perhaps it's futile to go scouring the world for uses > of the phrase "dynamic type" and eliminating t

Re: [OT] code is data

2006-06-19 Thread Diez B. Roggisch
>> because lots of people know how to describe XML transformations, and >> there are plenty of tools that implement such transformations efficiently ? > > Efficiently enough for dynamic (runtime) use ? Using XML-transformation for AST manipulation isn't my first choice either - yet efficiency co

Re: code is data

2006-06-19 Thread Ravi Teja
Kay Schluehr wrote: > Ravi Teja wrote: > > > People have however written various language interpreters (Scheme, > > Forth and yes, even Basic) in Python, just for kicks. Still does not > > make it a DSL language anymore than it makes C a DSL language. > > > > At present, the closest thing to writin

Re: Seeking regex optimizer

2006-06-19 Thread Mirco Wahab
Thus spoke [EMAIL PROTECTED] (on 2006-06-19 22:51): > It uses Aho-Corasick for the implementation which is fast and does what > you expect it to do. Nor does it have a problem of matching more than > 99 possible strings as the regexp approach may have. If you pull the strings into (?>( ... )) (a

Re: Newbie Question

2006-06-19 Thread Saint Malo
Thanks! That helped a lot! Now, lets say that I just want to display one or just a few of the items and not the whole line. For example, the text file contains the following: red blue yello green purple brown If the program searches for blue, i just want it to print blue, not the whole line.

Re: code is data

2006-06-19 Thread Ravi Teja
BJörn Lindqvist wrote: > > > > community has no interest in it. When I absolutely need macros, I will > > > > go elsewhere. > > I *like* 1..5 (ada, ruby) instead of range(5). If I had macros, I would > > have done it myself for *my* code. > I think this example more is a symptom of a childish nee

Recommended way to fix core python distribution issues in your own apps?

2006-06-19 Thread Russell Warren
I've got a case where I need to tweak the implementation of a default python library due to what I consider to be an issue in the library. What is the best way to do this and make an attempt to remain compatible with future releases? My specific problem is with the clock used in the threading.Eve

Re: any subway web dev experiences

2006-06-19 Thread Gerhard Häring
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Fredrik Lundh wrote: > bruno at modulix wrote: > >> Nope - it's a Python MVC web framework. Like Django, Pylons and >> Turborgears. And FWIW, there have been recently some discussions about >> merging Subway and Turbogears. > > recently? was that be

Re: [pysqlite] memory-leak in pysqlite 2.3.0 ?

2006-06-19 Thread Gerhard Häring
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Gerhard Häring wrote: > Michael Husmann wrote: >>> Michael Husmann wrote: After upgrading from pysqlite 2.0.5 to pysqlite 2.3.0 writing into a sqlite database increases memory consumption heavily. A similar program with Ruby and sqlite-r

Re: Newbie Question

2006-06-19 Thread Andrew Robert
Saint Malo wrote: > I am new to programming, and I've chosen python to start with. I wrote > a simple program that asks several questions and assings each one of > them a variable via raw_input command. I then combined all the > variables into one like this a = b + c + d. After this I wrote these

Newbie Question

2006-06-19 Thread Saint Malo
I am new to programming, and I've chosen python to start with. I wrote a simple program that asks several questions and assings each one of them a variable via raw_input command. I then combined all the variables into one like this a = b + c + d. After this I wrote these values to a file. What I

Re: Active Python versions

2006-06-19 Thread Tom Del Rosso
Trent Mick <[EMAIL PROTECTED]> typed in news://[EMAIL PROTECTED], > Tom Del Rosso wrote: >> Why is the Windows msi install file for ActivePython-2.4.3.12 only >> 15MB whereas the older msi file for ActivePython-2.4.2.10 was 19MB? >> >> BTW, is that the prefered Python environment? > > Are you sure

Re: What is Expressiveness in a Computer Language

2006-06-19 Thread Chris Smith
Marshall <[EMAIL PROTECTED]> wrote: > While I am quite sympathetic to this point, I have to say that > this horse left the barn quite some time ago. I don't think so. Perhaps it's futile to go scouring the world for uses of the phrase "dynamic type" and eliminating them. It's not useless to p

Re: Seeking regex optimizer

2006-06-19 Thread andrewdalke
Kay Schluehr wrote: > I have a list of strings ls = [s_1,s_2,...,s_n] and want to create a > regular expression sx from it, such that sx.match(s) yields a SRE_Match > object when s starts with an s_i for one i in [0,...,n]. Why do you want to use a regex for this? When you have constant strings t

Re: Calling every method of an object from __init__

2006-06-19 Thread John Machin
On 20/06/2006 5:55 AM, Rob Cowie wrote: > Hi all, > > Is there a simple way to call every method of an object from its > __init__()? > > For example, given the following class, what would I replace the > comment line in __init__() with to result in both methods being called? > I understand that I

Re: Calling every method of an object from __init__

2006-06-19 Thread George Sakkis
Rob Cowie wrote: > Hi all, > > Is there a simple way to call every method of an object from its > __init__()? > > For example, given the following class, what would I replace the > comment line in __init__() with to result in both methods being called? > I understand that I could just call each me

Re: What is Expressiveness in a Computer Language

2006-06-19 Thread Marshall
Chris Smith wrote: > > Basically, I start objecting when someone starts comparing "statically > typed" and "dynamically typed" as if they were both varieties of some > general concept called "typed". They aren't. Furthermore, these two > phrases were invented under the misconception that that are

Re: Active Python versions

2006-06-19 Thread Trent Mick
Tom Del Rosso wrote: > Why is the Windows msi install file for ActivePython-2.4.3.12 only 15MB > whereas the older msi file for ActivePython-2.4.2.10 was 19MB? > > BTW, is that the prefered Python environment? Are you sure you are comparing the right packages? By my count: ActivePython-2.4.2.10-

Re: What is Expressiveness in a Computer Language

2006-06-19 Thread Chris Smith
Joe Marshall <[EMAIL PROTECTED]> wrote: > > Chris Smith wrote: > > > > Knowing that it'll cause a lot of strenuous objection, I'll nevertheless > > interject my plea not to abuse the word "type" with a phrase like > > "dynamically typed". > > Allow me to strenuously object. The static typing com

Re: Calling every method of an object from __init__

2006-06-19 Thread K.S.Sreeram
Rob Cowie wrote: > class Foo(object): > def __init__(self): > #call all methods here > def test(self): > print 'The test method' > def hello(self): > print 'Hello user' class Foo(object): def __init__(self): for k in dir(self) : if not k.

Re: Calling every method of an object from __init__

2006-06-19 Thread Tim Chase
> Is there a simple way to call every method of an object from its > __init__()? > > For example, given the following class, what would I replace the > comment line in __init__() with to result in both methods being called? > I understand that I could just call each method by name but I'm looking

Re: Legitimate use of the "is" comparison operator?

2006-06-19 Thread David Isaac
> > (I was using *small* integers). "Fredrik Lundh" <[EMAIL PROTECTED]> wrote: > "small integers" is what the phrase "small integers" in the "small > integers" and "small integers" parts of my reply referred too, of course. But aren't "*small* integers" likely to be smaller than "small integers

Re: What is Expressiveness in a Computer Language

2006-06-19 Thread Joe Marshall
Chris Smith wrote: > > Knowing that it'll cause a lot of strenuous objection, I'll nevertheless > interject my plea not to abuse the word "type" with a phrase like > "dynamically typed". Allow me to strenuously object. The static typing community has its own set of terminology and that's fine.

Calling every method of an object from __init__

2006-06-19 Thread Rob Cowie
Hi all, Is there a simple way to call every method of an object from its __init__()? For example, given the following class, what would I replace the comment line in __init__() with to result in both methods being called? I understand that I could just call each method by name but I'm looking for

Re: Using Komodo 3.5 - Setting breakpoints in multiple *.py files

2006-06-19 Thread Trent Mick
jeem wrote: > I am using ActiveState Komodo 3.5 to work on a large python 2.4 > application with an extensive UI... I am attempting to debug the > application and am setting breakpoints in 4 different *.py files.. > Breakpoints in the main file are working OK, but any breakpoints in > imported fil

Re: Overriding a function...

2006-06-19 Thread K.S.Sreeram
Marc 'BlackJack' Rintsch wrote: >> 2) Once I assign mymodule.test with override, will modules that >> imported my module *PRIOR* to the assignment get override, or will they >> keep the original function test()? > > They see the `override()` function. That depends on how the import was done. If

Re: What is Expressiveness in a Computer Language

2006-06-19 Thread Matthias Blume
Pascal Costanza <[EMAIL PROTECTED]> writes: > Matthias Blume wrote: >> "Rob Thorpe" <[EMAIL PROTECTED]> writes: >> >>> I don't think dynamic typing is that nebulous. I remember this being >>> discussed elsewhere some time ago, I'll post the same reply I did then >>> .. >>> >>> >>> A language is

Re: Amara installation

2006-06-19 Thread Rick Zantow
"tjreedy" <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > > <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> O/S WinXP Home >> Vsn of Python: 2.4 >> >> Wish to install Amara. Using amara-allinone-1.0.win32-py2.4.exe >> (2965KB) >> >> Forder structure before installation:

Re: What is Expressiveness in a Computer Language

2006-06-19 Thread Chris Smith
Pascal Costanza <[EMAIL PROTECTED]> wrote: > How does your definition exclude the trivial type system in which the > only typing judgment states that every expression is acceptable? It is not necessary to exclude that trivial type system. Since it is useless, no one will implement it. However,

Re: Overriding a function...

2006-06-19 Thread [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote: > Suppose I have this module `mymodule.py' - > > # mymodule.py - begin > def test(): > print "original" > # mymodule.py - end > > Now assume that I do this in some arbitrary module -> > > def override(): > print "test is overridden" > > import mymodule > mymodule.t

Re: Overriding a function...

2006-06-19 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote: > 1) If mymodule is subsequently imported, will my `override' function be > used, or will python magically `fix' (or break depending on your > perspective) mymodule and use the original mymodule.test function? It will not `fix` it. Importing an al

Re: Seeking regex optimizer

2006-06-19 Thread gry
Kay Schluehr wrote: > I have a list of strings ls = [s_1,s_2,...,s_n] and want to create a > regular expression sx from it, such that sx.match(s) yields a SRE_Match > object when s starts with an s_i for one i in [0,...,n]. There might > be relations between those strings: s_k.startswith(s_1) ->

Overriding a function...

2006-06-19 Thread [EMAIL PROTECTED]
Suppose I have this module `mymodule.py' - # mymodule.py - begin def test(): print "original" # mymodule.py - end Now assume that I do this in some arbitrary module -> def override(): print "test is overridden" import mymodule mymodule.test = override Two questions - 1) If mymodule is

Re: What is Expressiveness in a Computer Language

2006-06-19 Thread Pascal Costanza
Chris Smith wrote: > Pascal Costanza <[EMAIL PROTECTED]> wrote: >> Types can be represented at runtime via type tags. You could insist on >> using the term "dynamically tagged languages", but this wouldn't change >> a lot. Exactly _because_ it doesn't make sense in a statically typed >> setting,

Re: Python with Eclipse

2006-06-19 Thread Fabio Zadrozny
On 6/19/06, Philippe Martin <[EMAIL PROTECTED]> wrote: Dennis Benzinger wrote:> Stan Cook wrote:>> I've been trying to use Eclipse with Python on Linux for a while and>> have noticed something odd.  After running the code or debugging a few>> times, its responsiveness gets really bad.  Upon checkin

[ANN] PyYAML-3.03: YAML parser and emitter for Python

2006-06-19 Thread Kirill Simonov
Announcing PyYAML-3.03 A new bug-fix release of PyYAML is now available: http://pyyaml.org/wiki/PyYAML Changes === * Fix Python 2.5 compatibility issues. * Fix numerous bugs in the float handling. * Fix scanning some ill-formed documen

Re: Need Help comparing dates

2006-06-19 Thread Tim Chase
> I kept getting a Python error for the following line: > > month = m[webMonth] > > I changed it to month = month_numbers[webMonth] > > and that did the trick. Sorry for the confusion. Often when I'm testing these things, I'll be lazy and create an alias to save me the typing. In this case,

Re: What is Expressiveness in a Computer Language

2006-06-19 Thread Pascal Costanza
Matthias Blume wrote: > "Rob Thorpe" <[EMAIL PROTECTED]> writes: > >> I don't think dynamic typing is that nebulous. I remember this being >> discussed elsewhere some time ago, I'll post the same reply I did then >> .. >> >> >> A language is statically typed if a variable has a property - called

Re: copyfile avoiding overwrites and race conditions

2006-06-19 Thread [EMAIL PROTECTED]
Larry Bates wrote: > I guess my approach would be different. To eliminate any race > conditions, I would keep a small text file that always contained > the next filename that is to be written. Something like: > > nextfiletowrite=/path/filename006.dat > > I would try to get a lock on this file, r

Re: What is Expressiveness in a Computer Language

2006-06-19 Thread Matthias Blume
"Rob Thorpe" <[EMAIL PROTECTED]> writes: > I don't think dynamic typing is that nebulous. I remember this being > discussed elsewhere some time ago, I'll post the same reply I did then > .. > > > A language is statically typed if a variable has a property - called > it's type - attached to it, an

Re: Need Help comparing dates

2006-06-19 Thread colincolehour
I kept getting a Python error for the following line: month = m[webMonth] I changed it to month = month_numbers[webMonth] and that did the trick. Tim Chase wrote: > > I am new to Python and am working on my first program. I am trying to > > compare a date I found on a website to todays date.

Re: What is Expressiveness in a Computer Language

2006-06-19 Thread Yet Another Dan
Chris Smith <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > Rob Thorpe <[EMAIL PROTECTED]> wrote: >> A language is latently typed if a value has a property - called it's >> type - attached to it, and given it's type it can only represent >> values defined by a certain class. > > Now I def

Re: [OT] code is data

2006-06-19 Thread bruno at modulix
Fredrik Lundh wrote: > Laurent Pointal wrote: >> Bruno Desthuilliers wrote: >>> Anton Vredegoor wrote: The idea is to have a way to transform a Python (.py) module into XML and then do source code manipulations in XML-space using ElementTree. > >>> > >>> My my my... I'm not against th

Re: Python with Eclipse

2006-06-19 Thread Philippe Martin
Dennis Benzinger wrote: > Stan Cook wrote: >> I've been trying to use Eclipse with Python on Linux for a while and >> have noticed something odd. After running the code or debugging a few >> times, its responsiveness gets really bad. Upon checking the equivalent >> of the task manager, I find se

Re: What is Expressiveness in a Computer Language

2006-06-19 Thread Matthias Blume
George Neuner writes: > I am, however, going to ask what > information you think type inference can provide that substitutes for > algorithm or data structure exploration. Nobody wants to do such a substitution, of course. In /my/ experience, however, I find that doing algorithm and data struc

Re: Installing Python on Windows Vista

2006-06-19 Thread Padraig
[EMAIL PROTECTED] wrote: > Padraig wrote: > > Hi all, > > > > Just a quick question... when I try to install Python on Windows Vista > > Beta 2 the installer seems to hang after I select the destination > > folder, saying that it will "return when it has finished calculating > > disk space require

  1   2   >