Saturday 15 March 2014

Running C Program on Windows 8.1 using Python (or not Python) -



Running C Program on Windows 8.1 using Python (or not Python) -

the original goal write software executable on windows platform read numbers 7-segment displays , record @ constant time interval. tried out couple of ocr libraries in python (since planning write programme in python) learned more suitable handwritten letters , redirected attending open source programme written in c, designed reading numbers 7-segment displays: http://www.unix-ag.uni-kl.de/~auerswal/ssocr/

so compiled source code in linux , planned move compiled file, along linked library files, windows machine, naively believing "exec" python script execute program. turns out couldn't - trying run programme (after manually adding .exe extension @ end , double clicking) generates response "the app cannot run on pc. find version computer, check software publisher".

so question is, whether there way execute c programme script on windows platform, , if not, might suggest me finish aforementioned task?

you can execute programme using python (like other programming languages). happens (for languages) scheme phone call , inquire underlying operating scheme execute program, because 1 of responsibilities of os.

open python repl (or write python script) , seek (this 1 of ways execute programme python)

import subprocess # if you're on windows phone call subprocess.call("notepad", shell=true) # if on linux phone call subprocess.call("ls", shell=true)

what happens python asks os execute specified programme (notepad or ls), weather os can run requested application story.

your c programme compiled on linux executable in format linux can run (probably elf format). windows requires executable files in different file format. file extensions help environment treat files appropriately. if alter extension of linux executable '.exe', not alter content, windows still not able run it.

you need recompile c programme on windows compiled programme executable on windows. if programme requires posix environment (for illustration if uses fork() syscalls or etc.), utilize cygwin on windows (that provides scheme calls , libraries available in linux windows) compile it.

python c windows

No comments:

Post a Comment