-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhello.py
More file actions
24 lines (20 loc) · 743 Bytes
/
hello.py
File metadata and controls
24 lines (20 loc) · 743 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#------------------------------------------------------------------------------------------------------
# Last modified: 29 January 2026
# You run this script as follows:
#
# python3.* hello.py argument
#
# where:
# * is the version of Python
# "argument" is your argument
#------------------------------------------------------------------------------------------------------
#import module sys which is a very standard one
import sys
#sys.argv[0] is the script name itself and can be ignored
word = sys.argv[1] #calls the first argument
#gather the code in a main() function
def main():
print ('Hello there', word)
#standard boilerplate to call the main() function to begin the program
if __name__ == '__main__':
main()