-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprintversion.py
More file actions
34 lines (26 loc) · 1019 Bytes
/
printversion.py
File metadata and controls
34 lines (26 loc) · 1019 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
27
28
29
30
31
32
33
34
import requests
# Replace USERNAME and REPOSITORY with your GitHub username and repository name
url = "https://raw.githubusercontent.com/dadaqi/CMPUT404/main/printversion.py"
# Send an HTTP GET request to the URL
response = requests.get(url)
# Check the status code of the response
if response.status_code == 200:
script_text = response.text
# Print the source code
print(script_text)
else:
# If the request is not successful, print an error message
print("Failed to retrieve source code")
# import requests
# script_url = "https://api.github.com/repos/dadaqi/CMPUT404/contents/printversion.py"
# response = requests.get(script_url)
# if response.status_code == 200:
# # If the request is successful, get the content of the file
# content = response.json()["content"]
# # Decode the content from base64
# source_code = codecs.encode("base64")
# script_text = response.text
# # Print the source code
# print(source_code)
import requests
print(requests.__version__)