title: Manage one Python project for different platform?
body: <p>I have a python project, which I hope it to run both Mac OSX and Raspbian(Raspberry pi).</p>
  
  <p>In this case, I want to know how I can manage my project(whole scripts) for both platform?</p>
  
  <p>I know that most codes are platform-independent, but some codes, like selenium, are platform dependent. Why?</p>
  
  <p>The reason is like this :</p>
  
  <p>My program is crawling certain web page and collecting data headlessly.</p>
  
  <p>I use my Raspberry with just ssh and so only command line interface is available. </p>
  
  <p>I use PhantomJS on Max OSX. But PhantomJS is difficult and complex to install in Raspberry pi.</p>
  
  <p>So, I have to use different <code>webdriver</code> for both cases.</p>
  
  <p>In Mac OSX,</p>
  
  <pre><code>browser = webdriver.PhantomJS()
  </code></pre>
  
  <p>In Raspbian,</p>
  
  <pre><code>from pyvirtualdisplay import Display
  display = Display(visible=0, size=(800, 600))
  display.start()
  self.browser = webdriver.Firefox()
  </code></pre>
  
  <p>But managing two discrete python projects (one for Mac OSX, the other for Raspbian) is kinda irratating..</p>
  
  <p>If I insert the codes something like below to deal with it,</p>
  
  <pre><code>import platform
  
  if platform.system() == 'Linux':
      from pyvirtualdisplay import Display
      display = Display(visible=0, size=(800, 600))
      display.start()
      self.browser = webdriver.Firefox()
  elif platform.system() =='Darwin':      # Mac OSX
      browser = webdriver.PhantomJS()
  </code></pre>
  
  <p>everytime the code be changed, I have to transfer whole project file to my Raspberry pi, which is very irritating.</p>
  
  <p>How could I deal with it effectively? </p>