[Tutor] Open url in browser window

Alan Gauld alan.gauld at btinternet.com
Tue Apr 15 11:25:30 CEST 2008

"Michael Finlayson" <mfin at comcast.net> wrote

> I would like to ask the group if it is even possible
> on a Mac before I go through learning Python.

This has less to do with Python than with Macs

Which browser are you thinking of using?
Mac users have a variety with Safari the most
common along with Firefox and IE for Mac.
But Opera and several others also exist.
I think Safari and IE are installed by default.
But any or all of them could be removed by
the user. (For example I removed IE since
its not very good on a MAC IMHO!)

Or do you install your own browser within
your application?

> We use this approach for several reasons.
> For the security of our training and the security
> of our clients computers,

The latter claim is a bit spurious, if they weren't
secure before launching your app they are
unlikely to be more secure during the running
of it! Especially if there are processes running
in the background or orther users logged in - MacOS
is a true multi user/multi tasking OS after all,
there may be several simultaneous users on
any machine.

> We do this by opening a browser window of
> a specific size with no url line, no menus, nothing except
> scroll bars, if necessary.

That will be totally browser dependant.

> Also, to discourage trainees from skipping out of
> the training to launch other applications, we also
> disable the tab key and control/alt/delete.

Thee are equivalents on a mac. I assume you also
make your app full screen and remove menus etc?
ie use kiosk view? That is presumably possible on
MacOS but recall that the menu bar in MacOS is
not attached to the app window.

> Are either or both of these possible on a Mac
> using Python?

If its possible on a Mac its almost certainly
possible via Python. The programming language
isn't your issue here, its what does MacOS and the
browser support?

> 1.       Control the default browser parameters
> (like you can setup popup windows in javascript
> with the onClick="MM_openBrWindow command)

Depends on the browser.

> 2.       Control of the user’s keyboard.

Yes that should be possible but it might involve a lot
of work catching all the possible exit codes on a Mac.

Alan Gauld
Author of the Learn to Program web site

More information about the Tutor mailing list