[Tutor] registering itunes with events

2006-11-17 Thread Orri Ganel
Hello all, As I mentioned in my recent emails, I've been working on a program that will display the currently playing iTunes track (for example, when iTunes is minimized to the system tray so that you don't have to enlarge it again just to see the name of the song). Unfortunately, of the hundreds

Re: [Tutor] Tutor Digest, Vol 33, Issue 67

2006-11-17 Thread Alan Gauld
"Danny Yoo" <[EMAIL PROTECTED]> wrote >> Note that this call will create a new name list inside the >> recursive >> call. You probably need to do: >> >> name += ListRegistryKeys(item) > > > Mutating the list while iterating over it is possibly bad. I'd go so far as to say almost certai

Re: [Tutor] problem with defining a global class instance

2006-11-17 Thread Alan Gauld
"sharath B N" <[EMAIL PROTECTED]> wrote > i am sort of newbie to python. I am trying to do a super Market > simulation with OOP in python. I have problems with using a class > instance as global... > def generate (... ,,...) > > " in this function i define the global variables " > global stoc

Re: [Tutor] registering itunes with events

2006-11-17 Thread Alan Gauld
"Orri Ganel" <[EMAIL PROTECTED]> wrote > been fruitless. My best guess is something along the lines of: > > iTunes = > win32com.client.gencache.EnsureDispatch("iTunes.Application") > iTunesEvents = win32com.client.WithEvents(iTunes, > iTunesEventHandler) > > where iTunesEventHandler is a class

[Tutor] problem with defining a global class instance

2006-11-17 Thread sharath B N
hi, i am sort of newbie to python. I am trying to do a super Market simulation with OOP in python. I have problems with using a class instance as global... def generate (... ,,...) " in this function i define the global variables " global stock,stockManager, manager etc. class Manager ... .

Re: [Tutor] registering itunes with events

2006-11-17 Thread Orri Ganel
Alan Gauld wrote: >"Orri Ganel" <[EMAIL PROTECTED]> wrote > > > >>been fruitless. My best guess is something along the lines of: >> >>iTunes = >>win32com.client.gencache.EnsureDispatch("iTunes.Application") >>iTunesEvents = win32com.client.WithEvents(iTunes, >>iTunesEventHandler) >> >>where i

[Tutor] Read the builtin module source, also itchy ellipses.

2006-11-17 Thread Thomas
Hi, I sometimes find it useful to read the source code of a module and for example I can type string.__file__ to find the location of the string module. However the .__file__ method is not available for the module builtin. Is it possible to read the source code for built in functions and if so h

Re: [Tutor] Read the builtin module source, also itchy ellipses.

2006-11-17 Thread Kent Johnson
Thomas wrote: > Hi, > > I sometimes find it useful to read the source code of a module and for > example I can type string.__file__ to find the location of the string > module. > > However the .__file__ method is not available for the module builtin. Is > it possible to read the source code

Re: [Tutor] OT: Vim was: free IDE for Python?

2006-11-17 Thread Mike Hansen
From: [EMAIL PROTECTED] on behalf of [EMAIL PROTECTED] Sent: Thu 11/16/2006 10:32 PM To: [EMAIL PROTECTED] Cc: tutor@python.org Subject: Re: [Tutor] OT: Vim was: free IDE for Python? Hi Alan, Greetings. Alan Gauld wrote: >> I have to chuckle when you

[Tutor] python CRM ERP

2006-11-17 Thread Picio
Hello, Can you point me to some CRM and ERP software written in Python, that in your "guru" opinion is a good product? Maybe also Open Source? Thanks Picio ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] OT: Vim was: free IDE for Python?

2006-11-17 Thread William O'Higgins Witteman
On Fri, Nov 17, 2006 at 11:02:18AM +0530, [EMAIL PROTECTED] wrote: >What the settings of ppl using vim for python? A few Python-specific things that I have in my .vimrc are as follows: set autoindent set ts=2 set shiftwidth=2 set expandtab set shiftround set smarttab filetype plugin on syntax on

Re: [Tutor] python CRM ERP

2006-11-17 Thread Christopher Arndt
Picio schrieb: > Hello, > Can you point me to some CRM and ERP software written in Python, that > in your "guru" opinion is a good product? Maybe also Open Source? Have you asked Google? http://tinyerp.org/ Chris ___ Tutor maillist - Tutor@python.org

[Tutor] a question about passing values between functions

2006-11-17 Thread kristinn didriksson
Hello, I am still wrestling with the concept of values going between functions. (just starting out)The program below works seems to work, but here is my question. In my understanding, return area in the first routine makes the value of area an instance of areaCirc and I use areaCirc in the other pr

[Tutor] Problem making '.exe' from python.

2006-11-17 Thread Chris Hengge
Whether using py2exe or pyInstaller I've noticed a problem and I'm not sure how to fix it... When I create a .exe and then make a shortcut to the file and run it.. the program will crash without warning. If I run the .exe directly it runs fine. My assumption of the problem: Since it is still bui

Re: [Tutor] Problem making '.exe' from python.

2006-11-17 Thread Jason Massey
Check to make sure that under the shortcut properties that you have the "Start in" field filled out with the directory the script is located. On 11/17/06, Chris Hengge <[EMAIL PROTECTED]> wrote: Whether using py2exe or pyInstaller I've noticed a problem and I'm not sure how to fix it... When I

[Tutor] str() conversion of unicode?

2006-11-17 Thread Tod Haren
I'm trying to calculate md5's on records from a Paradox database. The problem is that apparently some of the records have non ASCII characters. I'm at a loss as to how I should handle this. This snippet is called for each row in my recordset: m = md5.new() for f in rs.fields.keys(): val = s

Re: [Tutor] OT: Vim was: free IDE for Python?

2006-11-17 Thread Senthil_OR
William O'Higgins Witteman wrote: > On Fri, Nov 17, 2006 at 11:02:18AM +0530, [EMAIL PROTECTED] wrote: > >> What the settings of ppl using vim for python? > > A few Python-specific things that I have in my .vimrc are as follows: Thanks for sharing William. I think ppl in this list , might also

Re: [Tutor] Problem making '.exe' from python.

2006-11-17 Thread Chris Hengge
Awesome! Thank you! This has been driving me crazy for weeks. Now to figure out how to tell Inno to add that to a link, and I'm on my way! On 11/17/06, Jason Massey <[EMAIL PROTECTED]> wrote: Check to make sure that under the shortcut properties that you have the "Start in" field filled out wi

Re: [Tutor] a question about passing values between functions

2006-11-17 Thread Bob Gailer
kristinn didriksson wrote: > Hello, > I am still wrestling with the concept of values going > between functions. (just starting out)The program > below works seems to work, but here is my question. > In my understanding, return area in the first routine > makes the value of area an instance of area

Re: [Tutor] Problem making '.exe' from python.

2006-11-17 Thread Chris Hengge
Just wanted to wrap that up so nobody wastes time replying. I've fixed my Inno scripts and all my packages work now, case closed! Thanks again Jason. On 11/17/06, Chris Hengge <[EMAIL PROTECTED]> wrote: Awesome! Thank you! This has been driving me crazy for weeks. Now to figure out how to te

[Tutor] any win32com experts out there?

2006-11-17 Thread Orri Ganel
Hello again. As I've mentioned in the last couple of emails, I'm having trouble registering iTunes for events, and I don't know if it's a bug with iTunes or with win32com, or if there's something I'm doing wrong. So, if any win32com gurus out there know why the following doesn't work and how

Re: [Tutor] a question about passing values between functions

2006-11-17 Thread Alan Gauld
"kristinn didriksson" <[EMAIL PROTECTED]> wrote > In my understanding, return area in the first routine > makes the value of area an instance of areaCirc No, it simply assigns the value returned by areaCirc to area within . areaCirc assigns 4*(math.pi)*(diameter/2)**2 to its local variable

[Tutor] A Million Sevens

2006-11-17 Thread Thomas
Earlier today I typed the following into my pythonwin interactive interpreter in windows xp: int('7' * 10 ** 6) I expected either an error message or it to get stuck and require me to stop the process manually. I read that unlike long integers in C, longs in python are only limited by the amo

Re: [Tutor] A Million Sevens

2006-11-17 Thread Chris Hengge
Well, I dont get the point.. its not locking up my system or anything.. its just crunching away... even while I type this... I guess your point is that it should stop since a 32 bit O/S can only count to: 4,294,967,296 On 11/17/06, Thomas <[EMAIL PROTECTED]> wrote: Earlier today I typed the fol

Re: [Tutor] A Million Sevens

2006-11-17 Thread Chris Hengge
I'm thinking you either have a problem with a memory leak (my memory isn't changing, just at 100% CPU), or your CPU overheated from poor cooling since it is at 100% utilization. On 11/17/06, Chris Hengge <[EMAIL PROTECTED]> wrote: Well, I dont get the point.. its not locking up my system or any

Re: [Tutor] A Million Sevens

2006-11-17 Thread Luke Paireepinart
Chris Hengge wrote: > I'm thinking you either have a problem with a memory leak (my memory > isn't changing, just at 100% CPU), or your CPU overheated from poor > cooling since it is at 100% utilization. yeah I second this... there's no reason why this would reboot your computer. At Chris: It's b

Re: [Tutor] A Million Sevens

2006-11-17 Thread Collin Hockey
A mildly educated guess would be that python tried to access memory Windows wasn't going to allow it to have, effectively causing a BSOD and making Windows restart the system. Thomas wrote: > Earlier today I typed the following into my pythonwin interactive > interpreter in windows xp: > >

Re: [Tutor] A Million Sevens

2006-11-17 Thread Tim Peters
[Thomas] > Earlier today I typed the following into my pythonwin interactive > interpreter in windows xp: > > >>> int('7' * 10 ** 6) > > I expected either an error message Unlikely, if your box has enough RAM to run WinXP :-) > or it to get stuck and require me to stop the process manually. Not

Re: [Tutor] any win32com experts out there?

2006-11-17 Thread Alan Gauld
I'm no expert but I get the same response when I tried it. I googled a bit and found this long chain of useful looking stuff: http://www.velocityreviews.com/forums/t345123-how-to-receive-events-eg-user-mouse-clicks-from-ie.html One possibility mentioned at the end is: Adding win32gui.PumpW

Re: [Tutor] A Million Sevens

2006-11-17 Thread Chris Hengge
Not that it changes your reply, but just for my own sanity: int('7' * 10 ** 6) <- does this not just type-cast a char into an int? Meaning that rather then consuming 1024k as you stated, it would consume 2048k at the peak of the calculation(2bytes per char? * 1m = 2048k) then typecasting to int w

Re: [Tutor] A Million Sevens

2006-11-17 Thread Alan Gauld
Tim, Every now and then you pop up on the tutor list to answer "interesting" posts like this: "Tim Peters" <[EMAIL PROTECTED]> wrote > That much does /only/ the decimal-string -> large binary integer > part. > Don't display i until the next step. For display, it's /enormously/ > faster to conve

Re: [Tutor] A Million Sevens

2006-11-17 Thread Thomas
On 18/11/06, Chris Hengge <[EMAIL PROTECTED]> wrote: > Not that it changes your reply, but just for my own sanity: > int('7' * 10 ** 6) <- does this not just type-cast a char into an int? > > Meaning that rather then consuming 1024k as you stated, it would consume > 2048k at the peak of the calcul

Re: [Tutor] A Million Sevens

2006-11-17 Thread Luke Paireepinart
Chris Hengge wrote: > Not that it changes your reply, but just for my own sanity: > int('7' * 10 ** 6) <- does this not just type-cast a char into an int? it typecasts a 1,000,000 character long string to an integer. > > Meaning that rather then consuming 1024k as you stated, it would > consume 20