Answer the question
In order to leave comments, you need to log in
How to pass parameters containing Cyrillic characters from windows bat file to python interpreter?
For example, a bat file is like this: python my_program.py параметр1 параметр2
Python program prints krakozyabry:
import sys
source_file = sys.argv[1]
dest_file = sys.argv[2]
print( "исходный файл : " + source_file )
print( "результирующий файл " + dest_file )
Answer the question
In order to leave comments, you need to log in
You need to add a line to the batch file:
chcp 1251
python my_program.py parameter1 parameter2
or save the batch file in 866 encoding
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question