2
Contributors
4
Replies
42
Views
4 Years
Discussion Span
Last Post by aanchal_1
0

Add

print(type(variable))
# this can be useful too
print(variable.__class__)

there is also

import inspect
print(inspect.getmro(variable.__class__))

to get the ancestor classes.

Edited by Gribouillis

0

thank u . it said it's a 'pygame.surface' type.could you help me break my python game into funcctions.i use c++ but for my semester project i chose to use python.now i'm havin difficulty in modularizing it.although it works fine without the use of functions. but it looks too jumbled up...

0

This link tells you quite a lot about the pygame.Surface type, although the most important part is probably out of the class: the set of functions which use the pygame.Surface as a parameter.

If you're used to C++, you will find that it is much easier to write functions in python because python does not complain about the types. I suggest that you take a long piece of code and you try to break it into smaller logical parts, and you write a function for each of these subparts.

0

yes.i'll try. but trying to convert a non modular to a modular one is getting a little tedious.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.