Vous êtes sur la page 1sur 20

1.

INTRODUCTION

1.1 WHAT IS PYTHON?

Python is a popular programming language. It was created by Guido van Rossum, and
released in 1991. It is used for:

 web development (server-side),


 software development,
 mathematics,
 System scripting.

1.2 WHAT CAN PYTHON DO?

 Python can be used on a server to create web applications.


 Python can be used alongside software to create workflows.
 Python can connect to database systems. It can also read and modify files.
 Python can be used to handle big data and perform complex mathematics.
 Python can be used for rapid prototyping, or for production-ready software
development.

1.3 WHY PYTHON?

 Python works on different platforms (Windows, Mac, Linux, Raspberry Pi, etc.)
 Python has a simple syntax similar to the English language.
 Python has syntax that allows developers to write programs with fewer lines than
some other programming languages.
 Python runs on an interpreter system, meaning that code can be executed as soon as it
is written. This means that prototyping can be very quick.
 Python can be treated in a procedural way, an object-orientated way or a functional
way.

1
2. PYTHON HISTORY AND VERSIONS

 The implementation of Python was started in the December 1989 by Guido Van Rossum at
CWI in Netherland.

 In February 1991, van Rossum published the code (labeled version 0.9.0) to alt.sources.

 In 1994, Python 1.0 was released with new features like: lambda, map, filter, and reduce.

 Python 2.0 added new features like: list comprehensions, garbage collection system.

 On December 3, 2008, Python 3.0 (also called "Py3K") was released. It was designed to
rectify fundamental flaw of the language.

 ABC programming language is said to be the predecessor of Python language which was
capable of Exception Handling and interfacing with Amoeba Operating System.

 Python is influenced by following programming languages-

 ABC language.

 Modula-3

Fig.2.1. Python Logo

2
3. FEATURES OF PYTHON

There are many features in Python, some of which are discussed below –

3.1 EASY TO CODE


Python is high level programming language. Python is very easy to learn language as
compared to other language like c, c#, java script, java etc. It is very easy to code in python
language and anybody can learn python basic in few hours or days. It is also developer-
friendly language.

3.2 FREE AND OPEN SOURCE


Python language is freely available at official website and you can download it from the
given download link below click on the Download Python Keyword.
Download Python.

3.3 OBJECT-ORIENTED LANGUAGE


One of the key features of python is Object-Oriented programming. Python supports object
oriented language and concepts of classes, objects encapsulation etc.

3.4 GUI PROGRAMMING SUPPORT


Graphical Users interfaces can be made using a module such as PyQt5, PyQt4, wxPython or
Tk in python.

3.5 HIGH-LEVEL LANGUAGE


Python is a high-level language. When we write programs in python, we do not need to
remember the system architecture, nor do we need to manage the memory.

3.6 PYTHON IS PORTABLE LANGUAGE


Python language is also a portable language. for example, if we have python code for
windows and if we want to run this code on other platform such as Linux, Unix and Mac then
we do not need to change it, we can run this code on any platform.

3
3.7 PYTHON IS INTEGRATED LANGUAGE
Python is also an Integrated language because we can easily integrated python with other
language like C, C++ etc.

3.8 INTERPRETED LANGUAGE


Python is an Interpreted Language. because python code is executed line by line at a time.
like other language C, C++, java etc. there is no need to compile python code this makes it
easier to debug our code.

3.9 LARGE STANDARD LIBRARY


Python has a large standard library which provides rich set of module and functions so you do
not have to write your own code for every single thing.

4
4. COMPANY PROFILE

The Diesel Locomotive Works (DLW) in Varanasi, India, is a production unit owned by
Indian Railways. It manufactures diesel-electric locomotives and its spare parts. It is the
largest diesel-electric locomotive manufacturer in India. It is located on DLW to BHU road
of the metropolitan city of Varanasi.

Website - https://dlw.indianrailways.gov.in/
Annual production- 125 Locomotive
Total number of Staff -5947
Workshop land area- 89 hectares
Electrical power requirement-3468KVA
Electrical energy consumption-19.8 Million

Company

It was established in 1961. It rolled out first its locomotive on 3 January 1964, after three
years. The name of its first locomotive was KUNDAN. It manufactures locomotives which
are variants based on the original ALCO designs dating to the 1960s and the GM EMD
designs of the 1990s.DLW has an annual production capacity of 250 locomotives and plans
to increase it to 275 based on the current demand. Since inception, DLW has produced total
8099 locomotives (up to 31 January 2018) of various types. DLW now manufactures "More
than one locomotive a day". DLW manufactured 334 diesel-electric locomotives in last
financial year 2016-17, which is the highest ever loco production by any loco manufacturing
unit in India and bagged the "Best Production Unit Shield" for the second successive year.

Products
DLW locomotives have power outputs ranging from 2,600 horsepower (1,900 kW) to 5,500
horsepower (4,100 kW). Currently DLW is producing EMD GT46MAC and EMD
GT46PAC locomotives under license from Electro-Motive Diesels (formerly GM-EMD) for
Indian Railways. Some of its EMD locomotive products are WDP4, WDP4D, WDG4D,

5
WDGS and others as of June 2015. DLW recently started producing HEP capable WAP-7
high horsepower Electric Locomotives. Recently, it has been allotted to Santragachi &
Tughlakabad Loco Shed. It will also produce WDG4G (ES43ACmi, Customized for IR)
Locomotives from General-Electric Transportation.

Market

Besides the Indian Railways, it regularly exports diesel-electric locomotives and has supplied
locomotives to other countries such as Sri Lanka, Nepal, Bangladesh, Mali, Senegal, Sudan
Tanzania, Angola, and Vietnam and also to a few users within India, such as ports, large
power and steel plants and private railways.

Ancillary

In July 2006, DLW outsourced manufacture of some passenger and freight locomotives to
Parel Workshop, Central Railway and Mumbai.
The Diesel Locomotive Works, a production unit of Indian Railways converted the diesel
loco into electric loco with indigenous technology under “Make In India” initiative. The work
on this project was started on December 22, 2017 and the locomotive was successfully rolled
out on February 28, 2018.
Parts of rail engine are made here and get distributed all over the country. Previously, they
only manufacture diesel engine but now they also manufacture electric engine.

Some famous Engine build by the organization

➢ KUNDAN
First successful loco engine made by DLW.

➢ BHARTIYA
One of the heaviest Engines. Its number is 6073 YDM.
6
FACILITIES

DLW has its own cinema hall, cricket ground, playground, Bal Udyan DLW campus, DLW
Golf Course, DLW swimming pool, DLW officer’s club, DLW cinema hall, DLW residence,
DLW power station, DLW canteen, DLW officer’s rest house and St. John’s School DLW. It
provides great accommodation facilities to their employees. Based on the rank of the
employee they provide quarters and bungalow to the officer.

The current General Manager of DLW is Rashmi Goel.

7
5. ABOUT THE VIRTUAL ASSISTANT PROJECT

The basic idea behind this project is to create a simple stand-alone application
that helps less tech savvy people in the world to use the computer without feeling ignorant or
computer illiterate. Computers have become a very important devices and as well as less
expensive over time. The application works same like Siri / Google Assistant etc. But the
application deals with the computer itself mainly. The U.I of the application is self-
explanatory and minimal.

5.1 FEATURES OF THE PROJECT

5.1.1 Conversation- User can talk to the virtual assistant.

5.1.2 Greeting- This Project will greet you whenever it will open.

5.1.3 Date and Time- It will provide current date and time whenever required.

5.1.4 OS Management- This project can also manage some operating system works like
opening any folder or any application in the system.

5.1.5 Web Browser search- This project can easily search anything on the internet.

5.1.6 Location/Map- This project can also provide location of any place.

5.1.7 Query Online on Google- You can ask anything and the project will give its answer
with the help of Google.

5.1.8 Access Wikipedia-It can access the Wikipedia and give you some important
information as required.

5.1.9 Play Music- This project can play music to enhance your mood.

5.1.10 Open Application- This is one of the main features of the project that it can open any
application present in the system as required.

5.1.11 Open File/Folder-It can also open any specific file/folder as required.

5.1.12 Closing System-We can also close it by the command.

8
5.2 USE CASE DIAGRAM
A use case is a set of scenarios that describe an interaction between a user and a system. A
use case diagram displays the relationship among actors and use cases. The two main
components of a use case diagram are use cases and actors.

Ask For Date


& Time
Quarry on
Fill Personal Google
info. &
command

Ask for open


website
Voice Input
Command

Ask For
open
Conversatio Application
n

Ask For
open Folder

Place
Location
(Map)

Fig.5.1. Use Case Diagram

9
5.3 ACTIVITY DIAGRAM

It is basically a flowchart to represent the flow from one activity to another activity. The
activity can be described as an operation of the system. The control flow is drawn from one
operation to another. This flow can be sequential, branched, or concurrent. Activity diagrams
deal with all type of flow control by using different elements such as fork, join, etc.

Fig.5.2. Activity Diagram

10
5.4 REQUIREMENTS

Operating System Windows XP and above

Hard Disk 350 GB Minimum

RAM 1GB Minimum

Software Mozilla, Google Chrome, OPERA, Python

Language Used Python (2.7 or above)

11
5.5 CONTEXT DIAGRAM (ZERO LEVEL DFD)

Context Diagram shows the outermost level processes.

User Virtual Assistant Services

Fig.5.3. Context Diagram

12
5.6 DATA FLOW DIAGRAM (LEVEL 1)

Data Flow Diagram shows the flow of the data between the entities and the processes.

Google Web Google


User voice kit browser API

Virtual
Assistant

OS Conversio
Wikipedia
Managem n
API
ent

Fig.5.4. DFD Level 1

13
5.7 ENTITY-RELATIONSHIP DIAGRAM

Entity Relationship diagram show the relationship between the entities.

Here user and the virtual assistant are the entities and both has their attributes.

Voice Quarry on
Command command

Virtual Assistant
User Has

Voice Text Output


Output

Fig.5.5. E– R Diagram

14
5.8 CODING

from gtts import gTTS


import speech_recognition as sr
import os

import subprocess

from time import ctime

import random

import wikipedia

from time import strftime

import re

import wolframalpha

import sys

#import run_lookup

#import lookup_drive_change

from pyowm import OWM

import vlc

import webbrowser

import smtplib

import datetime

import requests

from weather import Weather

import pyttsx3

15
engine=pyttsx3.init()

voices=engine.getProperty('voices')

pyttsx3.voice.Voice.age=5

#for voice in voices:

# print(voice.id)

engine.setProperty('voice','HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech\Voi
ces\Tokens\TTS_MS_EN-US_DAVID_11.0')

#engine.say("I will speak this text")

#`engine.runAndWait()

def talkToMe(audio):

engine.say(audio)

engine.runAndWait()

"speaks audio passed as argument"

print(audio)

for line in audio.splitlines():

os.system("say " + audio)

# use the system's inbuilt say command instead of mpg123

# text_to_speech = gTTS(text=audio, lang='en')

# text_to_speech.save('audio.mp3')

# os.system('mpg123 audio.mp3')

def greetme():

currentH= int (datetime.datetime.now().hour)

if currentH>=0 and currentH<12:

16
talkToMe('good morning')

elif currentH>=12 and currentH<16:

talkToMe('good afternoon')

elif currentH>=16 and currentH!=0:

talkToMe ('good evening')

greetme()

def Command():

"listens for commands"

r = sr.Recognizer()

17
5.9 PROJECT SCREENSHOTS

Fig.5.6. Code Screenshot 1

Fig.5.7. Code Screenshot 2

18
Fig.5.8. Output Screenshot

19
6. REFRENCES

[1] https://www.google.com/

[2] https://www.youtube.com/

[3] https://www.wikipedia.org/

[4] https://www.slideshare.net/

[5] https://www.w3schools.com/

[6] https://www.tutorialspoint.com/

[7] https://www.javatpoint.com/

20

Vous aimerez peut-être aussi