Can we create and import modules in codekulptor?

I am writing code in codekulptor, I have a question that we can create a file (module / package) in codekulptor and can we import it into another program, for example

hello.py

def jj:
   ....
   ....
   print "hello world"

In another program

import hello

can we do this in codes? If so, how to do it?

+4
source share
1 answer

YES, every “file” in CodeSkulptor can be imported.

For example, the file http://www.codeskulptor.org/#user29_SdwDlVVu3J4qvLO.py can be imported using import user29_SdwDlVVu3J4qvLO.

A good idea is to do it import user29_SdwDlVVu3J4qvLO as my_modulename. See http://www.codeskulptor.org/#user29_fg2U0pzeuTFaCPi.py

+3
source

Source: https://habr.com/ru/post/1533457/


All Articles