Can you create custom modules for python in sololearn? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Can you create custom modules for python in sololearn?

Let's say I want to be able to make a python file called, I don't know, testMod, and import it as a module in another file. Can I do that in sololearn?

23rd Sep 2018, 1:24 AM
sillica sandwhich
sillica sandwhich - avatar
3 Answers
+ 3
What Hatsy said. But, if you really want to do it, there's a roundabout way. Save your python file somewhere online and access it using urllib in your python code. Here's an example where Cépagrave saved the source code for a python library (that wasn't available on Sololearn) on Github and accessed it from another code: https://code.sololearn.com/cfGR3GSuk7yw/?ref=app The relevant lines are #1 and #4. Now I'm not very familiar with accessing urls with Python, but I'm sure you can figure it out!
23rd Sep 2018, 2:22 AM
Kishalaya Saha
Kishalaya Saha - avatar
+ 4
Code Playground does not support multifile projects, at least not yet.
23rd Sep 2018, 2:00 AM
Hatsy Rei
Hatsy Rei - avatar
+ 2
I was wondering if someone was going to try that. One potential use for this, there's an import library for unicode that makes aligning those variable-width characters automatic. I had thought this would make maze codes and so on easier to do.
23rd Sep 2018, 2:30 AM
Kirk Schafer
Kirk Schafer - avatar