-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathimport.py
More file actions
35 lines (34 loc) · 1.15 KB
/
import.py
File metadata and controls
35 lines (34 loc) · 1.15 KB
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
import os
from os import getcwd
import sys
import datetime
import time
import html
"""
This program is the second example in the book Head First Python
@author: Tiago Saraiva
@date: 2024-01-09
"""
print("--------------------------------------------------")
where_am_i = getcwd()
print(where_am_i)
print("--------------------------------------------------")
print(sys.platform)
print(sys.version)
print("--------------------------------------------------")
print(os.environ)
print(os.getenv('USERPROFILE'))
print("--------------------------------------------------")
print(datetime.date.today())
print(datetime.date.today().day)
print(datetime.date.today().month)
print(datetime.date.today().year)
print("--------------------------------------------------")
formated_date = datetime.date.isoformat(datetime.date.today())
print(formated_date)
print("--------------------------------------------------")
print(time.strftime("%H:%M"))
print(time.strftime("%A %p"))
print("--------------------------------------------------")
print(html.escape("This HTML fragment contains a <script>script</script> tag."))
print(html.unescape("I ♥ Python's <standard library>."))