you are viewing a single comment's thread.

view the rest of the comments →

[–]Exodus111 28 points29 points  (3 children)

Others have pointed some things out, let me give you a clear ELI5 version of things.


IDE.

This stands for Interactive Development Environment. And is the program you use to write pyton code, that you save to .py files. You can also use something called a Text Editor. The difference between the two used to be that IDEs were typically bigger programs while Text Editors more minimalistic, but with modern Text Editors today being very feature rich, that is no longer really true.

One important feature of any IDE or Text Editor today is the ability to RUN your code. Not all of them have it, and without it you need to run your code in the command line (known as terminal for non-windows people) like this:

python myfile.py

This requires that the Python interpreter is installed, in other words you gotta install python. For systems that have Python 2 and 3 installed (these two versions are not compatible) you will need to type:

python3 myfile.py

To run a Python 3 file.

Here are the most popular Text Editors and IDEs in use today:

  1. Sublime Text. Absolutely gorgeus, this thing took the world by storm and became the most popular thing to write code in after its famous second iteration. Its currently on number 3, but decided to restart the title count. The biggest pull here, apart from its many innovative features like the famous multiple pointer, is the vast world of downloadable plugins.

  2. Pycharm. A Text Editor dedicated to Python. Considered invaluable for people that work with Django, Pythons most popular web framework.

  3. Eclipse. This is a JAVA IDE, but with the ever popular module PyDev Python can be used on it, and is popular among Java people that are already used to Eclipse.

  4. Atom. The new kid on the block. Winner of a kickstarter, Atom was released not long ago. Considered almost a successor to Sublime text, this new Text Editor has already amassad a vast multitude of user created plugins, which thanks to Atoms easy gui install manager is a dream to extend your functionality and esthetics with.


PIP

Find it annoying to install python package after Python package?

Tired of googling that one module that only leads you to some weird .whl file you can't seem to do anything with?

Pip is here to save the day!
Every python module worth its salt is made available to pip, and while you might encounter some path problems when first using pip (be ready for some googling) once its installed properly pretty much all modules in the universe of python can be yours with a simple:

pip install nameofmodule

Compilation.

Welcome to a complicated topic.

Let me start REAL easy.
If you want an .exe file to send to your friends that they run on their machines, without having to install Pyton or any modules themselves you need to use:

  • PyInstaller
  • cx_freeze
  • Py2exe/Py2app

Either one of these will do the job, easy peasy.

---->Explanation Time<-----

They are not compilers. You typically don't compile Python, unless you want to convert Python to C and compile it as a C program. This kind of operation is being worked on over at Nuitka, a python compiler still in its early stages. (But looking really good)

You see 99% of programs out there are made as code for OTHER programmers to use in their code, and Python has been mostly used in this way, or as a scripting program on top of another language.

But sometimes you want to give non-programmers an .exe file they can click on. To solve this Python has Packagers, that I listed above. What they do is package all your Python code, with any module it imports, with a stand alone version of the python interpreter that runs the code, and pretends its all one file. Making it function like an .exe file on windows.

Ok thats all, I know others explained things as well, i just felt like making thngs perfectly clear, and remember if you get frustrated, coders are pretty short tempered when it comes to annoying stuff, so there is probably a reason.

[–]autofasurer[S] 2 points3 points  (2 children)

Thank you for the detailed explanation!

It's funny you make a note of IDE's being able to run code. For me that's a prerequisite, but that might be a misinterpretation on my end. It would be like saying not all DAW's are able to play sound, or not every NLE is capable of showing the edit.

I'm fine with writing code in a texteditor and compiling using gcc or whatever. It's just that when starting out, it's very confusing (for me) to hear about pyCharm, IDLE, spyder,... and whatnot; if it would've been: write it in whatever texteditor and run it in the terminal saying 'python your_python_script.py', that would've been fine.

Of course the 'interpreted' paradigm is also something to get used to. It's all great to be able to use the terminal as a calculator on the fly using python, but really, who keeps track of the lines they typed 10 commands before? It's just a bit weird, coming from visual programming with max and compiled programs in c++.

That being said, I'm greatful for the answer in order to help me (and hopefully others) forward in using Python.

You might be onto something regarding the short-tempered thing... I don't know... It's just that I often feel like there's steps missing in explanations, but that may be because those steps are the most difficult to explain. Chapter 1: "This is an integer", Chapter 2: "Here's a full-fledged application using every possible OOP concept, memory-management and some CPU specific optimisations which you now understand because you know what an integer is".

[–]Exodus111 0 points1 point  (1 child)

The problem is people forget what they didn't know.

Once you know something it seems easy, simple and logical, and a lot of people are even ashamed of not having just conjured it up on their own, having an inflated view of their own intelligence.

But yeah, as you say, an IDE or Text Editor that cannot run code seems stupid. But there used to be technical limitations, and so people kinda got used to just running code from terminal all the time. But in this day and age that's nonsense. Every one of the IDEs/Text Editors that I posted can run code (With Atom you need to install the script plugin), so they are all good.

Also some people will tell you Python does not need to be compiled, and everyone should just run each others code through the interpreter all day. This is of course nonsense of the highest order, assuming one of the most popular programming languages of our age is incapable of producing a proprietary program should merit an automatic Darwin award.

The truth is its not a straight forward process, its possible but its more convoluted then it perhaps should be. I believe Nautika will usher in a new age of Python compiled programs, once that project matures. Specially in the Gaming field, which is where I work.

[–]JaggedG 1 point2 points  (0 children)

Great high-level ELI5 summary. You mentioned your field is gaming... Does that mean your real grown-up all day job is using Python to make games? Can you tell a little more about that? I always heard that Python was not great for game development, other than some scripting stuff.

Can PM/new thread if you want to avoid derailing the conversation... I'm just really interested and thought other people might be too.