Re: imp.find_module don't found my module but standard import statement can import this module… why ?

2011-07-05 Thread Stéphane Klein
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

Re: imp.find_module don't found my module but standard import statement can import this module… why ?

2011-07-05 Thread Eric Snow
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

imp.find_module don't found my module but standard import statement can import this module… why ?

2011-07-05 Thread Stéphane Klein
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

Re: Curiosity stirkes me on 'import this'.

2010-03-08 Thread Ben Finney
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

Re: Curiosity stirkes me on 'import this'.

2010-03-08 Thread Daniel Fetchinson
> 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

Curiosity stirkes me on 'import this'.

2010-03-07 Thread Xavier Ho
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

import this

2008-06-17 Thread Yuvgo0ogle GreeGma1l
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

Re: Why can't I import this?

2008-05-13 Thread John Henry
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.

Re: Why can't I import this?

2008-05-13 Thread Ben Finney
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

Re: Why can't I import this?

2008-05-13 Thread Gary Herron
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:

Re: Why can't I import this?

2008-05-13 Thread John Henry
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

Re: Why can't I import this?

2008-05-13 Thread Diez B. Roggisch
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

Re: Why can't I import this?

2008-05-13 Thread Gary Herron
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

Re: Why can't I import this?

2008-05-13 Thread John Henry
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

Re: Why can't I import this?

2008-05-13 Thread Diez B. Roggisch
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

Why can't I import this?

2008-05-13 Thread John Henry
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

Improvements for import this

2006-04-15 Thread Michael Hoffman
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