suggesting a launcher wrapper script for portable python

Gelonida N gelonida at gmail.com
Sun Aug 12 19:02:33 EDT 2012


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.







>
>





More information about the Python-list mailing list