[Tutor] Modularity

2016-01-14 Thread kay Cee
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

[Tutor] Private members?

2016-02-26 Thread kay Cee
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

[Tutor] Inheritance vs Assignment

2016-09-01 Thread kay Cee
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

[Tutor] Importing classes

2017-01-11 Thread kay Cee
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

[Tutor] list of functions

2017-03-30 Thread kay Cee
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

[Tutor] help with subprocess module

2017-08-19 Thread kay Cee
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)