<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>python Archives -</title>
	<atom:link href="https://mitindia.in/tag/python/feed/" rel="self" type="application/rss+xml" />
	<link>https://mitindia.in/tag/python/</link>
	<description></description>
	<lastBuildDate>Mon, 18 Jan 2021 07:22:36 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://mitindia.in/wp-content/uploads/2023/03/cropped-android-chrome-512x512-1-32x32.png</url>
	<title>python Archives -</title>
	<link>https://mitindia.in/tag/python/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Text extracting from an Image (OCR )</title>
		<link>https://mitindia.in/text-extracting-from-an-image-ocr/</link>
		
		<dc:creator><![CDATA[SKB]]></dc:creator>
		<pubDate>Mon, 18 Jan 2021 07:22:36 +0000</pubDate>
				<category><![CDATA[Artificial Intelligence]]></category>
		<category><![CDATA[Machine Learning]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[extract text from an image]]></category>
		<category><![CDATA[machine learning]]></category>
		<category><![CDATA[ocr]]></category>
		<guid isPermaLink="false">http://www.mitindia.in/?p=1119</guid>

					<description><![CDATA[<p>Extract text from an image. Extracting text from an image using pytesseract tool and package using Python programming. install tesseract.exe from here. First, here is an image which contains some text as following..[saved as sample.jpg) And here is the full code to extract text from above image. from PIL import Image #Python Imaging Library (abbreviated [&#8230;]</p>
<p>The post <a href="https://mitindia.in/text-extracting-from-an-image-ocr/">Text extracting from an Image (OCR )</a> appeared first on <a href="https://mitindia.in"></a>.</p>
]]></description>
										<content:encoded><![CDATA[<h1>Extract text from an image.</h1>
<p>Extracting text from an image using pytesseract tool and package using Python programming.</p>
<p>install tesseract.exe from <a href="https://sourceforge.net/projects/tesseract-ocr/">here.</a></p>
<p>First, here is an image which contains some text as following..[saved as sample.jpg)</p>
<p><img decoding="async" class="alignnone wp-image-1120 size-medium" src="http://www.mitindia.in/wp-content/uploads/2021/01/sample-300x162.jpg" alt="" width="300" height="162" srcset="https://mitindia.in/wp-content/uploads/2021/01/sample-300x162.jpg 300w, https://mitindia.in/wp-content/uploads/2021/01/sample-768x415.jpg 768w, https://mitindia.in/wp-content/uploads/2021/01/sample.jpg 850w" sizes="(max-width: 300px) 100vw, 300px" /></p>
<p>And here is the full code to extract text from above image.</p>
<pre class="EnlighterJSRAW" data-enlighter-language="null">from PIL import Image
#Python Imaging Library (abbreviated as PIL) (in newer versions known as Pillow)
# is a free and open-source additional library for the Python programming language that
#adds support for opening, manipulating, and saving many different image file formats.
import pytesseract
#Python-tesseract is an optical character recognition (OCR) tool for python
import cv2
pytesseract.pytesseract.tesseract_cmd = 'C:\\Program Files (x86)\\Tesseract-OCR\\tesseract.exe' 
img = "sample.jpg"
t1=pytesseract.image_to_string(Image.open(img))
#print(pytesseract.image_to_string(Image.open(img)))
print(t1)
file1=open('recognized.txt', 'w')
file1.writelines(t1) 
file1.close()
print("File created successfully!")
</pre>
<p>And the output from above program is..</p>
<p><img decoding="async" class="alignnone size-medium wp-image-1121" src="http://www.mitindia.in/wp-content/uploads/2021/01/output_text-300x98.png" alt="" width="300" height="98" srcset="https://mitindia.in/wp-content/uploads/2021/01/output_text-300x98.png 300w, https://mitindia.in/wp-content/uploads/2021/01/output_text.png 364w" sizes="(max-width: 300px) 100vw, 300px" /></p>
<p>As the program just extracted only characters from an image. And also extracted string is stored in text file by using file handling.</p>
<p><a class="a2a_button_whatsapp" href="https://www.addtoany.com/add_to/whatsapp?linkurl=https%3A%2F%2Fmitindia.in%2Ftext-extracting-from-an-image-ocr%2F&amp;linkname=Text%20extracting%20from%20an%20Image%20%28OCR%20%29" title="WhatsApp" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fmitindia.in%2Ftext-extracting-from-an-image-ocr%2F&amp;linkname=Text%20extracting%20from%20an%20Image%20%28OCR%20%29" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fmitindia.in%2Ftext-extracting-from-an-image-ocr%2F&#038;title=Text%20extracting%20from%20an%20Image%20%28OCR%20%29" data-a2a-url="https://mitindia.in/text-extracting-from-an-image-ocr/" data-a2a-title="Text extracting from an Image (OCR )"><img src="https://static.addtoany.com/buttons/favicon.png" alt="Share"></a></p><p>The post <a href="https://mitindia.in/text-extracting-from-an-image-ocr/">Text extracting from an Image (OCR )</a> appeared first on <a href="https://mitindia.in"></a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Data Science &#8211; 4 [extract gold price using web scrap]</title>
		<link>https://mitindia.in/data-science-4-extract-gold-price-using-web-scrap/</link>
		
		<dc:creator><![CDATA[SKB]]></dc:creator>
		<pubDate>Thu, 31 Dec 2020 05:31:11 +0000</pubDate>
				<category><![CDATA[Artificial Intelligence]]></category>
		<category><![CDATA[Machine Learning]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[data science]]></category>
		<category><![CDATA[machine learning]]></category>
		<category><![CDATA[webscrap]]></category>
		<guid isPermaLink="false">http://www.mitindia.in/?p=1090</guid>

					<description><![CDATA[<p>Extract live gold price using web scrap &#8211; Data Science in the following example we used three packages, they are a) bs4 [Beautiful Soup for web scraping] b) pandas [panel data for data representation ] c) request [to get source / url] #data science with Python - extracting Gold Price import bs4 import pandas as [&#8230;]</p>
<p>The post <a href="https://mitindia.in/data-science-4-extract-gold-price-using-web-scrap/">Data Science &#8211; 4 [extract gold price using web scrap]</a> appeared first on <a href="https://mitindia.in"></a>.</p>
]]></description>
										<content:encoded><![CDATA[<h1>Extract live gold price using web scrap &#8211; Data Science</h1>
<p>in the following example we used three packages, they are</p>
<p>a) bs4 [Beautiful Soup for web scraping]<br />
b) pandas [panel data for data representation ]<br />
c) request [to get source / url]</p>
<pre class="EnlighterJSRAW" data-enlighter-language="null">#data science with Python - extracting Gold Price
import bs4 
import pandas as pd 
import requests 

url = 'https://www.goodreturns.in/gold-rates/bangalore.html'
result = requests.get(url) 
soup = bs4.BeautifulSoup(result.content,'html.parser') 
price = soup.find_all('div', {"id":"current-price"})
for pr in price:
    print("Price:", pr.text)
txt=pr.text

from tkinter import *
root=Tk()
root.title('Gold Price')
root.configure(bg='gold')
root.geometry('200x100')
w=Label(root, text=txt, bg='red', font='sans 14')
b=Button(root, text="Close", fg='red', bg='yellow', command=root.destroy)
w.pack()
b.pack()
root.mainloop()</pre>
<p><strong>Output of the above example is:</strong></p>
<p><img decoding="async" class="alignnone  wp-image-1091" src="http://www.mitindia.in/wp-content/uploads/2020/12/goldprice-300x107.png" alt="" width="362" height="129" srcset="https://mitindia.in/wp-content/uploads/2020/12/goldprice-300x107.png 300w, https://mitindia.in/wp-content/uploads/2020/12/goldprice.png 495w" sizes="(max-width: 362px) 100vw, 362px" /></p>
<p><a href="https://www.mitindia.in/data-science-3-web-scraping/">Click here for other programs on Data Science </a></p>
<p><a class="a2a_button_whatsapp" href="https://www.addtoany.com/add_to/whatsapp?linkurl=https%3A%2F%2Fmitindia.in%2Fdata-science-4-extract-gold-price-using-web-scrap%2F&amp;linkname=Data%20Science%20%E2%80%93%204%20%5Bextract%20gold%20price%20using%20web%20scrap%5D" title="WhatsApp" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fmitindia.in%2Fdata-science-4-extract-gold-price-using-web-scrap%2F&amp;linkname=Data%20Science%20%E2%80%93%204%20%5Bextract%20gold%20price%20using%20web%20scrap%5D" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fmitindia.in%2Fdata-science-4-extract-gold-price-using-web-scrap%2F&#038;title=Data%20Science%20%E2%80%93%204%20%5Bextract%20gold%20price%20using%20web%20scrap%5D" data-a2a-url="https://mitindia.in/data-science-4-extract-gold-price-using-web-scrap/" data-a2a-title="Data Science – 4 [extract gold price using web scrap]"><img src="https://static.addtoany.com/buttons/favicon.png" alt="Share"></a></p><p>The post <a href="https://mitindia.in/data-science-4-extract-gold-price-using-web-scrap/">Data Science &#8211; 4 [extract gold price using web scrap]</a> appeared first on <a href="https://mitindia.in"></a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Multilevel, Hierarchical and Hybrid Inheritance</title>
		<link>https://mitindia.in/multilevel-hierarchical-and-hybrid-inheritance/</link>
		
		<dc:creator><![CDATA[SKB]]></dc:creator>
		<pubDate>Sun, 13 Dec 2020 07:26:15 +0000</pubDate>
				<category><![CDATA[Artificial Intelligence]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[hierarchical inheritance in python]]></category>
		<category><![CDATA[hybrid inheritance in python]]></category>
		<category><![CDATA[multilevel inheritance]]></category>
		<guid isPermaLink="false">http://www.mitindia.in/?p=1071</guid>

					<description><![CDATA[<p>Multilevel, Hierarchical and Hybrid Inheritance Multi-Level Inheritance in Python #Multilevel Inheritance in Python class India: def first(self): print ('India is the largest democratic country in the world') class Karnataka(India): def sec(self): print ('Karnataka is famous for IT and Coffee Production') class Bengaluru(Karnataka): def third(self): print ('Bengaluru also known as Garden city!') b=Bengaluru() b.first() b.sec() b.third() [&#8230;]</p>
<p>The post <a href="https://mitindia.in/multilevel-hierarchical-and-hybrid-inheritance/">Multilevel, Hierarchical and Hybrid Inheritance</a> appeared first on <a href="https://mitindia.in"></a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Multilevel, Hierarchical and Hybrid Inheritance</p>
<ol>
<li>Multi-Level Inheritance in Python</li>
</ol>
<pre class="EnlighterJSRAW" data-enlighter-language="null">#Multilevel Inheritance in Python
class India:
    def first(self):
        print ('India is the largest democratic country in the world')

class Karnataka(India):
    def sec(self):
        print ('Karnataka is famous for IT and Coffee Production')

class Bengaluru(Karnataka):
    def third(self):
        print ('Bengaluru also known as Garden city!')
b=Bengaluru()
b.first()
b.sec()
b.third()
</pre>
<p>Output of the above program is :</p>
<blockquote><p>India is the largest democratic country in the world<br />
Karnataka is famous for IT and Coffee Production<br />
Bengaluru also known as Garden city!</p></blockquote>
<p>2. Hierarchical Inheritance in Python example</p>
<pre class="EnlighterJSRAW" data-enlighter-language="null"># Hierarchial Inheritance using Python
class Details:
    def __init__(self):
        self.__id=""       
        self.__name=""
        self.__gender=""
    def setData(self,id,name,gender):
        self.__id=id
        self.__name=name
        self.__gender=gender
    def showData(self):
        print("Id: ",self.__id)
        print("Name: ", self.__name)
        print("Gender: ", self.__gender)
class Employee(Details): #Inheritance
    def __init__(self):
        self.__company=""
        self.__dept=""
    def setEmployee(self,id,name,gender,comp,dept):
        self.setData(id,name,gender)
        self.__company=comp
        self.__dept=dept
    def showEmployee(self):
        self.showData()
        print("Company: ", self.__company)
        print("Department: ", self.__dept)
class Doctor(Details): #Inheritance
    def __init__(self):
        self.__hospital=""
        self.__dept=""
    def setDoctor(self,id,name,gender,hos,dept):
        self.setData(id,name,gender)
        self.__hospital=hos
        self.__dept=dept
    def showDoctor(self):
        self.showData()
        print("Hospital: ", self.__hospital)
        print("Department: ", self.__dept)

def main2():
    print("Employee Object")
    e=Employee()
    e.setEmployee(1,"SHARAN","Male","ITC","Sales Manager")
    e.showEmployee()
    print("\nDoctor Object")
    d = Doctor()
    d.setDoctor(1, "Ramesh", "Male", "AIIMS", "ENT")
    d.showDoctor()
main2()
</pre>
<p>Output of the above program is :</p>
<blockquote><p>Employee Object<br />
Id: 1<br />
Name: SHARAN<br />
Gender: Male<br />
Company: ITC<br />
Department: Sales Manager</p>
<p>Doctor Object<br />
Id: 1<br />
Name: Ramesh<br />
Gender: Male<br />
Hospital: AIIMS<br />
Department: ENT</p></blockquote>
<p>3. Hybrid Inheritance in Python</p>
<pre class="EnlighterJSRAW" data-enlighter-language="null">#Hybrid Inheritance using Python
class Emp:
    cname="MIT India"
 
class SystemAdmin(Emp):
    srole="System Admin"
     
class WebDev(Emp):
    wrole="UI Developer"
     
class DBA(WebDev, SystemAdmin,Emp):
    drole="Data Base Creating"
     
obj=DBA()
print("Company Name:"+obj.cname)
print("SysAdmin:"+obj.srole)
print("WebDev:"+obj.wrole)
print("DBA:"+obj.drole)
</pre>
<p>Output of the above program is :</p>
<blockquote><p>Company Name:MIT India<br />
SysAdmin:System Admin<br />
WebDev:UI Developer<br />
DBA:Data Base Creating</p></blockquote>
<p>&nbsp;</p>
<p><a class="a2a_button_whatsapp" href="https://www.addtoany.com/add_to/whatsapp?linkurl=https%3A%2F%2Fmitindia.in%2Fmultilevel-hierarchical-and-hybrid-inheritance%2F&amp;linkname=Multilevel%2C%20Hierarchical%20and%20Hybrid%20Inheritance" title="WhatsApp" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fmitindia.in%2Fmultilevel-hierarchical-and-hybrid-inheritance%2F&amp;linkname=Multilevel%2C%20Hierarchical%20and%20Hybrid%20Inheritance" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fmitindia.in%2Fmultilevel-hierarchical-and-hybrid-inheritance%2F&#038;title=Multilevel%2C%20Hierarchical%20and%20Hybrid%20Inheritance" data-a2a-url="https://mitindia.in/multilevel-hierarchical-and-hybrid-inheritance/" data-a2a-title="Multilevel, Hierarchical and Hybrid Inheritance"><img src="https://static.addtoany.com/buttons/favicon.png" alt="Share"></a></p><p>The post <a href="https://mitindia.in/multilevel-hierarchical-and-hybrid-inheritance/">Multilevel, Hierarchical and Hybrid Inheritance</a> appeared first on <a href="https://mitindia.in"></a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Exception Handling in Python</title>
		<link>https://mitindia.in/exception-handling-in-python/</link>
		
		<dc:creator><![CDATA[SKB]]></dc:creator>
		<pubDate>Thu, 31 Oct 2019 07:43:05 +0000</pubDate>
				<category><![CDATA[Artificial Intelligence]]></category>
		<category><![CDATA[Machine Learning]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[divide by zero error in python]]></category>
		<category><![CDATA[exception handling in python]]></category>
		<category><![CDATA[file not found error in python]]></category>
		<guid isPermaLink="false">http://www.mitindia.in/?p=1010</guid>

					<description><![CDATA[<p>Python Exception Handling An exception is a problem that arises during the execution of a program. An exception can occur for many different reasons, including the following: A user has entered invalid data. A file that needs to be opened cannot be found. A network connection has been lost in the middle of communications etc. [&#8230;]</p>
<p>The post <a href="https://mitindia.in/exception-handling-in-python/">Exception Handling in Python</a> appeared first on <a href="https://mitindia.in"></a>.</p>
]]></description>
										<content:encoded><![CDATA[<h1><span style="color: #993300;">Python Exception Handling</span></h1>
<p>An exception is a problem that arises during the execution of a program. An exception can occur for many different reasons, including the following:</p>
<p>A user has entered invalid data.<br />
A file that needs to be opened cannot be found.<br />
A network connection has been lost in the middle of communications etc.</p>
<h2><strong>Programs on Exception Handling in Python </strong></h2>
<div><strong><span style="color: #ff0000;">#Divide by Zero Error using Python</span></strong></div>
<div>try:</div>
<div>a=int(input(&#8220;Enter num1:&#8221;))</div>
<div>b=int(input(&#8220;Enter num2:&#8221;))</div>
<div>c=a/b</div>
<div>print(c)</div>
<div>except Exception:</div>
<div>print(&#8216;Divide by ZERO Error&#8217;)</div>
<div>else:</div>
<div>print(&#8216;Done!&#8217;)</div>
<div></div>
<blockquote>
<div><strong><span style="color: #0000ff;">OUTPUT:</span></strong></div>
<div>Enter num1:2</div>
<div>Enter num2:0</div>
<div>Divide by ZERO Error</div>
</blockquote>
<div></div>
<div></div>
<div><strong><span style="color: #ff0000;">#Array Index Error using Python</span></strong></div>
<div>a=[1,2,3]</div>
<div>try:</div>
<div>print(a[3])</div>
<div>except IndexError:</div>
<div>print(&#8216;Invalid index&#8217;)</div>
<div></div>
<blockquote>
<div><strong><span style="color: #0000ff;">OUTPUT:</span></strong></div>
<div>Invalid index</div>
</blockquote>
<div></div>
<div><span style="color: #ff0000;"><strong># File not found error &#8211; python exception</strong></span></div>
<div>try:</div>
<div>    file= open(&#8220;D:/Test.txt&#8221;,&#8221;r&#8221;)</div>
<div>except IOError:</div>
<div>    print(&#8220;File not found&#8221;)</div>
<div>else:</div>
<div>    print(&#8220;The file opened successfully&#8221;)</div>
<div>    file.close()</div>
<div></div>
<blockquote>
<div><span style="color: #0000ff;"><strong>OUTPUT:</strong></span></div>
<div>The file opened successfully</div>
</blockquote>
<div></div>
<div><strong><span style="color: #ff0000;">#Raise error using Python</span></strong></div>
<div>try:</div>
<div>    age = int(input(&#8220;Enter your age:&#8221;))</div>
<div>    if age&lt;18:</div>
<div>        raise ValueError;</div>
<div>    else:</div>
<div>        print(&#8220;Eligible for vote&#8221;)</div>
<div>except ValueError:</div>
<div>    print(&#8220;Not Eligible for vote&#8221;)</div>
<div></div>
<blockquote>
<div><span style="color: #0000ff;"><strong>OUTPUT:</strong></span></div>
<div>Enter your age:18</div>
<div>Eligible for vote</div>
</blockquote>
<div></div>
<div><strong><span style="color: #ff0000;">#Arithmetic Exception using Python</span></strong></div>
<div>try:</div>
<div>    a = int(input(&#8220;Enter a:&#8221;))</div>
<div>    b = int(input(&#8220;Enter b:&#8221;))</div>
<div>    if b is 0:</div>
<div>        raise ArithmeticError;</div>
<div>    else:</div>
<div>        print(&#8220;a/b = &#8220;,a/b)</div>
<div>except ArithmeticError:</div>
<div>    print(&#8220;Second number should be non-zero&#8221;)</div>
<div></div>
<blockquote>
<div><span style="color: #0000ff;"><strong>OUTPUT:</strong></span></div>
<div>Enter a:2</div>
<div>Enter b:0</div>
<div>Second number should be non-zero</div>
</blockquote>
<div><a href="https://www.mitindia.in/object-oriented-programming-with-python/" target="_blank" rel="noopener">Object-oriented-programming-with-python</a></div>
<div><a href="https://www.mitindia.in/collections-in-python/" target="_blank" rel="noopener">collections-in-python</a></div>
<div><a href="https://www.mitindia.in/built-in-and-user-defined-functions-in-python/" target="_blank" rel="noopener">built-in-and-user-defined-functions-in-python</a></div>
<div></div>
<p><a class="a2a_button_whatsapp" href="https://www.addtoany.com/add_to/whatsapp?linkurl=https%3A%2F%2Fmitindia.in%2Fexception-handling-in-python%2F&amp;linkname=Exception%20Handling%20in%20Python" title="WhatsApp" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fmitindia.in%2Fexception-handling-in-python%2F&amp;linkname=Exception%20Handling%20in%20Python" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fmitindia.in%2Fexception-handling-in-python%2F&#038;title=Exception%20Handling%20in%20Python" data-a2a-url="https://mitindia.in/exception-handling-in-python/" data-a2a-title="Exception Handling in Python"><img src="https://static.addtoany.com/buttons/favicon.png" alt="Share"></a></p><p>The post <a href="https://mitindia.in/exception-handling-in-python/">Exception Handling in Python</a> appeared first on <a href="https://mitindia.in"></a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>How to run python programs on wamp server</title>
		<link>https://mitindia.in/how-to-run-python-programs-on-wamp-server/</link>
					<comments>https://mitindia.in/how-to-run-python-programs-on-wamp-server/#comments</comments>
		
		<dc:creator><![CDATA[SKB]]></dc:creator>
		<pubDate>Sat, 23 Jun 2018 12:32:24 +0000</pubDate>
				<category><![CDATA[Artificial Intelligence]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[How to connect mysql database using python?]]></category>
		<category><![CDATA[how to run python?]]></category>
		<guid isPermaLink="false">http://www.mitindia.in/?p=901</guid>

					<description><![CDATA[<p>How to run python in wamp server and mysql connectivity using python program Steps: Create a simple python program file as following. #!C:/Python27/python.exe print &#8220;Content-type: text/html\n&#8221; print &#8220;&#60;h1 align=center&#62;Python programming&#60;/h1&#62;&#8221; print &#8220;&#60;hr&#62;&#8221; print &#8220;&#60;h2&#62;Hello, world!&#60;/h2&#62;&#8221; 2. Save above file as &#8220;test.py &#8221; in wamp -&#62;www directory 3. Start wamp server 4. Open browser and type [&#8230;]</p>
<p>The post <a href="https://mitindia.in/how-to-run-python-programs-on-wamp-server/">How to run python programs on wamp server</a> appeared first on <a href="https://mitindia.in"></a>.</p>
]]></description>
										<content:encoded><![CDATA[<h1>How to run python in wamp server and mysql connectivity using python program</h1>
<p><strong>Steps:</strong></p>
<ol>
<li><strong>Create a simple python program file as following.</strong></li>
</ol>
<div>#!C:/Python27/python.exe</div>
<div>print &#8220;Content-type: text/html\n&#8221;</div>
<div>print &#8220;&lt;h1 align=center&gt;Python programming&lt;/h1&gt;&#8221;</div>
<div>print &#8220;&lt;hr&gt;&#8221;</div>
<div>print &#8220;&lt;h2&gt;Hello, world!&lt;/h2&gt;&#8221;</div>
<div></div>
<div>2. Save above file as &#8220;test.py &#8221; in wamp -&gt;www directory</div>
<div>3. Start wamp server</div>
<div>4. Open browser and type page url [as the following screen shot]</div>
<div><img loading="lazy" decoding="async" class="alignnone size-full wp-image-902" src="http://www.mitindia.in/wp-content/uploads/2018/06/hello-world.jpg" alt="" width="781" height="251" srcset="https://mitindia.in/wp-content/uploads/2018/06/hello-world.jpg 781w, https://mitindia.in/wp-content/uploads/2018/06/hello-world-300x96.jpg 300w, https://mitindia.in/wp-content/uploads/2018/06/hello-world-768x247.jpg 768w" sizes="(max-width: 781px) 100vw, 781px" /></div>
<div></div>
<h2><span style="color: #ff6600;">How to connect MySQL database using Python?</span></h2>
<ol>
<li><strong>Create a table in </strong>MySQL<strong> with the following record </strong></li>
</ol>
<p><img loading="lazy" decoding="async" class="alignnone size-full wp-image-903" src="http://www.mitindia.in/wp-content/uploads/2018/06/table.jpg" alt="" width="547" height="181" srcset="https://mitindia.in/wp-content/uploads/2018/06/table.jpg 547w, https://mitindia.in/wp-content/uploads/2018/06/table-300x99.jpg 300w" sizes="(max-width: 547px) 100vw, 547px" /></p>
<p><strong>2. Now create python program called &#8220;db5.py&#8221; as following</strong></p>
<blockquote><p>#!C:/Python27/python.exe<br />
print &#8220;Content-type: text/html\n&#8221;<br />
# Database program to access mysql data on WAMP server<br />
print(&#8220;&lt;h1&gt; Python and MySQL Connection &lt;/h1&gt;&#8221;)<br />
print(&#8220;&lt;hr&gt;&#8221;)<br />
import pymysql<br />
conn=pymysql.connect(host=&#8217;localhost&#8217;, user=&#8217;root&#8217;,<br />
password=&#8221;, db=&#8217;demo&#8217;)<br />
a=conn.cursor()<br />
sql=&#8217;SELECT * from emp&#8217;;<br />
a.execute(sql)<br />
countrow=a.execute(sql)</p>
<p>data=a.fetchall()<br />
print &#8220;&lt;table border=1 cellpadding=4 cellspacing=4&gt;&#8221;<br />
print &#8220;&lt;tr bgcolor=yellow&gt;&lt;th&gt; Name &lt;/th&gt; &lt;th&gt; Basic<br />
&lt;/th&gt; &lt;th&gt; Bonus &lt;/th&gt; &lt;th&gt; TA &lt;/th&gt; &lt;th&gt; PF &lt;/th&gt;<br />
&lt;/tr&gt;&#8221;<br />
for row in data :<br />
print<br />
&#8220;&lt;tr&gt;&lt;td&gt;&#8221;,row[0],&#8221;&lt;/td&gt;&#8221;,&#8221;&lt;td&gt;&#8221;,row[1],&#8221;&lt;/td&gt;&#8221;,&#8221;&lt;td&gt;&#8221;,<br />
row[2],&#8221;&lt;/td&gt;&#8221;,&#8221;&lt;td&gt;&#8221;,row[3],&#8221;&lt;/td&gt;&#8221;,&#8221;&lt;td&gt;&#8221;,row[4],&#8221;&lt;/td<br />
&gt; &lt;/tr&gt;&#8221;<br />
print &#8220;&lt;/table&gt;&#8221;</p></blockquote>
<p><strong>3. See the output as following</strong></p>
<p><img loading="lazy" decoding="async" class="alignnone size-full wp-image-904" src="http://www.mitindia.in/wp-content/uploads/2018/06/records.jpg" alt="" width="610" height="419" srcset="https://mitindia.in/wp-content/uploads/2018/06/records.jpg 610w, https://mitindia.in/wp-content/uploads/2018/06/records-300x206.jpg 300w" sizes="(max-width: 610px) 100vw, 610px" /></p>
<div></div>
<div style="text-align: right;"><a href="http://www.mitindia.in/artificial-intelligence/">Read here Artifical Intelligence</a></div>
<div><span style="color: #ff0000;"><a style="color: #ff0000;" href="http://www.pradhita.in/" target="_blank" rel="noopener">for State and Central Government Jobs and Career, Click here</a> </span></div>
<p><a class="a2a_button_whatsapp" href="https://www.addtoany.com/add_to/whatsapp?linkurl=https%3A%2F%2Fmitindia.in%2Fhow-to-run-python-programs-on-wamp-server%2F&amp;linkname=How%20to%20run%20python%20programs%20on%20wamp%20server" title="WhatsApp" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fmitindia.in%2Fhow-to-run-python-programs-on-wamp-server%2F&amp;linkname=How%20to%20run%20python%20programs%20on%20wamp%20server" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fmitindia.in%2Fhow-to-run-python-programs-on-wamp-server%2F&#038;title=How%20to%20run%20python%20programs%20on%20wamp%20server" data-a2a-url="https://mitindia.in/how-to-run-python-programs-on-wamp-server/" data-a2a-title="How to run python programs on wamp server"><img src="https://static.addtoany.com/buttons/favicon.png" alt="Share"></a></p><p>The post <a href="https://mitindia.in/how-to-run-python-programs-on-wamp-server/">How to run python programs on wamp server</a> appeared first on <a href="https://mitindia.in"></a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://mitindia.in/how-to-run-python-programs-on-wamp-server/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>Artificial  Intelligence</title>
		<link>https://mitindia.in/artificial-intelligence/</link>
		
		<dc:creator><![CDATA[SKB]]></dc:creator>
		<pubDate>Tue, 20 Mar 2018 05:13:20 +0000</pubDate>
				<category><![CDATA[Machine Learning]]></category>
		<category><![CDATA[ai]]></category>
		<category><![CDATA[Artificial Intelligence]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[lisp]]></category>
		<category><![CDATA[machine learning]]></category>
		<category><![CDATA[prolog]]></category>
		<category><![CDATA[python]]></category>
		<guid isPermaLink="false">http://www.mitindia.in/?p=861</guid>

					<description><![CDATA[<p>What is Artificial Intelligence (AI)? According to John McCarthy, AI is an ability to interact with the world in the form of speech, vision, motion, manipulation etc. or Ability to model the world and to reason about it. or Ability to learn and to adapt rapidly. Future goals of AI To build systems that exhibit [&#8230;]</p>
<p>The post <a href="https://mitindia.in/artificial-intelligence/">Artificial  Intelligence</a> appeared first on <a href="https://mitindia.in"></a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2><span style="color: #ff0000;">What is Artificial Intelligence (AI)?</span></h2>
<p><em>According to John McCarthy, AI is an ability to interact with the world in the form of speech, vision, motion, manipulation etc.</em><br />
or <em>Ability to model the world and to reason about it</em>.<br />
or <em>Ability to learn and to adapt rapidly.</em></p>
<p><img loading="lazy" decoding="async" class="size-medium wp-image-862 alignright" src="http://www.mitindia.in/wp-content/uploads/2018/03/AI-300x200.jpg" alt="Artificial Intelligence" width="300" height="200" /></p>
<p><strong><span style="color: #3366ff;">Future goals of AI</span><br />
</strong>To build systems that exhibit intelligent behaviour<br />
To understand intelligence in order to model it</p>
<p><span style="color: #3366ff;"><strong>A Brief History of AI</strong></span><br />
In 1955, Newell and Simon created the first AI program. The person who finally coined the term artificial intelligence and is regarded as the father of AI is John McCarthy.</p>
<p><span style="color: #3366ff;"><strong>Applications of AI</strong></span></p>
<p>1) Faster web searching<br />
2) Work in deadly environments like extreme weather<br />
3) Real-time language translate<br />
4) Delivering a correct medical diagnosis<br />
5) Intelligent tutoring systems in education<br />
6) Algorithmic trading in share market<br />
7) Quick market analysis and data mining<br />
8) Portfolio management<br />
9) Human resources and recruiting(HRM) &#8211; screeing resumes and performance appraisals.<br />
10) News, publishing and writing in media<br />
11) Online and customer service<br />
12) Self-parking and advanced cruise controls in cars and other vehicles.<br />
13) Optical character recognition (OCR)<br />
14) Robotics<br />
15) Hybrid intelligent system</p>
<p><span style="color: #3366ff;"><strong>What is the programming language used for artificial intelligence and machine learning?</strong></span><br />
As it purely depends on what languages you like programming in. AI programs have been written in just about every language ever created.</p>
<p><strong><span style="color: #3366ff;">The most common programming languages are.</span></strong></p>
<ul>
<li>Lisp,</li>
<li>Prolog</li>
<li>C/C++</li>
<li>Java (recently)</li>
<li>Python(more recently).</li>
</ul>
<p style="text-align: right;"><span style="color: #ff0000;"><strong><a style="color: #ff0000;" href="http://www.mitindia.in/angularjs/" target="_blank" rel="noopener">You can also read on AngularJS here</a></strong></span></p>
<p><a class="a2a_button_whatsapp" href="https://www.addtoany.com/add_to/whatsapp?linkurl=https%3A%2F%2Fmitindia.in%2Fartificial-intelligence%2F&amp;linkname=Artificial%20%20Intelligence" title="WhatsApp" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fmitindia.in%2Fartificial-intelligence%2F&amp;linkname=Artificial%20%20Intelligence" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fmitindia.in%2Fartificial-intelligence%2F&#038;title=Artificial%20%20Intelligence" data-a2a-url="https://mitindia.in/artificial-intelligence/" data-a2a-title="Artificial  Intelligence"><img src="https://static.addtoany.com/buttons/favicon.png" alt="Share"></a></p><p>The post <a href="https://mitindia.in/artificial-intelligence/">Artificial  Intelligence</a> appeared first on <a href="https://mitindia.in"></a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
