How to write Android Programs in Python?

How to open cmd.exe and use it in python?

  • i have just finished some simple tutorials on programming in python, and im trying to write some simple yet useful programs. the only way i know of to get get my program to interact with my computer on a useful manner is to use cmd.exe. (yes i'm a noob, so whoever answers please give a detailed explanation) every time i try and open the exe file with python, it says i have an ioerror. i have seen many sollution on the web, but i don't understand them, and for some, i don't have the proper modules. also, if i get in. could someone please tell me how to execute my code in cmd from within the python program.

  • Answer:

    import subprocess subprocess.call(['C:\\Temp\\a b c\\Notepad.exe']) import win32api # if active state python is installed or install pywin32 package seperately try: win32api.WinExec('NOTEPAD.exe') # Works seamlessly except: pass TheCommand = '\"\"C:\\Temp\\a b c\\Notepad.exe\"\"' os.system(TheCommand)

Jacob at Yahoo! Answers Visit the source

Was this solution helpful to you?

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.