[qutebrowser] How to run a userscript in Windows

Florian Bruhin me at the-compiler.org
Wed Aug 31 23:08:59 CEST 2016

* Daniel Schadt <daniel at kingdread.de> [2016-08-31 22:36:47 +0200]:
> > command called: spawn ['--userscript', 'SCRIPT.py']
> You're trying to call a Python userscript, which is basically just a
> text file interpreted with python.exe. So you're trying to call a "text
> file" as an application, which won't work on Windows - not even when
> you set .py files to open with Python. It's basically the same as
> trying to run a .txt as userscript, it's just not a valid Win32
> application. So as far as I can tell, the only things you can run on
> Windows as (user)script are native .exe and .bat/.cmd files.

That's what I suspected as well, but I wanted to try things out before
answering, and then didn't get to it yet :D

I'm guessing even from cmd.exe you couldn't simply run a .py file,

> So to solve this, you can either use
>     "\path\to\python.exe \path\to\script.py"
> as command for spawn (without the --userscript flag), or you can write
> a simple .bat file that just calls your real userscript under the hood.
> Also note that you're using the frozen version of qutebrowser, so to
> run Python scripts outside of the qutebrowser executable, you probably
> need a second (normal) Python installation.

Crazy idea, let's ship a general-purpose python.exe (if cx_Freeze
doesn't do that already) and interpret shebangs on Windows in
qutebrowser (no, please don't) :D


http://www.the-compiler.org | me at the-compiler.org (Mail/XMPP)
   GPG: 916E B0C8 FD55 A072 | http://the-compiler.org/pubkey.asc
         I love long mails! | http://email.is-not-s.ms/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <https://listi.jpberlin.de/pipermail/qutebrowser/attachments/20160831/03880e45/attachment.asc>

More information about the qutebrowser mailing list