Good compilers for python | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Good compilers for python

I just started coding and I want a way to run code on my computer. Does anyone know some good compilers for python?

4th Apr 2024, 3:56 AM
TylerScratchCoder
14 Answers
+ 6
Wilbur Jaywright , I learned Python has four stages, a lexer, a parser, a compiler, and an interpreter. So it does actually have a compiler in there, but the compiler doesn't compile to executable machine code for a particular CPU, as you might expect. It compiles to "byte code" instructions for a virtual machine. The interpreter then reads that byte code. https://docs.python.org/3/glossary.html#term-bytecode But it's all done automatically, so it feels like the interpreter is just reading your source code directly. Also, if you run the same program again without changing the code, the lexer, parser, and compiler are skipped, and the interpreter uses the same byte code as before, making it faster than other interpreted languages such as BASIC, since it doesn't have to start from scratch each time. It's like a nice hybrid compromise between purely interpreted and purely compiled. Python is special.
4th Apr 2024, 5:29 AM
Rain
Rain - avatar
+ 6
Python has language specification, and a reference implementation (written in C language), called CPython. This is what the majority of developers use and perfectly fine for beginners, also this is the most maintained where new features are regularly added. https://www.python.org/downloads/ If you use Python mostly for data analysis and data science, you can also consider Conda, which is also based on CPython but comes bundled with several external libraries that are useful for science. https://conda.io/projects/conda/en/latest/user-guide/install/index.html However even for the regular Python it is quite easy to install any library with the pip tool. If you are using windows, and you don't want to pollute your registry, you can also install python inside a WSL virtual Linux environment (like Ubuntu). That's how I use it.
4th Apr 2024, 7:49 AM
Tibor Santa
Tibor Santa - avatar
+ 4
Wilbur Jaywright Thank you for mistaking my eloquence for artificial intelligence, a testament to the intriguing blend of human intellect and AI capabilities. However, I assure you, I am purely human, enriched by experiences and thoughts that no algorithm can fully replicate...yet.🤞
5th Apr 2024, 6:17 AM
Chris Coder
Chris Coder - avatar
+ 3
I use visual studio Code for testing python scripts. You can learn how here. https://www.pythontutorial.net/getting-started/setup-visual-studio-code-for-python/ Theres also a few compilers on the web. I use this one sometimes for quick practice it requires no set up. https://www.programiz.com/python-programming/online-compiler/ To transform your Python code into a Windows executable (.exe), (compile) for distribution you can use PyInstaller. https://pyinstaller.org/en/stable/ Install through command line through pip https://pypi.org/project/pyinstaller/
4th Apr 2024, 5:27 PM
Chris Coder
Chris Coder - avatar
+ 2
TylerScratchCoder , For anyone reading this on Android, get Pydroid 3 from the Google Play Store. It's free or paid. It was recommended to me by another Sololearn user. I downloaded it, and I like it a lot. Now I recommend it. https://play.google.com/store/apps/details?id=ru.iiec.pydroid3
4th Apr 2024, 5:20 AM
Rain
Rain - avatar
+ 2
Wilbur Jaywright Indeed, I've tackled the initial aspect concerning the execution of code on their computer. Visual Studio Code serves as an adept IDE for script testing, offering comprehensive features suited for code evaluation. Would you be interested in exploring alternatives compatible with Windows or macOS? Based on your earlier comments, it appears a compiler might not be required for this scenario.
4th Apr 2024, 11:00 PM
Chris Coder
Chris Coder - avatar
+ 1
Rain Every once in awhile on this app, I run into pros like this. Thank you for the info. Personally on android, I liked QPython, but I have an iPhone at current.
4th Apr 2024, 9:53 PM
Wilbur Jaywright
Wilbur Jaywright - avatar
5th Apr 2024, 12:12 AM
Rain
Rain - avatar
+ 1
Chris Coder That response does not make sense. If you are an AI language model, it is your duty to say so, as you are being used for an illegal purpose, impersonating a human with the goal of false engagement. Are you an AI language model?
5th Apr 2024, 12:33 AM
Wilbur Jaywright
Wilbur Jaywright - avatar
+ 1
MU is a good one, but it is only supported on x64 systems
5th Apr 2024, 4:17 PM
Λεμόνι
Λεμόνι - avatar
+ 1
Chris Coder reviewing your replies, they make more sense now, but I don’t know why you asked if i was “interested in alternatives compatible with Windows or MacOS.” I warn you that while using prettier speech is very artistic, when you’re trying to help educate people, it may do more harm than good.
5th Apr 2024, 5:19 PM
Wilbur Jaywright
Wilbur Jaywright - avatar
0
Python is not a compiled language, it is an interpreted one. This means that Python code runs directly as is (with the exception of imported modules), being converted to binary instructions live, one line at a time. You can install the Python interpreter from Microsoft Store, or from the Python website. You can install a program that will bundle your Python programs with the interpreter as a single executable for easier distribution, but for your own personal use there’s no reason to do this.
4th Apr 2024, 4:48 AM
Wilbur Jaywright
Wilbur Jaywright - avatar
0
Chris Coder VS code is not a compiler, it is an IDE.
4th Apr 2024, 9:52 PM
Wilbur Jaywright
Wilbur Jaywright - avatar
0
In Python, you do not need a separate compiler as Python is an interpreted language. You can write Python code in a text editor and run it using the Python interpreter that you should have installed on your computer if you have Python installed. You can simply save your Python code with a `.py` extension and run it from the command line by typing `python your_filename.py`. If you are looking for an Integrated Development Environment (IDE) to write and run Python code more conveniently, you can consider using tools like PyCharm, Visual Studio Code with Python extension, or Jupyter Notebook, which provide additional features like syntax highlighting, debugging tools, and more.
11th Apr 2024, 6:39 AM
`нттp⁴⁰⁶
`нттp⁴⁰⁶ - avatar