471,356 Members | 1,682 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,356 software developers and data experts.

question on python syntax

If I type this in shell

$ ./yourfile.py 12:34 PM &

What does '$', '.', '/' and '& means in this succession? Note: 12:34
PM is a argument to the yourfile.py.

Sep 10 '07 #1
2 863
a.m. wrote:
If I type this in shell

$ ./yourfile.py 12:34 PM &

What does '$', '.', '/' and '& means in this succession? Note: 12:34
PM is a argument to the yourfile.py.
This not python syntax but Unix shell.

$ = shell prompt
../ = look for the program in my current working directory
yourfile.py = the program name
12:34 = argument 1
PM = argument 2
& = run in background
Sep 11 '07 #2
a.m. wrote:
If I type this in shell

$ ./yourfile.py 12:34 PM &

What does '$', '.', '/' and '& means in this succession? Note: 12:34
PM is a argument to the yourfile.py.
"$" is the shell prompting you to let you know it's ready for you to
type a command.

"./" says "look in the current directory for a file called ...".

Since the first token in the command contains a path separator ("/") the
normal mechanism of looking for the executable in each of the
directories in the current $PATH is not used [if you don't understand
this sentence, ignore it].

"&" says "run this command in the background and immediately prompt for
another command, instead of waiting for the command to finish like you
usually do".

Technically, by the way, 12:34 PM is *two* arguments to the yourfile.py,
not one.

regards
Steve
--
Steve Holden +1 571 484 6266 +1 800 494 3119
Holden Web LLC/Ltd http://www.holdenweb.com
Skype: holdenweb http://del.icio.us/steve.holden
--------------- Asciimercial ------------------
Get on the web: Blog, lens and tag the Internet
Many services currently offer free registration
----------- Thank You for Reading -------------

Sep 11 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

699 posts views Thread by mike420 | last post: by
75 posts views Thread by David MacQuigg | last post: by
14 posts views Thread by Uwe Mayer | last post: by
2 posts views Thread by yaffa | last post: by
2 posts views Thread by waltbrad | last post: by
3 posts views Thread by Kinokunya | last post: by
6 posts views Thread by Daniel | last post: by
reply views Thread by XIAOLAOHU | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.