ANN: numarray-1.3.2

2005-05-26 Thread Todd Miller
Numarray is an array processing package designed to efficiently manipulate large multi-dimensional arrays. Numarray is modelled after Numeric and features c-code generated from python template scripts, the capacity to operate directly on arrays in files, arrays of heterogeneous records, string

DFW Pythoneers' Coding Sprint This Saturday

2005-05-26 Thread Jeff Rush
The DFW Pythoneers meet, at nerdbooks.com (a local bookstore), with our laptops for hands-on Python programming on the 2nd and 4th Saturday of each month. As we progress, we'll be focusing on Extreme Programming techniques, re pair programming, version control, unit testing and so forth.

Re: Checking for a full house

2005-05-26 Thread Raymond Hettinger
Your use case for gathering roll statistics probably needs a more general solution: hands = { (1,1,1,1,1): 'nothing', (1,1,1,2): 'one pair', (1,2,2): 'two pair', (1,1,3): 'three of a kind', (2,3): 'full house', (1,4): 'four of a kind', (5): 'flush (five of a kind)' }

Re: Comparing 2 similar strings?

2005-05-26 Thread Roger Binns
[EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] ***Check out difflib, it's in the library.*** Perfect package for what the OP wants AFAICT. The method in difflib is okay, but doesn't do that good a job. It is also relatively slow. My need for this was matching records in BitPim (eg

Re: Running in Release or Debug version of the python interpreter?

2005-05-26 Thread Raphael Zulliger
Thanks for your answers! I prefer the proposal of Thomas Heller by using a small helper function like this: def IsDebugVersionRunning(): import imp for suffix in imp.get_suffixes(): if suffix[0] == '_d.pyd': return True return False

Re: evaluated function defaults: stored where?

2005-05-26 Thread alex23
David Isaac wrote: As a Python newbie I found this behavior quite surprising. It can be even more surprising if a default value is mutable: def foo(a, b=[]): ... b.append(a) ... return b foo(3,[1,2]) [1, 2, 3] foo('c',['a','b']) ['a', 'b', 'c'] foo(1) [1] So far, everything is

Strange Execution Times

2005-05-26 Thread curi42
I am running two functions in a row that do the same thing. One runs in .14 seconds, the other 56. I'm confused. I wrote another version of the program and couldn't get the slow behavior again, only the fast. I'm not sure what is causing it. Can anyone figure it out? Here is my code (sorry

Re: evaluated function defaults: stored where?

2005-05-26 Thread alex23
I wrote: (some guff on default parameters) Of course, it helps if I actually include the alternative function's code: def foo(a, b = None): ... if b == None: b = [] ... b.append(a) ... return b Sorry about that :) -alex23 -- http://mail.python.org/mailman/listinfo/python-list

Re: Checking for a full house

2005-05-26 Thread Paul Rubin
Raymond Hettinger [EMAIL PROTECTED] writes: Your use case for gathering roll statistics probably needs a more general solution: hands = { (1,1,1,1,1): 'nothing', (1,1,1,2): 'one pair', (1,2,2): 'two pair', (1,1,3): 'three of a kind', (2,3): 'full house', (1,4):

Re: __init__() not called automatically

2005-05-26 Thread Sakesun Roykiattisak
Does c++ call base class constructor automatically ?? If I'm not wrong, in c++ you also have to call base class constructor explicitly. Python just do not enforce the rule. You can leave it as desire. BTW, I've once been an C++ expert. Knowing python kill that skill. However, I'm not regret. I

Re: vim configuration for python

2005-05-26 Thread Gary Johnson
In comp.editors Leonard J. Reder [EMAIL PROTECTED] wrote: Hello, I am looking at configuring vim for Python. Most importantly I need 4 spaces when the tab is hit. I am searching and getting a bit confused. Does anyone know where I can find a set of ready made .vimrc and

Re: evaluated function defaults: stored where?

2005-05-26 Thread John Machin
David Isaac wrote: Default parameter values are evaluated once when the function definition is executed. Where are they stored? A good bet for where to start looking for the storage would be as an attribute of the function object. From this point, there are two paths: (a) Make a function and

Weekly Python Patch/Bug Summary

2005-05-26 Thread Kurt B. Kaiser
Patch / Bug Summary ___ Patches : 342 open ( +3) / 2839 closed ( +1) / 3181 total ( +4) Bugs: 936 open ( -2) / 4974 closed (+12) / 5910 total (+10) RFE : 189 open ( +2) / 159 closed ( +2) / 348 total ( +4) New / Reopened Patches __ optparse

Re: Improve the performance of a loop

2005-05-26 Thread Peter Otten
[EMAIL PROTECTED] wrote: What is the fastest way to code this particular block of code below.. I used numeric for this currently and I thought it should be really fast.. But, for large sets of data (bx and vbox) it takes a long time and I would like to improve. vbox = array(m) (size:

Re: Problem redirecting stdin on Windows

2005-05-26 Thread vincent wehren
aurora [EMAIL PROTECTED] schrieb im Newsbeitrag news:[EMAIL PROTECTED] | On Windows (XP) with win32 extension installed, a Python script can be | launched from the command line directly since the .py extension is | associated with python. However it fails if the stdin is piped or | redirected. |

Re: Checking for a full house

2005-05-26 Thread Raymond Hettinger
[Paul Rubin] 1. Flush means 5 cards of the same suit (i.e. all hearts), not 5 of a kind. More importantly, the (5) should be (5,). Also the poker terminology should be expressed in terms of dice rolls (the OP's use case). 2. That code doesn't detect flushes or straights. It also doesn't

Re: regexp for sequence of quoted strings

2005-05-26 Thread Paul McGuire
Ah, this is much better than my crude replace technique. I forgot about str.decode(). Thanks! -- Paul -- http://mail.python.org/mailman/listinfo/python-list

Re: Checking for a full house

2005-05-26 Thread flupke
Paul Rubin wrote: Raymond Hettinger [EMAIL PROTECTED] writes: Your use case for gathering roll statistics probably needs a more general solution: hands = { (1,1,1,1,1): 'nothing', (1,1,1,2): 'one pair', (1,2,2): 'two pair', (1,1,3): 'three of a kind', (2,3): 'full house',

Re: What are OOP's Jargons and Complexities?

2005-05-26 Thread alex goldman
John McGrath wrote: Unfortunately, there is no consensus as to what the term means. If the language allows the programmer to write programs from the 'slack' domain, by saying just trust me on this, then it's not strongly typed. What other meanings are there? I wasn't aware of the lack of

Writing a bytecode interpreter (for TeX dvi files)

2005-05-26 Thread Jonathan Fine
I'm writing some routines for handling dvi files. In case you didn't know, these are TeX's typeset output. These are binary files containing opcodes. I wish to write one or more dvi opcode interpreters. Are there any tools or good examples to follow for writing a bytecode interpreter? I am

Re: Just remember that Python is sexy

2005-05-26 Thread Ville Vainio
Peter == Peter Hansen [EMAIL PROTECTED] writes: Peter Sion Arrowsmith wrote: But can you come up with a method for remembering which way round str.find() and str.index() are? Peter Don't use str and you won't have anything to remember: Peter 'foo bar baz'.find('spam')

Re: Has ComboBox ctrl in Tkinter?

2005-05-26 Thread Martin Franklin
Cameron Laird wrote: In article [EMAIL PROTECTED], Fredrik Lundh [EMAIL PROTECTED] wrote: ÒÊÃÉɽÈË [EMAIL PROTECTED] wrote: i have not find the ComboBox in Tkinter,has it? where to get the doc about how to use combobox ctrl? the Tix add-on contains a combobox:

Re: What are OOP's Jargons and Complexities?

2005-05-26 Thread Pascal Costanza
alex goldman wrote: John McGrath wrote: Unfortunately, there is no consensus as to what the term means. If the language allows the programmer to write programs from the 'slack' domain, by saying just trust me on this, then it's not strongly typed. What other meanings are there? I wasn't

Re: evaluated function defaults: stored where?

2005-05-26 Thread Raymond Hettinger
Is it unsurprising if I look at it right? [John Machin's QOTW] Yes; in general this is true across many domains for a very large number of referents of it :-) There's a Quote of the Week in there somewhere. -- http://mail.python.org/mailman/listinfo/python-list

Re: Strange Execution Times

2005-05-26 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: I am running two functions in a row that do the same thing. One runs in .14 seconds, the other 56. I'm confused. I wrote another version of the program and couldn't get the slow behavior again, only the fast. I'm not sure what is causing it. Can anyone figure it

Re: __init__() not called automatically

2005-05-26 Thread Sriek
if i understand C++ right, in c++ you CAN explicitly call the base constructor ( for eg. if it requires some particular arguements ), but, the compiler automatically has to call the base class constructor ( see the rules for constructing an object of the derived classes ). But, yes, C++ can be

Re: __init__() not called automatically

2005-05-26 Thread Sriek
maybe like this: we can have the default behaviour as calling the default constructor ( with default arguements where required ). Along with this, keep the option open to call constructors explicitly. My only contention is that there may be a greater reason for this rule in the Python Language.

Re: Just remember that Python is sexy

2005-05-26 Thread Duncan Booth
Ville Vainio wrote: Peter == Peter Hansen [EMAIL PROTECTED] writes: Peter Sion Arrowsmith wrote: But can you come up with a method for remembering which way round str.find() and str.index() are? Peter Don't use str and you won't have anything to remember: Peter

compiling python code

2005-05-26 Thread Gabriele *Darkbard* Farina
Hi, I have a python file inside a zip file. I'd like to compile it and add the resulting .pyc file into the zip. I tryed reading the source and compiling it using compile(), but I don't know how to write .pyc file. Can someone give me some help? bye, gabriele --

Re: uploading files to a webdav SSL enabled server

2005-05-26 Thread Paul Boddie
rbt [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]... Has anyone used pure python to upload files to a webdav server over SSL? I have no control over the server. I can access it with all of the various webdav GUIs such as Konqueror, Cadaver, etc. by using a URL like this:

Point of Sale Use Cases

2005-05-26 Thread Andreas Pauley
Hi all, I've started writing use cases for my open source point of sale system (my first attempt at use cases). http://qualitypos.qbcon.com/ If anyone here has experience with either use cases or point of sale systems, feel free to comment or criticize. Regards, Andreas --

Re: using a com automation object (how do I avoid crash?)

2005-05-26 Thread Simon Brunning
On 5/25/05, James Carroll [EMAIL PROTECTED] wrote: I'm trying to call functions on an automation object, and I've run makepy to generate a wrapper, and 99% of the calls I make on the wrapper work great. my question is: Is my [''] * 10 as close as I can come to a variant array of

Re: how to import a module from a arbitraty path?

2005-05-26 Thread Simon Brunning
On 5/26/05, Andy Leszczynski [EMAIL PROTECTED] wrote: I have a program which is going to dynamicly load components from some arbitrary defined paths. How to do that? You can locate them with os.walk and fnmatch. Then you can temporarily add the directory to sys,path, and import using

Re: Strange Execution Times

2005-05-26 Thread John Machin
[EMAIL PROTECTED] wrote: I am running two functions in a row that do the same thing. 1. I see no functions here. You should set out a script like this: def main(): your_code_goes_here() if __name__ == '__main__': main() for two reasons (a) your code will be referring to locals

Re: SSL (HTTPS) with 2.4

2005-05-26 Thread Bloke
OK. I try pyopenssl and can get a secure socket to the server, but am unsure how to use this socket with urllib2 or even httplib. Here's the code I'm using: import sys, socket, string, base64, httplib from OpenSSL import SSL # Connects to the server, through the proxy def run(server, proxy):

Re: Checking for a full house

2005-05-26 Thread Raymond Hettinger
[Benedict] It would be interesting to see how complicated it would get to write code to detect the correct hands in poker with wildcards included. There is an interesting SF project with code written in C: http://pokersource.sourceforge.net/ In contrast, Python makes short work of these

Re: compiling python code

2005-05-26 Thread Fredrik Lundh
Gabriele *Darkbard* Farina wrote: I have a python file inside a zip file. I'd like to compile it and add the resulting .pyc file into the zip. I tryed reading the source and compiling it using compile(), but I don't know how to write .pyc file. Can someone give me some help? a PYC file

Re: win32clipboard.GetClipboardData() return string with null characters

2005-05-26 Thread Roger Upole
I don't get any extra characters. Do they always show up, or is it possible whatever application put the data on the clipboard put them there ? Roger . aurora [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I was using win32clipboard.GetClipboardData() to retrieve the Windows

assignment, references and list comprehension

2005-05-26 Thread Jim O'D
Hi everyone Was just posting a question as I got confused with a big messy sheaf of code when I thought I should make a simple example myself. Since I did I thought I'd post it for the good of mankind. I was confused as to whether the assignment of a result of a list comprehension created

ANN: blamehangle 0.1.0

2005-05-26 Thread Freddie
(sorry if this appears several million times, Australian usenet servers are useless, and Newshosting seems to hate me) blamehangle is Yet Another IRC Bot Framework. Started in 2003 as a replacement for a nasty perl monster, we're just now getting around to releasing it. Useful features

Re: __init__() not called automatically

2005-05-26 Thread Jeremy Sanders
On Wed, 25 May 2005 21:31:57 -0700, Sriek wrote: Similarly, why do we have to explicitly use the 'self' keyword everytime? I didn't like that when starting Python. Now when I look back at C++ code, I find it very hard to work out which variables and methods and members, and which are not,

Re: assignment, references and list comprehension

2005-05-26 Thread Fredrik Lundh
Jim O'D wrote: I was confused as to whether the assignment of a result of a list comprehension created references to the orginal objects... python never copies objects unless you tell it to, so the answer is yes. all the values you pass around are object references, not binary blobs. and it

Re: assignment, references and list comprehension

2005-05-26 Thread Jim O'D
trust me, it works the same way for all objects. Yes, it was lack of trust that led me on a 2 hour re-write to avoid creating subsets of object lists as I thought they were being copied. In fact it was another error... huh. I now know better. Jim --

Re: assignment, references and list comprehension

2005-05-26 Thread Jim O'D
reading this may help: http://effbot.org/zone/python-objects.htm /F site bookmarked ;) -- http://mail.python.org/mailman/listinfo/python-list

It's just a test.. sorry

2005-05-26 Thread ´º½º66
sorry -- http://mail.python.org/mailman/listinfo/python-list

It's just a test.. sorry

2005-05-26 Thread Äڳݴº½º
sorry -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem in Building a Simple EXE

2005-05-26 Thread Peter Hansen
ParE wrote: I wrote a small script which I have been trying to convert to an Executable. I have tried py2exe and McMillians. Both will convert it just fine but when I run it on a machine that does not have Python installed it will run the script twice. Any ideas on how I may fix this?

how to convert string to list or tuple

2005-05-26 Thread flyaflya
a = (1,2,3) I want convert a to tuple:(1,2,3),but tuple(a) return ('(', '1', ',', '2', ',', '3', ')') not (1,2,3) -- http://mail.python.org/mailman/listinfo/python-list

Re: how to import a module from a arbitraty path?

2005-05-26 Thread Peter Hansen
Simon Brunning wrote: On 5/26/05, Andy Leszczynski [EMAIL PROTECTED] wrote: I have a program which is going to dynamicly load components from some arbitrary defined paths. How to do that? You can locate them with os.walk and fnmatch. Then you can temporarily add the directory to

Re: What are OOP's Jargons and Complexities?

2005-05-26 Thread John McGrath
On 5/26/2005 at 3:11:44 AM, alex goldman wrote: What other meanings are there? http://en.wikipedia.org/wiki/Strongly_typed http://c2.com/cgi/wiki?StronglyTyped -- Regards, John McGrath -- http://mail.python.org/mailman/listinfo/python-list

Re: how to convert string to list or tuple

2005-05-26 Thread Simon Brunning
On 5/26/05, flyaflya [EMAIL PROTECTED] wrote: a = (1,2,3) I want convert a to tuple:(1,2,3),but tuple(a) return ('(', '1', ',', '2', ',', '3', ')') not (1,2,3) Short answer - use eval(). Long answer - *don't* use eval unless you are in control of the source of the string that you are

Re: urllib2 and SSL

2005-05-26 Thread rbt
flamesrock wrote: don't you need to install openSSL? I'm not sure. How does IE and Firefox handle SSL??? I didn't install anything for them to work. -- http://mail.python.org/mailman/listinfo/python-list

Re: Just remember that Python is sexy

2005-05-26 Thread Sion Arrowsmith
Duncan Booth [EMAIL PROTECTED] wrote: Ville Vainio wrote: Peter == Peter Hansen [EMAIL PROTECTED] writes: Peter Sion Arrowsmith wrote: But can you come up with a method for remembering which way round str.find() and str.index() are? Peter Don't use str and you won't have

Re: how to convert string to list or tuple

2005-05-26 Thread Fredrik Lundh
flyaflya [EMAIL PROTECTED] wrote: a = (1,2,3) I want convert a to tuple:(1,2,3),but tuple(a) return ('(', '1', ',', '2', ',', '3', ')') not (1,2,3) if you trust the source, use eval(a) if you don't trust it, you can use, say tuple(int(x) for x in re.findall(\d+, a)) or, perhaps

Access from one class to methode of other class

2005-05-26 Thread VK
Hi, all! In my programm i have to insert a variable from class 2 to class 1 and I get error NameError: global name 'd' is not defined. How do I get access to d.entry.insert() method of class 1 class 1: self.entry = Entry(self.entryframe) self.entry.pack() self.button =

Re: first release of PyPy

2005-05-26 Thread holger krekel
Hi Kay, On Mon, May 23, 2005 at 13:39 -0700, Kay Schluehr wrote: Does it mean You create an RPython object that runs on top of CPython, but is just an RPython facade wrapped around a CPython object? So You have four kinds of Pythons: RPy - translateable into LL code APy -

Re: __init__() not called automatically

2005-05-26 Thread John Roth
Sriek [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] hi, i come from a c++ background. i ws happy to find myself on quite familiar grounds with Python. But, what surprised me was the fact that the __init__(), which is said to be the equivlent of the constructor in c++, is not

Re: Checking for a full house

2005-05-26 Thread flupke
Raymond Hettinger wrote: [Benedict] It would be interesting to see how complicated it would get to write code to detect the correct hands in poker with wildcards included. There is an interesting SF project with code written in C: http://pokersource.sourceforge.net/ In contrast,

Re: Python Impact Analysis Tool ?

2005-05-26 Thread dcolford2000
Hi I am a mainframe designer/progrmmer. What I need is a tool that shows me at design time what links to what so that I can understand the application. When a design change comes through I could say OK this change affects only A, B, and C out of the whole alphanet. Then I would be able to isolate

Re: Python Impact Analysis Tool ?

2005-05-26 Thread Toby Dickenson
On Thursday 26 May 2005 13:46, [EMAIL PROTECTED] wrote: Hi I am a mainframe designer/progrmmer. What I need is a tool that shows me at design time what links to what so that I can understand the application. When a design change comes through I could say OK this change affects only A, B,

using timeit for a function in a class

2005-05-26 Thread flupke
Hi, i tried to use timeit on a function in a class but it doesn't do what i think it should do ie. time :) In stead it starts printing line after line of hello time test! What am i doing wrong in order to time the f function? class TimeTest(object): def f(self): print hello time

Re: Python Impact Analysis Tool ?

2005-05-26 Thread Mike Meyer
[EMAIL PROTECTED] writes: I am a mainframe designer/progrmmer. What I need is a tool that shows me at design time what links to what so that I can understand the application. When a design change comes through I could say OK this change affects only A, B, and C out of the whole alphanet. Then

Re: Access from one class to methode of other class

2005-05-26 Thread [EMAIL PROTECTED]
I don't know if your're actually calling the classes '1' and '2', but that's a really bad idea! class 2: def ins(self) d.entry.insert(variable) This is probably where you're getting the NameError. d is not defined, so calling d.entry will generate an error. Reidar --

Re: What are OOP's Jargons and Complexities?

2005-05-26 Thread Piet van Oostrum
Tassilo v. Parseval [EMAIL PROTECTED] (TvP) wrote: TvP Most often, languages with strong typing can be found on the functional TvP front (such as ML and Haskell). These languages have a dynamic typing TvP system. What do you mean with: 'Haskell has a dynamic typing system'? -- Piet van

Re: Access from one class to methode of other class

2005-05-26 Thread VK
I don't know if your're actually calling the classes '1' and '2', but that's a really bad idea! class 2: def ins(self) d.entry.insert(variable) This is probably where you're getting the NameError. d is not defined, so calling d.entry will generate an error. Reidar What

Re: how to import a module from a arbitraty path?

2005-05-26 Thread Maksim Kasimov
Andy Leszczynski wrote: I have a program which is going to dynamicly load components from some arbitrary defined paths. How to do that? A. import sys sys.path.append('/yourpath/libs') -- Best regards, Maksim Kasimov mailto: [EMAIL PROTECTED] --

File list from listdir or shell?

2005-05-26 Thread qwweeeit
Hi all, to obtain a file list from a dir you can use: import os, sys try: . sExtension=sys.argv[1] . sPath=sys.argv[2] except: . sExtension= . sPath='.' lF=os.listdir(sPath) # to remove from the list also the names of backup files lF=filter(lambda lF: '~' not in lF and sExtension in lF,lF)

Re: __init__() not called automatically

2005-05-26 Thread Dan Sommers
On 25 May 2005 21:31:57 -0700, Sriek [EMAIL PROTECTED] wrote: Similarly, why do we have to explicitly use the 'self' keyword everytime? Why do they (the C++ programmers) prepend m_ to otherwise perfectly good member names? Regards, Dan -- Dan Sommers http://www.tombstonezero.net/dan/ --

Re: __init__() not called automatically

2005-05-26 Thread Andrew Koenig
Sakesun Roykiattisak [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Does c++ call base class constructor automatically ?? If I'm not wrong, in c++ you also have to call base class constructor explicitly. In C++, if you don't call a base-class constructor (I am saying a rather

converting jpg to pdf

2005-05-26 Thread Raghul
Hi friends Is it possible to convert jpg to pdf in python. I need a program to convert jpg format file to pdf. Is there any sample or any library to do that? Pls guide me. Thanks in advance -- http://mail.python.org/mailman/listinfo/python-list

Re: converting jpg to pdf

2005-05-26 Thread Thomas Guettler
Am Thu, 26 May 2005 07:00:21 -0700 schrieb Raghul: Hi friends Is it possible to convert jpg to pdf in python. I need a program to convert jpg format file to pdf. Is there any sample or any library to do that? Pls guide me. Hi, import os os.system(convert foo.jpg foo.pdf)

Re: File list from listdir or shell?

2005-05-26 Thread Thomas Guettler
Am Thu, 26 May 2005 06:31:40 -0700 schrieb qwweeeit: Hi, ls -1 *.py (for the filenames only) or This can be done with the module glob of the standard library. HTH, Thomas -- Thomas Güttler, http://www.thomas-guettler.de/ -- http://mail.python.org/mailman/listinfo/python-list

Re: first release of PyPy

2005-05-26 Thread Anton Vredegoor
Carl Friedrich Bolz wrote: Rumors have it that the secret goal is being faster-than-C which is nonsense, isn't it? Maybe not. If one can call functions from a system dll (a la ctypes, some other poster already mentioned there was some investigation in this area) one can skip a layer of the

Re: urllib2 and SSL

2005-05-26 Thread rbt
flamesrock wrote: don't you need to install openSSL? I'm not sure. I don't understand why, but that fixes it. I used the OpenSSL binary from here: http://www.openssl.org/related/binaries.html Thanks for the tip... how *does* all of the other Win32 apps handle SSl w/o installing OpenSSL?

Re: Automatically populate and submit HTML Forms

2005-05-26 Thread erinhouston
These two blog entries might be of help to you. http://www.ishpeck.net/index.php?P=b1115239318ishpeck second half is at http://www.ishpeck.net/index.php?P=b1115225809ishpeck alex23 wrote: Hey rbt, You should take a look at mechanize: http://wwwsearch.sourceforge.net/mechanize/ One of its

Re: __init__() not called automatically

2005-05-26 Thread Steven Bethard
Sriek wrote: maybe like this: we can have the default behaviour as calling the default constructor ( with default arguements where required ). Along with this, keep the option open to call constructors explicitly. Ok, so here's another example: def init(self): print An __init__ method,

ANN: blamehangle 0.1.0

2005-05-26 Thread Freddie
(sorry if this appears several times, Australian usenet servers are atrocious) blamehangle is Yet Another IRC Bot Framework. Started in 2003 as a replacement for a nasty perl monster, we're just now getting around to releasing it. Useful features include: * Asynchronous HTTP client. * Threaded

Re: using timeit for a function in a class

2005-05-26 Thread Fredrik Lundh
flupke wrote: i tried to use timeit on a function in a class but it doesn't do what i think it should do ie. time :) In stead it starts printing line after line of hello time test! What am i doing wrong in order to time the f function? how do you expect timeit to figure out how long it takes

Re: __init__() not called automatically

2005-05-26 Thread Sri Charan
The compiler also calls the default arguement constructor automatically, if such a constructor is provided for the base class(es); but, this becomes a special case of what has been said by Andrew Koenig. So, it is NOT just the no arguement constructor that is automatically called; note that the

Re: __init__() not called automatically

2005-05-26 Thread Sri Charan
I guess you are right. -- http://mail.python.org/mailman/listinfo/python-list

Re: Automatically populate and submit HTML Forms

2005-05-26 Thread Grant Edwards
On 2005-05-25, rbt [EMAIL PROTECTED] wrote: How can I make a python client script connect to a Web server and automatically populate form fields and then submit the form? For example, say I wanted to check and see if 1924 was a leap year... how would I populate the 'year' field and then

Re: Automatically populate and submit HTML Forms

2005-05-26 Thread Grant Edwards
On 2005-05-26, Grant Edwards [EMAIL PROTECTED] wrote: How can I make a python client script connect to a Web server and automatically populate form fields and then submit the form? Just use urllib() and pass the form data to the urlopen() method. If given data, it will generate a POST

Re: vim configuration for python

2005-05-26 Thread DJK
Does anybody know of any scripts to check python syntax when you type :make? -- http://mail.python.org/mailman/listinfo/python-list

Re: Improve the performance of a loop

2005-05-26 Thread querypk
Actually slicing the way you suggested improved it to some extent. I did profile on this and I observed that it reduced the number of calls for __get_item__ and improved the timing to some extent. Which was useful to some extent. Thanks again. --

SCF Bundle released

2005-05-26 Thread Philippe C. Martin
Dear all, I am very happy to announce the release of SCFB: a python development toolkit for Smart Cards. SCFB comes with all necessary tools to easily get a Smart Card application running. SCFB also includes the necessary Smart Card and their software interface. SCFB is the tool we use to

Re: Python analog of Ruby on Rails?

2005-05-26 Thread bruno modulix
Christopher J. Bottaro wrote: bruno modulix wrote: (snip) Cool signature, can anyone do a Python one that I can leech? =) You mean this ?-) python -c print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for p in '[EMAIL PROTECTED]'.split('@')]) -- bruno desthuilliers python -c print

Re: Python analog of Ruby on Rails?

2005-05-26 Thread bruno modulix
George Sakkis wrote: Christopher J. Bottaro wrote: Cool signature, can anyone do a Python one that I can leech? =) -- C Here's the transliteration in python for your address: python -c print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for p in '[EMAIL

Re: Automatically populate and submit HTML Forms

2005-05-26 Thread rbt
Grant Edwards wrote: On 2005-05-25, rbt [EMAIL PROTECTED] wrote: How can I make a python client script connect to a Web server and automatically populate form fields and then submit the form? For example, say I wanted to check and see if 1924 was a leap year... how would I populate the

Re: __init__() not called automatically

2005-05-26 Thread bruno modulix
Paul McNett wrote: Sriek wrote: (snip) Similarly, why do we have to explicitly use the 'self' keyword everytime? This is closer to a wart, IMO, I've always explicitelly used the (implied) 'this' pseudo-pointer in Java, C++ etc. The wart is in all those languages that don't makes it

Re: Python analog of Ruby on Rails?

2005-05-26 Thread Shane Hathaway
George Sakkis wrote: Christopher J. Bottaro wrote: Cool signature, can anyone do a Python one that I can leech? =) -- C Here's the transliteration in python for your address: python -c print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for p in '[EMAIL

Re: __init__() not called automatically

2005-05-26 Thread Roy Smith
bruno modulix [EMAIL PROTECTED] wrote: I've always explicitelly used the (implied) 'this' pseudo-pointer in Java, C++ etc. The wart is in all those languages that don't makes it mandatory IMHO !-) And the correlary wart in Python is that the first argument to a method is not required to be

Re: Access from one class to methode of other class

2005-05-26 Thread bruno modulix
VK wrote: I don't know if your're actually calling the classes '1' and '2', but that's a really bad idea! class 2: def ins(self) d.entry.insert(variable) This is probably where you're getting the NameError. d is not defined, so calling d.entry will generate an error. What

Re: __init__() not called automatically

2005-05-26 Thread John Abel
bruno modulix wrote: Paul McNett wrote: Sriek wrote: (snip) Similarly, why do we have to explicitly use the 'self' keyword everytime? This is closer to a wart, IMO, Here's one of the shorter threads discussing 'self'. I remember one long running thread, but

Re: Access from one class to methode of other class

2005-05-26 Thread bruno modulix
VK wrote: Hi, all! In my programm i have to insert a variable from class 2 to class 1 and I get error NameError: global name 'd' is not defined. Looking at your code snippet, I think you have a lot of other errors before. class 1: self.entry = Entry(self.entryframe) NameError : self

Re: Just remember that Python is sexy

2005-05-26 Thread Duncan Booth
Sion Arrowsmith wrote: The name index implies it returns something you can use as an index to get at the substring. Unfortunately, -1 can of course be used as an index. Mind you, it would be perverse to expect to find the substring at it. That was my point. The returned index always points

Intellisense and the psychology of typing

2005-05-26 Thread andrew . queisser
Yesterday I typed in some C++ code that called a function with two ints. Intellisense (auto-complete) helpfully told me that the first formal parameter was called frontLight and the second ringLight. It occurred to me that I'm getting some semantic help here on top of the obvious type safety. It

Re: Access from one class to methode of other class

2005-05-26 Thread VK
VK wrote: Hi, all! In my programm i have to insert a variable from class 2 to class 1 and I get error NameError: global name 'd' is not defined. Looking at your code snippet, I think you have a lot of other errors before. class 1: self.entry = Entry(self.entryframe) NameError

Store doctest verbose results to a variable

2005-05-26 Thread mitchell
Is it possible to store doctest's verbose output to a variable? For example: import doctest, my_test_module a = doctest.testmod(my_test_module) The contents of 'a' is the tuple of passed and failed results. I tried passing verbose mode to the testmod function, but 'a' is still a tuple. Any

Re: Access from one class to methode of other class

2005-05-26 Thread Simon Brunning
On 5/26/05, VK [EMAIL PROTECTED] wrote: That is not real code, only dummy describing the problem We realise that. The problem is that there are problems in your dummy in addition to the real problems, and we can't tell them apart. -- Cheers, Simon B, [EMAIL PROTECTED],

Re: Access from one class to methode of other class

2005-05-26 Thread VK
On Thu, 26 May 2005 14:33:45 +0200, VK myname@example.invalid declaimed the following in comp.lang.python: Hi, all! In my programm i have to insert a variable from class 2 to class 1 and I get error NameError: global name 'd' is not defined. How do I get access to d.entry.insert() method

  1   2   >