Re: [Tutor] How to call the path of an input file

2016-01-21 Thread Steven D'Aprano
Hi John, and welcome. My responses interleaved between yours below. On Thu, Jan 21, 2016 at 11:51:09AM -0500, John Villarraga wrote: > I would like to know what is the syntax to call the path of the input file. Python only has one syntax for calling anything, and that is to put parentheses (ro

Re: [Tutor] How to call the path of an input file

2016-01-21 Thread Ben Finney
John Villarraga writes: > I would like to know what is the syntax to call the path of the input > file. It's not clear to me what “call the path of the input file” would mean. A filesystem path is not “callable” in a programming as you seem to be using it. > Below, my code is calling the input

Re: [Tutor] How to call the path of an input file

2016-01-21 Thread Martin A. Brown
Greetings John, >I would like to know what is the syntax to call the path of the >input file. Below, my code is calling the input file, but not the >path. >import sys >path = sys.argv[1] Are you looking for os.path.abspath() [0]? import os import sys path = os.path.abspath(sys.argv[1])