title: Open a setup python file?
body: <p>I recently downloaded the VSL compiler developed by Matthieu Amiguet (<a href="http://www.matthieuamiguet.ch/pages/compilateurs" rel="nofollow noreferrer">http://www.matthieuamiguet.ch/pages/compilateurs</a>) to learn how to compile with Python PLY. In the README it says to type python setup install. I readapted the code to work in python 3. Here is what I got as an error:</p>
  <p><a href="https://i.stack.imgur.com/Unkmo.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Unkmo.png" alt="enter image description here" /></a></p>
  <p>Here is setup.py</p>
  <pre><code>import sys, os, shutil
  
  def install():
      print ('Installing...')
      if not os.path.exists(vsldir): os.mkdir(vsldir)
      pyfiles = [f for f in os.listdir('VDK/src/') if not os.path.isdir(f) and f.endswith('.py')]
      for p in pyfiles:
          shutil.copy('VDK/src/'+p,vsldir)
      shutil.copy('VDK/bin/vslc',INSTALLDIR)
      shutil.copy('VRE/vsl',INSTALLDIR)
      shutil.copy('VRE/vsl',INSTALLDIR)
      shutil.copy('vmake/vmake',INSTALLDIR)
      os.chmod(INSTALLDIR+'vslc',111)
      os.chmod(INSTALLDIR+'vsl',111)
      os.chmod(INSTALLDIR+'vmake',111)
      print ('Installed!')
  
  def uninstall():
      print ('Desinstalling...')
      if os.path.exists(vsldir): os.system('rm -R '+vsldir)
      if os.path.exists(INSTALLDIR+'vslc'): os.system('rm '+INSTALLDIR+'vslc')
      if os.path.exists(INSTALLDIR+'vsl'): os.system('rm '+INSTALLDIR+'vsl')
      if os.path.exists(INSTALLDIR+'vsl'): os.system('rm '+INSTALLDIR+'vmake')
      print ('Desinstalled!')
  
  def printHelp():
      print ('''usage : python setup.py COMMANDE
              - install : installation of the compiler and runtime environement
              - uninstall : uninstall the compiler et the runtime environement
                  (this two last command need root password)''')
  
  if __name__ == '__main__':
      pythonpath = [path for path in sys.path if path.find('python')!=-1 and path.find('site-packages')!=-1]
      print ('========================================'.center(80))
      print ('=====         VSL Compiler         ====='.center(80))
      print ('===== David Jacod , Anthony Mougin ====='.center(80))
      print ('========================================'.center(80))
      if len(pythonpath)==0:
          print (' * No python path found. Installation failed')
          sys.exit(-1)
  
      if os.name=='posix': INSTALLDIR = '/usr/local/bin/'
      elif os.name=='nt': INSTALLDIR = 'c:/VSLCompiler/'
  
      pythonpath=pythonpath[0]
      vsldir = pythonpath+'/vslcomp/'
      if len(sys.argv)&lt;=2:
          if sys.argv[1]=='install': install()
          elif sys.argv[1]=='uninstall': uninstall()
          else: printHelp()
      else:
          printHelp()
  </code></pre>