Coders Packet

Movie Scheduling System - Python Based

By Prathiksha K

A movie scheduling system simplifies the task of organizing and managing movie showtimes and offers scheduling capabilities to accommodate changes in movie availability and theater availability.

Screenshot of Movie description Movie Schedule

The Provided code is a movie scheduling software implemented in Python. It allows users to input details of movies and generates a schedule for screening those movies in a multiplex cinema. Let's go through the code and its functionalities in more detail:

Importing Modules:- The code begins by importing the required modules: `PrettyTable` for displaying the schedule in a tabular format and `random` for generating random numbers.

User Input:
- The user is prompted to enter the number of screens in the multiplex mall.
- Then, the user is asked to enter the details of the movies they want to schedule. This includes the movie name, demand score, cast weightage, success rate, runtime, features, language, and local language.

MovieClass:
- The `MovieClass` is defined as a class to store and manipulate movie details.
- The class constructor (`__init__`) initializes the attributes of a movie object based on the provided input.
- The priority score of a movie is calculated based on the demand score, cast weightage, success rate, runtime, features, and language compatibility.
- The priority score is adjusted based on the success rate, time running, features, and language compatibility.
Movie and Details Dictionaries:
- The code creates two dictionaries, `Movie` and `Details`, to store movie objects and their corresponding details.

Weekend Input:
- The code prompts the user to enter the number of movies to be released on Friday.
- The user then inputs the details of these weekend movies.
- The weekend movies are added to the `Movie` and `Details` dictionaries.
Scheduling Functions:
- Several functions are defined to handle the scheduling process.
- The `initialization()` function initializes the schedule by creating an empty schedule dictionary.
- The `display_table()` function uses the `PrettyTable` module to display the schedule in a tabular format.
- The `sorting()` function sorts the movies based on their priority scores.
- The `percents()` function calculates the percentage distribution of showtimes among movies.
- The `determine_no_of_slots()` function determines the number of slots for each movie based on the total number of showtimes and screen count.
- The `scheduling()` function assigns movies to slots and screens in the schedule based on the determined number of slots and prime slots.
Main Scheduling:
- The scheduling process is performed for weekdays (Monday to Thursday) and weekends (Friday to Sunday).
- For weekdays, the movies are scheduled in prime slots (Slot4, Slot5) if the day is not a special occasion. Otherwise, movies are scheduled in all slots (Slot1 to Slot6).
- For weekends, the scheduling process is similar, with different numbers of slots based on the day.
- After scheduling each day, the schedule is displayed using the `display_table()` function.

Overall, the movie scheduling system optimizes the moviegoing experience by effectively managing showtimes and theater resources.

Download Complete Code

Comments

No comments yet

Download Packet

Reviews Report

Submitted by Prathiksha K (Prathi0625)

Download packets of source code on Coders Packet