parameters: ()
return_statement: return (filename, port_num, debug_id, pid, run_as)
docstring: Parses arguments for use with the launcher.
      Arguments are:
      1. Working directory.
      2. VS debugger port to connect to.
      3. GUID for the debug session.
      4. Debug options (not used).
      5. '-m' or '-c' to override the default run-as mode. [optional].
      6. Startup script name.
      7. Script arguments.
docstring_summary: Parses arguments for use with the launcher.
      Arguments are:
      1. Working directory.
      2. VS debugger port to connect to.
      3. GUID for the debug session.
      4. Debug options (not used).
      5. '-m' or '-c' to override the default run-as mode. [optional].
      6. Startup script name.
      7. Script arguments.
docstring_tokens: Parses arguments for use with the launcher . Arguments are : 1 . Working directory . 2 . VS debugger port to connect to . 3 . GUID for the debug session . 4 . Debug options ( not used ) . 5 . - m or - c to override the default run - as mode . [ optional ] . 6 . Startup script name . 7 . Script arguments .
function: def parse_argv():
      """Parses arguments for use with the launcher.
      Arguments are:
      1. Working directory.
      2. VS debugger port to connect to.
      3. GUID for the debug session.
      4. Debug options (not used).
      5. '-m' or '-c' to override the default run-as mode. [optional].
      6. Startup script name.
      7. Script arguments.
      """
  
      # Change to directory we expected to start from.
      os.chdir(sys.argv[1])
  
      port_num = int(sys.argv[2])
      debug_id = sys.argv[3]
  
      del sys.argv[:5]
  
      # Set run_as mode appropriately
      run_as = 'script'
      if sys.argv and sys.argv[0] == '-m':
          run_as = 'module'
          del sys.argv[0]
      elif sys.argv and sys.argv[0] == '-c':
          run_as = 'code'
          del sys.argv[0]
  
      # Preserve filename before we del sys.
      filename = sys.argv[0]
  
      # Fix sys.path to be the script file dir.
      sys.path[0] = ''
  
      pid = os.getpid()
  
      return (filename, port_num, debug_id, pid, run_as)
function_tokens: def parse_argv ( ) : # Change to directory we expected to start from. os . chdir ( sys . argv [ 1 ] ) port_num = int ( sys . argv [ 2 ] ) debug_id = sys . argv [ 3 ] del sys . argv [ : 5 ] # Set run_as mode appropriately run_as = 'script' if sys . argv and sys . argv [ 0 ] == '-m' : run_as = 'module' del sys . argv [ 0 ] elif sys . argv and sys . argv [ 0 ] == '-c' : run_as = 'code' del sys . argv [ 0 ] # Preserve filename before we del sys. filename = sys . argv [ 0 ] # Fix sys.path to be the script file dir. sys . path [ 0 ] = '' pid = os . getpid ( ) return ( filename , port_num , debug_id , pid , run_as )