Re: suggesting a launcher wrapper script for portable python

Discussion in 'Python' started by Gelonida N, Aug 13, 2012.

  1. Gelonida N

    Gelonida N Guest

    Hi Thomas,

    On 08/12/2012 09:05 PM, Thomas Jollans wrote:
    > On 08/12/2012 02:49 AM, Gelonida N wrote:
    >>
    >> One minor drawback of my suggested script would be, that a console
    >> window pops up for a few seconds when starting a .pyw file.

    >
    > (I'm no expert but) This should be avoidable if you use the Windows
    > Script Host instead of DOS command scripts to write the launchers.
    > I.e. use JScript or VBScript to do exactly the same thing. I don't know
    > much about Windows shortcut (*.lnk) files; if they can contain relative
    > paths, you could just create shortcuts that launch portable python with
    > the script.
    >


    You're absolutely right and I was rather sure, that I posted a link to
    an SO article with a wsf script avoiding this problem.

    Only drawback of this script was, that it did not detect the name of
    it's own script and that it did not pass command line arguments down to
    the python script.

    Well here is the link: http://preview.tinyurl.com/bu9rda5

    The suggested script was:

    <job>
    <script language="VBScript">
    set WshShell = WScript.CreateObject("WScript.Shell")
    CMDFile = "App\\pythonw.exe App\\gui.py"
    WshShell.Run CMDFile, 1
    </script>
    </job>

    The question is how to extend it such, that it detects it's own name
    (nice to have) and that it passes command line args down to python
    (essential)

    I know absolutely nothing about windows scripting.







    >
    >
    Gelonida N, Aug 13, 2012
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. David Thomas
    Replies:
    20
    Views:
    1,397
    Hans Mulder
    Jun 27, 2012
  2. Thomas Jollans
    Replies:
    0
    Views:
    129
    Thomas Jollans
    Aug 12, 2012
  3. Mark Lawrence
    Replies:
    0
    Views:
    194
    Mark Lawrence
    Aug 12, 2012
  4. Gelonida N
    Replies:
    0
    Views:
    107
    Gelonida N
    Aug 13, 2012
  5. Thomas Heller
    Replies:
    7
    Views:
    162
    Andreas Röhler
    Feb 1, 2013
Loading...

Share This Page