Atom can't recognize Python scripts - python

Hello everyone and thanks for reading. Today I tried to open a python script with Atom but it doesn't recognize that it is written in Python. Also even if a make a new script and save it as .py the problem insists. Not recognizing it as python script doesn't allow Atom to change colors of fonts or suggest words when programming etc, but I can still run the script normally through cmd.. Atom just displays it as plain text. What is even more weird is that when I click the button (bottom right of Atom's IDE) which opens up the available language formats, I can see everything (Auto Detection, Plain Text, Java, C, ...) other than Python.. Atom IDE can't find python
I run Windows 10 64bit, I have python 3.6.3 (checked the path already and seems it is working since I can see the version through cmd), I have also downloaded pip, sklearn
Now for Atom, I have only installed 3 packages, which are all for running scripts through Atom (atom-runner, platform-ide-terminal, script). I have already reinstalled both Atom & Python. Note that I also have version 2 python in my computer, but haven't linked a path to my laptop's systems variables so I guess it is not an issue.
I would really appreciate any suggestions, I am stuck here 1 day now and I don't want to switch Atom for anything else.

"It has nothing to do with Python itself. The language-python Atom package does the syntax highlighting and some other things in Atom. It's a core package, so it should be installed by default. Can you try apm enable language-python?" from user: anothernode
This solved my issued

Related

running python directory in cmd

I am trying to learn to code by reading through simple python project, and
there is one thing I quite do not understand.
Pardon me if the question was not phrased correctly, I am not sure how to phrase otherwise ...
IN the Getting started instruction, the part "run python installer",
What does installer refer here? does it refer to the installer folder in the directory or some pre-defined python commands?
Also, if it refers to the installer folder in the directory, how is that running any executable, since it is the folder, not any particular file????
I would really appreciate if anyone could help. Thank you
PS. https://github.com/sukeesh/Jarvis
is the link of the github project I Was reading through.
When it means python installer, it means the exe that installs python for you which you can get here depending on which version you want.
You may run your python code via anaconda prompt which u can get here also u can download your python library to the anaconda navigator
You also edit your code using Pycharm code editor

Atom Editor is not working on my computer, How can I resolve this to start programming

I opened the atom to write python code after a long time but it is showing like this
I have uninstalled and re-installed but did not worked
I also restarted my PC
I cannot do anything with atom, please suggest the method so that it works.
PYCharm is also not working

How to run python script using atom?

I have been using atom code editor to write C code and run it using a gcc compiler, recently I started out on python code and have been trying to run python script using atom code editor but i keep on getting errors, is there a way to fix this?
Having run C on atom should not interfere with you running python. Make sure you've installed the python extension and you name your file with the py extension. Also, install the 'script' extension. Enter your script and hit command-I. The script extension should then run your script. Command-I is just a shortcut to run script. You can install these extensions (add-ons) by going to Preferences under the Atom menu item. This opens a window in Atom and you can install from a list of available extensions.
Possible you need to change the language selected in the bottom right corner, see here: https://user-images.githubusercontent.com/31619951/31304897-b0900c7e-ab4a-11e7-803c-b34168895ed3.PNGIf still no go, might need to uninstall C++ packages in atom and reinstall atom-gpp-compiler, based on a github support thread I was reading through
If you run atom-python-run and gpp-compiler at the same time it will show you this error.
So disabling gpp-compiler will not show this problem when you want to run Python.
And when you run C then disabling atom-python-run and enable gpp-compiler will solve your problem.
I am a junior and this is the way I have solved my problem, please correct me if there is any mistake.
And if anyone has an easier way, please share.

.py files default to Xcode on Mac?

When I open a .py file on my Mac it opens in Xcode but wont run.
Why does this happen and how do I fix this?
Xcode doesn't seem to recognize Python syntax. How do I fix this? (for example True and False are not recognized as keywords)
The default application for .py files on Mac is set to open in Xcode. Usually at installation time, you're provided with a list of checkboxes of extensions to associate with the program you're installing.
To fix this, follow this tutorial:
http://www.imore.com/how-change-default-apps-os-x
Also, it doesn't recognize regular Python syntax because it's not configured to run Python. By default it's set to Objective C/Swift. You need to associate a project with a Python interpreter for it to pick up the syntax.
To setup a Python project in Xcode, follow this tutorial:
https://stackoverflow.com/a/5438416/4889267

How to install/run Python on a Mac

After giving up on doing a disk partition and getting Linux, I decided to try and install Python 3.3.2 on a 32 bit Intel Core 2 Duo iMac with OS X 10.6.8 Snow Leopard. I did pretty much everything the official website says, but it isn't working at all.
First of all, I downloaded the installer for Mac OS X 6 and later, which should supposedly put a folder called MacPython 3.3 with IDLE, PythonLauncher and a Build Applet tool in my Applications folder. What I have instead is a folder called Python 3.3 which does contain (aside from the documentation and a command to update shell profile) IDLE and PythonLauncher, but no Build Applet tool; I typed 'python' into my Terminal window to see if 3.3.2 was installed, but it said Python 2.6.1 even after restarting my computer. The ReadMe in the disk image that contains the installer says running the installer should also 'put the underlying machinery into the folder /Library/Frameworks/Python.framework'. I did every search imaginable and apparently there is no such folder anywhere in my hard drive.
Basically, I want to install 3.3.2 and run things in programme mode rather than shell mode, which I find to be a huge pain in the bottom. Any help is greatly appreciated.
You don't need to download or install any software.
Just write your code in your preferred text editor, and save it as a anything with .py at the end. Next, go to a terminal and type in python *****.py, where ***** means whatever your file is named.
Try typing 'idle python3.3' or something similar in the terminal.

Categories

Resources