Develop Python program using PyCharm

Hi when run this code

import sys
print("Hello " + sys.argv[1] + " from " + sys.argv[0])

it gives this error when I run this code

Traceback (most recent call last):
File “C:\Users\Name\AppData\Local\Programs\Python\Python39\lib\”, line 90, in runcode
exec(code, self.locals)
File “”, line 1, in
File “C:\Program Files\JetBrains\PyCharm 2021.3.2\plugins\python\helpers\pydev_pydev_bundle\”, line 198, in runfile
pydev_imports.execfile(filename, global_vars, local_vars) # execute the script
File “C:\Program Files\JetBrains\PyCharm 2021.3.2\plugins\python\helpers\”, line 18, in execfile
exec(compile(contents+"\n", file, ‘exec’), glob, loc)
File “C:/Users/Name/PycharmProjects/Spark/”, line 2, in
print("Hello " + sys.argv[1] + " from " + sys.argv[0])
IndexError: list index out of range

Learn Spark 1.6.x or Spark 2.x on our state of the art big data labs

  • Click here for access to state of the art 13 node Hadoop and Spark Cluster