Please tell me how to execute python file in Ubuntu by double

Chris Angelico rosuav at gmail.com
Wed Dec 13 16:04:03 EST 2017


On Thu, Dec 14, 2017 at 7:56 AM, eryk sun <eryksun at gmail.com> wrote:
> On Wed, Dec 13, 2017 at 5:43 AM, Chris Angelico <rosuav at gmail.com> wrote:
>>
>> A Windows equivalent would be to have a .py file associated normally
>> with the regular console, but some individual ones associated with
>> pythonw.exe - without renaming them to .pyw. AFAIK there is no way to
>> do this on Windows short of renaming the files.
>
> If using another file is ok, then a shell shortcut or hard link would
> work.A symbolic link doesn't work because it seems the shell resolves
> the link before querying the file association.

As workarounds go, a hardlink isn't too bad. (A shell shortcut has its
own problems and limitations.) But you still need to be able to define
a filename pattern, usually by specifying an extension, that catches
the alternates. So it's definitely a workaround, not a true feature.

ChrisA



More information about the Python-list mailing list