Le 05/07/2011 15:44, Eric Snow a écrit :
On Tue, Jul 5, 2011 at 1:36 AM, Stéphane Klein wrote:
Hi,
I would like import some module dynamically.
To import a module dynamically, you can use the built-in __import__ function:
module = __import__("js")
Even better, use importlib's import_mo
On Tue, Jul 5, 2011 at 1:36 AM, Stéphane Klein wrote:
> Hi,
>
> I would like import some module dynamically.
>
To import a module dynamically, you can use the built-in __import__ function:
module = __import__("js")
Even better, use importlib's import_module, which is available in
2.7/3.2. A
Hi,
I would like import some module dynamically.
First, I install "js.jquery"
$ pip install js.jquery
Here, I would like import "js" module.
>>> import imp
>>> imp.find_module("js")
Traceback (most recent call last):
File "", line 1, in
ImportError: No module named js
>>> import js
>>>
I
Daniel Fetchinson writes:
> > I'm curious. Was this encoded purely for fun?
>
> Yes.
For some more fun, try measuring the ‘this’ module source code against
the principles in the Zen.
--
\ “Leave nothing to chance. Overlook nothing. Combine |
`\ contradictory observa
> I took a look at the 'this' module to see where the file is stored. This is
> probably old news to some people, but was new to me.
>
> print this.s
> Gur Mra bs Clguba, ol Gvz Crgref
>
> Ornhgvshy vf orggre guna htyl.
> Rkcyvpvg vf orggre guna vzcyvpvg.
> Fvzcyr vf orggre guna pbzcyrk.
> Pbzcyrk
I took a look at the 'this' module to see where the file is stored. This is
probably old news to some people, but was new to me.
print this.s
Gur Mra bs Clguba, ol Gvz Crgref
Ornhgvshy vf orggre guna htyl.
Rkcyvpvg vf orggre guna vzcyvpvg.
Fvzcyr vf orggre guna pbzcyrk.
Pbzcyrk vf orggre guna pbz
This guy posted himself singing "import this" aka The Zen Of Python by Tim
Peters...
http://www.youtube.com/watch?v=kYB72Qa6F9I
--
Yuv
www.BasementPhilosophy.com
--
http://mail.python.org/mailman/listinfo/python-list
On May 13, 3:42 pm, Gary Herron <[EMAIL PROTECTED]> wrote:
> John Henry wrote:
> > On May 13, 1:49 pm, Gary Herron <[EMAIL PROTECTED]> wrote:
>
> >> John Henry wrote:
>
> >>> Hi list,
>
> >>> I can't understand this. The following import statement works fine:
>
> >>> from PythonCard.templates.
John Henry <[EMAIL PROTECTED]> writes:
> On May 13, 1:18 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote:
> > John Henry schrieb:
> >
> > > the class CodeEditor all exists and yet idle keep complaining
> > > that it can't import from PythonCard.tools.
> >
> > How do these complaints *look* - we c
John Henry wrote:
On May 13, 1:49 pm, Gary Herron <[EMAIL PROTECTED]> wrote:
John Henry wrote:
Hi list,
I can't understand this. The following import statement works fine:
from PythonCard.templates.dialogs import runOptionsDialog
but this one fails:
On May 13, 1:49 pm, Gary Herron <[EMAIL PROTECTED]> wrote:
> John Henry wrote:
> > Hi list,
>
> > I can't understand this. The following import statement works fine:
>
> > from PythonCard.templates.dialogs import runOptionsDialog
>
> > but this one fails:
>
> > from PythonCard.tools.codeEd
Thumper's dad always told him: If you don't have anything nice/useful/
garbage to say, then don't say noth'ng at all.
You mean it's not useful to tell you
- to give more information on *what* acutally goes wrong?
- in the meantime, to look harder for your mistake, because it's
unlikely to
John Henry wrote:
Hi list,
I can't understand this. The following import statement works fine:
from PythonCard.templates.dialogs import runOptionsDialog
but this one fails:
from PythonCard.tools.codeEditor.codeEditor import CodeEditor
This kind of "dotted" name import only works
On May 13, 1:18 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote:
> John Henry schrieb:
>
> > Hi list,
>
> > I can't understand this. The following import statement works fine:
>
> > from PythonCard.templates.dialogs import runOptionsDialog
>
> > but this one fails:
>
> > from PythonCard.t
John Henry schrieb:
Hi list,
I can't understand this. The following import statement works fine:
from PythonCard.templates.dialogs import runOptionsDialog
but this one fails:
from PythonCard.tools.codeEditor.codeEditor import CodeEditor
I've checked and rechecked to make sure that t
Hi list,
I can't understand this. The following import statement works fine:
from PythonCard.templates.dialogs import runOptionsDialog
but this one fails:
from PythonCard.tools.codeEditor.codeEditor import CodeEditor
I've checked and rechecked to make sure that the spellings are prope
As the capabilities of core Python have increased, I've noticed that the
logic in import this can be simplified to one line:
print s.decode("rot13")
;)
At the very least the last line:
print "".join([d.get(c, c) for c in s])
could use a generator expression instea
17 matches
Mail list logo