Я пытаюсь создать скрипт для резервного копирования в gcloud, но в сценарии, когда я выполняю команду gcloud init cmd, он задает мне вопросы, на которые мне приходится вводить числа, чтобы выбрать один из вариантов, но я не могу найти способ ввести нужные параметры с помощью сценарий
Код, который у меня сейчас есть, но он не работает:
Код: Выделить всё
def init(prod):
os.popen("gcloud init \n 1\n 1\n"+str(prod)).read()
Код: Выделить всё
Welcome! This command will take you through the configuration of gcloud.
Settings from your current configuration [default] are:
accessibility:
screen_reader: 'False'
core:
account: example@gmail.com
disable_usage_reporting: 'True'
project: A-project
Pick configuration to use:
[1] Re-initialize this configuration [default] with new settings
[2] Create a new configuration
Please enter your numeric choice:
Подробнее здесь: https://stackoverflow.com/questions/793 ... hon-script
Мобильная версия