4

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

hello.py

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

In another program

import hello

can we do that in codeskulptor? If yes,how to do it?

user1934044
  • 516
  • 5
  • 18

1 Answers1

3

YES, each "file" in CodeSkulptor can be imported.

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

The good idea is to make import user29_SdwDlVVu3J4qvLO as my_modulename. See http://www.codeskulptor.org/#user29_fg2U0pzeuTFaCPi.py

Olivier Pirson
  • 737
  • 1
  • 5
  • 24