Re: Problem redirecting stdin on Windows

2005-05-25 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: Improve the performance of a loop

2005-05-25 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

Weekly Python Patch/Bug Summary

2005-05-25 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: evaluated function defaults: stored where?

2005-05-25 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 a

Re: vim configuration for python

2005-05-25 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 ~/.vim/syn

Re: __init__() not called automatically

2005-05-25 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: Checking for a full house

2005-05-25 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', >

Re: evaluated function defaults: stored where?

2005-05-25 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

Strange Execution Times

2005-05-25 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 it

Re: evaluated function defaults: stored where?

2005-05-25 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, eve

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

2005-05-25 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: Comparing 2 similar strings?

2005-05-25 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

Re: Checking for a full house

2005-05-25 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)' } d

Re: Checking for a full house

2005-05-25 Thread Raymond Hettinger
[mwdsmith] > Below is my code for checking for a full house (when rolling > with 5 dice). There are many ways to do this. Here's one: .def isfullHouse(hand): .counts = [hand.count(card) for card in set(hand)] .return (3 in counts) and (2 in counts) and len(hand)==5 And here's a one-lin

Re: __init__() not called automatically

2005-05-25 Thread Steven Bethard
Paul McNett wrote: > Sriek wrote: >> 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 automatically called. > [snip]

Re: urllib2 and SSL

2005-05-25 Thread flamesrock
don't you need to install openSSL? I'm not sure. -- http://mail.python.org/mailman/listinfo/python-list

Re: evaluated function defaults: stored where?

2005-05-25 Thread Raymond Hettinger
[Alan Isaac] > Default parameter values are evaluated once when the function definition is > executed. Where are they stored? >>> def f(a, b=10, c=20): . pass >>> f.func_defaults (10, 20) > Where is this documented? http://docs.python.org/ref/types.html#l2h-78 Raymond Hettinger --

Re: __init__() not called automatically

2005-05-25 Thread Sriek
Tim pointed out rightly that i missed out the most crucial part of my question. i should have said that __init__() is not called automatically only for the inheritance hierarchy. we must explicitly call all the base class __init__() fuctions explicitly. i wanted a reason for that. Thanks Tim. --

Re: __init__() not called automatically

2005-05-25 Thread Paul McNett
Sriek wrote: > 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 automatically called. What do you mean by automati

Re: __init__() not called automatically

2005-05-25 Thread Tim Leslie
On 25 May 2005 21:31:57 -0700, Sriek <[EMAIL PROTECTED]> wrote: > 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 a

__init__() not called automatically

2005-05-25 Thread Sriek
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 automatically called. I'm sure there must be ample reason for this. I would

win32clipboard.GetClipboardData() return string with null characters

2005-05-25 Thread aurora
I was using win32clipboard.GetClipboardData() to retrieve the Windows clipboard using code similar to the message below: http://groups-beta.google.com/group/comp.lang.python/msg/3722ba3afb209314?hl=en Some how I notice the data returned includes \0 and some characters that shouldn't be there

Design problem...need some ideas

2005-05-25 Thread Mudcat
Howdy, I'm trying to create a selection helper, just like in Google or other places where a drop-down menu appears below the text selection box when you enter some text. As you type, the choices are narrowed based on the characters entered. I have everything worked out but the actual menu which i

evaluated function defaults: stored where?

2005-05-25 Thread David Isaac
Default parameter values are evaluated once when the function definition is executed. Where are they stored? (A guess: in a dictionary local to the function.) Where is this documented? As a Python newbie I found this behavior quite surprising. Is it common in many other languages? Is it unsurpris

Re: Q: "...Learning with Python" ...a property that addition and multiplication have...

2005-05-25 Thread Dan Sommers
On 25 May 2005 17:23:45 -0700, [EMAIL PROTECTED] wrote: > I'm reading "How to think like a computer scientist: Learning with > Python" and there's a question regarding string operations. The > question is, "Can you think of a property that addition and > multiplication have that string concatenati

urllib2 and SSL

2005-05-25 Thread rbt
urllib2 handles https request flawlessly on my Linux machines, but errors out on Windows like this: PythonWin 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on win32. Portions Copyright 1994-2004 Mark Hammond ([EMAIL PROTECTED]) - see 'Help/About PythonWin' for further copyright i

Re: Checking for a full house

2005-05-25 Thread Robert Kern
Tony Meyer wrote: > [Tony Meyer] > >>>def isfullHouse(roll): >>>return len(set(roll)) != 2 > > [Robert Kern] > >>[1, 1, 1, 1, 2] is not a full house. > > Opps. I did say it was untested (that should have been == not !=, too). > What about: > > def isfullHouse(roll): > return len(set(r

Re: Python Impact Analysis Tool ?

2005-05-25 Thread Stephen Prinster
Paul McNett wrote: > Terry Hancock wrote: > >> On Wednesday 25 May 2005 08:27 am, [EMAIL PROTECTED] wrote: >> >>> Is there an impact analysis tool out there that can cross reference >>> python -- VB has a couple of these tools (eg. Visual Expert) >> >> >> I could be wrong, but my first impression

RE: Checking for a full house

2005-05-25 Thread Tony Meyer
[Tony Meyer] >> def isfullHouse(roll): >> return len(set(roll)) != 2 [Robert Kern] > [1, 1, 1, 1, 2] is not a full house. Opps. I did say it was untested (that should have been == not !=, too). What about: def isfullHouse(roll): return len(set(roll)) == 2 and roll.count(min(roll)) != 1

Re: Checking for a full house

2005-05-25 Thread Roy Smith
"mwdsmith" <[EMAIL PROTECTED]> wrote: > Hi, I'm new to python, and I'm not sure if this is the place to post > this kind of question; so feel free to tell me if I should take this > elsewhere. Well, that depends. Are we doing your homework assignment for you? :-) > So, to start me off on python,

Re: Python analog of Ruby on Rails?

2005-05-25 Thread George Sakkis
"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 PROTECTED]'.split('@')])" Cheer

Problem redirecting stdin on Windows

2005-05-25 Thread aurora
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. Assume there is an echo.py that read from stdin and echo the input. Launc

Re: Checking for a full house

2005-05-25 Thread Robert Kern
Tony Meyer wrote: > def isfullHouse(roll): > return len(set(roll)) != 2 [1, 1, 1, 1, 2] is not a full house. -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter -- http://mail.python.org/mailm

how to import a module from a arbitraty path?

2005-05-25 Thread Andy Leszczynski
I have a program which is going to dynamicly load components from some arbitrary defined paths. How to do that? A. -- http://mail.python.org/mailman/listinfo/python-list

RE: Checking for a full house

2005-05-25 Thread Tony Meyer
> def removeAll(element, num2Rem, list): > l = list[:] > for num in range(0, num2Rem): > l.remove(element) > return l > > def isfullHouse(roll): > for die in range(1,7): > if roll.count(die)==3: > l = removeAll(die, 3, roll) > if l[0]==l[1]:

Re: Checking for a full house

2005-05-25 Thread Robert Kern
mwdsmith wrote: > Hi, I'm new to python, and I'm not sure if this is the place to post > this kind of question; so feel free to tell me if I should take this > elsewhere. > > So, to start me off on python, I decided to put together a little > script to test the probabilities of rolling certain com

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

2005-05-25 Thread Terry Reedy
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Greetings. > > I'm reading "How to think like a computer scientist: Learning with > Python" and there's a question regarding string operations. The > question is, "Can you think of a property that addition and > multiplication have tha

Checking for a full house

2005-05-25 Thread mwdsmith
Hi, I'm new to python, and I'm not sure if this is the place to post this kind of question; so feel free to tell me if I should take this elsewhere. So, to start me off on python, I decided to put together a little script to test the probabilities of rolling certain combinations of dice. Below is

Re: Automatically populate and submit HTML Forms

2005-05-25 Thread alex23
Hey rbt, You should take a look at mechanize: http://wwwsearch.sourceforge.net/mechanize/ One of its listed features is 'Easy HTML form filling, using ClientForm interface'. A more recent option which came up on this group a few days ago is twill: http://www.idyll.org/~t/www-tools/twill.html tw

Re: Q: "...Learning with Python" ...a property that addition and multiplication have...

2005-05-25 Thread Greg Ewing
[EMAIL PROTECTED] wrote: > "Can you think of a property that addition and > multiplication have that string concatenation and repetition do not?" Existence of inverses? E.g. the additive inverse of 3 is -3, but there are no "concatenative inverses" of strings. (BTW, I would consider this more ab

Re: Q: "...Learning with Python" ...a property that addition and multiplication have...

2005-05-25 Thread [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote: > Greetings. > > I'm reading "How to think like a computer scientist: Learning with > Python" and there's a question regarding string operations. The > question is, "Can you think of a property that addition and > multiplication have that string concatenation and repetiti

Re: Using properties

2005-05-25 Thread alex23
[EMAIL PROTECTED] wrote: > Thanks for the help. I now understand it better. As Bruno points out, I > really don't need a property in this case, as my attribute is public, > and I will remove it. Should you need it to be a property at a latter date, it's worth noting that you can achieve what you w

how to accomplish dl progress bars?

2005-05-25 Thread flamesrock
Certain web applications, everything from wget to downloader for X has this nifty feature I'd like to accomplish in python. Its the progress bar/time elapsed/time remaining scheme Filename | Progress| Speed (kB/s) | T/Elapsed | T/Remaining

Re: vim configuration for python

2005-05-25 Thread Stephen Thorne
On 26/05/05, 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 ~/.vim/syntax

Q: "...Learning with Python" ...a property that addition and multiplication have...

2005-05-25 Thread jeffbernstein
Greetings. I'm reading "How to think like a computer scientist: Learning with Python" and there's a question regarding string operations. The question is, "Can you think of a property that addition and multiplication have that string concatenation and repetition do not?" I thought it was the comm

Re: setting up scipy in windows

2005-05-25 Thread hawkesed
Thanks to both you guys. I got scipy up and running yesterday. Here are the steps I went through: 1. I un-installed some non-official pythons. (Plone and ActiveState) 2. I loaded STANDARD Python 2.3.5 3. I loaded Python for Windows extensions. 4. I Loaded Numeric 5. Loaded SCIPY 6. Tested it by typ

Re: vim configuration for python

2005-05-25 Thread Simon Percivall
I don't know if the binary editions include the Misc directory, but if you download the Python source you'll find a directory called Misc. In it, there's a vimrc file. -- http://mail.python.org/mailman/listinfo/python-list

Re: vim configuration for python

2005-05-25 Thread haihui guo
I think you can do set tabstop=4 also, it's better to set expandtab so, the tab will be expanded as space. HG On Wed, 25 May 2005 16:36:04 -0700, Leonard J. Reder <[EMAIL PROTECTED]> wrote: > Hello, > > I am looking at configuring vim for Python. Most importantly I > need 4 spaces when the

Re: pyvm -- faster python

2005-05-25 Thread Stelios Xanthakis
Hi Michael [...] > > Releasing open source means that people *may* fix their own bugs, or > abandon the code. [...] I agree with all the points made. Moreover let me add that "code is one expression of a set of good ideas", and ideas want to be free! ;) I've decided to release the source code

vim configuration for python

2005-05-25 Thread Leonard J. Reder
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 ~/.vim/syntax/python.vim. If could find c.vim and cpp.vim these would be useful a

Re: What are OOP's Jargons and Complexities?

2005-05-25 Thread David Formosa (aka ? the Platypus)
On Tue, 24 May 2005 09:16:02 +0200, Tassilo v. Parseval <[EMAIL PROTECTED]> wrote: > Also sprach John W. Kennedy: [...] > Most often, languages with strong typing can be found on the functional > front (such as ML and Haskell). These languages have a dynamic typing > system. I haven't yet come ac

Re: Improve the performance of a loop

2005-05-25 Thread Steven Bethard
[EMAIL PROTECTED] wrote: > vbox = array(m) (size: 1000x1000 approx) > for b in bx: > vbox[ b[1], b[0]:b[2] ] = 0 > vbox[ b[3], b[0]:b[2] ] = 0 > vbox[ b[1]:b[3], b[0] ] = 0 > vbox[ b[1]:b[3], b[2] ] = 0 This may not help, but you could try to minimize the number of times you call

Re: regexp for sequence of quoted strings

2005-05-25 Thread Steven Bethard
Paul McGuire wrote: text = r"'the','dog\'s','bite'" def unquote(s,l,t): > > ... t2 = t[0][1:-1] > ... return t2.replace("\\'","'") > ... Note also, that the codec 'string-escape' can be used to do what's done with str.replace in this example: py> s "'the','dog\\'s','bite'" py> s

Re: import cx_Oracle fails!

2005-05-25 Thread Daniel
Hi Bernard My system is a PA 8K series with 4096 MB and 2 processors, running 64 bit mode OS. I only created the recipe above after 1 week of mistakes :-), but I don't know if it will work with your branch of patches @ 11.23 version. I really hate HP-UX >-(, god bless BSD!!! :-D -- http://mai

Improve the performance of a loop

2005-05-25 Thread querypk
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: 1000x1000 approx) for b in bx: vbo

Re: regexp for sequence of quoted strings

2005-05-25 Thread Paul McGuire
Pyparsing includes some built-in quoted string support that might simplify this problem. Of course, if you prefer regexp's, I'm by no means offended! Check out my Python console session below. (You may need to expand the unquote method to do more handling of backslash escapes.) -- Paul (Downloa

py2exe problems with win32com [ EnsureDispatch('ADODB.Connection') ]

2005-05-25 Thread list . repository
Problem: Works fine when running python test.py but fails when executing test.exe. test.py: conn = win32com.client.gencache.EnsureDispatch('ADODB.Connection') conn.Open("Provider='SQLOLEDB';Data Source='.';Initial Catalog='mydatabase';User ID='user';Password='pwd';") . . . setup.py:(same KeyEr

Re: SSL (HTTPS) with 2.4

2005-05-25 Thread pyguy2
After failed attempts at trying to get my code to work with squid. I did some research into this and came up with some info. http://www.python.org/peps/pep-0320.txt "- It would be nice if the built-in SSL socket type could be used for non-blocking SSL I/O. Currently packages such as Twisted wh

Re: regexp for sequence of quoted strings

2005-05-25 Thread Alexander Schmolck
gry@ll.mit.edu writes: > I have a string like: > {'the','dog\'s','bite'} > or maybe: > {'the'} > or sometimes: > {} > > [FYI: this is postgresql database "array" field output format] > > which I'm trying to parse with the re module. > A single quoted string would, I think, be: > r"\{'([^']|\\'

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

2005-05-25 Thread James Carroll
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-allocated empty strings? I'm trying to call a function called E

Re: Python Impact Analysis Tool ?

2005-05-25 Thread Paul McNett
Terry Hancock wrote: > On Wednesday 25 May 2005 08:27 am, [EMAIL PROTECTED] wrote: > >>Is there an impact analysis tool out there that can cross reference >>python -- VB has a couple of these tools (eg. Visual Expert) > > I could be wrong, but my first impression is that that must be > VB jargon

Re: Tkinter Text Question

2005-05-25 Thread Fredrik Lundh
James Stroud wrote: > Thank you Fredrik, this worked beautifully. I had no idea about the "@" > prefix. Incidentally, I had to change the code to > > w.index("@%s,%s" % (e.x, e.y)) > > Maybe the x,y is a python 2.4 thing. no, it's a think-before-cutting-and-pasting thing. should have been "@%d,%

Re: regexp for sequence of quoted strings

2005-05-25 Thread Steven Bethard
gry@ll.mit.edu wrote: > I have a string like: > {'the','dog\'s','bite'} > or maybe: > {'the'} > or sometimes: > {} > [snip] > > I want to end up with a python array of strings like: > > ['the', "dog's", 'bite'] > > Any simple clear way of parsing this in python would be > great; I just assume

Re: Has ComboBox ctrl in Tkinter?

2005-05-25 Thread Cameron Laird
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: > >http://docs.python.org/lib/node72

Re: Tkinter Text Question

2005-05-25 Thread James Stroud
Thank you Fredrik, this worked beautifully. I had no idea about the "@" prefix. Incidentally, I had to change the code to w.index("@%s,%s" % (e.x, e.y)) Maybe the x,y is a python 2.4 thing. I'm still stuck in 2.3. James On Wednesday 25 May 2005 12:18 am, Fredrik Lundh wrote: > w.index("@x,y"

Re: Python analog of Ruby on Rails?

2005-05-25 Thread Christopher J. Bottaro
bruno modulix wrote: > Christopher J. Bottaro wrote: >> Hello fellow Pythonists, >> Is there such a thing? > > As what ? > Oops, sorry, the question is in the subject... May be helpful to repeat > it in the body. > > You may want to have a look at Subway Cool, that looks like what I'm looking

Re: Python Impact Analysis Tool ?

2005-05-25 Thread Terry Hancock
On Wednesday 25 May 2005 08:27 am, [EMAIL PROTECTED] wrote: > Is there an impact analysis tool out there that can cross reference > python -- VB has a couple of these tools (eg. Visual Expert) I could be wrong, but my first impression is that that must be VB jargon for something we might know unde

regexp for sequence of quoted strings

2005-05-25 Thread gry
I have a string like: {'the','dog\'s','bite'} or maybe: {'the'} or sometimes: {} [FYI: this is postgresql database "array" field output format] which I'm trying to parse with the re module. A single quoted string would, I think, be: r"\{'([^']|\\')*'\}" but how do I represent a *sequence* of

Re: Using properties

2005-05-25 Thread Terry Reedy
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Thanks for the help. I now understand it better. As Bruno points out, I > really don't need a property in this case, as my attribute is public, > and I will remove it. As much to the point is that your name attribute is static in the

Re: Where do I find the dispatch name?

2005-05-25 Thread James Carroll
I looked through all the IIDs in: PythonWin, Tools, COM Object Browser, RegisteredCategories, Automation Objects. After looking through all the IIDs I saw one that looked like it might work... and it did. -Jim On 5/25/05, James Carroll <[EMAIL PROTECTED]> wrote: > I just ran makepy to cre

Re: namespaces in eval(): spot error in 3 line program

2005-05-25 Thread Terry Reedy
"pasa" <[EMAIL PROTECTED]> wrote in message > Do functions carry their own pointer to global namespace, > which gets defined at function compile time, or what is > happening here? To expand on Just's answer: For lexical scoping -- resolution of globals in the definition context -- some refer

Automatically populate and submit HTML Forms

2005-05-25 Thread rbt
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 submit it for processing? I have no control of the

Re: Pyro2.3 problem

2005-05-25 Thread Irmen de Jong
Golawala, Moiz M (GE Infrastructure) wrote: > Hi All, > > I am seeing some interesting behavior with Pyro 2.3. I created a server using > Pyro2.2 > and a client on a different machine with Python2.2 and communication was just > fine (I > am not using a Name server). However when I upgraded the c

Pyro2.3 problem

2005-05-25 Thread Golawala, Moiz M (GE Infrastructure)
Hi All, I am seeing some interesting behavior with Pyro 2.3. I created a server using Pyro2.2 and a client on a different machine with Python2.2 and communication was just fine (I am not using a Name server). However when I upgraded the client to Pyro2.3 (the server was sill on Pyro2.2) and tr

Where do I find the dispatch name?

2005-05-25 Thread James Carroll
I just ran makepy to create a wrapper for my com object, and it generated the wrapper with the CLSID.py under site-packages/win32com/gen_py/ Now, I'm trying to figure out how to invoke it. How do I figure out what string to give Dispatch? For instance: xl = win32com.client.Dispatch("Excel.Applic

Re: Using properties

2005-05-25 Thread tkpmep
Thanks for the help. I now understand it better. As Bruno points out, I really don't need a property in this case, as my attribute is public, and I will remove it. Thomas Philips -- http://mail.python.org/mailman/listinfo/python-list

Re: Unusable outer edge of Tkinter canvases?

2005-05-25 Thread Dave Opstad
In article <[EMAIL PROTECTED]>, "Fredrik Lundh" <[EMAIL PROTECTED]> wrote: > to fix this, you can either set the border width to zero, add scrollbars > to the widget (this fixes the coordinate system), or explicitly reset the > coordinate system: > > w.xview_moveto(0) > w.yview_moveto(0)

Re: Python analog of Ruby on Rails?

2005-05-25 Thread bruno modulix
Christopher J. Bottaro wrote: > Hello fellow Pythonists, > Is there such a thing? As what ? Oops, sorry, the question is in the subject... May be helpful to repeat it in the body. You may want to have a look at Subway > My work is thinking of maybe experimenting with > Ruby on Rails for some

Python analog of Ruby on Rails?

2005-05-25 Thread Christopher J. Bottaro
Hello fellow Pythonists, Is there such a thing? My work is thinking of maybe experimenting with Ruby on Rails for some lesser projects. Naturally, I wonder if Python can do as good a job or better... Thanks for the info, -- C -- http://mail.python.org/mailman/listinfo/python-list

Re: namespaces in eval(): spot error in 3 line program

2005-05-25 Thread Just
In article <[EMAIL PROTECTED]>, "pasa" <[EMAIL PROTECTED]> wrote: > I'm an old time python user, but just got bitten by namespaces in eval. > If this is an old discussion somewhere, feel free to point me there. > > Based on the documentation, I would have expected the following to > work: > > d

Re: Trouble with regexes

2005-05-25 Thread Fredrik Lundh
Fernando Rodriguez wrote: > I'm trying to write a regex that matches a \r char if and only if it > is not followed by a \n (I want to translate text files from unix > newlines to windows\dos). Unix uses \n and Windows uses \r\n, so matching lone \r isn't going to help you the slighest... (read on

Re: IRIX MipsPro compiler chokes on Python.h

2005-05-25 Thread Bram Stolk
Andrew MacIntyre wrote: > My suspicion would be directed to a #define that is incorrect, as the > snippet above suggests that select() appears in two system headers > (/usr/include/sys/time.h & /usr/include/unistd.h). thanks for the info. I need to undef the following from my pyconfig.h to make i

Re: Unusable outer edge of Tkinter canvases?

2005-05-25 Thread Fredrik Lundh
Dave Opstad wrote: > When drawing rectangles in Tkinter canvases I've noticed the outer edges > (say 3-5 pixels) don't always draw. For instance, try typing this in an > interactive session (Terminal in OS X or Command Prompt in Windows XP): > > >>> import Tkinter as T > >>> root = T.Tk() > >>> f

RE: Build error Python 2.4.1 - stat problem?

2005-05-25 Thread Brandt, Servatius
Hello, I found the solution of my problems. The configure script decided to switch on large file support, but the #defines set in pyconfig.h caused an inconsistency between the stat function calls (32 bit versions) and the stat structures used (64 bit versions). After I switched off the large fi

ReWrite Request Within SocketServer?

2005-05-25 Thread John Abel
Hi! I may be missing something simple, but is there a way to have verify_request change the request before it gets processed by the RequestHandlerClass? Regards J -- http://mail.python.org/mailman/listinfo/python-list

Re: pygame 1.6 for windows (python2.4)

2005-05-25 Thread bc
Got it! Thank you so much for your much appreciated help. Bill Carey -- http://mail.python.org/mailman/listinfo/python-list

Trouble with regexes

2005-05-25 Thread Fernando Rodriguez
Hi, I'm trying to write a regex that matches a \r char if and only if it is not followed by a \n (I want to translate text files from unix newlines to windows\dos). I tried this, but it doesn't work: p = re.compile(r'(\r)[^\n]', re.IGNORECASE) it still matches a string such as r'\r\n' -- http:

namespaces in eval(): spot error in 3 line program

2005-05-25 Thread pasa
I'm an old time python user, but just got bitten by namespaces in eval. If this is an old discussion somewhere, feel free to point me there. Based on the documentation, I would have expected the following to work: def foo(k): print k; print a ns = {'a':1, 'foo': foo} eval('foo(2)', ns) But it d

Unusable outer edge of Tkinter canvases?

2005-05-25 Thread Dave Opstad
When drawing rectangles in Tkinter canvases I've noticed the outer edges (say 3-5 pixels) don't always draw. For instance, try typing this in an interactive session (Terminal in OS X or Command Prompt in Windows XP): >>> import Tkinter as T >>> root = T.Tk() >>> f = T.Frame(root) >>> f.grid() >>

Re: Using properties

2005-05-25 Thread bruno modulix
[EMAIL PROTECTED] wrote: > I have a class with a name attribute, which I want to modify using > property.The following code works just fine: > > class Portfolio(object): > > def __init__( self, name="Port1"): > self.name=name This may not do what you think it does (see below) > >

Problem in Building a Simple EXE

2005-05-25 Thread ParE
Hello, 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? Paras

Re: Using properties

2005-05-25 Thread Leif K-Brooks
[EMAIL PROTECTED] wrote: > name=property(getname,setname,None,None) > > However, it no longer works if I modify getname and setname to > > def getname(self): > return self.name > > def setname(self,newname="Port2"): > self.name=newname That's because you're actually

Re: Using properties

2005-05-25 Thread Terry Reedy
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >I have a class with a name attribute, which I want to modify using > property.The following code works just fine: > > class Portfolio(object): > >def __init__( self, name="Port1"): >self.name=name > >def getname(self): >

distutils, install_data and RPM distributions

2005-05-25 Thread bwooster47
I have a simple python script that I need to create a kit for, and it has one config file. This is for Unix only, and very restricted use, so here's my relevant setup.py: setup(., scripts=['myscript.py'], data_files=[('/etc', ['myscript.cfg'])],...) My problem is that when I repeatedly

ºô­¶±H¦sªA°È­p¹º¶R¤Q°e¤G..............................................................................................................................................................................................................................................................................................

2005-05-25 Thread dsafl
UHOSTNET.COM [EMAIL PROTECTED] ²{±À¥X¥þ·sÀu´f ªA°È­p¹º¶R¤Q°e¤G¡A¤Z¹wú¤Q­Ó¤ëªA°È¤ë¶O¡A¦h°e¨â­Ó¤ë¡C ²{§Y¥Ñ¨ä¥¦¤½¥qÂà¥Î§Ú­Ì¡A§Y¦h°e±z¤T­Ó¤ëªA°È¡C (¥ô¦ó°ì¦WÂಾ) ¤ä´© PHP+MySQL, Access+ASP, ASP.NET, CGI, SSI ¹q¶l¯f¬r¹LÂo, ©U§£¹q¶l¹LÂo ¤Î WebMail µ¥.. ¥»¤ë§C«e¥Ó½ÐW1000§Y°e­º¦¸¦w¸ËÁʪ«¨®µ{¦¡ os

Re: Localized Type Inference of Atomic Types in Python

2005-05-25 Thread Blake Garretson
On 5/24/05, Brett C. <[EMAIL PROTECTED]> wrote: My thesis, "Localized Type Inference of Atomic Types in Python", wassuccessfully defended today for my MS in Computer Science at the CaliforniaPolytechnic State University, San Luis Obispo.  With that stamp of approval I am releasing it to the world. 

Re: uploading files to a webdav SSL enabled server

2005-05-25 Thread Peter Hansen
rbt wrote: > Has anyone used pure python to upload files to a webdav server over SSL? We were not using SSL at the time (since it wasn't supported in standard Python, as I recall), but we successfully used the webdav client that was part of Zope a few years ago. I suspect you could adapt it to

Re: Parsing XML - Newbie help

2005-05-25 Thread Fredrik Lundh
"rh0dium" wrote: > Ok so up to here I am ok. I find ( If you want the full xml let me > know) two blocks of system memory. It MUST be "System Memory" only. > Now how do I get a list of all of the children "nodes" of this. They > are named bank:N ( i.e bank:0, bank:1 etc [see below] ). For eac

Re: python24.zip

2005-05-25 Thread Scott David Daniels
Dieter Maurer wrote: > "Martin v. Löwis" <[EMAIL PROTECTED]> writes on Sun, 22 May 2005 21:24:41 > +0200: >>... >>>The application was Zope importing about 2.500 modules >>>from 2 zip files "zope.zip" and "python24.zip". >>>This resulted in about 12.500 opens -- about 4 times more >>>than would be

uploading files to a webdav SSL enabled server

2005-05-25 Thread rbt
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: webdavs://dav.hostname.com/user_name/uploads My goal is to upload files a

  1   2   >