Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #81490 > unrolled thread
| Started by | Chris Angelico <rosuav@gmail.com> |
|---|---|
| First post | 2014-11-25 17:51 +1100 |
| Last post | 2014-11-25 17:51 +1100 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.lang.python
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: unloading a module created with imp.new_module Chris Angelico <rosuav@gmail.com> - 2014-11-25 17:51 +1100
| From | Chris Angelico <rosuav@gmail.com> |
|---|---|
| Date | 2014-11-25 17:51 +1100 |
| Subject | Re: unloading a module created with imp.new_module |
| Message-ID | <mailman.16268.1416898271.18130.python-list@python.org> |
On Tue, Nov 25, 2014 at 5:48 PM, Patrick Stinson <patrickkidd@gmail.com> wrote:
> Is it still possible to import non-module objects? I guess this question is
> just for fun now :)
rosuav@sikorsky:~$ python3
Python 3.5.0a0 (default:23ab1197df0b, Nov 20 2014, 12:57:44)
[GCC 4.7.2] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.modules["hello"]=lambda s: print("Hello, %s!"%s)
>>> import hello
>>> hello("world")
Hello, world!
>>>
ChrisA
Back to top | Article view | comp.lang.python
csiph-web