SCOUG-Programming Mailing List Archives
Return to [ 17 |
December |
2001 ]
<< Previous Message <<
Content Type: text/plain
leganii@surfree.com wrote:
>
> Two more questions and one comment, for Sheridan.
>
> I don't recall anything about variable declarations,
> constants, etc.
One does not have to declare variables. Very much like REXX. Simply make an assignment.
>
> How do you comment in it Python?
>
# this is a Python comment
> You didn't say anything about Zope! :-)
I don't know anything about Zope (at least I don't think I do.)
>
> Enjoyed your presentation!
Thanks
>
I looked up how to capture command line arguments. They are captured by the sys module as a list
using a dedicated variable: argv
# example program from "Processing XML with Python" page 165
# import the sys module
import sys
print "There are", len(sys.argv), 'command-line parameter(s)'
# side note: " and ' are Ok if used in pairs
# print the list
print sys.argv
Here is a sample of a run
C> python args.py a.txt b.txt
There are 3 command-line parameter(s)
['args.py', 'a.txt', 'b.txt']
You can now use Python's list operations to do whatever you want with the parameters.
Sheridan
=====================================================
To unsubscribe from this list, send an email message
to "steward@scoug.com". In the body of the message,
put the command "unsubscribe scoug-programming".
For problems, contact the list owner at
"rollin@scoug.com".
=====================================================
<< Previous Message <<
Return to [ 17 |
December |
2001 ]
The Southern California OS/2 User Group
P.O. Box 26904
Santa Ana, CA 92799-6904, USA
Copyright 2001 the Southern California OS/2 User Group. ALL RIGHTS
RESERVED.
SCOUG, Warp Expo West, and Warpfest are trademarks of the Southern California OS/2 User Group.
OS/2, Workplace Shell, and IBM are registered trademarks of International
Business Machines Corporation.
All other trademarks remain the property of their respective owners.
|