-1

i am trying to run function from python from different directory with

python -c 'import /advg/users/ibrahims/test-coverage-files/coverage.py; coverage.InitliazeResultHtml' i get the following output :

  File "<string>", line 1
import $location;  $location.InitliazeResultHtml
       ^SyntaxError: invalid syntax

can you please help me how to run InitliazeResultHtml from /advg/users/ibrahims/test-coverage-files/coverage.py script in shell ?

thanks in advance.

yonikohen
  • 11
  • 6

1 Answers1

0

This error means what you type was not correct, python don't understand what you type. I think you should simply type python to enter interactive mode, and then do what you want.

import sys
sys.append(your path to this file)

You can google python module to see how to import.

I know why you got that problem, you should not use ' ', you should use " ".Try this to see whether it helps.

disccip
  • 573
  • 3
  • 5
  • 15
  • i am trying to call python function in shell from other directory , and i am getting this error , what i am asking is how to call it properly – yonikohen Jun 24 '16 at 08:50
  • http://stackoverflow.com/q/279237/6490497 you can check this question. I have edit my answer and you try it. – disccip Jun 24 '16 at 16:37