original_docstring: 
          Create an input file from the runlevel.
          Will execute yambo in the folder with the runlevel arguments, 
          read the file and return an instance of this class
          
docstring: Create an input file from the runlevel.
  Will execute yambo in the folder with the runlevel arguments,
  read the file and return an instance of this class
docstring_tokens: Create an input file from the runlevel . Will execute yambo in the folder with the runlevel arguments read the file and return an instance of this class
code: def from_runlevel(cls,runlevel,executable=yambopyenv.YAMBO,folder='.',filename='yambo.in'):
          """
          Create an input file from the runlevel.
          Will execute yambo in the folder with the runlevel arguments, 
          read the file and return an instance of this class
          """
          workdir = os.getcwd()
  
          #check if there exists a SAVE folder
          save_path = os.path.join(folder,'SAVE')
          if not os.path.isdir(save_path): raise ValueError('SAVE folder not found in %s'%save_path)
          
          #run yambo
          os.chdir(folder)
          if os.path.isfile(filename): os.remove(filename)
          if '-Q' not in runlevel: runlevel += ' -Q' 
          command = "%s %s"%(executable,runlevel)
          yambo = Popen(command, stdout=PIPE, stderr=PIPE, stdin=PIPE, shell=True)
          yambo.wait()
          os.chdir(workdir)
  
          instance = cls()
          err = instance.read_file(os.path.join(folder,filename))
  
          if err:
              lines = []; app = lines.append
              app('Yambo did not create the %s input file.'%filename)
              app('command: %s'%command)
              app('folder:  %s/'%folder)
              raise FileNotFoundError("\n".join(lines))
  
          #read input file
          return cls.from_file(filename=filename,folder=folder)
code_tokens: def from_runlevel ( cls , runlevel , executable = yambopyenv . YAMBO , folder = '.' , filename = 'yambo.in' ) : workdir = os . getcwd ( ) save_path = os . path . join ( folder , 'SAVE' ) if not os . path . isdir ( save_path ) : raise ValueError ( 'SAVE folder not found in %s' % save_path ) os . chdir ( folder ) if os . path . isfile ( filename ) : os . remove ( filename ) if '-Q' not in runlevel : runlevel += ' -Q' command = "%s %s" % ( executable , runlevel ) yambo = Popen ( command , stdout = PIPE , stderr = PIPE , stdin = PIPE , shell = True ) yambo . wait ( ) os . chdir ( workdir ) instance = cls ( ) err = instance . read_file ( os . path . join ( folder , filename ) ) if err : lines = [ ] ; app = lines . append app ( 'Yambo did not create the %s input file.' % filename ) app ( 'command: %s' % command ) app ( 'folder:  %s/' % folder ) raise FileNotFoundError ( "\n" . join ( lines ) ) return cls . from_file ( filename = filename , folder = folder )
short_docstring: Create an input file from the runlevel.
short_docstring_tokens: Create an input file from the runlevel .
comment: """
          Create an input file from the runlevel.
          Will execute yambo in the folder with the runlevel arguments, 
          read the file and return an instance of this class
          """$SEP$#check if there exists a SAVE folder$SEP$#run yambo$SEP$#read input file