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

Chris Angelico rosuav at gmail.com
Sat Dec 9 17:15:49 EST 2017


On Sun, Dec 10, 2017 at 12:58 AM, Marko Rauhamaa <marko at pacujo.net> wrote:
> alister <alister.ware at ntlworld.com>:
>
>> On Wed, 06 Dec 2017 10:35:58 +1200, Steve D'Aprano wrote:
>>> Then how does my Linux box know that when I double-click on a text
>>> file, it launches kwrite rather than (say) the Gimp or LibreOffice?
>>>
>>> When I right-click on a mp4 video, I get a menu that includes a Open
>>> With command that shows (amount others) Kaffeine, mplayer and VLC.
>>>
>>> If you mean the Linux *kernel* doesn't do file associations, then you
>>> should have said so.
>>>
>>> But why do you care about the kernel? Would you think it even the
>>> *tiniest* useful to claim that "Linux doesn't do email" because it is
>>> sendmail or postfix (or similar) that sends email rather than the
>>> Linux kernel itself?
>>
>> Linux does not associate by file extn it uses a 'magic' file to
>> analyse the content of the file so that it runs the correct
>> application regardless of the file extn.
>
> "Linux" is one of those words that has ceased to have much meaning.
> Personally, I wouldn't think "double-clicking on a text file" has
> anything to do with linux. I use linux during most of my waking hours
> but I don't remember ever "double-clicking on a text file".

And there are plenty of people who use Python all their waking hours,
but never once write a generator function. Systems like this are large
enough that different people get to use different subsets of the
functionality. There's a HUGE difference between "using Linux for
headless servers" and "using Linux for software development" and
"using Linux for video editing" in terms of which features you'll use.
I, for instance, couldn't *imagine* using Linux without SSH, but my
mother uses Linux too and has never SSH'd to a different computer for
any reason. On the other hand, she makes extensive use of Libre
Office, which I only have installed for those rare occasions when
someone sends me a spreadsheet file or something. But we're both using
Linux, and that's perfectly acceptable use of terminology.

ChrisA



More information about the Python-list mailing list