1
vote
1answer
126 views

Object-oriented Twitter filter

I submitted a previous version of this program but I've completely rewritten it in an Object Oriented style. This is only my second attempt at OO programming so I'm interested in hearing how I can ...
2
votes
1answer
27 views

Python Vector implementation that acts as a class and also a collection of staticmethods

Recently I've been wondering about ways of implementing objects in code that can be represented by other primitives. An example of this is a Vector, which can be represented by a Vector\$N\$D where ...
7
votes
3answers
147 views

Script for finding cheating students in a quiz

Below is a script to find cheating students in a quiz in a daily moodle activity log exported in .xls. It works fine and is written in a procedural way. Essentially the script isolates the activity ...
3
votes
1answer
50 views

Base class for subclasses that can track their own instances

I'm new to Python, with some background in Java and C# from a while ago, and more recently in scripting worlds like Bash and AppleScript. I wanted to be able to create classes that could report ...
4
votes
2answers
58 views

Changing attributes in different objects

First some background - I am developing a Python program which has thousands of lines spread across many files. I have intermediate programming skills - and no commercial OOP experience, and have ...
3
votes
1answer
414 views

Model for web applications

I'm developing a model for web applications. The database that I use is Redis. I created special DbField objects like ...
3
votes
2answers
69 views

Doctor/Patient Reservation Scheduling

I am trying to implement a Doctor/patient scheduling system. It would be great if someone can review my code and suggest how I can improve it further. I would like to know how to have a date-based ...
4
votes
0answers
117 views

Tetris clone written in Python/Pygame

I have a medium-sized project here, and I would like some comments on the code. In particular I'd like comments on how well I'm handling OO-programming, my programs logic and whether you think my code ...
1
vote
1answer
42 views

Checking sensors in an environment

I have the following diagram (did this only to ask here, it's obviously missing details): From the diagram you can see I have to check if all sensors in an environment are respecting the ...
1
vote
1answer
47 views

Follow up: Python class for Facebook

This is a follow-up post I have taken some of the suggestions there and have made some changes from my side too. I think it looks better, but please look at it and lemme know if you think any more ...
5
votes
2answers
93 views

Python script for generating random C code

I'm writing a Python script to randomly generate C functions. This is my first time using classes in Python and I'm basically doing my best to pretend I'm using Java. I'm looking for a review of my ...
5
votes
2answers
109 views

Airline/Hotel reservation system in Python : Follow up

Follow up for my initial question. Modified my earlier code and adding new changes. Initial Question in Code Review ...
5
votes
1answer
238 views

Airline/Hotel reservation system in Python

I am trying to teach myself OOP in Python. I am picking up some projects from GitHub and trying it out on my own. I wrote a Airline/Hotel Reservation System, where I want to maintain the customer ...
4
votes
2answers
99 views

Is one view that handles two sibling models a good idea?

I am using Django multi-table inheritance: Video and Image are models derived from Media. ...
11
votes
1answer
157 views

Refractoring OOP vs. Functional Programming Approach

I am writing a python script that will call mandrills export activity api for every blog on a worpress mu install except for the main site. The script is designed to be called from a cron job on a ...
16
votes
4answers
3k views

Simple card game to learn OOP

My goal was to get my hands dirty in OOP by designing and using classes and getting started with inheritance and other OOP concepts. I have written a very small code to play a card Game called ...
13
votes
2answers
191 views

Condorcet voting method in OOP Python

I'm currently learning Python and having a great time so far (coming from PHP, I have a feeling of suddenly seeing the light). At the same time, I'm studying voting algorithms. So, for training ...
5
votes
1answer
371 views

Does this tkinter-based web browser widget use a well implemented class?

I have fully functional code in class format, and as far as I am aware from my previous question, it conforms to PEP 8 and the code logic and implementation is suitably pythonic. My main concerns here ...
5
votes
1answer
73 views

Case study with a biological populations. A list of lists of lists

I have a population (Pop) which has an attribute which is a list of individuals (Ind) where each individual has an attribute ...
5
votes
3answers
185 views

How object oriented is my Crazy Eights game?

I have this Crazy Eights game (which at the moment does not include crazy cards): ...
4
votes
1answer
145 views

Making this Pygame code object-oriented

PYTHON 2.7- I want to make my code OOP. I also want feedback from you on correctness, tidiness, design patterns and so on. Here's the download link. It's not permanent but it's the best I have ...
8
votes
3answers
252 views

Model cars as classes

I am learning about object oriented programming in Python using classes. I have attached an image of what I had in mind when structuring my classes. This is supposed script model cars. I want to know ...
7
votes
7answers
2k views

Rock Papers Scissors in Python

I am a newbie to Python and have started object oriented programming recently. I have implemented a Rock Paper Scissors" application in OOP. I request the SO community to help me to evaluate my code, ...
2
votes
2answers
276 views

Pong game in Python

I'm writing a pong game in Python and I created classes for the game objects. The top level class is Object, and Ball and ...
1
vote
2answers
473 views

Help needed using OOP in Rock, Paper, Scissors program

This is an OOP Rock, Paper, Scissors program I wrote in Python. I am just learning about using classes and I'd appreciate some advice on improving it. ...
2
votes
2answers
184 views

Is this code 'Pythonic'?

Looking for some feedback on Python best practices, general code quality, and bonus points if you have knowledge of CANOpen that you can leverage to find anything I missed functionality wise, but ...
3
votes
3answers
131 views

Critique of Code Regarding OOP Principles

I was wondering if anyone could give a critique of my code. We are supposed to be using inheritance and OOP principles. All the functions but the PlayerSet class were given, so really I just need ...
3
votes
2answers
206 views

Game Of Life OOP Python

This is pretty much an OOP version of this question, with the improvements: ...
1
vote
2answers
313 views

OOP Challenge in Python

I was trying to solve the final puzzle at the end of the classes chapter (Chapter 8) in "Python Programming for the Absolute Beginner" which is stated as: Create a Critter Farm program by ...
2
votes
3answers
131 views

Python OO Code Review for small blogging script

I've recently re-written a Python script I use to run a couple of lightweight blogs. Looking over the horrible code I'd written before, I decided to rewrite it using object-oriented concepts. I wanted ...
5
votes
2answers
228 views

Strategy Design Pattern in Python

I'm reading the awesome Head First Design Patterns book. As an exercise I converted first example (or rather a subset of it) to Python. The code I got is rather too simple, i.e. there is no abstract ...
0
votes
1answer
87 views

Instance of one class to contain arbitrary number of instances of another class in Python

I'm trying to see if there is a better way to design this. I have a class Animal that is inherited by Male and Female classes (Female class has an additional attribute). I also have a class called ...
3
votes
3answers
313 views

Python Time Class definition and methods, use of __init__

I've written a Time class that records the time of day and performs simple timing operations (add 2 times, convert a time object to an integer and back again,etc.) following the prompts in How to ...
10
votes
1answer
450 views

D&D Monster Organiser

I've made a python script to properly organise D&D monster stats in a directory. The script brings up the stats as instance variables of a Monster (class) instance. For those unfamiliar with the ...
2
votes
1answer
228 views

OOP design of code representing units of measurement

I am developing a meta-data framework for monitoring systems such that I can easily create data adapters that can pull in data from different systems. One key component is the unit of measurement. To ...
1
vote
1answer
253 views

JPEG metadata processor

I am looking to make the below code a bit more efficient / OOP based. As can be seen by the X, Y & Z variables, there is a bit of duplication here. Any suggestions on how to make this code more ...