Jun-09-2021, 04:06 PM
(Jun-07-2021, 12:25 AM)Larz60+ Wrote: Correct me if I'm wrong, but I think that what you're looking for a place where you can run your code, so:
- you need to save your script to a file with a
.py
suffix
- open a command (terminal) window
- run command
python 3 myfile.py
(replace 'myfile' with saved file prefix)
you can run code line by line (interpretively) by typingpython3
at command line, then entering code one line at a time.
google python IDE to get a list.
The choice of which one is best is personal, but two very popular choices are VSCode and PyCharm
I like VSCode, and there is a tutorial here that will get you started.
there is a built in one (very basic) named IDLE see: IDLE
Thanks @Larz60+
I have read your comment thoroughly & return my understanding or misunderstanding in square brackets [ ].
(1) you need to save your script to a file with a .py suffix [Yes all the files created have .py suffix]
(2) open a command (terminal) window [I dont know precisely what you mean - Win10 has a command box at far left of the Task Bar which is what I use so I dont "open" anything. Am I misunderstanding something?]
(3) run command python 3 myfile.py (replace 'myfile' with saved file prefix) - [This is what I was inserting python /pythonprojects/texteditor.py so I added 3 python 3 /pythonprojects/texteditor.py but it made no difference.]
(4) you can run code line by line (interpretively) by typing python3 at command line, then entering code one line at a time. [I dont understand that. Is that referring to the Python DOS prompt window headed with the following?]
Python 3.8.1 (tags/v3.8.1:1b293b6, Dec 18 2019, 22:39:24) [MSC v.1916 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>
(5) The choice of which one is best is personal, but two very popular choices are VSCode and PyCharm [I already have VSCode and PyCharm but prefer to use UltraEdit32 which Im more familiar with. When I start to use more sophisticated coding, I guess PyCharm would be my better choice.]
(6) there is a built in one (very basic) named IDLE see: IDLE [Where do I see: IDLE?]
Im tending to think that the lack of a window opening, or the one that does open momentarily then closes, is caused by a Windows malfunction or misuse, rather than the Python code that Im entering.
All Im wanting at this stage is to get a "window to open". Once I achieve that, I can then add to it, to make things work.
My experience in programming is in PHP using CodeIgniter which I find is limited & Im wanting to integrate it with Python of which Im led to believe is more flexible. But Im finding Python extremely alien with little or no explanation.
Would it be a good idea to first learn C then move to C++ before learning Python?
Can you reply in terms that a Win10/PHP developer understands?