Python files don't recognize IDLE - python-2.7

I had both Python 2.6 and 2.7 installed on my system and IDLE that I used (by right clicking on a Python file and selecting 'edit with IDLE') was from version 2.6. For some reason, I had to completely remove Python 2.6 form my system. Now, Python files don't show 'edit with IDLE' on right click, even though IDLE 2.7 is installed. I have also tried uninstalling Python 2.7 completely and re installing it. What could be wrong?
Thanks

Happened with me too once.
Install Python. Then open IDLE and save an empty file with a .py extension. Then close IDLE. Go to the file that you have just saved. Then right click >> open with >> choose default program. Then choose python. There will be some more options like pythonw but you only choose python. After you are done, right click on the file and you will find "Edit with IDLE"So, that is it.

The way to do it is to go right click on the file then choose look another app on PC and go C:\Python27\Lib\idlelib and choose the idle (batch file for windows)

Related

How do I open WebStorm from terminal?

I've looked around but I've only found answers for past versions. I have a new version of WebStorm and I want to open my projects from the command line, but wstorm . and webstorm . doesn't seem to work.
I've tried going to Tools > Create Command Line Launcher... and I get this:
I go to ToolBox's WebStorm Settings and I'm met with this:
Generate shell scripts is turned on, but the but the commands still do not work in my terminal.
Am I missing something? Am I supposed to add in a Shell scripts location? I'm not entirely sure I understand.
It's actually very easy. First you open up Webstorm, and press SHIFT twice. This will bring up a search box, where you type: Create Command Line Launcher. You will see a search result from Tools will be highlighted, click on it, and it will suggest the default path. Just click on Ok. Your command line launcher is now ready, so you can open terminal, cd to your project root folder, and type webstorm ./ to launch webstorm.
If the Create Command Line Launcher option is not working, try the following:
If you are on MacOS, try adding the path as instructed in their official page. And if you are on Linux, just uninstall the current version and reinstall as a snap package using sudo snap install webstorm --classic. This way, you can launch it from the terminal just by typing webstorm
After opening a ticket with Jetbrains support, the default path is /usr/local/bin. Adding this worked.
You can use open-ide tool. It allows you to define all of your editors and to open any folder with your editor straight from terminal

why im not able to import pygame? [duplicate]

I've downloaded pygame-1.9.1release.tar.gz from the Pygame website. I extracted and installed it and it's working fine in the command line Python interpreter in Terminal (Ubuntu). But I want to install it for some IDE, like PyCharm. How can I do it?
Well, you don't have to download it for PyCharm here. You probably know how it checks your code. Through the interpreter! You don't need to use complex command lines or anything like that. You need to is:
Download the appropriate interpreter with PyGame included
Open your PyCharm IDE (Make sure it is up to date)
Go to File
Press Settings (Or Ctrl + Alt + S)
Double click on the option that looks like Project: Name_of_Project
Click on Project Interpreter
Choose the interpreter you want to use that includes PyGame as a module
Save your options
And you are ready to go! Here is an alternate (I have never done this, please try to test it)
Add PyGame in the same folder as your PyCharm file (Your PyCharm stuff is always in
a specific file placed by you during installation/upgrade)
Please consider putting your PyCharm stuff inside a folder for easy access.
I hope this helps you!
For PyCharm 2017 do the following:
File - Settings
Double click on your project name
Select Project Interpreter
Click on green + button on the right side of the window
Type Pygame in search window
Click Install package.
Not I'm saying that the answers above won't work, but it might be frustrating to a newbie to do command line magic.
If you are using PyCharm and you are on a Windows 10 machine use the following instructions:
Click on the Windows start menu and type cmd and click on the Command Prompt icon.
Use the command pushd to navigate to your PyCharm project which should be located in your user folder on the C:\ drive. Example: C:\Users\username\PycharmProjects\project name\venv\Scripts.
(If you are unsure go to the settings within PyCharm and navigate to the Python Interpreter settings. This should show you the file path for the interpreter that your project is using. Credit to Anthony Pham for instructions to navigate to interpreter settings.)
HINT: Use copy and paste in the command prompt to paste in the file path.
Use the command pip install pygame and the pip program will handle the rest for you.
Restart you Pycharm and you should now be able to import pygame
Hope this helps. I had a fun time trying to find out the correct way to get it installed, so hopefully this helps someone out in the future.
I just figured it out!
Put the .whl file in C:\Program Files\Anaconda3
While in the folder, click on the blue File tab in the upper left corner of the Window Explorer (assuming you're using Windows)
Click on Open Windows PowerShell as administrator
Write or just copy and paste: py -m pip install pygame
It should start installing
Done!
I hope it works for you. I know it did for me.
I already had pygame installed with python38-32
since its working just fine with it. I used this version of python us my project interpreter.
1.File -settings
2.according to your settings look for project interpreter
3.click on your current project interpreter and click on the add symbol
4.choose system interpreter
5.select the python version thats works with pygame for you
6.Note: some versions of pygame don't work with some versions of python be sure
of what are you doing.
7.hope it works.

Verify that the Kernel Path Interpreter is Correct

I am having a problem starting Canopy.
I was running a large calculation when I restarted the kernel.
Ever since then I have not been able to get Canopy to open to the editor. When I open the program, The 'Welcome to Canopy' window opens but when I try to open an editor or a recent file I get the following error:
"The kernel (user python environment) has failed to start. Please verify that the kernel interpreter path is correct."
I have tried closing and opening Canopy.
Shutting my computer down and starting Canopy.
Uninstalling and re-installing Canopy (I started with 1.1 and this time downloaded 1.2)
And followed the directions at https://support.enthought.com/entries/23097479-Restarting-Canopy-after-Unexpected-error-ParseError-
When I click on the Show Details button in the error window, it says:
Error message:
[Error 740] The requested operation required elevation
How can I get Canopy up and running again? Or are there other environment better than Canopy for free download?
Thanks
This is a new one! Are you by chance running Windows Vista? If not, which Windows version? Are you still logged in as the same user that you were before the original crash? Any other changes that you have made in the system configuration?
I suggest that you delete the following directories
C:\Users\<your user name>\AppData\Roaming\Enthought
C:\Users\<your user name>\AppData\Local\Enthought\Canopy\User
C:\Users\<your user name>\AppData\Local\Enthought\Canopy\System
then restart Canopy. When it asks you, accept its default locations for the environment path.
Note that to see the AppData directory in Windows Explorer, you must set Explorer to show hidden files (Computer / Organize / Folder & Search Options / View / Advanced settings / Show hidden...)
For the better than canopy part of your question, try Anaconda it's put out by Travis Oliphant, formerly of Enthought, and creator of NumPy and SciPy ... and it's awesome. It comes with Numba, which nearly eliminates the need for Cython or writing c-extensions in general. For your first question, I have no experience with canaopy other than frustration so I am no help.
Anaconda can be downloaded for free here

SublimeLinter: How to remove from SublimeText 3

When I tried to remove SublimeLinter on Mac I deleted the package, cache, every part of it in Application Support but it seems I can’t get rid of it in SublimeText 3.
I open ST and I instantly get a message in a new tab from PackageControl telling me that SublimeLinter installed successfully and all the folders and files are created again. Couldn't find any solution online. Thanks in advance for your help!
You need to uninstall it via Package Control. Hit Command ⌘Shift ⇧P to open the Command Palette, then type pcr and select Package Control: Remove Package. Scroll down the list, or type sublimelinter, hit Enter, and restart. You should be all set after that.
This worked for me guys, I deleted the windows app version of Python because there was two paths when I typed "Where Python" on CMD. Then after I deleted Anaconda and reinstalled it, it fixed itself.

Django django-admin.py command problem

I'm new to Python and Django. In fact, I'm new to web framework too. I'm using Windows 7 OS and have installed Django.
I knew Django has been installed successfully. When I go to tutorials, this command, "django-admin.py startproject appproject" always suggested to be run before starting the project.
However, when I run this command, django-admin.py was not recognized as keyword.
Can anyone please help me to see what's wrong here?
On windows python scripts get installed to C:\Python27\Scripts (by default for Python2.7). However the python installer does not automatically Add this location to your PATH. What you need to do is either replace any call to django-admin.py with C:\Python27\Scripts\django-admin.py, or add it to your path. You can do that by:
Open your Start Menu and Locate My Computer, Right Click on it and choose Properties
On the left hand side select "Advanced System Settings".
Next click on the "Environment Variables" button.
Look in the bottom scroll box until you find one named PATH. Select this and hit Edit.
To the end of the current value, append ";C\Python27\Scripts".
Close/Save everything, including your cmd.exe prompt. When you reopen it C:\Python27\Scripts should be on your path, and django-admin.py should work.