You know, there are several IDEs one could use to write python scripts. Since I might be leaning strongly in the direction of becoming a Python evangelist, I do not want to discourage you (whoever may be reading this) by leading you to software that may just annoy you.
I would prefer you experienced the raw power at the most basic level since that will give you independence. Python is cross-platform, and the interpreter is the same in both Unix and Windows. I'm starting to just call Linux Unix to avoid confusion.
Attached is a text file. If you download it, immediately open it in emacs or a non-word-processor like Notepad++, and rename it list_factors.py
Again, I have to emphasize that I would like this particular thread to be focused on something simple yet powerful.
Using our own self-defined functions in a Python interpreter, the same scripts in both Linux(UNIX) and Windows (or even Macintosh, for that matter).
In this thread I will not be mentioning all the IDEs like PyCharm or Eclipse or Python Tools for Visual Studio. I want this thread to just be about the interpreter and how to use our own scripts or those we want to use from packages "in the PYTHONPATH".
After installing Python 2.7.X, you can just create a directory called py in your home directory.
/home/H/py
or
C:\Users\H\py
Linux and Windows, respectively
From a terminal (like cmd.exe command prompt) change to the directory py where you place list_primes.py
It is a very small file meant to show how to use our own functions, since when first using Python, modules can seem mysterious --- packages and all that, like numpy, math, os, sys, etc
Suppose you were to start the Python interpreter (typing the word python at the command prompt in the directory where list_factors.py is. You can add this directory to a path later if you decide writing and using your own scripts is something that interests you.
You will get the prompt of the Python interpreter.
>>>
This is how to use the little homemade function, as an example.
>>> from list_factors import primeFactors
>>> primeFactors((2222222)
It will output [2, 239, 4649]
If you wanted to use a debugger to step through that code, that is a fun and powerful way to understand what is going on by stepping through the lines of the code.
I think this is a more exciting way to learn rather than struggling to get high-end IDE functioning.
You can skip all that annoyance and get right to the real magic.
Saving the .py file to .txt is just a way to trick this message board. It will not upload .py files.
peace
oh, and remember one thing: if you are installing Python in Microsoft Windows, if you are interested in Math, then packages like numpy are essential and not easily set up in Windows. You can eliminate unnecessary grief by installing the 32-bit
Anaconda package (python.exe) which has numpy and many other mathematics packages which will be accessible.