Re: [Tutor] How to kill an app from python on windows?

2006-12-04 Thread Tim Golden
[Paulino] | To launch an app one can state os.startfile('hello.pdf') and | the file is opened in acrobat . | | And how can I kill the app from python, in order to, for | instance, rename the file? | | Is it possible? This link may get you started:

Re: [Tutor] Rounding a float to n significant digits

2006-12-04 Thread Dick Moores
At 12:52 PM 11/30/2006, Dick Moores wrote: At 11:19 PM 11/27/2006, Dick Moores wrote: I just dug this Tim Smith creation out of the Tutor archive. def round_to_n(x, n): Rounds float x to n significant digits, in scientific notation. Written by Tim Peters. See his

[Tutor] Getting the screen size....using Tkinter

2006-12-04 Thread Asrarahmed Kadri
Hi folks, Is it possible to get the screen size using a standard API of Tkinter? And also any function to position the window in the center of the screen..?? Thanks in anticipation. Regards, Asrarahmed Kadri -- To HIM you shall return. ___ Tutor

[Tutor] Why is startfile unavailable on my mac?

2006-12-04 Thread Nathan Cain
When I type the following in macpython IDLE,: import os os.startfile() I get the following error: Traceback (most recent call last): File pyshell#10, line 1, in module os.startfile() AttributeError: 'module' object has no attribute 'startfile' Why is this unavailable to me? I am

Re: [Tutor] Why is startfile unavailable on my mac?

2006-12-04 Thread Kent Johnson
Nathan Cain wrote: When I type the following in macpython IDLE,: import os os.startfile() I get the following error: Traceback (most recent call last): File pyshell#10, line 1, in module os.startfile() AttributeError: 'module' object has no attribute 'startfile' Why is

Re: [Tutor] Getting the screen size....using Tkinter

2006-12-04 Thread Feise, David
Try this: from Tkinter import * root = Tk() root.winfo_screenwidth() 1280 root.winfo_screenheight() 1024 -Dave From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Asrarahmed Kadri Sent: Monday, December 04, 2006 8:44 AM To: tutor-python

[Tutor] difflib.SequenceMatcher with get_matching_blocks is incorrect

2006-12-04 Thread Thomas
I'm trying to write a program to test someone's typing speed and show them their mistakes. However I'm getting weird results when looking for the differences in longer (than 100 chars) strings: import difflib # a tape measure string (just makes it easier to locate a given index) a =

[Tutor] clicking a javascript link in a browser

2006-12-04 Thread Nathan Cain
There is a link on a pop-up window from a page that I opened with webbrowser.open() the link is: javascript:Events.clearList(); is there a way for python to click that link? Thank you. *** Nathan Cain http://www.Web-Magnets.com Refrigerator Magnets

Re: [Tutor] Why is startfile unavailable on my mac?

2006-12-04 Thread John Fouhy
On 05/12/06, Kent Johnson [EMAIL PROTECTED] wrote: The docs for os.startfile() say it is available on Windows only. Hmm, well you could do a basic Mac version of startfile like this: def startfile(fn): os.system('open %s' % fn) -- John. ___

Re: [Tutor] Getting the screen size....using Tkinter

2006-12-04 Thread Michael Lange
On Mon, 4 Dec 2006 16:43:42 + Asrarahmed Kadri [EMAIL PROTECTED] wrote: Hi folks, Is it possible to get the screen size using a standard API of Tkinter? And also any function to position the window in the center of the screen..?? Thanks in anticipation. You might want to have a

Re: [Tutor] Tutor Digest, Vol 34, Issue 7

2006-12-04 Thread Lazarus billa
was scrubbed... URL: http://mail.python.org/pipermail/tutor/attachments/20061204/6dbfe8ac/attachment-0001.html -- Message: 2 Date: Mon, 4 Dec 2006 10:51:58 -0600 From: Nathan Cain [EMAIL PROTECTED] Subject: [Tutor] Why is startfile unavailable on my mac