reza karimi
reza karimi

Reputation: 174

seeing source code of objects in a python module

I came up with this question when I was trying to use pygame. I wrote the following line

pygame.time.

but pyCharm didn't give me a list of methods to choose. I wanted to use pygame.time.Clock() but when this happened I tried to see the source code of time but I couldn't. I was just able to see the source code of pygame module and in that, there was just the following line on 'time':

try:
    import pygame.time
except (ImportError, IOError):
    time = MissingModule("time", geterror(), 1)

So my question is that, what is 'time' object and where is it? is it just a compiled python file that came with pygame when I installed it? Can I see the methods inside it or is there a way to let pyCharm suggest the methods inside of it?

Upvotes: 2

Views: 63

Answers (1)

Rabbid76
Rabbid76

Reputation: 210908

So my question is that, what is 'time' object and where is it?

time is not an object it is a module. Pygame is well documented. A complete documentation of the pygame.time module can be found at pygame.time.

It is not necessary to import the module. Via pygame.time you can access all objects of the module. However, you can import all objects form the module with:

from pygame.time import *

Upvotes: 1

Related Questions