Just starting Python extensions ...

NEWBIE ALERT!

Esteemed List Participants and Lurkers:

I'm having a lot of fun getting started with Python ... it is the most
elegant and graceful language I have ever used (Fortran, Cobol, Basic, many
assemblers, Forth, C, VB, etc.). I don't have the resources or the
research time to buy a stack of books, so I'm begging help here. Please be
graciously patient. I do have many a few "start-up" questions, but I'll
only ask one at a time. I know this particular question isn't directly
wxPython, but here I am ...

I can't get the "time()" function to work. Here is a snippet right from
the IDLE GUI ...

import time
fpVar = time()

Traceback (most recent call last):
  File "<pyshell#1>", line 1, in ?
    fpVar = time()
TypeError: 'module' object is not callable

I know the module is loaded ... I can print the "doc" attribute. Isn't
there supposed to be a "time()" function? When I print "time.__doc__" the
following is in it:

Functions:
time() -- return current time in seconds since the Epoch as a float

If I've loaded the module containing the function, why isn't the function
available?

Thank you for your gracious comments, suggestions, and even criticisms.

        Blessings in abundance, all the best, and ENJOY!

        Art Du Rea Carlisle, PA

I know the module is loaded ... I can print the "doc" attribute. Isn't
there supposed to be a "time()" function? When I print "time.__doc__" the
following is in it:

time is the base module
time.time() is one of the availables time methods

so:

import time

time.time()

188882838300....

time.ctime()

'Sat Aug 02 00:52:02 2003'

Alessandro Crugnola [sephiroth]
Flash | PHP Developer

Team Macromedia Volunteer for Flash
http://www.macromedia.com/go/team

Flash-php mailing list
http://www.flash-php.it/index.php?ml=fpcoders&action=subscribe

Hi!

>>> import time
>>> fpVar = time()

Try

fpVar = time.time()

or

from time import time
fpVar = time()

If you import time, then time is the module in the actual namespace. If
you want to call a function from the imported module cou'll have to
write module.function(params).

If you import the function time of the module time, you could call it
directly.

Basic, many assemblers, Forth, C, VB, etc.). I don't have the
resources or the research time to buy a stack of books, so I'm
begging help here.

IMHO, there are some helpful things like tutorials and references on the
Python-homepage. It will not take too much money or time, to have a
look at them to get started...
http://diveintopython.org/ could help as well...

Bye,

Bjoern

···

Am Samstag, 2. August 2003 00:38 schrieb Art:

NEWBIE ALERT!

Esteemed List Participants and Lurkers:

I'm having a lot of fun getting started with Python ... it is the
most elegant and graceful language I have ever used (Fortran, Cobol,
Basic, many assemblers, Forth, C, VB, etc.). I don't have the
resources or the research time to buy a stack of books, so I'm
begging help here. Please be graciously patient. I do have many a
few "start-up" questions, but I'll only ask one at a time. I know
this particular question isn't directly wxPython, but here I am ...

I can't get the "time()" function to work. Here is a snippet right
from the IDLE GUI ...

>>> import time
>>> fpVar = time()

Traceback (most recent call last):
  File "<pyshell#1>", line 1, in ?
    fpVar = time()
TypeError: 'module' object is not callable

I know the module is loaded ... I can print the "doc" attribute.
Isn't there supposed to be a "time()" function? When I print
"time.__doc__" the following is in it:

Functions:
time() -- return current time in seconds since the Epoch as a float

If I've loaded the module containing the function, why isn't the
function available?

Thank you for your gracious comments, suggestions, and even
criticisms.

        Blessings in abundance, all the best, and ENJOY!

        Art Du Rea Carlisle, PA

---------------------------------------------------------------------
To unsubscribe, e-mail:
wxPython-users-unsubscribe@lists.wxwindows.org For additional
commands, e-mail: wxPython-users-help@lists.wxwindows.org

--
small office solutions
info@sosnetz.de - http://www.sosnetz.de