这是python创建表空间脚本,我需要使用变量跟随位置
PGSQL_HOME = raw_input('Type the tablespace location path :>')
ctbsql = "CREATE TABLESPACE test OWNER tester LOCATION 'PGSQL_HOME/9.0/data/testspc';"
subprocess.Popen(['psql', '-U', 'postgres', '-c', ctbsql])
当然,PGSQL_HOME
将被视为一个字符串,并且不能接受路径值,有没有其他方法可以在脚本中创建表空间?在
我不知道我是否得到了你,如果你想得到输入变量,你应该这样使用它:
相关问题 更多 >
编程相关推荐