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

2017-12-09 Thread Chris Angelico
On Sun, Dec 10, 2017 at 12:58 AM, Marko Rauhamaa  wrote:
> alister :
>
>> 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
-- 
https://mail.python.org/mailman/listinfo/python-list


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

2017-12-09 Thread Marko Rauhamaa
alister :

> 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".

BTW, with the triumph of systemd, I would say linux is falling ever more
to the background. I am thinking more and more that "Linux" is a bad
generic name for the modern distros. Instead, we should talk about
"systemd" as the overall name of the OS. Linux really is a relatively
minor component in the mind of the user or the application developer.
For example, Linux doesn't dictate how one should develop a system
service; systemd calls the shots.


Marko
-- 
https://mail.python.org/mailman/listinfo/python-list


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

2017-12-09 Thread alister via Python-list
On Wed, 06 Dec 2017 10:35:58 +1200, Steve D'Aprano wrote:

> On Tue, 5 Dec 2017 07:58 pm, Lawrence Dâ ÖOliveiro wrote:
> 
>> On Tuesday, December 5, 2017 at 3:39:26 AM UTC+13, Rick Johnson wrote:
>>>
>>> Sounds like your OS file associations are all botched-up ...
>>
>> Linux doesnâ Öt do â £OS file associationsâ Ø.
> 
> 
> 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.

to get a python program to run it simply needs the correct "Shebang" ass 
the 1st line

Usually 

#!/usr/bin/env python
 
or similar




-- 
Some say the world will end in fire,
Some say in ice.
From what I've tasted of desire
I hold with those who favor fire.
But if it had to perish twice,
I think I know enough of hate
To say that for destruction, ice
Is also great
And would suffice.
-- Robert Frost, "Fire and Ice"
-- 
https://mail.python.org/mailman/listinfo/python-list


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

2017-12-08 Thread Steve D'Aprano
On Tue, 5 Dec 2017 07:58 pm, Lawrence Dâ ÖOliveiro wrote:

> On Tuesday, December 5, 2017 at 3:39:26 AM UTC+13, Rick Johnson wrote:
>>
>> Sounds like your OS file associations are all botched-up ...
>
> Linux doesnâ Öt do â £OS file associationsâ Ø.


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?



--
Steve

-- 
https://mail.python.org/mailman/listinfo/python-list