# This program was authored by M. Srinu , RGU IIIT NUZVID.
# Please maintain certain indentation after copying the program.
from Tkinter import *
import Tkinter
import tkMessageBox
import Tkinter as tk
import os, glob
import sys
import string
import re
import tkFileDialog
import random
while(3):
def hotel():
print "\t\t\t//** Hi friend welcome to my new hotel**//\n"
n=raw_input("Enter your name here :")
class Application(Frame):
def say_hi(self):
print "Hi !",n
def createWidgets(self):
self.QUIT = Button(self)
self.QUIT["text"] = "QUIT"
self.QUIT["fg"] = "red"
self.QUIT["bg"] ="yellow"
self.QUIT["command"] = self.quit
self.QUIT.pack({"side": "left"})
self.hi_there = Button(self)
self.hi_there["text"] = "Hello",
self.hi_there["fg"] = "red"
self.hi_there["bg"] ="blue"
self.hi_there["command"] = self.say_hi
self.hi_there.pack({"side": "left"})
def __init__(self, master=None):
Frame.__init__(self, master)
self.pack()
self.createWidgets()
root = Tk()
app = Application(master=root)
app.mainloop()
root.destroy()
d={'idly':10,'dosa':15,'puri':15,'biryani':40,'chicken biryani':50,'rice':35,'yellow rice':30}
top = Tkinter.Tk()
def hello():
tkMessageBox.showinfo(" Menu","item\t Rs\n\nidly\t10\ndosa\t15\npuri\t15\nrice\t35\nbiryani\t40\nchicken biryani 50\nyellow rice 30\n\n'Note': Please close the below window after press the ok button.")
B1 = Tkinter.Button(top, text = "Press this button to see the menu", command = hello)
B1.pack()
top.mainloop()
l=[]
print ("Plz give order,if u enough just press 'Enter'\n")
while(1):
k=raw_input("Order which item u want >>>") #take order
if k=='':
break;
l.append(k) #take ordered items into a list
print("\t\t\tThanq for ur ordered\n")
class Application(Frame):
def say_hi(self):
print "Your ordered menu is",l
def createWidgets(self):
self.QUIT = Button(self)
self.QUIT["text"] = "QUIT"
self.QUIT["fg"] = "red"
self.QUIT["bg"] ="yellow"
self.QUIT["command"] = self.quit
self.QUIT.pack({"side": "left"})
self.hi_there = Button(self)
self.hi_there["text"] = "Your ordered menu",
self.hi_there["fg"] = "red"
self.hi_there["bg"] ="blue"
self.hi_there["command"] = self.say_hi
self.hi_there.pack({"side": "left"})
def __init__(self, master=None):
Frame.__init__(self, master)
self.pack()
self.createWidgets()
root = Tk()
app = Application(master=root)
app.mainloop()
root.destroy()
s=0
print "\t\t\t/**/Individual bill is/**/\t"
print"\t\t\t* * * * * * * * * * *"
print("\t\t\titem\t\tprice")
print"\t\t\t* * * * * * * * * * *"
for i in l: #to print the the ordered item and price
for key in d:
if i==key:
s+=d[key]
print "\t\t\t",i,"\t\t",d[i]
if i not in d:
print "\t\t\tThe item ",i," was not found in the menu"
print"\t\t\t* * * * * * * * * * *"
jk=raw_input("If u want to drink anything just press y >>>") #ask user he/she want to drink anything or not
if jk=="y":
q={'tea':5,'coffee':7,'ice-cream':10,'cone ice-cream':20,'coke':25,'pepsi':20,'mazza':25}
top = Tkinter.Tk()
def hello2():
tkMessageBox.showinfo(" Menu","item\t Rs\n\ntea\t05\ncoke\t25\ncoffee\t07\npepsi\t20\nmazza\t25\nice-cream\t10\ncone ice-cream 20\n\n'Note': Please close the below window after press the ok button.")
B2 = Tkinter.Button(top, text = "Press this button to see the menu", command = hello2)
B2.pack()
top.mainloop()
list=[]
print " if u enough just press 'Enter'\n"
while(2):
a=raw_input("Order which item u want >>>")
if a=='':
break;
list.append(a)
class Application(Frame):
def say_hi(self):
print "Your ordered menu is",list
def createWidgets(self):
self.QUIT = Button(self)
self.QUIT["text"] = "QUIT"
self.QUIT["fg"] = "red"
self.QUIT["bg"] ="yellow"
self.QUIT["command"] = self.quit
self.QUIT.pack({"side": "left"})
self.hi_there = Button(self)
self.hi_there["text"] = "Your ordered menu",
self.hi_there["fg"] = "red"
self.hi_there["bg"] ="blue"
self.hi_there["command"] = self.say_hi
self.hi_there.pack({"side": "left"})
def __init__(self, master=None):
Frame.__init__(self, master)
self.pack()
self.createWidgets()
root = Tk()
app = Application(master=root)
app.mainloop()
root.destroy()
b=0
print "\t\t\t/**/Individual bill is/**/\t"
print"\t\t\t* * * * * * * * * * *"
print("\t\t\titem\t\tprice")
print"\t\t\t* * * * * * * * * * *"
for i in list:
for key in q:
if i==key:
b+=q[key]
print "\t\t\t",i,"\t\t",q[i]
if i not in q:
print"\t\t\tThe item ",i," was not found in the menu"
print"\t\t\t* * * * * * * * * * *"
print "Total bill for your eating is ",s,"\n"
print "Total bill of your drinking is ",b,"\n"
print "Total bill of your drinking and eating is ",s+b,"\n"
def gift():
if s+b>=150:
box=['A.C','P.C','T.V','Refrigerator','Dining table']
random.shuffle(box)
l=input("WoW !!!! Congratulations @!!@ you got a lottery Enter which index item u want(0 to 4) >>>")
print "\nIn this lottery you got a",box[l],"\n We will sent this item to your home plz fill the below form \n"
print"\t\t*****************************\n\t\t* The lottery box items are *\n\t\t*****************************\t\t\n--------------------------------------------------------------------------\n",box,"\t\t\n--------------------------------------------------------------------------\n"
print"\t\t\t\t//**Lottery form**//"
name=raw_input("Enter your name here(What u gave first) >>>\n--------------\n")
while(n!=name):
name=raw_input("Please enter What u gave first) >>>\n--------------\n")
print("--------------")
p_n=input("Enter your phone number here >>>\n--------------\n")
print("--------------")
address=raw_input("Enter your address here in this form (vill,m.d,dist) >>>\n--------------\n")
print("--------------")
print"Thanq,",name," we will sent the","'",box[l],"'", "to your address\n"
elif s+b>=100:
box=['Cricket bat','Volley ball','video game','5-books','Bag','Radio']
random.shuffle(box)
l=input("WoW !!!! Congratulations @!!@ you got a lottery Enter which index item u want(0 to 5) >>>")
print "\nIn this lottery you got a",box[l],"\n We will sent this item to your home plz fill the below form \n"
print"\t\t*****************************\n\t\t* The lottery box items are *\n\t\t*****************************\t\t\n--------------------------------------------------------------------------\n",box,"\t\t\n--------------------------------------------------------------------------\n"
print"\t\t\t\t//**Lottery form**//"
name=raw_input("Enter your name here(What u gave first) >>>\n--------------\n")
while(n!=name):
name=raw_input("Please enter What u gave first) >>>\n--------------\n")
print("--------------")
p_n=input("Enter your phone number here >>>\n--------------\n")
print("--------------")
address=raw_input("Enter your address here in this form (vill,m.d,dist) >>>\n--------------\n")
print("--------------")
print"Thanq,",name," we will sent the","'",box[l],"'", "to your address\n"
elif s+b>=50:
box=['watch','camera','pen','pencil','Cricket ball','Fan','Chair']
random.shuffle(box)
l=input("WoW !!!! Congratulations @!!@ you got a lottery Enter which index item u want(0 to 6) >>>")
print "\nIn this lottery you got a",box[l],"\n We will sent this item to your home plz fill the below form \n"
print"\t\t*****************************\n\t\t* The lottery box items are *\n\t\t*****************************\t\t\n--------------------------------------------------------------------------\n",box,"\t\t\n--------------------------------------------------------------------------\n"
print"\t\t\t\t//**Lottery form**//"
name=raw_input("Enter your name here(What u gave first) >>>\n--------------\n")
while(n!=name):
name=raw_input("Please enter What u gave first) >>>\n--------------\n")
print("--------------")
p_n=input("Enter your phone number here >>>\n--------------\n")
print("--------------")
address=raw_input("Enter your address here in this form (vill,m.d,dist) >>>\n--------------\n")
print("--------------")
print"Thanq,",name," we will sent the","'",box[l],"'", "to your address\n"
pb=input("Please pay the bill......! here :")
if (pb==(s+b)):
print ("Thanq ....!")
elif(pb>s+b):
rb=pb-(s+b)
print "You will get ",rb," rupees "
gift()
else:
print "Total bill for your eating is ",s,"\n"
def gift():
if s>=150:
box=['A.C','P.C','T.V','Refrigerator','Dining table']
random.shuffle(box)
l=input("WoW !!!! Congratulations @!!@ you got a lottery Enter which index item u want(0 to 4)")
print "\nIn this lottery you got a",box[l],"\n We will sent this item to your home plz fill the below form \n"
print"\t\t*****************************\n\t\t* The lottery box items are *\n\t\t*****************************\t\t\n--------------------------------------------------------------------------\n",box,"\t\t\n--------------------------------------------------------------------------\n"
print"\t\t\t\t//**Lottery form**//"
name=raw_input("Enter your name here(What u gave first) >>>\n--------------\n")
while(n!=name):
name=raw_input("Please enter What u gave first) >>>\n--------------\n")
print("--------------")
p_n=input("Enter your phone number here >>>\n--------------\n")
print("--------------")
address=raw_input("Enter your address here in this form (vill,m.d,dist) >>>\n--------------\n")
print("--------------")
print"\nThanq,",name," we will sent the","'",box[l],"'", "to your address\n"
elif s>=100:
box=['Cricket bat','Volley ball','video game','5-books','Bag','Radio']
random.shuffle(box)
l=input("WoW !!!! Congratulations @!!@ you got a lottery Enter which index item u want(0 to 5) >>>")
print "\nIn this lottery you got a",box[l],"\nWe will sent this item to your home plz fill the below form \n"
print"\t\t*****************************\n\t\t* The lottery box items are *\n\t\t*****************************\t\t\n--------------------------------------------------------------------------\n",box,"\t\t\n--------------------------------------------------------------------------\n"
print"\t\t\t\t//**Lottery form**//"
name=raw_input("Enter your name here(What u gave first) >>>\n--------------\n")
while(n!=name):
name=raw_input("Please enter What u gave first) >>>\n--------------\n")
print("--------------")
p_n=input("Enter your phone number here >>>\n--------------\n")
print("--------------")
address=raw_input("Enter your address here in this form (vill,m.d,dist) >>>\n--------------\n")
print("--------------")
print"\nThanq,",name," we will sent the","'",box[l],"'", "to your address\n"
elif s>=50:
box=['watch','camera','pen','pencil','Cricket ball','Fan','Chair']
random.shuffle(box)
l=input("WoW !!!! Congratulations @!!@ you got a lottery Enter which index item u want(0 to 6) >>>")
print "\nIn this lottery you got a",box[l],"\n We will sent this item to your home plz fill the below form \n"
print"\t\t*****************************\n\t\t* The lottery box items are *\n\t\t*****************************\t\t\n--------------------------------------------------------------------------\n",box,"\t\t\n--------------------------------------------------------------------------\n"
print"\t\t\t\t//**Lottery form**//"
name=raw_input("Enter your name here(What u gave first) >>>\n--------------\n")
while(n!=name):
name=raw_input("Please enter What u gave first) >>>\n--------------\n")
print("--------------")
p_n=input("Enter your phone number here >>>\n--------------\n")
print("--------------")
address=raw_input("Enter your address here in this form (vill,m.d,dist) >>>\n--------------\n")
print("--------------")
print"\nThanq,",name," we will sent the","'",box[l],"'", "to your address\n"
pb=input("Please pay the bill......! here :")
if (pb==s):
print ("Thanq ....!")
elif(pb>s):
rb=pb-s
print "You will get ",rb," rupees "
gift()
hotel()
com=raw_input("If u want to write a comment on my program just press 1 :")
if com=='1':
class MyDialog:
def __init__(self, parent):
top = self.top = Toplevel(parent)
Label(top, text="Write your comment here").pack()
self.e = Entry(top)
self.e.pack(padx=5)
b = Button(top, text="OK", command=self.ok)
b.pack(pady=5)
def ok(self):
print "\n\tThankq..... for your comment"
cr=open("Comment.txt","a")
print "\n"
cr.write(self.e.get())
cr.close()
print "\nClose the side empty window\n"
self.top.destroy()
root = Tk()
d = MyDialog(root)
root.wait_window(d.top)
re=input("R u want to run this program again press any key expect 0(don't use characters):")
if (re==0):
print "\t\t\tThankq..........."
break
Hi gys, are you looking to write a program to know the sign depends on the birth date or horoscope on python? write down following codes on python, those will make a nice program. #This program will get the horoscope sign. def getSign(): name = raw_input ("Enter Your Name: ") month = raw_input("Enter Birth Month: ") day = int(raw_input("Enter Birth Day of Month: ")) if month "y": main() letter = raw_input("Go again? (y/n): ")
a = 0while a < 10 :a += 1print (a)Write the above simple script in a text editor (I use nano). Save as loop.py in home folder. To run, open a terminal and at the prompt, write: python loop.pyResult:rodney@downstairs:~$ python loop.py12345678910
Python is just a programming software, you don't actually need it to run your computer. You can use Python if you'd like to program something, or learn how to program.
open MS-DOS in the directory you have the python file in. type "python [INSERTNAMEOFSCRIPT]"
it depends what type of program you wish to write. python is a very simple programing langauge therefore it doesnt have much room to play with. i mainly use it to work out simple math problems, or use it to calculate thing for games i play, Ex.) This is a program i wrote to work out the Pythagorean therom to find side "C": a = input("Enter Corner Side A\n ") b = input("Enter Corner Side B\n ") c = a*a+b*b import math print math.sqrt(c) raw_input("Press <enter> To Leave Program") input mean that's where you enter your variable, raw input is what you put at the end so it doesnt just run away (NOTE*** THIS IS A PYTHON 2.6.5 SCRIPT, IT WILL NOT WORK ON OTHER VERSIONS OF PYTHON" notice i put ("Press <enter> To Leave Program") this is what it will say before it "runs away". i suggest watching some youtube videos on how to write programs for your version of python. also try using the manual that comes with your version of python. it helps greatly.
Hi gys, are you looking to write a program to know the sign depends on the birth date or horoscope on python? write down following codes on python, those will make a nice program. #This program will get the horoscope sign. def getSign(): name = raw_input ("Enter Your Name: ") month = raw_input("Enter Birth Month: ") day = int(raw_input("Enter Birth Day of Month: ")) if month "y": main() letter = raw_input("Go again? (y/n): ")
ponka
In which computer language?
Wesley Chun has written: 'Python fundamentals' -- subject(s): Python (Computer program language) 'Core Python programming' -- subject(s): Python (Computer program language)
a = 0while a < 10 :a += 1print (a)Write the above simple script in a text editor (I use nano). Save as loop.py in home folder. To run, open a terminal and at the prompt, write: python loop.pyResult:rodney@downstairs:~$ python loop.py12345678910
Python is just a programming software, you don't actually need it to run your computer. You can use Python if you'd like to program something, or learn how to program.
If you have an interest in games, and know how to program in python you should investigate pygame. Pygame is a python module which is designed to let you use python to write games with sprites and sound. For an introduction to Pygame, see chapter 17 in Al Sweigart's free ebook Invent Your Own Computer Games With Python. (see related link) The Pygame module is available for download from pygame.org.
open MS-DOS in the directory you have the python file in. type "python [INSERTNAMEOFSCRIPT]"
Python is a runtime interpreter. It usually runs on the web server.
Think Python,A byte of python Invent Computer games with pythonAre three possibles, and all are free and libre
Python is named after the comedy troupe Monty Python, not the genus of snake. The creators of Python intended it to be fun to program in, and hoped to reflect that in its name.
it depends what type of program you wish to write. python is a very simple programing langauge therefore it doesnt have much room to play with. i mainly use it to work out simple math problems, or use it to calculate thing for games i play, Ex.) This is a program i wrote to work out the Pythagorean therom to find side "C": a = input("Enter Corner Side A\n ") b = input("Enter Corner Side B\n ") c = a*a+b*b import math print math.sqrt(c) raw_input("Press <enter> To Leave Program") input mean that's where you enter your variable, raw input is what you put at the end so it doesnt just run away (NOTE*** THIS IS A PYTHON 2.6.5 SCRIPT, IT WILL NOT WORK ON OTHER VERSIONS OF PYTHON" notice i put ("Press <enter> To Leave Program") this is what it will say before it "runs away". i suggest watching some youtube videos on how to write programs for your version of python. also try using the manual that comes with your version of python. it helps greatly.