[Tutor] Danny's __std__ module

tpc@csua.berkeley.edu tpc@csua.berkeley.edu
Wed May 28 15:58:03 2003


hi Danny, I was curious: when you made this module did you intend for
it to be called only when you name a file after a standard module, or for
general everyday use ?  I ask because I am writing a script and when I
called your module in my script and then tried to run it I got:

[tpc@nike htdocs]# ./text2decimalascii.py hello world
Traceback (most recent call last):
  File "./text2decimalascii.py", line 2, in ?
    from __std__ import sys
ImportError: cannot import name sys

I then called your module on a program called random.py and it
works fine.  I guess I am trying to figure out when to use your module and
when not to.

On Wed, 28 May 2003 tpc@CSUA.Berkeley.EDU wrote:

>
>
> hi Danny, I just downloaded your module and tried to install it and I get
> this:
>
> [tpc@nike __std__-1.0]# python setup.py
> usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
>    or: setup.py --help [cmd1 cmd2 ...]
>    or: setup.py --help-commands
>    or: setup.py cmd --help
>
> error: no commands supplied
>
> Am I doing something wrong ?
>
> On Wed, 28 May 2003, Danny Yoo wrote:
>
> >
> >
> > On Wed, 28 May 2003, Jennifer Cianciolo wrote:
> >
> > > I'm having trouble generating random numbers.
> > >
> > > if I do
> > >
> > > import random
> > > random.random()
> > >
> > > I get
> > >
> > > TypeError: 'module' object is not callable
> >
> >
> > Hello!
> >
> >
> > Hmmm... we seem to be getting a whole slew of module importing questions
> > today...  *grin* I think we need more information; it sounds like the
> > 'random' that you're importing isn't the one from the Standard Library.
> >
> >
> >
> > Let's probe this: what's the name of your current source file?  Is it
> > called 'random.py', or is there a 'random.py' in your current directory?
> > If so, that's most likely the source of our problem.  If not, then we'll
> > have to think of something else.
> >
> >
> > By the way, I've actually cooked up a small pseudomodule that tries to
> > alleviate a common module importing problem:
> >
> >     http://hkn.eecs.berkeley.edu/~dyoo/python/__std__/
> >
> >
> >
> >
> > Good luck to you!
> >
> >
> >
> > _______________________________________________
> > Tutor maillist  -  Tutor@python.org
> > http://mail.python.org/mailman/listinfo/tutor
> >
>
>
> _______________________________________________
> Tutor maillist  -  Tutor@python.org
> http://mail.python.org/mailman/listinfo/tutor
>