I would like to know how to run a Python command inside a batch file and store the result in an enviroment variable. The aim is to carry out several floating point operations, as batch files only allow integer operations.
I need to read some strings (real numbers) using the bat file, then pass those strings to python variables, convert the strings into doubles with python, carry out several simple operations (multiplications and divisions) and finally store the results of the operations in new batch variables.
您需要将python添加到系统路径 ,然后可以使用以下命令通过批处理运行python脚本:
python script.py args
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.