Re: Author of a Python Success Story Needs a Job!

2009-12-29 Thread Diez B. Roggisch
Please, if there is anyone out there who needs a highly creative and highly skilled software designer for new and completely original work, then for the love of God I implore you to contact me. You don't write if you are willing to relocate, and if yes, if outside the USA is an option. We hir

Re: (help)Tkinter, how to make labels scrolling?

2009-12-29 Thread Ren Wenshan
It works, Thank you very much. On Dec 28, 6:38 pm, Francesco Bochicchio wrote: > > Hi, > > if you want to realize an 'animated scrolling' effect, you need to > move the scrolling code out of the start callback > in a function which is called periodically by the GUI mainloop. In > Tkinter, you can

Re: Thanks for the help not given :)

2009-12-29 Thread Ben Finney
J writes: > And each time, I started writing a post, complete with code samples > and my thoughts... and in EVERY case, so far, I've found the answer on > my own ONLY after writing that post. > […] actually writing out a post helps me organize my thoughts, the > problem, and what I've done so fa

Re: How to write simple code to match strings?

2009-12-29 Thread beginner
Hi Steve, On Dec 30, 12:01 am, Steven D'Aprano wrote: > On Tue, 29 Dec 2009 21:01:05 -0800, beginner wrote: > > Hi All, > > > I run into a problem.  I have a string s that can be a number of > > possible things. I use a regular expression code like below to match and > > parse it. But it looks ve

Re: detect interactivity

2009-12-29 Thread Dave Angel
Steve Holden wrote: Roald de Vries wrote: On Dec 30, 2009, at 2:28 AM, Dave Angel wrote: Roald de Vries wrote: mehow define a different set of functions??? I'm using a database, and want to use python interactively to manipulate it. On the other hand, I also want to be

Re: TypeError: startView() takes exactly 1 argument (3 given)

2009-12-29 Thread Dave Angel
Ron Croonenberg wrote: Hello, I am trying to write a plugin for Rhythmbox in python and run into a 'strange' problem. For a method (an action for clicking a button) I started a method and however many arguments I use, it keeps giving me the same error: 'TypeError: startView() takes exactly

Re: How to write simple code to match strings?

2009-12-29 Thread Steven D'Aprano
On Tue, 29 Dec 2009 21:01:05 -0800, beginner wrote: > Hi All, > > I run into a problem. I have a string s that can be a number of > possible things. I use a regular expression code like below to match and > parse it. But it looks very ugly. Also, the strings are literally > matched twice -- once

Re: the need for 64 bits

2009-12-29 Thread Cameron Simpson
On 29Dec2009 21:42, Aahz wrote: | In article <8950e4a5-f630-4ffb-b7ed-5c539913a...@a6g2000yqm.googlegroups.com>, | Mensanator wrote: | >Ah, the 8 GB Mac wouldn't have helped. Glad I didn't spend the extra | >$1000. | | It's almost always cheaper to buy your Mac and then upgrade the RAM | separa

Re: Difference Between Two datetimes

2009-12-29 Thread Stephen Hansen
On Tue, Dec 29, 2009 at 7:21 AM, M.-A. Lemburg wrote: > If you want a more human readable, relative format use Age(): > > >>> Age(bree, nat) > 0x2b99c6e37ef0> > > i.e. 8 years, 4 months, 29 days, 49 minutes, 35 seconds. > That is... awesome. I use mx.DateTime all the time, and never knew about

Re: the need for 64 bits

2009-12-29 Thread Aahz
In article <8950e4a5-f630-4ffb-b7ed-5c539913a...@a6g2000yqm.googlegroups.com>, Mensanator wrote: > >Ah, the 8 GB Mac wouldn't have helped. Glad I didn't spend the extra >$1000. It's almost always cheaper to buy your Mac and then upgrade the RAM separately. -- Aahz (a...@pythoncraft.com)

Re: Python 2.6 ftplib has timeout parameter, but how to detect a timeout

2009-12-29 Thread Aahz
In article , Brendan wrote: > >I was quite happy to see that ftplib in Python 2.6 now has a timeout >parameter. With large file downloads my script would often hang, >presumably from timing out. Now that there is a timeout parameter, how >would I detect when a timeout occurs? Without looking at

Re: detect interactivity

2009-12-29 Thread Steven D'Aprano
On Wed, 30 Dec 2009 03:33:18 +0100, Roald de Vries wrote: > I'm using a database, and want to use python interactively to manipulate > it. On the other hand, I also want to be able to use it non- > interactively. In that case, it would be a waste of CPU to load the > function/class definitions mea

Re: detect interactivity

2009-12-29 Thread Steven D'Aprano
On Wed, 30 Dec 2009 03:26:20 +0100, Roald de Vries wrote: > On Dec 30, 2009, at 1:52 AM, Steven D'Aprano wrote: >> On Tue, 29 Dec 2009 16:09:58 +0100, Roald de Vries wrote: >> >>> Dear all, >>> >>> Is it possible for a Python script to detect whether it is running >>> interactively? It can be usef

How to write simple code to match strings?

2009-12-29 Thread beginner
Hi All, I run into a problem. I have a string s that can be a number of possible things. I use a regular expression code like below to match and parse it. But it looks very ugly. Also, the strings are literally matched twice -- once for matching and once for extraction -- which seems to be very s

Re: detect interactivity

2009-12-29 Thread Steve Holden
Roald de Vries wrote: > > On Dec 30, 2009, at 2:28 AM, Dave Angel wrote: > >> Roald de Vries wrote: >>> On Dec 29, 2009, at 8:34 PM, Dave Angel wrote: Antoine Pitrou wrote: > Le Tue, 29 Dec 2009 16:09:58 +0100, Roald de Vries a écrit : > > >> Dear all, >> >> Is it pos

TypeError: startView() takes exactly 1 argument (3 given)

2009-12-29 Thread Ron Croonenberg
Hello, I am trying to write a plugin for Rhythmbox in python and run into a 'strange' problem. For a method (an action for clicking a button) I started a method and however many arguments I use, it keeps giving me the same error: 'TypeError: startView() takes exactly 1 argument (3 given)' d

Re: Thanks for the help not given :)

2009-12-29 Thread J
On Tue, Dec 29, 2009 at 17:58, Phlip wrote: > To the OP - adding "... because Python sucks" to your subject lines will > increase the quantity of answers - but possibly not the quality. Unlike Stephan, I hope this was intended in humor/irony rather than the way it looks, because my OP was meant h

Re: detect interactivity

2009-12-29 Thread Roald de Vries
On Dec 30, 2009, at 2:28 AM, Dave Angel wrote: Roald de Vries wrote: On Dec 29, 2009, at 8:34 PM, Dave Angel wrote: Antoine Pitrou wrote: Le Tue, 29 Dec 2009 16:09:58 +0100, Roald de Vries a écrit : Dear all, Is it possible for a Python script to detect whether it is running interactivel

Re: I think I found a bug in Python 2.6.4 (in the inspect module)

2009-12-29 Thread inhahe
On Tue, Dec 29, 2009 at 6:38 PM, Irmen de Jong wrote: > On 29-12-2009 23:22, inhahe wrote: > > inspect.getargvalues is used on frames, not on regular code objects. > Maybe you were looking for inspect.getargspec? > That explains it! I knew I'd done this before, I was just looking at the wrong fun

Re: detect interactivity

2009-12-29 Thread Roald de Vries
On Dec 30, 2009, at 1:52 AM, Steven D'Aprano wrote: On Tue, 29 Dec 2009 16:09:58 +0100, Roald de Vries wrote: Dear all, Is it possible for a Python script to detect whether it is running interactively? It can be useful for e.g. defining functions that are only useful in interactive mode. Ah,

Re: detect interactivity

2009-12-29 Thread Dave Angel
Roald de Vries wrote: On Dec 29, 2009, at 8:34 PM, Dave Angel wrote: Antoine Pitrou wrote: Le Tue, 29 Dec 2009 16:09:58 +0100, Roald de Vries a écrit : Dear all, Is it possible for a Python script to detect whether it is running interactively? It can be useful for e.g. defining functions th

Re: detect interactivity

2009-12-29 Thread Steven D'Aprano
On Tue, 29 Dec 2009 16:09:58 +0100, Roald de Vries wrote: > Dear all, > > Is it possible for a Python script to detect whether it is running > interactively? It can be useful for e.g. defining functions that are > only useful in interactive mode. Ah, I should have looked more carefully at the do

Re: detect interactivity

2009-12-29 Thread Steven D'Aprano
On Tue, 29 Dec 2009 16:09:58 +0100, Roald de Vries wrote: > Dear all, > > Is it possible for a Python script to detect whether it is running > interactively? It can be useful for e.g. defining functions that are > only useful in interactive mode. Check __name__. It's set to '__main__' when runni

Re: Moving from PHP to Python. Is it Possible

2009-12-29 Thread Aaron Watters
Sancar wants to move from PHP to Python. The following a shameless plug for WHIFF: http://whiff.sourceforge.net -- I wrote it partially because I wanted PHP-like features using Python, but better ;). On Dec 11, 5:26 am, Sancar Saran wrote: > Greetings. > After 3 days of crawling google, div

Re: I think I found a bug in Python 2.6.4 (in the inspect module)

2009-12-29 Thread Irmen de Jong
On 29-12-2009 23:22, inhahe wrote: On Tue, Dec 29, 2009 at 5:11 PM, inhahe wrote: On Tue, Dec 29, 2009 at 5:10 PM, inhahe wrote: So i'm guessing that the attribute has been changed from func_code to f_code but the inspect module wasn't updated to reflect that. er i mean from f_code to fun

Re: I think I found a bug in Python 2.6.4 (in the inspect module)

2009-12-29 Thread Daniel Fetchinson
On 12/29/09, inhahe wrote: > Python 2.6.4 (r264:75708, Oct 26 2009, 08:23:19) [MSC v.1500 32 bit (Intel)] > on > win32 > Type "help", "copyright", "credits" or "license" for more information. import inspect def a(b=1): pass > ... inspect.getargvalues(a) > Traceback (most recent call

Re: detect interactivity

2009-12-29 Thread Roald de Vries
On Dec 29, 2009, at 8:34 PM, Dave Angel wrote: Antoine Pitrou wrote: Le Tue, 29 Dec 2009 16:09:58 +0100, Roald de Vries a écrit : Dear all, Is it possible for a Python script to detect whether it is running interactively? It can be useful for e.g. defining functions that are only useful in i

Re: Another Sets Problem

2009-12-29 Thread Emile van Sebille
On 12/29/2009 12:52 PM Victor Subervi said... On Tue, Dec 29, 2009 at 4:30 PM, Carsten Haese mailto:carsten.ha...@gmail.com>> wrote: You need to rethink your priorities. Understanding your code is a prerequisite, not a luxury. You keep saying that you'll get around to understanding yo

Re: Thanks for the help not given :)

2009-12-29 Thread Stefan Behnel
Phlip, 29.12.2009 23:58: And I hope you answered your questions here, if no one else did, to avoid dead search trails in the archives. You should have read the posting. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Thanks for the help not given :)

2009-12-29 Thread Phlip
To the OP - adding "... because Python sucks" to your subject lines will increase the quantity of answers - but possibly not the quality. You can also learn a little about good questions by answering others's here. And I hope you answered your questions here, if no one else did, to avoid dead

Re: Another Sets Problem

2009-12-29 Thread Stefan Behnel
Victor Subervi wrote: I'm using python 2.4.3 which apparently requires that I import Set: from sets import Set ... unless you use "set" instead of "Set". I've done this. In another script I successfully manipulated MySQL sets by so doing. Here's the code snippet from the script where I was a

Re: Which version of MSVC?90.DLL's to distribute with Python 2.6 based Py2exe executables?

2009-12-29 Thread David Bolen
Jonathan Hartley writes: > I guess I really need an installer. Oh well. This need not be that much of a hurdle. Several solutions exist such as Inno Setup (my personal preference), NSIS, etc... which are not hard to create a solid installer with. I suspect your end users will appreciate it too

Re: I think I found a bug in Python 2.6.4 (in the inspect module)

2009-12-29 Thread inhahe
On Tue, Dec 29, 2009 at 5:11 PM, inhahe wrote: > On Tue, Dec 29, 2009 at 5:10 PM, inhahe wrote: >> >> So i'm guessing that the attribute has been changed from func_code to >> f_code but the inspect module wasn't updated to reflect that. >> > > er i mean from f_code to func_code > f_locals doesn'

Re: I think I found a bug in Python 2.6.4 (in the inspect module)

2009-12-29 Thread inhahe
On Tue, Dec 29, 2009 at 5:10 PM, inhahe wrote: > > So i'm guessing that the attribute has been changed from func_code to > f_code but the inspect module wasn't updated to reflect that. > er i mean from f_code to func_code -- http://mail.python.org/mailman/listinfo/python-list

I think I found a bug in Python 2.6.4 (in the inspect module)

2009-12-29 Thread inhahe
Python 2.6.4 (r264:75708, Oct 26 2009, 08:23:19) [MSC v.1500 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import inspect >>> def a(b=1): pass ... >>> inspect.getargvalues(a) Traceback (most recent call last): File "", line 1, in File "C:\P

Re: Thanks for the help not given :)

2009-12-29 Thread Jon Clements
On Dec 29, 9:28 pm, a...@pythoncraft.com (Aahz) wrote: > In article , > > J   wrote: > > >So though I've only posted a small bit here and on python-win, I did > >want to thank y'all for helping me when you have, and even when you > >actually haven't! > > Get a teddybear, that helps, too.  ;-)  (I.e

Re: Moving from PHP to Python. Is it Possible

2009-12-29 Thread Robert Kern
On 2009-12-29 15:26 PM, Aahz wrote: In article<4b2602a0$0$30660$426a3...@news.free.fr>, Bruno Desthuilliers wrote: zeph a �crit : 4) It's better to collect all your eventual output into a string that you print Yuck ! Definitly one of the worst advises you could give. By all mean, *DONT* d

Re: Thanks for the help not given :)

2009-12-29 Thread Aahz
In article , J wrote: > >So though I've only posted a small bit here and on python-win, I did >want to thank y'all for helping me when you have, and even when you >actually haven't! Get a teddybear, that helps, too. ;-) (I.e. try to explain your problem to a teddybear.) -- Aahz (a...@pythoncr

Re: Moving from PHP to Python. Is it Possible

2009-12-29 Thread Aahz
In article <4b2602a0$0$30660$426a3...@news.free.fr>, Bruno Desthuilliers wrote: >zeph a écrit : >> >> 4) It's better to collect all your eventual output into a string that >> you print > >Yuck ! Definitly one of the worst advises you could give. > > >By all mean, *DONT* do that. Use a templating

Thanks for the help not given :)

2009-12-29 Thread J
I just wanted to take a break from writing some code to thank the list for all the help you've NOT given me :-) And I do mean that but I should explain... At least three times today, I've been working on various bits of code, and run into a problem that I just could not figure out. And each

Re: Python OOP Problem

2009-12-29 Thread Lie Ryan
On 12/29/2009 3:01 PM, Миклухо wrote: On 28 дек, 18:29, "Martin v. Loewis" wrote: In this case (you just started to learn Python), I recommend to take an explicit approach. Create a dictionary that maps class names to classes: name2class = { "MyObject" : MyObject, "MyOtherObjec

Re: clean data [was: Simple distributed example for learning purposes?]

2009-12-29 Thread Lie Ryan
On 12/29/2009 9:14 AM, Ethan Furman wrote: Lie Ryan wrote: On 12/28/2009 11:59 PM, Shawn Milochik wrote: With address data: one address may have suite data and the other might not the same city may have multiple zip codes why is that even a problem? You do put suite data and zipcode into diff

Re: Another Sets Problem

2009-12-29 Thread Victor Subervi
On Tue, Dec 29, 2009 at 4:30 PM, Carsten Haese wrote: > Victor Subervi wrote: > > On Tue, Dec 29, 2009 at 3:58 PM, Carsten Haese > > wrote: > > > > Victor Subervi wrote: > > > You know I did this before, substituting "f" for "field", and it > > honestly

Re: Cookies

2009-12-29 Thread Carsten Haese
Victor Subervi wrote: > Hi; > I have these lines: > > cookie = os.environ.get('HTTP_COOKIE') > if not cookie: > cookie = Cookie.SimpleCookie() > cExpires, cPath, cComment, cDomain, cMaxAge, cVersion = myCookie() > cookie['lastvisit'] = str(time.time()) > cookie['lastvisit']['ex

Re: Another Sets Problem

2009-12-29 Thread Carsten Haese
Victor Subervi wrote: > On Tue, Dec 29, 2009 at 3:58 PM, Carsten Haese > wrote: > > Victor Subervi wrote: > > You know I did this before, substituting "f" for "field", and it > honestly wouldn't print but threw a 500 error. Now it works. I don't > u

Re: Another Sets Problem

2009-12-29 Thread Victor Subervi
On Tue, Dec 29, 2009 at 3:58 PM, Carsten Haese wrote: > Victor Subervi wrote: > > You know I did this before, substituting "f" for "field", and it honestly > wouldn't print but threw a 500 error. Now it works. I don't understand. > > That's exactly why you keep running into strange problems. I str

Re: getting name of passed reference

2009-12-29 Thread Dave Angel
Joel Davis wrote: On Dec 29, 11:21 am, Emile van Sebille wrote: In an extremely controlled situation you may avoid headaches when deploying this kind of technique. Regardless, we all want to make you aware that this _will_ likely cause headaches, and, idle curiosity aside, none of us can

Re: Another Sets Problem

2009-12-29 Thread Carsten Haese
Victor Subervi wrote: > You know I did this before, substituting "f" for "field", and it honestly > wouldn't print but threw a 500 error. Now it works. I don't understand. That's exactly why you keep running into strange problems. I strongly urge you to learn to understand why your code does what

Re: getting name of passed reference

2009-12-29 Thread Martin P. Hellwig
Joel Davis wrote: I'm just curious if anyone knows of a way to get the variable name of a reference passed to the function. Put another way, in the example: def MyFunc ( varPassed ): print varPassed; MyFunc(nwVar) how would I get the string "nwVar" from inside of "MyFunc"? is it poss

Cookies

2009-12-29 Thread Victor Subervi
Hi; I have these lines: cookie = os.environ.get('HTTP_COOKIE') if not cookie: cookie = Cookie.SimpleCookie() cExpires, cPath, cComment, cDomain, cMaxAge, cVersion = myCookie() cookie['lastvisit'] = str(time.time()) cookie['lastvisit']['expires'] = cExpires cookie['lastvisit

Re: detect interactivity

2009-12-29 Thread Dave Angel
Antoine Pitrou wrote: Le Tue, 29 Dec 2009 16:09:58 +0100, Roald de Vries a écrit : Dear all, Is it possible for a Python script to detect whether it is running interactively? It can be useful for e.g. defining functions that are only useful in interactive mode. Try the isatty() metho

Re: Windows, IDLE, __doc_, other

2009-12-29 Thread W. eWatson
Lie Ryan wrote: On 12/29/2009 5:10 AM, W. eWatson wrote: Lie Ryan wrote: If you're on Windows, don't use the "Edit with IDLE" right-click hotkey since that starts IDLE without subprocess. Use the shortcut installed in your Start menu. When I go to Start and select IDLE, Saves or Opens want to

Re: getting name of passed reference

2009-12-29 Thread MRAB
Joel Davis wrote: On Dec 29, 11:21 am, Emile van Sebille wrote: On 12/29/2009 7:02 AM Joel Davis said... On Dec 29, 2:29 am, "Gabriel Genellina" wrote: I'm sure other limitations apply too -- don't rely on this technique for anything critical. -- Gabriel Genellina Gabriel, thanks for your i

Re: adding python engine into c++ application

2009-12-29 Thread griwes
Great thanks ;) I will try to combine cython and embedding python interpreter soon. -- http://mail.python.org/mailman/listinfo/python-list

ANN: Pymazon 0.1beta released.

2009-12-29 Thread Chris Colbert
I'm happy to announce the first beta release of Pymazon: a Python implemented alternative to the Amazon mp3 downloader. Pymazon was created specifically to alleviate the issues surrounding the Linux version of the Amazon mp3 downloader (though it should run just fine in Windows too). Pymazon can

Re: Which version of MSVC?90.DLL's to distribute with Python 2.6 based Py2exe executables?

2009-12-29 Thread Jonathan Hartley
On 29/12/2009 18:31, pyt...@bdurham.com wrote: Jonathan, I'm going to try to run vcredist_x86.exe automatically (as opposed to asking my users to download and run it manually). I don't currently have any installer, so I'm going to run vcredist_x86.exe on my application start-up. Some logic like

Re: Which version of MSVC?90.DLL's to distribute with Python 2.6 based Py2exe executables?

2009-12-29 Thread python
Jonathan, I'm going to try to run vcredist_x86.exe automatically (as opposed to asking my users to download and run it manually). I don't currently have any installer, so I'm going to run vcredist_x86.exe on my application start-up. Some logic like this seems to do this trick: if platform.sy

Re: getting name of passed reference

2009-12-29 Thread Joel Davis
On Dec 29, 11:21 am, Emile van Sebille wrote: > On 12/29/2009 7:02 AM Joel Davis said... > > > On Dec 29, 2:29 am, "Gabriel Genellina" > > wrote: > >> I'm sure other limitations apply too -- don't rely on this technique for > >> anything critical. > > >> -- > >> Gabriel Genellina > > > Gabriel, >

Re: How to iterate the input over a particular size?

2009-12-29 Thread John Posner
On Tue, 29 Dec 2009 01:35:41 -0500, Steven D'Aprano wrote: On Tue, 29 Dec 2009 00:49:50 -0500, John Posner wrote: On Sun, 27 Dec 2009 09:44:17 -0500, joy99 wrote: Dear Group, I am encountering a small question. Suppose, I write the following code, input_string=raw_input("PRINT A STRING:

Re: How to iterate the input over a particular size?

2009-12-29 Thread John Posner
On Tue, 29 Dec 2009 01:35:41 -0500, Steven D'Aprano wrote: On Tue, 29 Dec 2009 00:49:50 -0500, John Posner wrote: On Sun, 27 Dec 2009 09:44:17 -0500, joy99 wrote: Dear Group, I am encountering a small question. Suppose, I write the following code, input_string=raw_input("PRINT A STRING:

Re: How to iterate the input over a particular size?

2009-12-29 Thread John Posner
On Tue, 29 Dec 2009 01:35:41 -0500, Steven D'Aprano wrote: On Tue, 29 Dec 2009 00:49:50 -0500, John Posner wrote: On Sun, 27 Dec 2009 09:44:17 -0500, joy99 wrote: Dear Group, I am encountering a small question. Suppose, I write the following code, input_string=raw_input("PRINT A STRIN

Re: Another Sets Problem

2009-12-29 Thread Victor Subervi
On Tue, Dec 29, 2009 at 1:14 PM, Carsten Haese wrote: > Victor Subervi wrote: > > On Tue, Dec 29, 2009 at 12:54 PM, Carsten Haese > > wrote: > > > > Victor Subervi wrote: > > > Since it is difficult to send the inputs but easy to provide the > > > outpu

Re: getting name of passed reference

2009-12-29 Thread Stephen Hansen
On Tue, Dec 29, 2009 at 8:17 AM, Joel Davis wrote: > did set the tone and I think I've been more than a little tolerant on > this. Someone posts a question, responds back with a "n/m I found the > solution, here it is" and his response is essentially to berate them, > telling them how crappy their

PyCon Early Bird is Ending Soon!

2009-12-29 Thread VanL
Do you have a year-end hole in your training budget? Or will the improved economy let you finally attend a work conference? Come to sunny and warm Atlanta in February for PyCon 2010. Early bird registration ends on January 6. Register: https://us.pycon.org/2010/register/ See the talks: http://us.

Re: Another Sets Problem

2009-12-29 Thread Carsten Haese
Victor Subervi wrote: > On Tue, Dec 29, 2009 at 12:54 PM, Carsten Haese > wrote: > > Victor Subervi wrote: > > Since it is difficult to send the inputs but easy to provide the > > outputs, and as opposed to posting the printout, let me direct you >

Re: Another Sets Problem

2009-12-29 Thread Victor Subervi
On Tue, Dec 29, 2009 at 12:54 PM, Carsten Haese wrote: > Victor Subervi wrote: > > Since it is difficult to send the inputs but easy to provide the > > outputs, and as opposed to posting the printout, let me direct you here > > to see it first-hand: > > http://angrynates.com/cart/enterProducts2.py

Re: getting name of passed reference

2009-12-29 Thread Steve Holden
Joel Davis wrote: > On Dec 29, 10:08 am, Steve Holden wrote: >> Joel Davis wrote: >>> On Dec 29, 2:04 am, Steven D'Aprano >>> wrote: On Mon, 28 Dec 2009 19:28:32 -0800, Joel Davis wrote: > my thanks go out to Emile and Mr Hanson for their responses, I think > I've found the solution,

Re: Another Sets Problem

2009-12-29 Thread Carsten Haese
Victor Subervi wrote: > Since it is difficult to send the inputs but easy to provide the > outputs, and as opposed to posting the printout, let me direct you here > to see it first-hand: > http://angrynates.com/cart/enterProducts2.py?store=products All right, I've gone to that URL. Now what? I see

Re: Another Sets Problem

2009-12-29 Thread Victor Subervi
On Tue, Dec 29, 2009 at 12:21 PM, MRAB wrote: > Victor Subervi wrote: > > On Tue, Dec 29, 2009 at 6:29 AM, Jean-Michel Pichavant < >> jeanmic...@sequans.com > wrote: >> >>Matt Nordhoff wrote: >> >>Victor Subervi wrote: >> >>On Mon, Dec 28, 2

Re: Another Sets Problem

2009-12-29 Thread Victor Subervi
On Tue, Dec 29, 2009 at 12:15 PM, Carsten Haese wrote: > Victor Subervi wrote: > > Once again, it seems nobody is bothering to address this issue. Is it > > beyond your reach as it is beyond mine? I feel compelled to restate the > > problem once again as I did in my original post, and to once agai

Re: Which version of MSVC?90.DLL's to distribute with Python 2.6 based Py2exe executables?

2009-12-29 Thread Martin v. Loewis
>> However, this takes a few seconds to run. Is there a sensible way for >> me to only run this if the required DLL is not already installed? How >> should I be detecting that? Look at windows\winsxs\ >> Also: Will this work on 64 bit machines? Or do I not need to worry >> about that? If you shi

Re: Another Sets Problem

2009-12-29 Thread Steve Holden
Victor Subervi wrote: > On Tue, Dec 29, 2009 at 10:16 AM, Steve Holden > wrote: > > Victor Subervi wrote: > > On Tue, Dec 29, 2009 at 9:33 AM, Steve Holden > > >> wrot

Re: Another Sets Problem

2009-12-29 Thread Emile van Sebille
On 12/29/2009 5:51 AM Victor Subervi said... > # print 'XXX', types[x] > elif types[x][0:3] == 'set': > for f in field: > print 'AAA%s\n' % (field) > else: > print 'YYY'

Re: Another Sets Problem

2009-12-29 Thread MRAB
Victor Subervi wrote: On Tue, Dec 29, 2009 at 6:29 AM, Jean-Michel Pichavant mailto:jeanmic...@sequans.com>> wrote: Matt Nordhoff wrote: Victor Subervi wrote: On Mon, Dec 28, 2009 at 1:41 PM, MRAB mailto:pyt...@mrabarnett.plus.com>

Re: getting name of passed reference

2009-12-29 Thread Emile van Sebille
On 12/29/2009 7:02 AM Joel Davis said... On Dec 29, 2:29 am, "Gabriel Genellina" wrote: I'm sure other limitations apply too -- don't rely on this technique for anything critical. -- Gabriel Genellina Gabriel, thanks for your input, I had no idea that did that and it could have been deployed

Re: getting name of passed reference

2009-12-29 Thread Joel Davis
On Dec 29, 10:08 am, Steve Holden wrote: > Joel Davis wrote: > > On Dec 29, 2:04 am, Steven D'Aprano > > wrote: > >> On Mon, 28 Dec 2009 19:28:32 -0800, Joel Davis wrote: > >>> my thanks go out to Emile and Mr Hanson for their responses, I think > >>> I've found the solution, much shorter as well

Re: Another Sets Problem

2009-12-29 Thread Carsten Haese
Victor Subervi wrote: > Once again, it seems nobody is bothering to address this issue. Is it > beyond your reach as it is beyond mine? I feel compelled to restate the > problem once again as I did in my original post, and to once again post > the entire code. Hopefully someone will help me see my

Re: Another Sets Problem

2009-12-29 Thread MRAB
Victor Subervi wrote: On Mon, Dec 28, 2009 at 4:23 PM, Steve Holden > wrote: [snip] Boy, does it! It looks great...on paper. Here's some revised code to debug: # print 'XXX', types[x] elif types[x][0:3] == 'set': for f in

Re: Another Sets Problem

2009-12-29 Thread Victor Subervi
On Tue, Dec 29, 2009 at 10:16 AM, Steve Holden wrote: > Victor Subervi wrote: > > On Tue, Dec 29, 2009 at 9:33 AM, Steve Holden > > wrote: > > > > That's a bit like being told you have to produce something green, and > > then when you do, being told "no, not t

Re: getting name of passed reference

2009-12-29 Thread Steve Holden
Joel Davis wrote: > On Dec 29, 2:04 am, Steven D'Aprano > wrote: >> On Mon, 28 Dec 2009 19:28:32 -0800, Joel Davis wrote: >>> my thanks go out to Emile and Mr Hanson for their responses, I think >>> I've found the solution, much shorter as well: >>> > #!/usr/bin/python >>> > import traceba

Re: getting name of passed reference

2009-12-29 Thread Francesco Bochicchio
On 29 Dic, 00:54, Joel Davis wrote: > I'm just curious if anyone knows of a way to get the variable name of > a reference passed to the function. > > Put another way, in the example: > >   def MyFunc ( varPassed ): >      print varPassed; > >   MyFunc(nwVar) > > how would I get the string "nwVar"

Re: More On the Strange Problem

2009-12-29 Thread Albert van der Horst
In article <4b32881...@dnews.tpgi.com.au>, Lie Ryan wrote: >On 12/24/2009 8:00 AM, MRAB wrote: >> >> >>> print first_twin == second_twin >> True > >err... I don't think there is any situation where first_twin == >second_twin wouldn't be considered a bug. They look similar, they act >similar, and

Re: Which version of MSVC?90.DLL's to distribute with Python 2.6 based Py2exe executables?

2009-12-29 Thread Jonathan Hartley
On Dec 29, 2:24 pm, Jonathan Hartley wrote: > On Dec 27, 1:51 pm, pyt...@bdurham.com wrote: > > > > > Hi Martin, > > > > You'll need to include Microsoft.VC90.CRT.manifest and msvcr90.dll. > > > Thank you for your answers. From my research and testing on this topic: > > > 1. Can I safely place the

Re: detect interactivity

2009-12-29 Thread Antoine Pitrou
Le Tue, 29 Dec 2009 16:09:58 +0100, Roald de Vries a écrit : > Dear all, > > Is it possible for a Python script to detect whether it is running > interactively? It can be useful for e.g. defining functions that are > only useful in interactive mode. Try the isatty() method (*) on e.g. stdin: $

Re: Object Relational Mappers are evil (a meditation)

2009-12-29 Thread J Kenneth King
Steven D'Aprano writes: > On Wed, 23 Dec 2009 10:55:19 -0500, J Kenneth King wrote: > >> Steven D'Aprano writes: >> >>> On Mon, 21 Dec 2009 11:44:29 -0500, J Kenneth King wrote: >>> A programmer that lacks critical thinking is a bad programmer. The language they use has no beari

Re: Difference Between Two datetimes

2009-12-29 Thread M.-A. Lemburg
W. eWatson wrote: > According to one web source, this program: > > import datetime > bree = datetime.datetime(1981, 6, 16, 4, 35, 25) > nat = datetime.datetime(1973, 1, 18, 3, 45, 50) > > difference = bree - nat > print "There were", difference, "minutes between Nat and Bree" > > yields: > Ther

detect interactivity

2009-12-29 Thread Roald de Vries
Dear all, Is it possible for a Python script to detect whether it is running interactively? It can be useful for e.g. defining functions that are only useful in interactive mode. Kind regards, Roald -- http://mail.python.org/mailman/listinfo/python-list

Re: getting name of passed reference

2009-12-29 Thread Joel Davis
On Dec 29, 2:29 am, "Gabriel Genellina" wrote: > En Tue, 29 Dec 2009 00:28:32 -0300, Joel Davis   > escribió: > > > > > On Dec 28, 9:37 pm, Joel Davis wrote: > > my thanks go out to Emile and Mr Hanson for their responses, I think > > I've found the solution, much shorter as well: > > >     > #!

Re: getting name of passed reference

2009-12-29 Thread Joel Davis
On Dec 29, 2:04 am, Steven D'Aprano wrote: > On Mon, 28 Dec 2009 19:28:32 -0800, Joel Davis wrote: > > my thanks go out to Emile and Mr Hanson for their responses, I think > > I've found the solution, much shorter as well: > > >     > #!/usr/bin/python > > >     > import traceback > > >     > def

Re: Which version of MSVC?90.DLL's to distribute with Python 2.6 based Py2exe executables?

2009-12-29 Thread Jonathan Hartley
On Dec 27, 1:51 pm, pyt...@bdurham.com wrote: > Hi Martin, > > > You'll need to include Microsoft.VC90.CRT.manifest and msvcr90.dll. > > Thank you for your answers. From my research and testing on this topic: > > 1. Can I safely place these 2 files in the same folder as my Py2exe > generated EXE fi

Re: Python OOP Problem

2009-12-29 Thread Миклухо
On Dec 29, 7:35 pm, Laszlo Nagy wrote: > > Thanks for reply, but it doesn't fit to my task. If I will add later > > other objects(and it will be very often) - I should stop the service, > > but that would be very bad. > > I think you meant "if you add other classes".> I'm not sure, if this is > s

python interface to Yahoo groups?

2009-12-29 Thread guthrie
I'm looking for something to monitor & download yahoo group messages using Python, similar to the Perl module WWW::Yahoo::Groups. I've seen a few comments (speculations?) that Yahoo groups uses Python code, but couldn't find any examples of samples of such access tools. Any references or pointers

Re: Another Sets Problem

2009-12-29 Thread Steve Holden
Victor Subervi wrote: > On Tue, Dec 29, 2009 at 9:33 AM, Steve Holden > wrote: > > That's a bit like being told you have to produce something green, and > then when you do, being told "no, not that green, a light green". So you > produce something a lighter

Re: adding python engine into c++ application

2009-12-29 Thread Stefan Behnel
griwes, 29.12.2009 12:25: Hello, I am going to write an application in C++, application which should be easy to extend by scripts. I chose python for script language in this application. I'd like to have own API for python. And here the question arises: how do I implement a python engine within a

Re: Another Sets Problem

2009-12-29 Thread Victor Subervi
On Tue, Dec 29, 2009 at 9:33 AM, Steve Holden wrote: > That's a bit like being told you have to produce something green, and > then when you do, being told "no, not that green, a light green". So you > produce something a lighter gree and then being told "no, a slightly > redder green". And so on

Re: Difference Between Two datetimes

2009-12-29 Thread Steve Holden
W. eWatson wrote: > Peter Otten wrote: >> W. eWatson wrote: >> >>> This is quirky. >>> >>> >>> t1=datetime.datetime.strptime("20091205_221100","%Y%m%d_%H%M%S") >>> >>> t1 >>> datetime.datetime(2009, 12, 5, 22, 11) >>> >>> type(t1) >>> >>> >>> >>> t1: 2009-12-05 22:11:00 >>> >>> but in the pr

Re: Python OOP Problem

2009-12-29 Thread Laszlo Nagy
Thanks for reply, but it doesn't fit to my task. If I will add later other objects(and it will be very often) - I should stop the service, but that would be very bad. I think you meant "if you add other classes". I'm not sure, if this is solution, but test passed: myimportmod = __import__(

Re: Another Sets Problem

2009-12-29 Thread Steve Holden
Victor Subervi wrote: > On Mon, Dec 28, 2009 at 4:23 PM, Steve Holden > wrote: > > There is only one way for the piece of code you quote to print nothing > (unless you suspect a bug in the Python interpreter, but the probability > of that is so low compared

Re: Another Sets Problem

2009-12-29 Thread Victor Subervi
On Tue, Dec 29, 2009 at 6:29 AM, Jean-Michel Pichavant < jeanmic...@sequans.com> wrote: > Matt Nordhoff wrote: > >> Victor Subervi wrote: >> >> >>> On Mon, Dec 28, 2009 at 1:41 PM, MRAB >> > wrote: >>> >>> DON'T USE BARE EXCEPTS! (There are 2 in yo

Re: subprocess returncode is masked

2009-12-29 Thread Steve Holden
Emmanuel wrote: > MRAB wrote : >> Emmanuel wrote: >>> I'm using Python 2.6 and the new subprocess module to get the exit >>> value of an external executable. It appears the return value given by >>> wait() or poll() operations is masked under Unix: I only get the >>> lower 8 bits. So an exit value

  1   2   >