简体   繁体   English

我如何使我的python文件恢复正常?

[英]How to i make my python files go back to normal?

So i'm using python3.4, but decided to try out 2.7. 所以我正在使用python3.4,但决定尝试2.7。 Bad idea. 馊主意。 When i installed python 2 all of my python files started opening with python 2 IDLE, which wasn't really my plan. 当我安装python 2时,我所有的python文件都开始使用python 2 IDLE打开,这并不是我的计划。 I then decided to uninstall python 2 again and i figured that now it should go back to normal. 然后,我决定再次卸载python 2,我认为现在应该可以恢复正常了。 It didn't. 没有。

The files now wanted to open as pyWin instead of python 3. I changed the "open as" and tried put it to idle. 现在,这些文件要以pyWin而不是python 3打开。我更改了“ open as”并尝试使其处于空闲状态。 Now the problem is that it always opens as idle, and there is no icon. 现在的问题是它始终以空闲状态打开,并且没有图标。 Usually you get the option "open as idle" when you right click on it, and you get the console when you double click. 通常,当您右键单击时,会得到“以空闲方式打开”选项,而双击时会得到控制台。 Now it opens as idle even if i double click on it, which i don't want. 现在,即使我双击它,它也会以空闲状态打开,这是我不想要的。 Now i don't know how to make it go back to normal. 现在,我不知道如何使其恢复正常。 I tried searching on the internet, but it only told me to set the "open as" to idle, which doesn't do what i want. 我尝试在Internet上搜索,但只告诉我将“打开方式”设置为空闲,这并不能满足我的要求。

I don't know if this got messy, let me know if there is anything i need to clearify. 我不知道这是否混乱,请让我知道是否需要澄清。

在此处输入图片说明 在此处输入图片说明

So, the problem is the interpreter. 因此,问题出在解释器上。 On a Linux machine i'd suggest du edit/add the shebang line. 在Linux机器上,我建议您编辑/添加shebang行。

But this looks like Windows to me. 但这对我来说就像Windows。 I guess the easiest solution would be to reinstallt Python3.X in the prefered version. 我猜最简单的解决方案是在首选版本中重新安装Python3.X。 This should overwrite the PATH variables. 这应该覆盖PATH变量。

EDIT: I havent had this problem yet, this solution just sounds logicle to me. 编辑:我还没有这个问题,这个解决方案对我来说听起来很合逻辑。

Re-set the file association. 重新设置文件关联。 In a cmd.exe window, give the following commands. cmd.exe窗口中,输入以下命令。

assoc .py=Python.File
ftype Python.File="C:\path\to\python3.exe" "%1" %*

In the ftype command, you should use the proper path to your Python 3 executable. ftype命令中,应该使用正确的Python 3可执行文件路径。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使我的代码 go 回到 python 中的特定 while 循环? - How to make it my code go back to a specific while loop in python? 如何让 Python 回到要求输入的状态 - How to make Python go back to asking for input 我希望我的角色只要我按住按钮就可以做某事,然后一旦我松开按钮就恢复正常 - I want my character to do something as long as I'm holding a button, then go back to normal once I let go of the button 如何使变为 0 的值,使其变为 go 回到 python 中的相同值? - How to make the value that goes to 0, to make it to go back to same value in python? 如何让我的递归函数返回以继续递归其他单元格 - How can I make my recursive function go back to continue recursing other cells 如何将 boolean 属性 go 恢复为 Python ZA2F2ED4F9EBC2CBB1DZC2A 中的默认值? - How do I make a boolean attribute go back to a default value in a Python class? 如何将Caesar密码转换为Python中的正常代码? - How could I translate Caesar cipher code back to normal in Python? 我如何获得一个循环来读取子目录并列出文件,然后返回我正在工作的目录并列出 python3 中的文件? - How do i get a loop to read through subdirectorys and list files then go back to the directory i was working in and list the files therein python3? 我如何在 Ubuntu 中使用 pyenv go 回到我的系统 python - how do i go back to my system python using pyenv in Ubuntu 如何使我的python代码循环返回 - How to make my python code loop back
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM