Recently I've decided to write a pong style game with pygame; however, I can't
seem to modularize the game successfully.
I'm looking to make individual modules for each class eg. Ball, Paddle,bounds,
Game, Physics and Logic.
Used like this :
ball = Ball(), paddle = Paddle() and etc...
In a Game
Say I have a basic Circle class, for example:
class Circle:
def __init__(self, radius):
self.__radius = radius
Does adding the double underscore make this member directly inaccessible to
children of the Circle class?
Also, I'd like to know if there are any side effects to programmi
Suppose there is ->
Class a():
def__init__(self, var):
pass
Class b(a):
def__init__(self):
super().__init__(self, var)
pass
Note: syntax may be incorrect ...
Is it better to do
b = a()
Instead of making b its own class?
Also, what would be the benef
Is there a proper way to import a class from a module? If so, please tell.
Thank You,
Unee0x
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
Greetings all,
I would like to use a list of functions for an automation project, and this
is the prototype I came up with
###
def func1():
print('func1')
def func2():
print('func2')
def func3():
print('func3')
func_list = ('func1', 'func2', 'func3')
for f in func_list
I made a python script that will update a Ubuntu Server every second and
writes asuccess message and date to a log file, but for some reason the
file is not being written to.
Here is the Script:
#!/usr/bin/python3
import subprocess
import time
import datetime
class UpdateError(Exception)