title: Having a file pathname as a starting input of a Python program
body: <p>Just for fun, I tried to make a shortcut for the "java -jar filepathname" command on the Windows prompt.</p>
  
  <pre><code>import os
  import time
  
  
  def getJarFileName(pathName):
      jarFileName = ""
  
      for i in range(0, len(pathName)):
          if (pathName[i] == "\\"):
              jarFileName = ""
          else:
              jarFileName += pathName[i]
  
      return jarFileName
  
  jarFound = False
  
  while (jarFound == False):
      jarPathName = input("Insert a *.jar file pathname to execute:\n")
  
      if not (jarPathName.endswith(".jar")):
          jarPathName += ".jar"
  
      if (os.access(jarPathName, os.R_OK)): 
          os.system('cls')
          os.system("java -jar " + jarPathName)
          jarFound = True
  
          print("\n| \"%s\" terminated. |" % getJarFileName(jarPathName))
          time.sleep(1)
  
      else:
          print("\n| \"%s\" not found. |\n" % getJarFileName(jarPathName))
  </code></pre>
  
  <p>This works wonderfully, but I'd like to skip the input process, and basically be able to directly open .jar files with this program (maybe by dropping jar files on this launcher's icon, and stuff like that). I searched all evening for something like this, but I couldn't find anything. Is what I want to do even possible? Thanks in advance for your help.</p>
  
  <p>NB: I know that there are other more convenient ways to open .jar files, I'm just playing around with this kinds of things.</p>