开发者

How to run command from within eclipse(Pydev)

开发者 https://www.devze.com 2023-02-25 07:50 出处:网络
Is it possible to runpython command from within eclipse(Pydev)? I want to create a procedure which will create database. Currently I create database by writing the command in command prompt, But I wa

Is it possible to run python command from within eclipse(Pydev)?

I want to create a procedure which will create database. Currently I create database by writing the command in command prompt, But I want the same from my code within eclipse.

Something like:

def createDatabase()
     开发者_StackOverflowcreatedb -U myUser -T template0 


Try popen2 module. It allows you to spawn processes. Then you can call your function from PyDev console


You can also execute a program from Run>External Tools>External Tools Configurations. Once you set it up, you can re-run it from the toolbar.

0

精彩评论

暂无评论...
验证码 换一张
取 消