FAQ
Hey guys,

I am new to python. I want to make a shortcut that opens my websites
and re-sizes them to display on different areas on the screen. I looked
around but i had no luck. Is that possible with python? if so can someone
point to to the right direction? Here is what I came up with so far..

Thanks in advance,

--------------------------------------------------------------------------------------------------------------


import webbrowser

# The websites i want to open..
url1 = 'http://www.python.org/'
url2 = 'http://www.google.com/'
url3 = 'http://msn.com/'

# the path to ie
ie = webbrowser.get('c:\\program files\\internet explorer\\iexplore.exe')
ie.open(url1)
ie.open(url2)
ie.open(url3)




--
Dustin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20110702/5ef7b717/attachment.html>

Search Discussions

  • Chris Rebert at Jul 3, 2011 at 2:10 am

    On Sat, Jul 2, 2011 at 6:21 PM, Dustin Cheung wrote:
    Hey guys,
    I am new to python. I want to make a shortcut that opens my websites
    and?re-sizes?them to ?display on different areas on the screen. I looked
    around but i had no luck. Is that possible with python? if so can someone
    point to to the right direction? Here is what I came up with so far..
    The window positioning+resizing bit will likely require using
    platform-specific APIs. Since you appear to be on Windows, the
    relevant library would be pywin32 (http://pypi.python.org/pypi/pywin32
    ). You would use it to invoke some COM API that does window
    positioning+resizing. I am unable to give more details as I'm on a
    Mac.

    Sidenote: Have you tried Firefox's "Bookmark All Tabs" feature?

    Cheers,
    Chris
  • Chris Rebert at Jul 3, 2011 at 3:08 am

    On Sat, Jul 2, 2011 at 7:10 PM, Chris Rebert wrote:
    On Sat, Jul 2, 2011 at 6:21 PM, Dustin Cheung wrote:
    Hey guys,
    I am new to python. I want to make a shortcut that opens my websites
    and?re-sizes?them to
    point to to the right direction? Here is what I came up with so far..
    The window positioning+resizing bit will likely require using
    platform-specific APIs. Since you appear to be on Windows, the
    relevant library would be pywin32 (http://pypi.python.org/pypi/pywin32
    ). You would use it to invoke some COM API that does window
    positioning+resizing. I am unable to give more details as I'm on a
    Mac.

    Sidenote: Have you tried Firefox's "Bookmark All Tabs" feature?
    On Sat, Jul 2, 2011 at 7:34 PM, Dustin Cheung wrote:
    Hey,
    Thanks for showing me to pywin32. I'll look into it and see what i can come
    up with. Also, I?haven't?tried the?Firefox?feature. I thought the bookmark
    all feature only saved one browser with multiple tabs.
    Correct. I don't know your precise use-case and thought that this
    could possibly be sufficient but significantly less complicated.
    I'm sorry but this
    might be a stupid question but was do you mean by COM API?
    COM as in:
    http://en.wikipedia.org/wiki/Component_Object_Model

    API as in a programming interface:
    http://en.wikipedia.org/wiki/Application_programming_interface

    It's my understanding that most Windows GUI automation stuff tends to
    involve using COM. Again, I don't know specifics, I've just followed
    other Windows-specific posts on the mailinglist.

    Cheers,
    Chris
  • Dustin Cheung at Jul 6, 2011 at 1:30 am
    Hey,

    I am looking into Tkinter. But i am not sure if it will actually work. This
    maybe a crazy idea but i was wondering if i can put a web browser in the
    frame. I have tried to use Tkinter to resize and place the windows to
    certain areas of the screen but that's not working or the way im approaching
    this problem is completely wrong. I want to make a program that will have
    websites displayed in specific areas of the screen. I was planning on using
    the program on the big screen. So is it possible to put the web browser
    inside the frame in Tkinter?

    On Sat, Jul 2, 2011 at 7:10 PM, Chris Rebert wrote:
    On Sat, Jul 2, 2011 at 6:21 PM, Dustin Cheung wrote:
    Hey guys,
    I am new to python. I want to make a shortcut that opens my websites
    and re-sizes them to display on different areas on the screen. I looked
    around but i had no luck. Is that possible with python? if so can someone
    point to to the right direction? Here is what I came up with so far..
    The window positioning+resizing bit will likely require using
    platform-specific APIs. Since you appear to be on Windows, the
    relevant library would be pywin32 (http://pypi.python.org/pypi/pywin32
    ). You would use it to invoke some COM API that does window
    positioning+resizing. I am unable to give more details as I'm on a
    Mac.

    Sidenote: Have you tried Firefox's "Bookmark All Tabs" feature?

    Cheers,
    Chris


    --
    Dustin Cheung
    -------------- next part --------------
    An HTML attachment was scrubbed...
    URL: <http://mail.python.org/pipermail/python-list/attachments/20110705/6e4f3cb3/attachment-0001.html>
  • Thomas Jollans at Jul 6, 2011 at 8:02 am

    On 07/06/2011 03:30 AM, Dustin Cheung wrote:
    I am looking into Tkinter. But i am not sure if it will actually work.
    This maybe a crazy idea but i was wondering if i can put a web browser
    in the frame. I have tried to use Tkinter to resize and place the
    windows to certain areas of the screen but that's not working or the way
    im approaching this problem is completely wrong. I want to make a
    program that will have websites displayed in specific areas of the
    screen. I was planning on using the program on the big screen. So is it
    possible to put the web browser inside the frame in Tkinter?
    What you could do, in effect, is write your own web browser, using an
    existing rendering engine. I do not know which rendering engines are how
    easily used in Tkinter code (possibly none of them).

    This isn't a job for (traditional, cross-platform) Python. It *may* be
    possible with pyWin32. It may be easier with the Windows Script Host
    (which apparently can support Python). I personally would use
    browser-side JavaScript; it's certainly possible to open a popup of a
    specific size in JS, not sure about specific position on-screen. Maybe
    you have to write an extension for Firefox or Chrome.

    On Sat, Jul 2, 2011 at 7:10 PM, Chris Rebert <clp2 at rebertia.com
    wrote:

    On Sat, Jul 2, 2011 at 6:21 PM, Dustin Cheung <dustin299 at gmail.com
    wrote:
    Hey guys,
    I am new to python. I want to make a shortcut that opens my websites
    and re-sizes them to display on different areas on the screen. I looked
    around but i had no luck. Is that possible with python? if so can someone
    point to to the right direction? Here is what I came up with so far..
    The window positioning+resizing bit will likely require using
    platform-specific APIs. Since you appear to be on Windows, the
    relevant library would be pywin32 (http://pypi.python.org/pypi/pywin32
    ). You would use it to invoke some COM API that does window
    positioning+resizing. I am unable to give more details as I'm on a
    Mac.

    Sidenote: Have you tried Firefox's "Bookmark All Tabs" feature?

    Cheers,
    Chris




    --
    Dustin Cheung
  • Chris Angelico at Jul 6, 2011 at 8:37 am

    On Wed, Jul 6, 2011 at 11:30 AM, Dustin Cheung wrote:
    Hey,
    I am looking into Tkinter. But i am not sure if it will actually work. This
    maybe a crazy idea but i was wondering if i can put a web browser in the
    frame. I have tried to use Tkinter to resize and place the windows to
    certain areas of the screen but?that's?not working or the way im approaching
    this problem is completely wrong. I want to make a program that will have
    websites displayed in specific areas of the screen. I was planning on using
    the program on the big screen. So is it possible to put the web browser
    inside the frame in Tkinter?
    Thinking along a quite different line here, is it possible for you to
    use regular frames? Create an HTML file with:

    <frameset rows="50%,50%">
    <frameset cols="50%,50%">
    <frame src="http://blah/blah">
    <frame src="http://another/blah">
    </frameset>
    <frameset cols="50%,50%">
    <frame src="http://third/blah">
    <frame src="http://final/blah">
    </frameset>
    </frameset>

    That should divide your screen four ways (if I haven't botched my HTML
    - ages since I've used frames).

    ChrisA
  • Cousin Stanley at Jul 7, 2011 at 7:21 am

    Chris Angelico wrote:

    <frameset rows="50%,50%">
    <frameset cols="50%,50%">
    <frame src="http://blah/blah">
    <frame src="http://another/blah">
    </frameset>
    <frameset cols="50%,50%">
    <frame src="http://third/blah">
    <frame src="http://final/blah">
    </frameset>
    </frameset>

    That should divide your screen four ways
    ( if I haven't botched my HTML
    - ages since I've used frames ).
    html !botched .... :-)

    An example of your frameset code

    http://csphx.net/fourpy.htm


    --
    Stanley C. Kitching
    Human Being
    Phoenix, Arizona
  • Ian at Jul 6, 2011 at 8:19 pm

    On 03/07/2011 02:21, Dustin Cheung wrote:
    Hey guys,

    I am new to python. I want to make a shortcut that opens my websites
    and re-sizes them to display on different areas on the screen. I
    looked around but i had no luck. Is that possible with python? if so
    can someone point to to the right direction? Here is what I came up
    with so far..
    I suggest you create a dummy page on your disk with an onload event that
    uses javascript to open, size and load all the windows you want.

    Then create a short cut to the dummy page.

    Regards

    Ian
  • Dustin Cheung at Jul 6, 2011 at 11:16 pm
    Okay thanks for the help guys, ill keep you guys posted.
    On Wed, Jul 6, 2011 at 1:19 PM, Ian wrote:
    On 03/07/2011 02:21, Dustin Cheung wrote:

    Hey guys,

    I am new to python. I want to make a shortcut that opens my websites and
    re-sizes them to display on different areas on the screen. I looked around
    but i had no luck. Is that possible with python? if so can someone point to
    to the right direction? Here is what I came up with so far..


    I suggest you create a dummy page on your disk with an onload event that
    uses javascript to open, size and load all the windows you want.

    Then create a short cut to the dummy page.

    Regards

    Ian



    --
    http://mail.python.org/**mailman/listinfo/python-list<http://mail.python.org/mailman/listinfo/python-list>


    --
    Dustin Cheung
    -------------- next part --------------
    An HTML attachment was scrubbed...
    URL: <http://mail.python.org/pipermail/python-list/attachments/20110706/68c26bf7/attachment-0001.html>

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppython-list @
categoriespython
postedJul 3, '11 at 1:21a
activeJul 7, '11 at 7:21a
posts9
users7
websitepython.org

People

Translate

site design / logo © 2022 Grokbase