Good day. Please i need help to create new-site and new-app using script.
I have figured out how to run script using the python os module.
I created a file test.py
THE PYTHON SCRIPT (test.py)
import os
import sys
import subprocess
p = subprocess.run([‘bench’, ‘new-app’, ‘sample’])
RUNNING THE SCRIPT
h@h:~/frappe-bench-13-beta-pre$ python3.8 t.py
App Title (default: Hh):
Please I need to know how to pass the variables during the subprocess automatically by pre-provided variables…
For example #####################################################
THE PYTHON SCRIPT (test_example.py)
import os
import sys
import subprocess
app_title = “sample”
description = “the Description”
publisher = “the Publisher”
email = “sample@gmail.com”
Icon =“null”
color =“grey”
license =“MIT”
p = subprocess.Popen([‘bench’, ‘new-app’, ‘sample’])
#arguments
RUNNING THE SCRIPT ######################################
h@h:~/frappe-bench-13-beta-pre$ python3.8 sample.py
App Title (default: Sample): app_title
App Description: description
App Publisher: publisher
App Email: email
App Icon (default ‘octicon octicon-file-directory’): Icon
App Color (default ‘grey’): color
App License (default ‘MIT’): license