Skip to content

Commit

Permalink
Fixed relative import issue
Browse files Browse the repository at this point in the history
  • Loading branch information
mafshin committed Nov 28, 2023
1 parent e8ab7d3 commit 0d5b97e
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.vscode
__pycache__
**/__pycache__/
.DS_Store
2 changes: 1 addition & 1 deletion problems/P001/p001_ui.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from nicegui import ui

from P001.p001 import solution
from p001_solution import solution

class Options:
def __init__(self):
Expand Down
3 changes: 1 addition & 2 deletions problems/P002/p002_ui.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from nicegui import ui
from P001.p001 import *
from P002.p002 import add, divide, multiply, subtract
from p002_solution import add, divide, multiply, subtract

class Options:
def __init__(self):
Expand Down
5 changes: 5 additions & 0 deletions problems/problems_ui.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
import os
import sys
for dir in [f for f in os.listdir('.') if os.path.isdir(os.path.join('.', f))]:
sys.path.append(dir)

from nicegui import ui
from P001 import p001_ui
from P002 import p002_ui
Expand Down

0 comments on commit 0d5b97e

Please sign in to comment.