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 doe

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', >>

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 c

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 alrea

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'

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 ther

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

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 too

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. t

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 r

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 -- http://mail.python.org/mailman

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 -- http://mail.pytho

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 pre

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 __impor

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 inst

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 co

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 Windo

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 refe

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 include:

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, unles

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. >

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 -- http://mail.python.org/mailman/lis

Re: assignment, references and list comprehension

2005-05-26 Thread Jim O'D
> reading this may help: > > http://effbot.org/zone/python-objects.htm > > > > > 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 th

Re: Just remember that Python is sexy

2005-05-26 Thread Peter Hansen
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 rememb

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

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 ev

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'

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, pe

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 = Button(comma

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 - non-tra

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

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

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,

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. Th

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 -- http://mai

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'? -- P

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. > >

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] -- http://mail.python.org/mailman/listinfo/

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

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" ra

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 hi

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 OpenSS

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

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__ met

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 da

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

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 de

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 th

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 "P

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. -- http://mail.python.org/mailman/listinfo/python-li

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 deve

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

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

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 popul

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 make

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

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 b

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 gen

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 lo

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

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

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. I

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.entryf

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], http://www.brunningonl

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

Re: Intellisense and the psychology of typing

2005-05-26 Thread [EMAIL PROTECTED]
my opinion is that if you find it useful, use it. if you don't then don't... either way, its up to you to decide what's useful and what's not. don't ask us. Try it out yourself. -- http://mail.python.org/mailman/listinfo/python-list

os independent way of seeing if an executable is on the path?

2005-05-26 Thread Steven Bethard
This has probably been answered before, but my Google skills have failed me so far... Is there an os independent way of checking to see if a particular executable is on the path? Basically what I want to do is run code like: i, o, e = os.popen3(executable_name) but I'd like to give an info

Majordomo results: {Filename?} HELLO

2005-05-26 Thread majordomo-owner
Warning: This message has had one or more attachments removed The command "Warning:" is invalid. Use the "help topics" command to see a list of valid commands. Discarded 3 line(s) of unrecognized text. Valid commands processed: 0 0 succeeded, 0 stalled, and 0 failed. Use the following c

[PATCH] add offset argument to mmap

2005-05-26 Thread Christopher Li
I am surprised to find out the mmap module in python always mmap from offset 0. So I just hack up some patch to allow it accept offset arguments. So here it is. Chris Add optional offset argument to mmap module. Test on linux with Python 2.4. The windows code is totally untested. Signed-Off-b

Re: Store doctest verbose results to a variable

2005-05-26 Thread Fredrik Lundh
"mitchell" <[EMAIL PROTECTED]> wrote: > 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

Re: File list from listdir or shell?

2005-05-26 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > Unluckily, to capture the stdout I have to redirect it to a file... > I hoped that this could work ... > lF=sys.stdin.readline(os.system("ls -1 *.py")) hint: look up "os.popen" and "subprocess" in the library reference. -- http://mail.python.org/mailman/listinfo/p

Re: [PATCH] add offset argument to mmap

2005-05-26 Thread Fredrik Lundh
Christopher Li wrote: > I am surprised to find out the mmap module in python always > mmap from offset 0. So I just hack up some patch to allow it > accept offset arguments. patches posted to the newsgroup are likely to be ignored or forgotten. patches posted to the patch tracker http://sou

Re: urllib2 and SSL

2005-05-26 Thread Paul Rubin
rbt <[EMAIL PROTECTED]> writes: > Thanks for the tip... how *does* all of the other Win32 apps handle > SSl w/o installing OpenSSL? Do they bundle it and only use it for > themselves? That seems foolish. Mozilla has its own SSL stack. IE uses one built into wininet, I think. -- http://mail.pytho

Re: converting jpg to pdf

2005-05-26 Thread Larry Bates
You use PIL (Python Imaging Library) if you want simple conversion or ReportLab if you want to combine several along with text, etc. -larry Raghul wrote: > 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

Re: Intellisense and the psychology of typing

2005-05-26 Thread Jason Gurtz
On 5/26/2005 12:31, [EMAIL PROTECTED] wrote: > 1) Intellisense is really just another crutch that does more harm than > good? To me I found the intellisense in VS for C++ was somewhat helpful in my earliest stage of learning where I had to look up how many args a function had. After a while, I

Re: os independent way of seeing if an executable is on the path?

2005-05-26 Thread Don
Steven Bethard wrote: > This has probably been answered before, but my Google skills have failed > me so far... > > Is there an os independent way of checking to see if a particular > executable is on the path? Basically what I want to do is run code like: > i, o, e = os.popen3(executable_n

[ANNOUNCE] Twenty-fifth release of PythonCAD now available

2005-05-26 Thread Art Haas
I'm pleased to announce the twenty-fifth development release of PythonCAD, a CAD package for open-source software users. As the name implies, PythonCAD is written entirely in Python. The goal of this project is to create a fully scriptable drafting program that will match and eventually exceed feat

Re: "...Learning with Python" ...a property that addition andmultiplication have...

2005-05-26 Thread GMane Python
The inablility to work with negative values. Addition can do the following: 5 + (-4) read as 5 plus the value negative four. Multiplication can do the following: 5 * (-1) read as 5 times the value negative one. String concatination can not subtract the sub-string 'lo' from 'hello'. 'hello' - 'l

Re: os independent way of seeing if an executable is on the path?

2005-05-26 Thread Trent Mick
> > In Windows, I can read the error file, and get something like: > > "'' is not recognized as an internal or external > > command,\noperable program or batch file.\n" > > and I'm sure I could parse this, but this seems fragile, and clearly os > > dependent. http://starship.python.net/crew/tmick/

  1   2   >