简体   繁体   中英

Run Python command in a Windows batch file

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM