0% found this document useful (0 votes)
3 views67 pages

Cube Code Rs

The proposed Help Desk Ticketing system aims to streamline query resolution by allowing users to generate and track tickets online, improving productivity compared to traditional email methods. The system will utilize Python and MySQL, featuring a colorful GUI and automated ticket management to enhance efficiency and response times. It is designed to be accessible on various platforms, ensuring ease of use for both customers and support agents.

Uploaded by

udhaya7b
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views67 pages

Cube Code Rs

The proposed Help Desk Ticketing system aims to streamline query resolution by allowing users to generate and track tickets online, improving productivity compared to traditional email methods. The system will utilize Python and MySQL, featuring a colorful GUI and automated ticket management to enhance efficiency and response times. It is designed to be accessible on various platforms, ensuring ease of use for both customers and support agents.

Uploaded by

udhaya7b
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 67

1.

INTRODUCTION

ABSTRACT:

The main aim of proposed Help Desk Ticketing system is to generate


tickets for the queries & get the required solution to solve the queries. This management
system provides an online platform to raise tickets, view raised tickets & check status of
the raised tickets. Help Desk Ticketing system has increased the productivity for many
users in the organization. Helpdesk Ticketing system lets you solve the queries with the
help of online platform via a web-based environment. The user can raise tickets for even
the minute queries so as to work smoothly & effectively. The ticketing tool can be used
within the organization or remotely which can be accessed by anyone in organization or
end user. The conventional system used for solving any queries were executed with the
help of e-mail which was much time consuming & unorganized in the nature. The
Ticketing System is an effective way of solving queries effectively & in a time saving
manner. This helpdesk ticketing system can be used on any platform as it is available in
the virtual environment.
2.SYSTEM ANALYSIS

EXISTING SYSTEM

The current customer support system may rely on traditional or semi-automated


methods, leading to several inefficiencies. Key challenges include:

 Customer queries are tracked manually, leading to errors and delays.

 Customer support agents may struggle with scattered information.

 Customers can reach support teams through phone, email, live chat, social media, and
helpdesk portals.

 Issues are logged and tracked as tickets for systematic resolution.

 Knowledge bases, FAQs, and community forums help customers find answers
independently.
PROPOSED SYSTEM

The proposed Customer Support Framework using Python with a colorful GUI aims to
overcome these limitations by integrating advanced features:

 Tracks and prioritizes customer queries efficiently.


 Automates ticket management, reducing manual effort and response time.
 Organizes customer queries systematically, ensuring smooth workflow.
 Faster response times and automated chatbot support provide instant solutions.
 Customers can track their queries in real-time.
3.SYSTEM REQUIREMENT

SOFTWARE REQUIREMENTS
OS : Windows 10, Linux, or macOS

Python : 3.13

Database : MySQL 8.x

IDE : Pycharm

Additional Libraries : TKinter, MySQL

HARDWARE REQUIREMENTS
Processor : Intel Core i3

RAM : 4GB

Storage : 50GB HDD

Display : 1366x768 resolution

Network : Internet connection for package


4.SYSTEM DESIGN

DATAFLOW DIAGRAM

USERS

ADMIN ACTIONS
Id (PK)
Username (Unique) View Tickets
Password role Respond to Tickets
(Enum:customer, admin) Delete Tickets

1-to-Many(user_id) Manages

TICKETS

Id(PK)
User_id (FK->Users.id)
Subject
Message
Status(Enum: Open, In Progress, Resolved)
DATABASE DESIGN
1.Table: users
Stores user details (both customers and admins).

Column Data Type Constraints


id INT Primary Key, Auto Increment
username VARCHAR(100) Unique, Not Null
password VARCHAR(100) Not Null
role ENUM(‘customer’, Default: ’customer’
’admin’)
2.Table: tickets
Stores support tickets submitted by customers.

Column Data Type Constraints


Id INT Primary Key, Auto
Increment
user id INT Foreign Key(users.id),
Not Null
subject VARCHAR(255) Not Null
message TEXT Not Null
status ENUM(‘Open’, ’In Progress’, Default: ‘Open’
’Resolved’)
response TEXT Nullable

Example:
User Table(Stores user details)
id user name password role
1 Alice alice123 customer
2 Bob Bob123 admin
3 Charlie Charlie99 customer

Tickets Table (Stores support tickets)

user_id Subject message status response


1 Login Issue Unable to Open NULL
login to my
account
2 Payment Payment In Progress We are
Failed stuck, need looking
assistance into it
3 Password Forgot my Resolved Reset link
Reset password sent to
email
5.SOFTWARE DESCRIPTION

Python is a very popular general-purpose interpreted, interactive, object-oriented,


and high-level programming language. Python is dynamically-typed and garbage-
collected programming language. It was created by Guido van Rossum during 1985-
1990. Like Perl, Python source code is also available under the GNU General Public
License (GPL). Python supports multiple programming paradigms, including Procedural,
Object Oriented and Functional programming language. Python design philosophy
emphasizes code readability with the use of significant indentation. This tutorial gives a
complete understanding of Python programming language starting from basic concepts to
advanced concepts.

PYTHON FEATURES:
 Uses an elegant syntax, making the programs you write easier to read.
 Is an easy-to-use language that makes it simple to get your program working.
This makes Python ideal for prototype development and other ad-hoc programming
tasks, without compromising maintainability.
 Comes with a large standard library that supports many common programming
tasks such as connecting to web servers, searching text with regular expressions,
reading and modifying files.

 Python's interactive mode makes it easy to test short snippets of code. Therealso a
bundled development environment called IDLE.

 Is easily extended by adding new modules implemented in a compiled language such


as C or C++.
 Can also be embedded into an application to provide a interface.
 Runs anywhere, including Mac OS X, Windows, Linux, and UNIX, with unofficial
builds also available for Android and iOS.
 Is free software in two senses. It doesn't cost anything to download or use Python, or
to include it in your application. Python can also be freely modified and re-distributed
because while the language is copyrighted it's available under an open-source license.

PYTHON CAREERS:
 Game developer

 Web designer

 Python developer

 Full-stack developer

 Machine learning engineer

 Data scientist

 Data analyst

CHARACTERISTICS OF PYTHON

 It supports functional and structured programming methods as well as OOP.


 It can be used as a scripting language or can be compiled to byte-code for
building large applications.
 It provides very high-level dynamic data types and supports dynamic type checking.
 It supports automatic garbage collection.

PYTHON HISTORY

Guido Van Rossum, a Dutch programmer, created Python programming


language. In the late 80's, he had been working on the development of ABC language
in a computer

science research institute named Centrum Wiskunde & Informatica (CWI) in the
Netherlands. In 1991, Van Rossum conceived and published Python as a successor of
ABC language. For many uninitiated people, the word Python is related to a species of
snake. Rossum though attributes the choice of the name Python to a popular comedy
series "Monty Python's Flying Circus" on BBC. Being the principal architect of Python,
the developer community conferred upon him the title of "Benevolent Dictator for Life
(BDFL). However, in 2018, Rossum relinquished the title. Thereafter, the development
and distribution of the reference implementation of Python is handled by a nonprofit
organization Python Software Foundation. Important stages in the history of Python:
Python 0.9.0 Python's first published version is 0.9. It was released in February 1991. It
consisted of support for core object- oriented programming principles. Python 1.0 In
January 1994, version 1.0 was released, armed with functional programming tools,
features like support for complex numbers etc. Python 2.0 Next major version – Python
2.0 was launched in October 2000.

Many new features such as list comprehension, garbage collection and Unicode
support were included with it. Python 3.0 Python 3.0, a completely revamped version of
Python was released in December 2008. The primary objective of this revamp was to
remove a lot of discrepancies that had crept in Python 2.x versions. Python 3 was
backported to Python 2.6. It also included a utility named as python2to3 to facilitate
automatic translation of Python 2 code to Python 3. EOL for Python 2.x Even after the
release of Python 3, Python Software Foundation continued to support the Python 2
branch with incremental micro versions till 2019. However, it decided to discontinue the
support by the end of year 2020, at which time Python 2.7.17 was the last version in the
branch.
PYTHON 3.11:
One of the most important features of Python's version 3.11 is the significant
improvement in speed. According to Python's official documentation, this version is
faster than the previous version (3.10) by up to 60%. It also states that the standard
benchmark suite shows a 25% faster execution rate.
 Python 3.11 has a better exception messaging. Instead of generating a long
traceback on the occurrence of an exception, we now get the exact expression
causing the error.
 As per the recommendations of PEP 678, the add_note() method is added to
the BaseException class. You can call this method inside the except clause and
pass a custom error message.
 It also adds the cbroot() function in the maths module. It returns the cube root
of a given
 number.
 A new module tomllib is added in the standard library. TOML (Tom's Obvious
Minimal Language) can be parsed with tomlib module function.
PYTHON IDE’s:
Jupyter Notebook

Jupyter Notebook is an open-source IDE that is used to create Jupyter documents


that can be created and shared with live codes. Also, it is a web-based interactive
computational environment. The Jupyter Notebook can support various languages that
are popular in data science such as Python, Julia, Scala, R, etc

Spyder
Spyder is an open-source Python IDE that was originally created and developed
by Pierre Raybaut in 2009. It can be integrated with many different Python packages such
as NumPy, SymPy, SciPy, pandas, IPython, etc. The Spyder editor also supports code
introspection, code completion, syntax highlighting, horizontal and vertical splitting,
etc. It is considered one of the best Python IDEs for data science field.
Sublime text

Sublime text is a proprietary code editor and it supports a Python API. Some of
the features of Sublime Text are project-specific preferences, quick navigation,
supportive plugins for cross-platform, etc. While the Sublime text is quite fast and has a
good support group, it is not available for free. Perhaps a lot of good features are
available as well, and you can build a basic project in it.
For more advance and complex loaded features, you have to take its premium
subscription. Also, it is one of the best choices among Data Scientists.

Visual Studio Code


Visual Studio Code is a code editor that was developed by Microsoft. It was
developed using Electron but it does not use Atom. Some of the features of Visual Studio
Code are embedded Git control, intelligent code completion, support for debugging,
syntax highlighting, code refactoring, etc. It is also quite fast and lightweight as well.
Data Scientist also prefers this IDE over other IDEs, due to its extensive feature list.

Pycharm
Pycharm is a Python IDE developed by JetBrains and created specifically for
Python. It has various features such as code analysis, integrated unit tester, integrated
Python debugger, support for web frameworks, etc. Pycharm is particularly useful in
machine learning because it supports libraries such as Pandas, Matplotlib.
Rodeo
Rodeo is an open-source IDE that was developed by Yhat for data science
in Python. So Rodeo includes Python tutorials and also cheat sheets that can be used for
reference if required. Some of the features of Rodeo are syntax highlighting, auto-
completion, easy interaction with data frames and plots, built-in IPython support, etc.

Thonny:
Thonny is a Python IDE that was developed at The University of Tartu for Python.
It is created for beginners that are learning to program in Python or for those that are
teaching it. Some of the features of Thonny are statement stepping without breakpoints,
simple pip GUI, line numbers, live variables during debugging,
Atom
Atom is an open-source text and code editor that was developed using
Electron.It has multiple features such as a sleek interface, a file system browser,
various extensions, etc. Atom also has an extension that can support Python while it is
running and work as a Python IDE
Geany
Geany is a free text editor that supports Python and contains IDE features as
well and it is considered as one of the best Python IDEs for data science. It was
originally authored by Enrico Troger in C and C++. Some of the features of Geany are
Symbol lists, Auto-completion, Syntax highlighting, Code navigation, Multiple
document support, etc.
PYTHON CLASSES AND OBJECTS
A class is a user-defined blueprint or prototype from which objects are created.
Classes provide a means of bundling data and functionality together. Creating a new
class creates a new type of object, allowing new instances of that type to be made.
Each class instance can have attributes attached to it for maintaining its state. Class
instances can also have methods (defined by their class) for modifying their state.
Syntax: Class Definition class ClassName:
# Statement

Syntax: Object Definition obj = ClassName() print(obj.atrr)

The class creates a user-defined data structure, which holds its own data members
and member functions, which can be accessed and used by creating an instance of that
class. A class is like a blueprint for an object.

init () method
The method init () is similar to constructors in Constructors are used to
initializing the object’s state. Like methods, a constructor also contains a collection of
statements (i.e. instructions) that are executed at the time of Object creation. It runs as
soon as an object of a class is instantiated.
str () method
Python has a particular method called str (). that is used to define
how a class object should be represented as a string. It is often used to give an object a
human- readable textual representation, which is helpful for logging, debugging, or
showing users object information. When a class object is used to create a string using
the built-in functions print() and str(), the str () function is automatically used.

CLASS AND INSTANCE VARIABLES:


Unique to each instance and class variables are for attributes and methods
shared by all instances of the class. Instance variables are variables whose value is
assigned inside a constructor or method with self whereas class variables are variables
whose value is assigned in the class.

CONSTRUCTORS IN PYTHON:
Constructors are generally used for instantiating an object. The task of
constructors is to initialize(assign values) to the data members of the class when an
object of the class is created. In Python the init () method is called the constructor
and is always called when an object is created.
Syntax of constructor declaration:

def init (self):

# body of the constructor

TYPES OF CONSTUCTORS:
 default constructor:
The default constructor is a simple constructor which doesn‟t accept any
arguments. Its definition has only one argument which is a reference to the instance
being constructed.
 parameterized constructor:
constructor with parameters is known as parameterized constructor. The
parameterized constructor takes its first argument as a reference to the instance being
constructed known as self and the rest of the arguments are provided by the
programmer.
Advantages of using constructors in Python:

 Initialization of objects:

Constructors are used to initialize the objects of a class. They allow you to set default
values for attributes or properties, and also allow you to initialize the object with custom
data.
 Easy to implement:
Constructors are easy to implement in Python, and can be defined
using the init () method. Better readability: Constructors improve the readability of
the code by making it clear what values are being initialized and how they are being
initialized.
 Encapsulation:

Constructors can be used to enforce encapsulation, by ensuring that the object‟s


attributes are initialized correctly and in a controlled manner.
Disadvantages of using constructors in Python:

 Overloading not supported:

Unlike other object-oriented languages, Python does not support method


overloading. This means that you cannot have multiple constructors with different
parameters in a single class.
• Limited functionality:

Constructors in Python are limited in their functionality compared to


constructors in other programming languages. For example, Python does not have
constructors with access modifiers like public, private or protected.
 Constructors may be unnecessary:

In some cases, constructors may not be necessary, as the default values of


attributes may be sufficient. In these cases, using a constructor may add unnecessary
complexity to the code.
Destructors in Python
Destructors are called when an object gets destroyed. In Python, destructors are
not needed as much as in C++ because Python has a garbage collector that handles
memory management automatically.
The del () method is a known as a destructor method in Python. It is called
when all references to the object have been deleted i.e when an object is garbage
collected.

Syntax of destructor declaration :


def del (self):

# body of destructor

ADVANTAGES OF USING DESTRUCTORS IN PYTHON:

• Automatic cleanup:

Destructors provide automatic cleanup of resources used by an object when it is


no longer needed. This can be especially useful in cases where resources are limited, or
where failure to clean up can lead to memory leaks or other issues.
 Consistent behavior:

Destructors ensure that an object is properly cleaned up, regardless of how it is


used or when it is destroyed. This helps to ensure consistent behavior and can help to
prevent bugs and other issues.
 Easy to use:

Destructors are easy to implement in Python, and can be defined using the

del () method.

 Supports object-oriented programming:

Destructors are an important feature of object-oriented programming, and can


be used to enforce encapsulation and other principles of object-oriented design.

 Helps with debugging:

Destructors can be useful for debugging, as they can be used to trace


the lifecycle of an object and determine when it is being destroyed.

INHERITANCE IN PYTHON

One of the core concepts in (OOP) languages is inheritance. It is a mechanism that


allows you to create a hierarchy of classes that share a set of properties and methods
by deriving a class from another class. Inheritance is the capability of one class to derive
or inherit the properties from another class.
Benefits of inheritance are:

Inheritance allows you to inherit the properties of a class, i.e., base class to
another, i.e., derived class.

 It represents real-world relationships well.


 It provides the reusability of a code. We don‟t have to write the same code again
and again. Also, it allows us to add more features to a class without modifying it.
 It is transitive in nature, which means that if class B inherits from another class A,
then all the subclasses of B would automatically inherit from class A.
 Inheritance offers a simple, understandable model structure.
 Less development and maintenance expenses result from an inheritance.

Python Inheritance Syntax

The syntax of simple inheritance in Python is as follows:

Class BaseClass:

{Body}
Class DerivedClass(BaseClass):

{Body}

POLYMORPHISM IN PYTHON

The word polymorphism means having many forms. In programming,


polymorphism means the same function name (but different signatures) being used for
different types. The key difference is the data types and number of arguments used in
function.

POLYMORPHISM WITH INHERITANCE:

In Python, Polymorphism lets us define methods in the child class that have
the same name as the methods in the parent class. In inheritance, the child class inherits
the methods from the parent class. However, it is possible to modify a method in a child
class that it has inherited from the parent class. This is particularly useful in cases where
the method inherited from the parent class doesn‟t quite fit the child class. In such
cases, we re- implement the method in the child class. This process of re-implementing
a method in the child class is known as Method Overriding.

Class or Static Variables in Python


All objects share class or static variables. An instance or non-static variables are
different for different objects (every object has a copy).
Features of Static Variables

 Static variables are allocated memory once when the object for the class is
created for the first time.
 Static variables are created outside of methods but inside a class
 Static variables can be accessed through a class but not directly with an
instance.
 Static variables behavior doesn‟t change for every object.

Static variables can be useful for maintaining state across all instances of a class,
or for sharing data among all instances of a class. However, it‟s important to use them
carefully and to ensure that their values are synchronized with the state of the
program, especially in a multithreaded environment.

Advantages:

 Memory efficiency:

Since static variables are shared among all instances of a class, they can
save memory by avoiding the need to create multiple copies of the same data.
 Shared state:

Static variables can provide a way to maintain shared state across all
instances of a class, allowing all instances to access and modify the same data.
 Easy to access:

Static variables can be accessed using the class name itself, without needing
an instance of the class. This can make it more convenient to access and modify the
data stored in a static variable.
 Initialization:

Static variables can be initialized when the class is defined, making it easy to
ensure that the variable has a valid starting value.
 Readability:

Static variables can improve the readability of the code, as they clearly
indicate that the data stored in the variable is shared among all instances of the class.
Disadvantages:
 Inflexibility:

Static variables can be inflexible, as their values are shared across all
instances of the class, making it difficult to have different values for different
instances.
 Hidden dependencies:

Static variables can create hidden dependencies between different parts


of the code, making it difficult to understand and modify the code.
 Thread safety:

Static variables can be problematic in a multithreaded environment, as


they can introduce race conditions and synchronization issues if not properly
synchronized.
 Namespace pollution:

Static variables can add to the namespace of the class, potentially causing
name conflicts and making it harder to maintain the code.
 Testing:

Static variables can make it more difficult to write effective unit tests,
as the state of the static variable may affect the behavior of the class and its
methods. Overall, static variables can be a useful tool in Python programming,
but they should be used with care and attention to potential downsides, such as
inflexibility, hidden dependencies, and thread safety concerns.
METAPROGRAMMING WITH METACLASSES IN PYTHON
The metaclass is responsible for the generation of classes, so we can write
our custom metaclasses to modify the way classes are generated by performing extra
actions or injecting code. Usually, we do not need custom metaclasses but sometimes
it‟s necessary. There are problems for which metaclass and non-metaclass-based
solutions are available (which are often simpler) but in some cases, only metaclass.
Creating custom Metaclass

To create our custom meta class, our custom meta class has to inherit
type meta class and usually override –
 new ():

It‟s a method which is called before init (). It creates the object and returns
it.

We can override this method to control how the objects are created.

 init ():

This method just initialize the created object passed as a parameter .We can
create

classes using the type() function directly.


It can be called in following ways –

1. When called with only one argument, it returns the type. We have seen it
before in the above examples.
2. When called with three parameters, it creates a class. Following arguments are
passed to it
3. Class name
4. Tuple having base classes inherited by class
5. Class Dictionary: It serves as a local namespace for the class, populated with class
methods and variable
PYTHON EXCEPTION HANDLING:

Error in Python can be of two types. Errors are problems in a program due to which
the program will stop the execution. On the other hand, exceptions are raised when
some internal events occur which change the normal flow of the program.

Different types of exceptions in python:

In Python, there are several built-in Python exceptions that can be raised when an
error occurs during the execution of a program. Here are some of the most common
types of exceptions in Python:
 Syntax Error:

This exception is raised when the interpreter encounters a syntax error in the
code, such as a misspelled keyword, a missing colon, or an unbalanced parenthesis.
 Type Error:

This exception is raised when an operation or function is applied to an


object of the wrong type, such as adding a string to an integer.
 Name Error:

This exception is raised when a variable or function name is not found in the
current scope.
 Index Error:

This exception is raised when an index is out of range for a list, tuple, or
other sequence types.
 Key Error:

This exception is raised when a key is not found in a dictionary.

 Value Error:

This exception is raised when a function or method is called with an invalid


argument or input, such as trying to convert a string to an integer when the string
does not represent a valid integer.

 Attribute Error
This exception is raised when an attribute or method is not found on an
object, such as trying to access a non-existent attribute of a class instance.

Advantages of Exception Handling:

 Improved program reliability:

By handling exceptions properly, you can prevent your program from


crashing or producing incorrect results due to unexpected errors or input.
 Simplified error handling:

Exception handling allows you to separate error handling code from the
main program logic, making it easier to read and maintain your code.
 Cleaner code:

With exception handling, you can avoid using complex conditional


statements to check for errors, leading to cleaner and more readable code.
 Easier debugging:

When an exception is raised, the Python interpreter prints a trace back


that shows the exact location where the exception occurred, making it easier to
debug your code.
Disadvantages of Exception Handling:

 Performance overhead:

Exception handling can be slower than using conditional statements to


check for errors, as the interpreter has to perform additional work to catch and
handle the exception.
 Increased code complexity:

Exception handling can make your code more complex, especially if you
have to handle multiple types of exceptions or implement complex error handling
logic.
 Possible security risks:

Improperly handled exceptions can potentially reveal sensitive


information or create security vulnerabilities in your code, so its important to
handle exceptions carefully and avoid exposing too much information about
your program. Overall, the benefits of exception handling in Python outweigh the
drawbacks, but its important to use it judiciously and carefully in order to
maintain code quality and program reliability.

PYTHON FUNCTIONS

Python Functions is a block of statements that return the specific task. The idea
is to put some commonly or repeatedly done tasks together and make a function
so that instead of writing the same code again and again for different inputs, we
can do the function calls to reuse code contained in it over and over again.

Benefits of Using Functions

 Increase Code Readability

 Ease of use

Generators in Python

A Generator in Python is a function that returns an iterator using the Yield

keyword.In this article, we will discuss how the generator function works in python.
Generator Function in Python

A generator function in Python is defined like a normal function, but whenever


it needs to generate a value, it does so with the rather than return. If the body of a
def contains yield, the function automatically becomes a Python generator function.
Create a Generator in Python

In Python, we can create a generator function by simply using the def keyword and
the yield keyword. The generator has the following

syntax
def function_name():

Generator Object

Python Generator functions return a generator object that is iterable, i.e., can be used
as an Generator objects are used either by calling the next method of the generator object
or using the generator object in a “for in” loop.
Python Generator Expression

In Python, generator expression is another way of writing the generator function. It uses
the Python technique but instead of storing the elements in a list in memory, it creates
generator objects.
Generator Expression Syntax

The generator expression in Python has the following Syntax: (expression for item in
iterable)

PYTHON LAMBDA

Python, an anonymous function means that a function is without a name. As we already


know that def keyword is used to define the normal functions and the lambda keyword is
used to create anonymous functions.
Python lambda Syntax:

lambda arguments : expression


Python lambda properties:

 This function can have any number of arguments but only one expression,
which is evaluated and returned.
 One is free to use lambda functions wherever function objects are required.

 You need to keep in your knowledge that lambda functions are syntactically
restricted to a single expression.
 It has various uses in particular fields of programming, besides other
types of expressions in functions.
Python input() Function

Python input() function is used to take user input. By default, it returns the
user input in form of a string.
input() Function

Syntax:

input(prompt)

prompt [optional]: any string value to display as input message

Python list() Function

Python list() function takes any iterable as a parameter and returns a list.
In Python iterable is the object you can iterate over.
Syntax: list(iterable)

Parameter:

 iterable: 

An object that could be a sequence (string, tuples) or collection (set,


dictionary) or any iterator object.
We can create by using list() function. Below are the ways by which we can use
list() function in Python:
 To create a list from a string

 To create a list from a tuple

 To create a list from set and dictionary


 Taking user input as a list

Using pandas crosstab to create a bar plot

It is a simple cross-tabulation that help us to understand the relationship


between two or more variable. It will give a clear understanding of the data and
makes analysis easier.

Let us take an example if we take a data set of Handedness of people

which includes peoples nationality, sex, age, and name. Suppose if we want to
analyze the relationship between nationality and handedness of the peoples. Crosstab
. gives you the relationship between them

Crosstab using pandas

Before creating the barplot we should create cross-tabulation using pandas.


Syntax: pandas.crosstab(index, columns, values=None, rownames=None,
colnames=None, aggfunc=None, margins=False, margins_name=’All’, dropna=True,
normalize=False
Creating bar plots
Bar graphs are most used to compare between different groups or to track changes
over time. Using bar plots to the crosstab is one of the efficient ways to conclude the
crosstab and analyze them even better.

Syntax: DataFrame.plot.bar(x=None, y=None, **kwargs)


Stacked barplot

Dataframe.plot(kind=”bar”, stacke d = True, rot=0)

Exploring Correlation in Python

A correlation Matrix is basically a covariance matrix. Also known as the auto-


covariance matrix, dispersion matrix, variance matrix, or variance-covariance matrix.
It is a matrix in which the i-j position defines the correlation between the ith and jth
parameter of the given data set. When the data points follow a roughly straight-line
trend, the variables are said to have an approximately linear relationship. In some
cases, the data points fall close to a straight line, but more often there is quite a bit of
variability of the points around the straight-line trend. A summary measure called
correlation describes the strength of the linear association.

Correlation in Python

Correlation summarizes the strength and direction of the linear (straight-line)


association between two quantitative variables. Denoted by r, it takes values
between -1 and +1. A positive value for r indicates a positive association, and
a negative value for r indicates a negative association. The closer r is to 1 the closer
the data points fall to a

straight line, thus, the linear association is stronger. The closer r is to 0, making
the linear association weaker.

PYTHON MODULES FOR AUTOMATION


1. PyAutoGUI

PyAutoGUI is a Python library that allows you to automate tasks by


controlling the mouse and keyboard. It‟s a powerful tool for automating repetitive
tasks, creating macros, and even testing GUI applications.
2. Selenium

Selenium is a powerful tool for automating interactions with web applications. It allows
us to script actions that a user would typically perform on a website, such as clicking
buttons, filling out forms, and navigating through web pages
3. Requests

Automation using the requests library in Python is typically used for making HTTP
requests to interact with web services, APIs, or websites programmatically. You can send
various types of HTTP requests, such as GET, POST, PUT, DELETE, etc. Once you
send a request, you can handle the response, which includes the status code, headers, and
content.
4. Beautiful Soup

Automation using BeautifulSoup is typically used for web scraping tasks. BeautifulSoup
is a Python library that makes it easy to extract data from HTML and XML documents.
We can use Use BeautifulSoup‟s methods to locate and extract specific elements
from the HTML document.
5. Pandas

Automation using pandas typically involves automating tasks related to data


manipulation, analysis, and processing. Once the data is obtained we want to
automate tasks on it.
The data can come from various sources, including CSV files, Excel spreadsheets,
databases, web APIs, or web scraping using libraries like BeautifulSoup. We can
use pandas to conduct data analysis, including summary statistics, grouping, aggregation,
and visualization.
PYTHON JSON
Python JSON JavaScript Object Notation is a format for structuring data. It is
mainly used for storing and transferring data between the browser and the
server.

This package provides all the necessary tools for working with JSON Objects
including parsing, deserializing, and many more.

TESTING IN PYTHON
Test Runner is a library or a testing tool which reads the source code that contains unit
tests and a bunch of settings which can be executed and produces its output to the
console or log files. There are different Test Runners available in Python. Popular one
are
 Unit test
 nose or nose2
 pytest
unit test :
It is built into the standard python library. import unit test should be the
starting line of code for using it. Depends upon the python version, it should differ as
later versions of Python supports unit test and earlier versions supported unittest2.
nose or nose2:
This is an open source application and similar to unit test only.It is compatible
with numerous kinds of tests that are written using unit test framework. nose2 is
the recent version one, and they are installed by using.
pytest:
It supports unit test test cases execution. It has benefits like supporting built in
assert statement, filtering of test cases, returning from last failing test etc
How to Structure a Simple Test:
1. For writing a test, need to know what is going to get tested.
2. Does it cover unit testing and/or integration testing?
3. All kind of necessary inputs (it can range between integer, float, type data types
etc., ) and the code for their execution and get the output and compare the
output with expected result.
How to Write Assertions:
Assertion is nothing but validating the output against a known response. i.e.
in above code, we have passed the list containing 3 values namely 10, 20 and 30,
and we know that its multiplication result is 6000. So as a last step in code, we will be
writing assertion code and above code comes up with assert Equal and surely it will
give the output as 6000 and hence the test case passes.
pytest:
It supports unit test test cases execution. It has benefits like supporting built in
assert statement, filtering of test cases, returning from last failing test etc
How to Structure a Simple Test:
1. For writing a test, need to know what is going to get tested.
2. Does it cover unit testing and/or integration testing?
3. All kind of necessary inputs (it can range between integer, float, type data
types etc., ) and the code for their execution and get the output and
compare the output with expected result.
How to Write Assertions:
Assertion is nothing but validating the output against a known response. i.e.
in above code, we have passed the list containing 3 values namely 10, 20 and 30,
and we know that its multiplication result is 6000. So as a last step in code, we will be
writing assertion code and above code comes up with assert Equal and surely it will
give the output as 6000 and hence the test case passes.
RUNNING TESTS FROM PYCHARM:
1. First from project tool window, select the tests directory
2. Then, on the context menu, choose “Unit Tests in” or “PyTests in“ For individual
test,
 Via main toolbar by using Run or Debug command
 Via context menu by using Run or Debug by clicking the specific file
Testing for Web Frameworks Like Django and Flask:
Based on unit test, Django and Flask makes things easier, and they have their
testing framework:
Django Test Runner:
The Django start app template will have created a tests.py file inside your
application directory. If you don’t have that already, you can create it with the
following contents.

INTRODUCTION TO SQLITE
SQLite is an in-process library that implements a self-contained, serverless,
zero- configuration, transactional SQL database engine. It is a popular choice as an
embedded database for local/client storage in application software such as web
browsers. It is also used in many other applications that need a lightweight, embedded
database.
SQLite is ACID-compliant and implements most of the SQL standards,
using a dynamically and weakly typed SQL syntax that does not guarantee domain
integrity.
To use SQLite in a C/C++ program, you can use the sqlite3 API, which provides
a lightweight, simple, self-contained, high-reliability, full-featured, and SQL database
engine. The API is implemented as a library of C functions that can be called from your
program. One of the main benefits of using SQLite is that it is very easy to get started
with.
SQLite History
SQLite was created in the year 2000 by D. Richard Hipp, who continues
to lead the development of the software today. SQLite was designed to be a lightweight
and simple database engine that could be easily embedded into other applications. It
was created as an alternative to more complex and heavyweight database engines, such
as MySQL and PostgreSQL. Over the years, SQLite has gained widespread adoption
and is now one of the most widely used database engines in the world. It is used in
many applications, including web browsers, mobile phones, and a wide variety of other
software.

SQLite is an open-source software project, and the source code is available


under the terms of the SQLite license, which is a permissive, public domain-like
license. This has contributed to its widespread adoption, as developers are free to use
and modify the source code as they see fit.
Why SQLite?
1. Ease of use:
SQLite is very easy to get started with, as it requires no setup or
configuration.
You can simply include the library in your project and start using it.
2. Embeddability:
SQLite is designed to be embedded into other applications. It is a self-
contained, serverless database engine, which means you can include it in your
application without the need for a separate database server.
3. Lightweight:
SQLite is a very lightweight database engine, with a small library size
(typically less than 1MB). This makes it well-suited for use in applications where
the database is embedded directly into the application binary.
4. Serverless:

As mentioned earlier, SQLite is a serverless database engine, which means


there is no need to set up and maintain a separate database server process. This makes
it easy to deploy and manage, as there are no additional dependencies to worry about.
5. Cross-platform:
SQLite is available on many platforms, including Linux, macOS, and
Windows, making it a good choice for cross-platform development.
6. Standalone:
SQLite stores all of the data in a single file on the filesystem, which makes it
easy to copy or backup the database.
7. High reliability:
SQLite has been widely tested and used in production systems for many
years, and has a reputation for being a reliable and robust database engine.
Features of SQLite
 The transactions follow ACID properties i.e. atomicity, consistency, isolation, and
durability even after system crashes and power failures.
 The configuration process is very easy, no setup or administration is needed.
 All the features of SQL are implemented in it with some additional features like
partial indexes, indexes on expressions, JSON, and common table expressions.
 Sometimes it is faster than the direct file system I/O.
 It supports terabyte-sized databases and gigabyte-sized strings and blobs.
 Almost all OS supports SQLite like Android, BSD, iOS, Linux, Mac, Solaris,
VxWorks, and Windows (Win32, WinCE, etc. It is very much easy to port to other
systems.
 A complete database can be stored in a single cross-platform disk file.

Applications of SQLite
1. Due to its small code print and efficient usage of memory, it is the popular
choice for the database engine in cell phones, PDAs, MP3 players, set-top boxes,
and other electronic gadgets.
2. It is used as an alternative for open to writing XML, JSON, CSV, or some
proprietary format into disk files used by the application.
3. As it has no complication for configuration and easily stores file in an ordinary disk
file, so it can be used as a database for small to medium sized websites.
4. It is faster and accessible through a wide variety of third-party tools, so it has great
applications in different software platforms.
SQLite Commands
In SQLite, DDL (Data Definition Language) is used to create and modify
database objects such as tables, indices, and views. Some examples of DDL
statements in SQLite are:

o CREATE TABLE: creates a new table in the database


o ALTER TABLE: modifies an existing table in the database
o DROP TABLE: deletes a table from the database
o CREATE INDEX: creates a new index on a table
o DROP INDEX: deletes an index from a table
DML (Data Modification Language):
DML is used to modify the data stored in the database. Some examples of
DML statements in SQLite are:
o INSERT INTO: inserts a new row into a table
o UPDATE: updates the data in one or more rows of a table
o DELETE FROM: deletes one or more rows from a table
DQL (Data Query Language):
DML is used to retrieve data from the database. Some examples of DQL
statements in SQLite are:
o SELECT: retrieves data from one or more tables in the database
o JOIN: retrieves data from multiple tables based on a common field
o GROUP BY: groups the results of a query by one or more fields
o HAVING: filters the results of a query based on a condition
SQLite Limitation
vLimited concurrency:
SQLite uses file-based locking to control access to the database, which
can lead to performance issues when multiple clients are trying to read and write to the
database simultaneously. This makes it less suitable for use in highly
concurrent systems. No support for stored procedures: SQLite does not support
stored procedures, which are pre-compiled SQL statements that can be executed on
the server. This means that all SQL code must be sent to the server and compiled at
runtime, which can be less efficient than using stored procedures.
No support for triggers:
SQLite does not support triggers, which are database actions that are
automatically triggered by specified events (such as the insertion of a row into a
table). This means that you have to manually implement any logic that needs to be
triggered by specific events.

Limited support for data types:

SQLite has a relatively small set of data types compared to other database
engines. It does not support many of the more advanced data types, such as arrays
and JSON, that are available in other databases.

Limited scalability:
SQLite is not designed to be a high-concurrency, high-transaction-rate
database engine. It is more suited for use in smaller-scale, low-concurrency systems,
and may not be able to scale to handle very large amounts of data or very high levels
of concurrency.
Difference between MySQL and SQLite:

1. MySQL :
MySQL is an open-source relational database management system(RDBMS)
based on Structured Query Language (SQL). It is currently developed and managed
by Oracle Corporation, since acquisition by Sun Microsystems on 27 January 2010,
which had itself acquired MySQL in 2008. It was initially released internally on
23 may 1995 by David Axmark, Allan Larsson and Michael “Monty” Widenius
of MySQL AB from Sweden, though development for personal use by Widenius and
Axmark began in 1994. Since acquisition of Sun by Oracle, the original developers
left MySQL to work on a fork known as MariaDB. It is widely being used in many
small and large scale industrial applications and capable of handling a large volume
of data.
2. SQLite :
SQLite is a software library that provides a relational database management
system(RDBMS). It was designed by D. Richard Hipp on August 2000. The design
goals of SQLite were to allow the program to be operated without installing a database
management system(DBMS) or requiring a database administrator. The lite in SQLite
means light weight in terms of setup, database administration, and required resource.
Difference between MySQL and SQLite:

S.NO.
MySQL SQLite
1. Released by MySQL AB on May Developed By D. Richard Hipp
1995. Developed by Oracle since on August 2000.
2010.

2. MySQL is developed in C and C++ SQLite is developed only in C


languages. language.

3. MySQL requires a database server SQLite does not require a server


for its functioning. Hence, it to run. Hence, it is serverless.
follows client/server architecture.

4. It can handle multiple connections It can handle only one


simultaneously. connection at a time.

5. It is highly scalable and can handle It can handle only small set of
a large volume of data very data if the volume of data
efficiently. increased its performance
degrades.
6. It requires large space in the It requires only some KBs of
memory for its functioning (approx space as it is very lightweight
600 Mb). approx (250Kb- 300Kb).

7. MySQL supports multiple user SQLite does not support


environment. multiple user environment.

8. It also supports XML format. It does not supports XML


format.

9. MySQL is licensed under the GNU SQLite is in the public domain


General Public License which and can be used without any
means it is open source and free to licensing restrictions.
use
6.Project Description

The Comprehensive Customer Support Framework is a Python-based project aimed


at enhancing customer service operations by providing an efficient query resolution and
ticket management system. It ensures that users can register, submit queries, and track their
tickets, while support staff can manage and resolve customer issues effectively.

This project is built using Tkinter for GUI development, MySQL for database
management, and Python's MySQL Connector for seamless database connectivity. It
provides an intuitive and user-friendly interface for customers and support agents, ensuring
smooth query resolution and efficient ticket tracking.

Objectives
The main objectives of this project are:

 To develop a user-friendly GUI for query submission and ticket tracking.


 To implement a secure authentication system for user registration and login.
 To create an automated ticketing system for efficient query resolution.
 To enable database connectivity for structured data storage and retrieval.

 To provide an admin panel for support staff to manage and resolve customer tickets.

Technology Purpose

Core programming
Python language for logic
implementation
GUI framework for user
Tkinter
interface design
Database for storing user
MySQL credentials, queries, and
ticket status
Enables communication
MySQL Connector between Python and
MySQL
Secure password hashing
bcrypt
for authentication
Technologies & Packages Used
The project is developed using the following technologies and libraries:

Features & Functionalities

A. User Registration & Authentication

 New users can register by providing a username and password.


 Passwords are stored securely in the MySQL database.
 Registered users can log in to access the query submission interface.

B. Query Submission System

 Users can enter a subject and message describing their issue.


 Clicking the "Submit" button stores the query in the database.
 A unique ticket ID is generated for tracking purposes.

C. Ticket Management System (Admin Panel)

 Support staff can view and manage tickets from users.


 Each ticket has a status (Pending, In Progress, Resolved, Closed).
 Admin can update ticket status based on resolution progress.

D. Database Connectivity
MySQL is used to store:

 User Credentials (Username, Password)


 Submitted Queries (User ID, Subject, Message, Date Submitted)
 Ticket Status (Ticket ID, Status Updates, Resolution Time)
 MySQL Connector is used to establish a seamless connection between Python
and the database.

E. GUI-Based Interface (Using Tkinter)


A Graphical User Interface (GUI) is developed using -
The interface includes:
 Login Page (Username, Password, Login Button)
 Registration Page (Username, Password, Register Button)
 Query Submission Page (Subject, Message, Submit Button)
 Admin Panel (View Tickets, Update Status Button)

Functional Workflow

Step 1: User Registration

 A new user opens the application.


 They enter a username and password to register.
 The details are stored in the MySQL database.
 The user is redirected to the login page.

Step 2: User Login & Query Submission

 The registered user logs in using their credentials.


 After successful login, the user is directed to the query submission
page.
 The user enters the subject and message describing the issue.
 Clicking "Submit" saves the query in the database, and a unique ticket
ID is generated.
 The user receives a confirmation message with the ticket details.

Step 3: Admin Ticket Management

 The admin logs in to the Admin Panel.


 The system displays all pending tickets submitted by users.
 The admin can view details of each ticket.
 The ticket status is updated as In Progress, Resolved, or Closed.
 Once resolved, users receive a notification about the resolution.
Database Schema (MySQL Table Structure)
User Table (users)
Column Data Type Description
username VARCHAR(255) Unique Username
password VARCHAR(255) Hashed Password

Query Table (queries)


Column Data Type Description
ticket_id INT (Primary Key, Unique Ticket ID
Auto Increment)
subject TEXT Query Subject
message TEXT Query Message

Expected Outcomes

 Faster query resolution and tracking.


 Ensures structured issue handling.
 Simple GUI for easy navigation.
 MySQL ensures structured and safe data management.
 Users can track ticket progress seamlessly.

Future Enhancements

 Email Notifications – Send email updates for ticket status changes.


 Role-Based Access Control – Different access levels for users and support
staff.
 Chatbot Integration – AI-powered chatbot for instant query resolution.
 Performance Analytics Dashboard – Track support efficiency with charts and
reports.
7.Source code

import tkinter as tk
from tkinter import messagebox, ttk
import mysql.connector
# Database Connection
def connect_db():
return mysql.connector.connect(
host="localhost",
user="root",
password="udhaya@1507 ",
database="customer_support"
)
def create_tables():
db = connect_db()
cursor = db.cursor()
cursor.execute("""
CREATE TABLE IF NOT EXISTS users (
id INT AUTO_INCREMENT PRIMARY KEY,
username VARCHAR(100) UNIQUE,
password VARCHAR(100),
role ENUM('customer', 'admin')
)
""")
cursor.execute("""
CREATE TABLE IF NOT EXISTS tickets (
id INT AUTO_INCREMENT PRIMARY KEY,
user_id INT,
subject VARCHAR(255),
message TEXT,
status ENUM('Open', 'In Progress', 'Resolved') DEFAULT 'Open',
response TEXT,
FOREIGN KEY (user_id) REFERENCES users(id

)
""")
db.commit()
db.close()
create_tables()
def login_screen(root):
for widget in root.winfo_children():
widget.destroy()
tk.Label(root, text="Login", font=("Times", 20, "bold"), bg="#f2f2f2").pack(pady=20)
tk.Label(root, text="Username", font=("Times", 20, "bold"), bg="#f2f2f2").pack()
username_entry = tk.Entry(root)
username_entry.pack()
tk.Label(root, text="Password", font=("Times", 20, "bold"), bg="#f2f2f2").pack()
password_entry = tk.Entry(root, show="*")
password_entry.pack()
tk.Button(root, text="Login", command=lambda: authenticate(root,
username_entry.get(), password_entry.get()),
bg="#4CAF50", fg="white").pack(pady=10)
tk.Button(root, text="Register", command=lambda: register_screen(root),
bg="#008CBA", fg="white").pack()
def register_user(root, username, password):
if not username or not password:
messagebox.showerror("Error", "Username and password cannot be empty")
return
db = connect_db()
cursor = db.cursor()
try:
cursor.execute("INSERT INTO users (username, password, role) VALUES (%s,
%s, 'customer')", (username, password))
db.commit()
messagebox.showinfo("Success", "Registration successful! You can now log in.")
login_screen(root)
except mysql.connector.IntegrityError:
messagebox.showerror("Error", "Username already exists. Try a different one.")
finally:
db.close()
def register_screen(root):
for widget in root.winfo_children():
widget.destroy()
tk.Label(root, text="Register", font=("Times", 20, "bold"),
bg="#f2f2f2").pack(pady=20)
tk.Label(root, text="Username", font=("Times", 20, "bold"), bg="#f2f2f2").pack()
reg_username_entry = tk.Entry(root)
reg_username_entry.pack()
tk.Label(root, text="Password", font=("Times", 20, "bold"), bg="#f2f2f2").pack()
reg_password_entry = tk.Entry(root, show="*")
reg_password_entry.pack()
tk.Button(root, text="Register",
command=lambda: register_user(root, reg_username_entry.get(),
reg_password_entry.get()), bg="#4CAF50",
fg="white").pack(pady=10)
tk.Button(root, text="Back to Login", command=lambda: login_screen(root),
bg="#008CBA", fg="white").pack()
def authenticate(root, username, password):
db = connect_db()
cursor = db.cursor()
cursor.execute("SELECT id, role FROM users WHERE username=%s AND
password=%s", (username, password))
user = cursor.fetchone()
db.close()
if user:
user_id, user_role = user
customer_dashboard(root, user_id) if user_role == 'customer' else
admin_dashboard(root)
else:
messagebox.showerror("Error", "Invalid credentials")
def admin_dashboard(root):
for widget in root.winfo_children():
widget.destroy()
tk.Label(root, text="Admin Dashboard", font=("Times", 20, "bold"),
bg="#f2f2f2").pack(pady=20)
tk.Button(root, text="Logout", command=lambda: login_screen(root),
bg="#FF5733", fg="white").pack()
def customer_dashboard(root, user_id):
for widget in root.winfo_children():
widget.destroy()
tk.Label(root, text="Customer Dashboard", font=("Times", 20, "bold"),
bg="#f2f2f2").pack(pady=20)
tk.Button(root, text="Create Ticket", command=lambda: create_ticket_screen(root,
user_id), bg="#4CAF50",
fg="white").pack(pady=5)
def create_ticket_screen(root, user_id):
for widget in root.winfo_children():
widget.destroy()
tk.Label(root, text="Create Support Ticket", font=("Times", 20, "bold"),
bg="#f2f2f2").pack(pady=20)
tk.Label(root, text="Subject", font=("Times", 20, "bold"), bg="#f2f2f2").pack()
ticket_subject = tk.Entry(root)
ticket_subject.pack()
tk.Label(root, text="Message", font=("Times", 20, "bold"), bg="#f2f2f2").pack()
ticket_message = tk.Text(root, height=5, width=40)
ticket_message.pack()

tk.Button(root, text="Submit",
command=lambda: submit_ticket(root, user_id, ticket_subject.get(),
ticket_message.get("1.0", tk.END)),
bg="#4CAF50", fg="white").pack(pady=10)
tk.Button(root, text="Back", command=lambda: customer_dashboard(root, user_id),
bg="#008CBA", fg="white").pack()
def submit_ticket(root, user_id, subject, message):
db = connect_db()
cursor = db.cursor()
cursor.execute("INSERT INTO tickets (user_id, subject, message) VALUES (%s, %s,
%s)", (user_id, subject, message))
db.commit()
ticket_id = cursor.lastrowid
cursor.execute("SELECT * FROM tickets WHERE id = %s", (ticket_id,))
ticket_details = cursor.fetchone()
db.close()
evidence_message = (
f"Ticket Submitted Successfully!\n\n"
f"Ticket ID: {ticket_details[0]}\n"
f"Subject: {ticket_details[2]}\n"
f"Message: {ticket_details[3]}\n"
f"Status: {ticket_details[4]}\n"
)
messagebox.showinfo("Ticket Submission Evidence", evidence_message)
customer_dashboard(root, user_id)
root = tk.Tk()
root.title("Customer Support System")
root.geometry("600x400")
root.configure(bg="#f2f2f2")
login_screen(root)
root.mainloop()

import tkinter as tk
from tkinter import ttk, messagebox
import mysql.connector
# Database Connection
def connect_db():
return mysql.connector.connect(
host="localhost",
user="root",
password="udhaya@1507 ",
database="customer_support"
)
def fetch_tickets():
db = connect_db()
cursor = db.cursor()
cursor.execute("SELECT id, subject, message, response FROM tickets")
tickets = cursor.fetchall()
db.close()
return tickets
def update_response(ticket_id, response):
db = connect_db()
cursor = db.cursor()
cursor.execute("UPDATE tickets SET response=%s WHERE id=%s", (response,
ticket_id))
db.commit()
db.close()
messagebox.showinfo("Success", "Response updated successfully!")
show_tickets()
def delete_ticket(ticket_id):
db = connect_db()
cursor = db.cursor()
cursor.execute("DELETE FROM tickets WHERE id=%s", (ticket_id,))
db.commit()
db.close()
messagebox.showinfo("Success", "Ticket deleted successfully!")
show_tickets()
def show_tickets():
root = tk.Tk()
root.title("Ticket and Comment View")
root.geometry("900x500")
tree = ttk.Treeview(root, columns=("ID", "Subject", "Message", "Response"),
show="headings")
tree.heading("ID", text="Ticket ID")
tree.heading("Subject", text="Subject")
tree.heading("Message", text="Message")
tree.heading("Response", text="Response")
tree.column("ID", width=80)
tree.column("Subject", width=200)
tree.column("Message", width=300)
tree.column("Response", width=200)
tree.pack(fill=tk.BOTH, expand=True)
tickets = fetch_tickets()
for ticket in tickets:
tree.insert("", "end", values=ticket)
response_entry = tk.Entry(root, width=50)
response_entry.pack(pady=5)
def respond():
selected_item = tree.selection()
if not selected_item:
messagebox.showerror("Error", "No ticket selected")
return
ticket_id = tree.item(selected_item, "values")[0]
response = response_entry.get()
if response:
update_response(ticket_id, response)
else:
messagebox.showerror("Error", "Response cannot be empty")
def delete():
selected_item = tree.selection()
if not selected_item:
messagebox.showerror("Error", "No ticket selected")
return
ticket_id = tree.item(selected_item, "values")[0]
delete_ticket(ticket_id)
tk.Button(root, text="Respond", command=respond, bg="#4CAF50",
fg="white").pack(pady=5)
tk.Button(root, text="Delete", command=delete, bg="#FF5733",
fg="white").pack(pady=5)
root.mainloop()
if __name__ == "__main__":
show_tickets()

1. Database Setup

a) Connecting to MySQL

python

CopyEdit

def connect_db():

return mysql.connector.connect(

host="localhost",

user="root",
password="udhaya@1507",

database="customer_support"

 This function establishes a connection to a MySQL database named customer_support


using the provided credentials.

b) Creating Tables

python

CopyEdit

def create_tables():

db = connect_db()

cursor = db.cursor()

cursor.execute("""

CREATE TABLE IF NOT EXISTS users (

id INT AUTO_INCREMENT PRIMARY KEY,

username VARCHAR(100) UNIQUE,

password VARCHAR(100),

role ENUM('customer', 'admin')

""")

cursor.execute("""

CREATE TABLE IF NOT EXISTS tickets (

id INT AUTO_INCREMENT PRIMARY KEY,

user_id INT,
subject VARCHAR(255),

message TEXT,

status ENUM('Open', 'In Progress', 'Resolved') DEFAULT 'Open',

response TEXT,

FOREIGN KEY (user_id) REFERENCES users(id)

""")

db.commit()

db.close()

 users table stores id, username, password, and role (either ‘customer’ or ‘admin’).

 tickets table stores support tickets submitted by users.

2. User Authentication

a) Login Screen

python

CopyEdit

def login_screen(root):

for widget in root.winfo_children():

widget.destroy()

tk.Label(root, text="Login", font=("Times", 20, "bold"),


bg="#f2f2f2").pack(pady=20)

tk.Label(root, text="Username", font=("Times", 20, "bold"), bg="#f2f2f2").pack()

username_entry = tk.Entry(root)
username_entry.pack()

tk.Label(root, text="Password", font=("Times", 20, "bold"), bg="#f2f2f2").pack()

password_entry = tk.Entry(root, show="*")

password_entry.pack()

tk.Button(root, text="Login", command=lambda: authenticate(root,


username_entry.get(), password_entry.get()),

bg="#4CAF50", fg="white").pack(pady=10)

tk.Button(root, text="Register", command=lambda: register_screen(root),


bg="#008CBA", fg="white").pack()

 The login screen allows users to enter a username and password.

b) User Authentication

python

CopyEdit

def authenticate(root, username, password):

db = connect_db()

cursor = db.cursor()

cursor.execute("SELECT id, role FROM users WHERE username=%s AND


password=%s", (username, password))

user = cursor.fetchone()

db.close()

if user:

user_id, user_role = user

customer_dashboard(root, user_id) if user_role == 'customer' else


admin_dashboard(root)
else:

messagebox.showerror("Error", "Invalid credentials")

 Verifies the username and password from the database.

 Redirects the user to either Customer Dashboard or Admin Dashboard.

3. User Registration

a) Registration Screen

python

CopyEdit

def register_screen(root):

for widget in root.winfo_children():

widget.destroy()

tk.Label(root, text="Register", font=("Times", 20, "bold"),


bg="#f2f2f2").pack(pady=20)

tk.Label(root, text="Username", font=("Times", 20, "bold"), bg="#f2f2f2").pack()

reg_username_entry = tk.Entry(root)

reg_username_entry.pack()

tk.Label(root, text="Password", font=("Times", 20, "bold"), bg="#f2f2f2").pack()

reg_password_entry = tk.Entry(root, show="*")

reg_password_entry.pack()

tk.Button(root, text="Register",

command=lambda: register_user(root, reg_username_entry.get(),


reg_password_entry.get()), bg="#4CAF50",

fg="white").pack(pady=10)
tk.Button(root, text="Back to Login", command=lambda: login_screen(root),
bg="#008CBA", fg="white").pack()

 Provides an interface for new users to register.

b) Registering Users

python

CopyEdit

def register_user(root, username, password):

if not username or not password:

messagebox.showerror("Error", "Username and password cannot be empty")

return

db = connect_db()

cursor = db.cursor()

try:

cursor.execute("INSERT INTO users (username, password, role) VALUES (%s,


%s, 'customer')", (username, password))

db.commit()

messagebox.showinfo("Success", "Registration successful! You can now log in.")

login_screen(root)

except mysql.connector.IntegrityError:

messagebox.showerror("Error", "Username already exists. Try a different one.")

finally:

db.close()

 Registers a customer by inserting data into the users table.


4. Customer Dashboard

python

CopyEdit

def customer_dashboard(root, user_id):

for widget in root.winfo_children():

widget.destroy()

tk.Label(root, text="Customer Dashboard", font=("Times", 20, "bold"),


bg="#f2f2f2").pack(pady=20)

tk.Button(root, text="Create Ticket", command=lambda: create_ticket_screen(root,


user_id), bg="#4CAF50",

fg="white").pack(pady=5)

 Allows customers to create new support tickets.

Creating a Support Ticket

python

CopyEdit

def create_ticket_screen(root, user_id):

for widget in root.winfo_children():

widget.destroy()

tk.Label(root, text="Create Support Ticket", font=("Times", 20, "bold"),


bg="#f2f2f2").pack(pady=20)

tk.Label(root, text="Subject", font=("Times", 20, "bold"), bg="#f2f2f2").pack()

ticket_subject = tk.Entry(root)

ticket_subject.pack()
tk.Label(root, text="Message", font=("Times", 20, "bold"), bg="#f2f2f2").pack()

ticket_message = tk.Text(root, height=5, width=40)

ticket_message.pack()

tk.Button(root, text="Submit",

command=lambda: submit_ticket(root, user_id, ticket_subject.get(),


ticket_message.get("1.0", tk.END)),

bg="#4CAF50", fg="white").pack(pady=10)

tk.Button(root, text="Back", command=lambda: customer_dashboard(root, user_id),


bg="#008CBA", fg="white").pack()

 Users enter subject and message before submitting the ticket.

5. Admin Dashboard

python

CopyEdit

def admin_dashboard(root):

for widget in root.winfo_children():

widget.destroy()

tk.Label(root, text="Admin Dashboard", font=("Times", 20, "bold"),


bg="#f2f2f2").pack(pady=20)

tk.Button(root, text="Logout", command=lambda: login_screen(root),


bg="#FF5733", fg="white").pack()

 Admin can view and manage tickets.

Admin Ticket Management

python

CopyEdit
def show_tickets():

root = tk.Tk()

root.title("Ticket and Comment View")

root.geometry("900x500")

tree = ttk.Treeview(root, columns=("ID", "Subject", "Message", "Response"),


show="headings")

tree.heading("ID", text="Ticket ID")

tree.heading("Subject", text="Subject")

tree.heading("Message", text="Message")

tree.heading("Response", text="Response")

tickets = fetch_tickets()

for ticket in tickets:

tree.insert("", "end", values=ticket)

def respond():

selected_item = tree.selection()

ticket_id = tree.item(selected_item, "values")[0]

response = response_entry.get()

update_response(ticket_id, response)

def delete():

selected_item = tree.selection()

ticket_id = tree.item(selected_item, "values")[0]

delete_ticket(ticket_id)
tk.Button(root, text="Respond", command=respond, bg="#4CAF50",
fg="white").pack()

tk.Button(root, text="Delete", command=delete, bg="#FF5733", fg="white").pack()

root.mainloop()
8.SCREEN LAYOUT

REGISTRATION PORTAL:

REGISTRATION SUCCESSFUL:
LOGIN PORTAL:

DASHBOARD:
CREATE YOUR TICKET:

HERE’s YOUR TICKET CREATED:


COMMENT VIEW:
9.SYSTEM TESTING

System testing is a comprehensive testing process that evaluates the complete and
integrated software system to verify that it meets specified requirements. It involves testing the
software's functionality, reliability, and performance as a whole, rather than individual
components, to ensure overall system quality and effectiveness.

It is indeed typically accomplished by software testing engineers. Its performance occurs


in a context comparable to the one used in production, permitting the developers and other
relevant parties to analyze user responses.

There are four levels of software testing: unit, integration testing, system testing and
acceptance testing, all are used for the testing purpose. Unit Testing used to test a single
software; Integration Testing used to test a group of units of software, System Testing used to
test a whole system and Acceptance Testing used to test the acceptability of business
requirements. Here we are discussing system testing which is the third level of testing levels.

The below flowchart shows where the System testing happens in the software
development life-cycle.
It is important to follow a specific order when testing software. Following is a
chronologically organized list of software testing categories.

 Unit testing - During development, each module or block of code is subjected to


unit testing. Most of the time, the programmer who writes the code is responsible
for unit testing.
 Integration testing - It occurs before, during, and after integrating a new module
into the main software package. This includes testing each code module. A single
piece of software may comprise various modules, which are frequently built by
multiple developers.
 System testing - A high-skilled software tester performs System testing on the
entire software application before it is released to the general public.
 Acceptance testing - Acceptance testing and beta testing of a software application
are performed by real end users.
 White box testing - Which uses internal coding to design test cases
 Black box testing- Which uses GUI or user perspective to develop test cases.
 Validation testing-Verifying that the software performs as intended and addresses
user needs effectively.

System testing falls under Black box testing as it includes testing of the external working of the
software. Testing follows user's perspective to identify minor defects.

System Testing includes the following steps.

 Verification of input functions of the application to test whether it is producing


the expected output or not. o Testing of integrated software by including external
peripherals to check the interaction of various components with each other.
 Testing of the whole system for End to End testing.
 Behaviour testing of the application via a user's experience
System Testing Important

 System Testing gives hundred percent assurance of system performance as it


covers end to end function of the system. o It includes testing of System software
architecture and business requirements. o It helps in mitigating live issues and
bugs even after production.
 System testing uses both existing system and a new system to feed same data in
both and then compare the differences in functionalities of added and existing
functions so, the user can understand benefits of new added functions of the
system.
10.CONCLUSION

A Customer Support System is a vital component of any business, ensuring efficient


communication and resolution of customer issues. By integrating technologies like ticketing
systems, AI chatbots, knowledge bases, and analytics, businesses can enhance customer
satisfaction, streamline operations, and improve service quality.The application of service
management theories such as Queuing Theory, the SERVQUAL Model, and Customer
Satisfaction Theory helps optimize response times, measure service quality, and meet
customer expectations.

A well-implemented Customer Support System leads to: Higher customer satisfaction


and loyalty. Improved efficiency and reduced response time. Better decision-making through
data-driven insights. Increased business growth and competitive advantage.

In today's customer-driven market, an efficient Customer Support System is no longer


a luxury but a necessity. Businesses that prioritize customer support build stronger
relationships, enhance brand reputation, and achieve long-term success.
11.BIBLIOGRAPHY
BOOK REFERENCES
1. Van Rossum, G., & Drake Jr., F. L. (2009). The Python Language Reference Man-ual
Network Theory Ltd.
2. McKinney, W. (2017). Python for Data Analysis: Data Wrangling with Pandas, NumPy,
and IPython (2nd ed.). O'Reilly Media.
3. Matthes, E. (2019). Python crash course (2nd ed.). No Starch Press.
4. Reese, G. (2000). Database programming with JDBC and MySQL. O'Reilly Me-dia.

WEBSITES

o https://www.w3schools.com/python/
o https://www.geeksforgeeks.org/python-mysql-connection/
o https://docs.python.org/3/
o https://dev.mysql.com/doc/

You might also like