title: execute python script with function from command line, Linux
body: <p>I have my python file called convertImage.py and inside the file I have a script that converts an image to my liking, the entire converting script is set inside a function called convertFile(fileName)</p>
  
  <p>Now my problem is I need to execute this python script from the linux command line while passing the convertFile(fileName) function along with it.</p>
  
  <p>example:</p>
  
  <pre><code> linux user$: python convertImage.py convertFile(fileName)
  </code></pre>
  
  <p>This should execute the python script passing the appropriate function.</p>
  
  <p>example:</p>
  
  <pre><code>def convertFile(fileName):
  
      import os, sys
      import Image
      import string
  
      splitName = string.split(fileName, "_")
      endName = splitName[2]
      splitTwo = string.split(endName, ".")
      userFolder = splitTwo[0]
  
      imageFile = "/var/www/uploads/tmp/"+fileName
  
      ...rest of the script...
  
      return
  </code></pre>
  
  <p>What is the right way to execute this python script and properly pass the file name to the function from the liunx command line?</p>
  
  <p>Thank in advanced</p>