This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import os | |
root_path = "/" | |
path_list = [root_path] | |
while len(path_list): | |
path = path_list.pop() | |
try: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# https://docs.python.org/3/library/sqlite3.html | |
import sqlite3 | |
con = sqlite3.connect("tutorial.db") | |
cur = con.cursor() | |
cur.execute("CREATE TABLE movie(title, year, score)") | |
cur.execute(""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM python:3 | |
WORKDIR /usr/src/app | |
# COPY requirements.txt ./ | |
# RUN pip install --no-cache-dir -r requirements.txt | |
COPY hello.py . | |
CMD ["python", "./hello.py"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def calc(x): | |
print("-- Calculating") | |
try: | |
result = 5 / x | |
except ZeroDivisionError: | |
print("-- Expected error, continue") | |
result = 0 | |
print("-- Result ready") | |
return result |
OlderNewer