Re: [Tutor] Get keyboard input while other program is in focus?

2006-10-16 Thread billburns
[Jack] > > What commands can I use to have the program know a certain key has > > been pressed while another program is in focus? [Luke] > I think Pygame and TKInter have a capture-all-keys function, but this > might also prevent the keypresses from actually going to the target > application. If

Re: [Tutor] how do I find where my program is installed?

2006-09-07 Thread billburns
> way. so I need to tell my program to set the working directory back to the > installation directory... but where is this? > Here's what I do in my py2exe app: installDir = os.path.dirname(os.path.abspath(sys.argv[0])) and take a look at this link: http://www.py2exe.org/index.cgi/WhereAmI H

Re: [Tutor] Find multiple lines in a file

2005-11-09 Thread billburns
[Kent wrote] > > OK, none of my suggestions gets you closer to this...the simplest way is > > if you can read the whole file into memory. Then you can just replace > > the strings in place and write it out again. For example: > > > > oldPolicies = '''<< > > /Policies << > >/PageSize 3 > > >>