Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #94722 > unrolled thread

My code won't work if I double click the saved file

Started byjohn <johnreysecoya@gmail.com>
First post2015-07-29 00:20 -0700
Last post2015-07-30 09:49 +0100
Articles 4 — 3 participants

Back to article view | Back to comp.lang.python


Contents

  My code won't work if I double click the saved file john <johnreysecoya@gmail.com> - 2015-07-29 00:20 -0700
    Re: My code won't work if I double click the saved file Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-07-29 21:06 +0100
    Re: My code won't work if I double click the saved file Cameron Simpson <cs@zip.com.au> - 2015-07-30 12:06 +1000
    Re: My code won't work if I double click the saved file Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-07-30 09:49 +0100

#94722 — My code won't work if I double click the saved file

Fromjohn <johnreysecoya@gmail.com>
Date2015-07-29 00:20 -0700
SubjectMy code won't work if I double click the saved file
Message-ID<04881038-a14e-4469-be33-7fcd77496f67@googlegroups.com>
I have windows 8 running on my computer and I think I downloaded python 2 and 3 simultaneously or I think my computer has built in python 2 and I downloaded python 3. And now when I ran my code in IDLE, the code works fine but when I save my program and double click the save file, it will run but it doesn't worked like it used to work in IDLE.

Can someone explain the possible problem I'm currently facing?

I just want my program to run perfectly in both IDLE and when I double click the saved file.

I posted my question in stackoverflow but I didn't find an answer.

http://stackoverflow.com/questions/31692156/i-think-my-computer-has-built-in-python-2-and-i-installed-python-3

[toc] | [next] | [standalone]


#94753

FromMark Lawrence <breamoreboy@yahoo.co.uk>
Date2015-07-29 21:06 +0100
Message-ID<mailman.1081.1438200427.3674.python-list@python.org>
In reply to#94722
On 29/07/2015 08:20, john wrote:
> I have windows 8 running on my computer and I think I downloaded python 2 and 3 simultaneously or I think my computer has built in python 2 and I downloaded python 3. And now when I ran my code in IDLE, the code works fine but when I save my program and double click the save file, it will run but it doesn't worked like it used to work in IDLE.
>
> Can someone explain the possible problem I'm currently facing?
>
> I just want my program to run perfectly in both IDLE and when I double click the saved file.
>
> I posted my question in stackoverflow but I didn't find an answer.
>
> http://stackoverflow.com/questions/31692156/i-think-my-computer-has-built-in-python-2-and-i-installed-python-3
>

Please run your code from a command prompt.  Tell us exactly what you 
expected to happen and what actually happened.  If you get a traceback 
please cut and paste the entire traceback here.  Show us your code, just 
the bit that causes the problem, as cutting the code back to the bare 
minimum often helps you find the problem.  There is advice on how to do 
this here http://sscce.org/

-- 
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence

[toc] | [prev] | [next] | [standalone]


#94760

FromCameron Simpson <cs@zip.com.au>
Date2015-07-30 12:06 +1000
Message-ID<mailman.1085.1438223859.3674.python-list@python.org>
In reply to#94722
On 29Jul2015 00:20, john <johnreysecoya@gmail.com> wrote:
>I have windows 8 running on my computer and I think I downloaded python 2 and 3 simultaneously or I think my computer has built in python 2 and I downloaded python 3. And now when I ran my code in IDLE, the code works fine but when I save my program and double click the save file, it will run but it doesn't worked like it used to work in IDLE.
>
>Can someone explain the possible problem I'm currently facing?
>
>I just want my program to run perfectly in both IDLE and when I double click the saved file.
>
>I posted my question in stackoverflow but I didn't find an answer.
>
>http://stackoverflow.com/questions/31692156/i-think-my-computer-has-built-in-python-2-and-i-installed-python-3

This sounds like what is known as a "file association" issue. Your computer's 
desktop is perhaps associating .py files with the python2 executable. I do not 
use Windows, but I believe you can adjust these associations.

However, the first question (to verify that this is the issue) is: if you 
deliberately invoke python2 and execute your code with it, does it behave the 
same way as when you currently double click on the file?

Cheers,
Cameron Simpson <cs@zip.com.au>

The mere existence of a problem is no proof of the existence of a solution.
        - Yiddish Proverb

[toc] | [prev] | [next] | [standalone]


#94767

FromMark Lawrence <breamoreboy@yahoo.co.uk>
Date2015-07-30 09:49 +0100
Message-ID<mailman.1088.1438246165.3674.python-list@python.org>
In reply to#94722
On 30/07/2015 03:06, Cameron Simpson wrote:
> On 29Jul2015 00:20, john <johnreysecoya@gmail.com> wrote:
>> I have windows 8 running on my computer and I think I downloaded
>> python 2 and 3 simultaneously or I think my computer has built in
>> python 2 and I downloaded python 3. And now when I ran my code in
>> IDLE, the code works fine but when I save my program and double click
>> the save file, it will run but it doesn't worked like it used to work
>> in IDLE.
>>
>> Can someone explain the possible problem I'm currently facing?
>>
>> I just want my program to run perfectly in both IDLE and when I double
>> click the saved file.
>>
>> I posted my question in stackoverflow but I didn't find an answer.
>>
>> http://stackoverflow.com/questions/31692156/i-think-my-computer-has-built-in-python-2-and-i-installed-python-3
>>
>
> This sounds like what is known as a "file association" issue. Your
> computer's desktop is perhaps associating .py files with the python2
> executable. I do not use Windows, but I believe you can adjust these
> associations.
>

With the advent of the Python Launcher for Windows things have changed. 
Here's my setup.

C:\Users\Mark\Documents\MyPython>assoc .py
.py=Python.File

C:\Users\Mark\Documents\MyPython>ftype Python.File
Python.File="C:\Windows\py.exe" "%L" %*

-- 
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web