Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
executable file
·
42 lines (29 loc) · 1.09 KB

File metadata and controls

executable file
·
42 lines (29 loc) · 1.09 KB
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#! /usr/bin/env python
"""Example Python script.
Copyright (c) 2018 Cisco and/or its affiliates."""
import os
def say_hello(name):
"""Function that will say hello to someone.
"""
# Print out a hello message to the name given
print("Hello there {name}. It's great to see you.".format(name = name))
def script_details():
"""Function that reports by printing to screen some details about the execution of the script."""
# Get the current directory and print it out.
cur_dir = os.getcwd()
print("Current directory is {}".format(cur_dir))
# Get the User ID and Group List for the User
user_id = os.getuid()
group_list = os.getgroups()
# Print to screen
print("The user id is {}".format(user_id))
print("The user is a member of the following groups:")
print(",".join(str(g) for g in group_list))
if __name__ == "__main__":
# If executed as a script, run this block.
# Check Script details
script_details()
# List of names, and say hello to them
names = ["Hank","Eric","Stuart","Bryan"]
for name in names:
say_hello(name)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.