开发者

How to run command from within eclipse(Pydev)

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜