MetaTrader 5 Python User Group - how to use Python in Metatrader - page 8

 
Vladimir Karputov:

So I gave up. Cleared the changes from Path.

I'll just run the scripts by clicking on the folder.

Well, it's a rudimentary thing. It should work.

Try writing the same path in the bottom "system variables" field. It won't kill your Windows and won't affect anything at all.

 
Maxim Dmitrievsky:

Well, it's a rudimentary thing, it should work.

try writing the same path in the "system variables" field at the bottom. This will not kill your Windows and will not affect anything at all.

Second time "bottom field" - I'm not a telepath :) .

 
Vladimir Karputov:

Second time "bottom field" - I'm not a telepath :) .

green, find the PATH there too and the same


 
Vladimir Karputov:

Yes, the icons are like that. Everything runs when you click on it.

Well, then it's working.

If you want to run a script from the command line, you need to go to the folder where you saved the script, I usually at the root of D: make a folder py

and then Win+x - PowerShell

then bang on the keyboard:

D:

cd py


we're all in the folder where we saved the script and run the script by the script name from that folder... so to speak good old DOS ))))

SZS: You can add a folder in the Path, then you will not need to walk around the directory


 
Igor Makanu:

It's very complicated somehow.
You can open the desired folder ==> click on the box describing the folder path ==> type "cmd" there and press Enter.
And voila, the cmd window will open with the path already written.

 

Visual Studio Code is not a bad editor. It's free.

It supports Python, C#, C++ and even MQL.

You can run Python files from it (haven't tried others).

 
Igor Makanu:

run python scripts from the windows command line, the python interpreter will be called to execute the script.

You are running from an IDLE shell , Python itself has no compiler - you can write scripts in notepad, but save them with a .py extension

or install IDE for python, Spyder all first put to rummage, then PyCharm or I put on a laptop Wing IDE - it does not demand the resources of your PC

This will allow you to do debugging (step-by-step) ?


Added:

Opted for.

PyCharm.

 
Vladimir Karputov:

This will allow for debugging (step-by-step) ?


Added:

Opted for.

PyCharm.

Yeah sure, everything is just like normal compilers - breakpoints, view variable values, auto substitute names/operators/functions...

PyCharm is definitely the best, but on my laptop with 4GB of RAM it's impossible to use - you constantly wait until it does something there, even though I have an SSD on my laptop, on a PC with 8GB of RAM it works without problems

 
By the way, VS Code has step-by-step debugging.
 
Dmitriy Skub:
By the way, VS Code has step-by-step debugging.

both in Spyder and in Wing IDE - I installed

Reason: