0

Last week I started using python for writing install scripts for my raspberry pi 3. I installed debian jessie on my pi and within debian I'm using exagear.

When I start the script, I would like to realize that the code could check in which architecture it's running. With the 'arch' command in Debian I can see it's 'armv71' and within exagear it's 'i686'. I have two different functions in python, one for the 'armv71' architecture and one for the 'i686' architecture. I would activate them by using a if and else statement. Could anyone help me solve this problem?

0xsegfault
  • 2,899
  • 6
  • 28
  • 58
Tom
  • 1
  • 1

1 Answers1

0

I think you can use subprocess module

import subprocess

myoutput = subprocess.check_output(["arch"])

if myoutput=='x86_64\n':
    print 'this is x86'
else:
    print 'something else...'
Paul
  • 21
  • 2