python + bash + new user

Carel Fellinger cfelling at iae.nl
Wed Jul 21 20:09:30 EDT 1999


Joyce Stack <joyce at netcard.com> wrote:
> Sorry about being vague...i meant the Bash prompt...i have gotten other simple
> programs to work...changed mode and executed the programs ...but i dont know how to
> run the program and pass a variable at the same time...

Gerrit showed you how to pass a command-line-script to python, and I will
show how to pass parameters to your script, you can ofcourse combine the two:)

	$ cat simple.py
	#!/usr/bin/python
	from sys import argv
	print "I'll show you my parameters:"
	for p in argv:
		print p

	$ ./simple.py one parameter and others
	./simple.py
	one
	parameter
	and
	others

hope this helps

-- 
groetjes, carel




More information about the Python-list mailing list