You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In server.py, what is the recommend way to import python files located in serverFilesCourse? I know a similar question has been asked in #6044 but what if I just have a small amount of code that doesn't amount to a library? Say a couple of functions I find myself using for grading? Is the recommendation to turn it into a library anyway and install it?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
In server.py, what is the recommend way to import python files located in serverFilesCourse? I know a similar question has been asked in #6044 but what if I just have a small amount of code that doesn't amount to a library? Say a couple of functions I find myself using for grading? Is the recommendation to turn it into a library anyway and install it?
I did find the following on https://stackoverflow.com/questions/67631/how-do-i-import-a-module-given-the-full-path but it seems like quite a bit of work and something the "average" user would struggle with. I can't even toss it into a function to reuse because that code would need to be located in serverFilesCourse to make it reusable.
The example below assumes you want to use a function located in serverFilesCourse/dummy.py.
Beta Was this translation helpful? Give feedback.
All reactions