Skip to content

Commit 0d5b97e

Browse files
committed
Fixed relative import issue
1 parent e8ab7d3 commit 0d5b97e

File tree

4 files changed

+9
-4
lines changed

4 files changed

+9
-4
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
.vscode
2-
__pycache__
2+
**/__pycache__/
3+
.DS_Store

problems/P001/p001_ui.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from nicegui import ui
22

3-
from P001.p001 import solution
3+
from p001_solution import solution
44

55
class Options:
66
def __init__(self):

problems/P002/p002_ui.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
from nicegui import ui
2-
from P001.p001 import *
3-
from P002.p002 import add, divide, multiply, subtract
2+
from p002_solution import add, divide, multiply, subtract
43

54
class Options:
65
def __init__(self):

problems/problems_ui.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
import os
2+
import sys
3+
for dir in [f for f in os.listdir('.') if os.path.isdir(os.path.join('.', f))]:
4+
sys.path.append(dir)
5+
16
from nicegui import ui
27
from P001 import p001_ui
38
from P002 import p002_ui

0 commit comments

Comments
 (0)