-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Expand file tree
/
Copy path03_modules.py
More file actions
26 lines (22 loc) · 795 Bytes
/
03_modules.py
File metadata and controls
26 lines (22 loc) · 795 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
25
26
"""
In this exercise, you'll be playing around with the sys module,
which allows you to access many system specific variables and
methods, and the os module, which gives you access to lower-
level operating system functionality.
"""
import sys
# See docs for the sys module: https://docs.python.org/3.7/library/sys.html
# Print out the command line arguments in sys.argv, one per line:
print(sys.argv)
# Print out the OS platform you're using:
print(sys.platform)
# Print out the version of Python you're using:
print(sys.version)
import os
# See the docs for the OS module: https://docs.python.org/3.7/library/os.html
# Print the current process ID
print(os.getpid())
# Print the current working directory (cwd):
print(os.getcwd())
# Print out your machine's login name
print(os.getlogin())