[Tutor] sorting and writing to data file

2014-02-02 Thread adrian
Hello community, Newbie here. I have a data (.dat) file with integers (2,9,1,5,7,3,9) in it just as shown. My instructions are to sort the numbers and rewrite them back to the data file. *here is my code:** * lab3int=[2,9,1,5,7,3,9] lab3int.sort() print(lab3int) lab3int=open('lab3int.dat','w

[Tutor] Embed python in a website

2012-05-03 Thread Adrian
I recently created a gui form using tkinter, is it possible to integrate this form to my website page? How do i integrate? Adrian Sent from my iPad ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http

[Tutor] binding a button to an entry

2012-05-01 Thread ADRIAN KELLY
title("Password entry box")root.geometry("300x100")app=Frame(root)app.grid() #labelslbl=Label(app, text="Enter your password: ")lbl.grid(row=1, column=0) #create entry widgetse = Entry(root)e.grid(row=1, column=1)s=e.get() #create a submit button

[Tutor] stuck on null values

2012-03-15 Thread ADRIAN KELLY
=raw_input("Enter the number of kids: ") price=child*number_childprint """___ Thank you, the Price will be: """,price print"""

Re: [Tutor] FW: null inputs

2012-03-15 Thread ADRIAN KELLY
thanks very much i get it now... > From: hugo.yo...@gmail.com > Date: Thu, 15 Mar 2012 16:03:12 +0100 > Subject: Re: [Tutor] FW: null inputs > To: eire1...@gmail.com > CC: kellyadr...@hotmail.com; tutor@python.org > > On Thu, Mar 15, 2012 at 3:56 PM, James Reynolds wrote: > >

[Tutor] FW: null inputs

2012-03-15 Thread ADRIAN KELLY
Adrian Kelly 1 Bramble Close Baylough Athlone County Westmeath 0879495663 From: kellyadr...@hotmail.com To: tutor@python.org Subject: null inputs Date: Thu, 15 Mar 2012 14:19:16 + Hi guys, how do i prevent a user from leaving a blank when inputting? e.g. age=int(input("

[Tutor] null inputs

2012-03-15 Thread ADRIAN KELLY
Hi guys, how do i prevent a user from leaving a blank when inputting? e.g. age=int(input("what age are you? ")).. i want to stop the user pressing enter if age==""? Adrian Kelly 1 Bramble Close Baylough Athlone County W

Re: [Tutor] appending to a file on a new line

2012-01-19 Thread ADRIAN KELLY
pointer left off. i dont know how to solve this. where do i put the '\n'? to be honest the .join i dont understand but otherwise it prints as a list e.g. ('name','age','etc') Adrian > Date: Thu, 19 Jan 2012 09:42:45 -0500 > Subject: Re: [T

[Tutor] appending to a file on a new line

2012-01-19 Thread ADRIAN KELLY
kelly\\Desktop\\details.txt",'a') User_info.write("\n".join(Details)) all the best, Adrian___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options:

[Tutor] Defining a File path

2012-01-10 Thread Adrian
Hi guys, I know that if i dont include any path information, python looks in the current directory for the file. My question is how do i specify a file path to open a file saved on my desktop for example. Thanks all Adrian Sent from my iPad

Re: [Tutor] reset password program

2011-12-16 Thread ADRIAN KELLY
500 > From: d...@davea.name > To: kellyadr...@hotmail.com > CC: tutor@python.org > Subject: Re: [Tutor] reset password program > > On 12/16/2011 05:02 PM, ADRIAN KELLY wrote: > > Hi guys, > > i created a program that allows users to login using a password that i set > >

[Tutor] reset password program

2011-12-16 Thread ADRIAN KELLY
hanks all, adrian___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] list, tuple or dictionary

2011-11-29 Thread ADRIAN KELLY
Sound Wayne, thank you From: waynejwer...@gmail.com Date: Tue, 29 Nov 2011 15:11:46 -0600 Subject: Re: [Tutor] list, tuple or dictionary To: kellyadr...@hotmail.com CC: tutor@python.org On Tue, Nov 29, 2011 at 3:04 PM, ADRIAN KELLY wrote: thanks guy, i was thinking of using a

Re: [Tutor] list, tuple or dictionary

2011-11-29 Thread ADRIAN KELLY
w would i go about adding, for example tea and eggs to get a subtotal? Adrian Kelly 1 Bramble Close Baylough Athlone County Westmeath 0879495663 From: waynejwer...@gmail.com Date: Tue, 29 Nov 2011 14:49:00 -0600 Subject: Re: [Tutor] list, tuple or dictionary To: kellyadr...@hotmail.com CC: tut

[Tutor] list, tuple or dictionary

2011-11-29 Thread ADRIAN KELLY
i am trying to create a program that will allow users to enter items and their prices; should i be looking at a list, tuple or what? many thanksadrian ___ Tutor maillist - Tutor@python.org To unsubscribe

[Tutor] FW: How do i show discount?(sorted)

2011-11-19 Thread ADRIAN KELLY
From: kellyadr...@hotmail.com To: kellyadr...@hotmail.com Subject: RE: How do i show discount? Date: Sat, 19 Nov 2011 23:34:27 + sorted it guys, used a third function Adrian From: kellyadr...@hotmail.com To: tutor@python.org Subject: How do i show discount

[Tutor] How do i show discount?

2011-11-19 Thread ADRIAN KELLY
def shop(total_spend):min_spend=25discount_amount=150discount=0.05 if total_spend >= min_spend and total_spend > discount_amount: checkout=total_spend-(total_spend*discount) discount=total_spend*discountelse:checkout = total_spend discount =

[Tutor] urgent help!!!!!!!!!!!

2011-11-17 Thread ADRIAN KELLY
n amount over 50: 'else:total=exchange(amount)print 'Your exchange comes to: ',total Adrian Kelly 1 Bramble Close Baylough Athlone County Westmeath 0879495663 From: waynejwer...@gmail.com Date: Thu, 17 Nov 2011 16:53:59 -0600 Subject: Re: [Tutor] please h

Re: [Tutor] please help - stuck for hours

2011-11-17 Thread ADRIAN KELLY
i know i should use input but when i changed to raw_input it wouldn't recognise the word print on the next line. honestly i have tried everything to get this working..i am 6 hrs at one program Adrian Kelly 1 Bramble Close Baylough Athlone County Westmeath 0879495663

Re: [Tutor] please help - stuck for hours

2011-11-17 Thread ADRIAN KELLY
total=exchange(amount)print 'Your exchange comes to: ',total main() Adrian Kelly 1 Bramble Close Baylough Athlone County Westmeath 0879495663 From: waynejwer...@gmail.com Date: Thu, 17 Nov 2011 15:35:29 -0600 Subject: Re: [Tutor] please help - stuck for hours To: kellyadr.

[Tutor] infinite loop

2011-11-17 Thread ADRIAN KELLY
#i am nearly there guys..please loop at the infinite loop i am getting here..PLEASE!!#ADRIAN def exchange(cash_in):euro=1dollar=float(1.35)base=50if cash_in>base:totalreturn=cash_in*dollarelse:totalreturn=0 return totalret

[Tutor] please help - stuck for hours

2011-11-17 Thread ADRIAN KELLY
i have tried everything, i am trying to build in a loop to my 2 functions which worked fine up until my latest sorti. please have a look if you can.. def exchange(cash_in):euro=1dollar=1.35base=50if cash_in>base: totalreturn=cash_in*dollarelse:tota

Re: [Tutor] local variable referenced before assignment

2011-11-17 Thread ADRIAN KELLY
you are spot on. thanks very much i understand the problem now and its been solved. very clear help thanks, adrian > Date: Thu, 17 Nov 2011 14:01:19 -0500 > From: d...@davea.name > To: kellyadr...@hotmail.com > CC: tutor@python.org > Subject: Re: [Tutor]

[Tutor] local variable referenced before assignment

2011-11-17 Thread ADRIAN KELLY
7;not enough'return totalreturn print exchange() Adrian Kelly 1 Bramble Close Baylough Athlone County Westmeath 0879495663 ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription opt

[Tutor] format integer to currency

2011-11-16 Thread ADRIAN KELLY
print ("i own {0:.2f} {1}".format(1.1,"million")) can anyone help me with code to change the format of this to currency €1.10 million thanks for your help ___ Tutor maillist - Tutor@python.org To unsubscrib

Re: [Tutor] modulus

2011-11-16 Thread ADRIAN KELLY
really appreciate that answer thanks very much.. Adrian Kelly 1 Bramble Close Baylough Athlone County Westmeath 0879495663 From: waynejwer...@gmail.com Date: Wed, 16 Nov 2011 09:59:50 -0600 Subject: Re: [Tutor] modulus To: kellyadr...@hotmail.com CC: tutor@python.org On

[Tutor] modulus

2011-11-16 Thread ADRIAN KELLY
Please can anyone tell me how i can print this without all the brackets and commas, i know i need the modulus symbol but i dont know how it works. any advice would be appreciated regards adrian def arguments(): name=raw_input ("Please enter your firstname: ") surname

Re: [Tutor] changing dictionary to lowercase

2011-10-28 Thread Adrian
Ok boss point noted Sent from my iPad On 28 Oct 2011, at 19:05, bob gailer wrote: > Always reply-all so a copy goes to the tutor list. > > Always put your responses following the question rather than at the top of > the email. > > On 10/28/2011 8:28 AM, Adrian wrote

[Tutor] changing dictionary to lowercase

2011-10-27 Thread ADRIAN KELLY
Hi all, is it possible to change a dictionary list to lowercase..without having to retype? e.g. definitions={"Deprecated": "No longer in use", "Depreciation": "fall in value of an asset"} i have tried definiti

[Tutor] printing a key not a value

2011-10-25 Thread ADRIAN KELLY
if i have a dictionary called definitions is there a way of printing the keys and not the values that go with them? thanks so much Adrian___ Tutor maillist - Tutor@python.org To unsubscribe or

[Tutor] (no subject)

2011-10-17 Thread ADRIAN KELLY
Hello world, can anyone tell me how i can perfect the program below. it works find (prints 6 random numbers within a range) but on occasions the numbers are repeated. Thanks so much everyone #program that will allow the user to generate random numbers #from a range that they select. impor

[Tutor] FW: 6 random numbers(again)

2011-10-17 Thread ADRIAN KELLY
> Subject: Re: [Tutor] 6 random numbers > From: shanta...@gmail.com > Date: Mon, 17 Oct 2011 01:53:18 +0530 > CC: tutor@python.org > To: kellyadr...@hotmail.com > > On 17-Oct-2011, at 1:13 AM, ADRIAN KELLY wrote: > > > hello all, > > anyone know ho

[Tutor] 6 random numbers

2011-10-16 Thread ADRIAN KELLY
hello all, anyone know how i would go about printing 6 random numbers, i know i could copy and paste 6 times (which would work) but i was thinking about a while loop, ie. while lottery_numbers.count is <7. Is it possible to code this? is it possible to count random variables? i am trying to ke

[Tutor] basic problem

2011-10-06 Thread ADRIAN KELLY
Hi all, can someone spell out to me in (simply if possible) what this programme is doing. i understand the concept of the "for" loop and what its doing with the message the user enters. i just cant understand the VOWELS and how it keeps adding 1 letter to the message. thanks for looking

Re: [Tutor] guess age programme (still stuck!!!!!)

2011-09-30 Thread ADRIAN KELLY
:print "Correct...well done!!"else:breakprint "Out of attempts" print "\n\nGood guess!!" input ("\n\nPress the enter key to exit.") Date: Fri, 30 Sep 2011 14:31:52 +0200 From: cwi...@compuscan.co.za T

[Tutor] guess age programme (please help)

2011-09-30 Thread ADRIAN KELLY
ing a condition so that when the guesses = 0, the programme closes or stops etc. any advice would be very grateful (particularly the correct code) i am learning if's and loops so please keep explanations as simple as possible. i really appreciate everyones hel

[Tutor] last part of my programme

2011-09-29 Thread ADRIAN KELLY
can anyone tell me why the last part of my programme wont work. i want the user to have to press enter to exit but it doesn't happen through the python interface. the programme works fine otherwise but just shuts down when finished thanks all a

[Tutor] password loop

2011-09-23 Thread ADRIAN KELLY
Can anyone help me with the programme below; i hope you can see what i am trying to do, if i enter the wrong password the loop goes on forever and if i enter the right one nothing is printed... i am a newbieall comments welcome thanks adrian print 'hello&#

[Tutor] guess-my-number programme

2011-09-23 Thread ADRIAN KELLY
its meant to count the number of guesses made by the user by adding 1 but i just cant figure out how it does this..can someone explain?? i.e. tries = 1, tries +1 etc cant get my head around it... thanks all Adrian Kelly 1 Bramble Close Baylough Athlone County Westmeat

[Tutor] On off Toggle

2011-03-12 Thread Adrian Atkinson
class Television(object): def __init__(self,__channel,volume,is_on): self.volume = volume self.is_on = "Power is off" power = self.is_on def toggle_power(self): if choice == "1" and power == self.is_on : power = "Power is Now on" elif c

Re: [Tutor] Delete file before function ends

2008-10-06 Thread Adrian Greyling
I'll take a peek at the subprocess docs Steve, and see if I can learn something there... Thanks for the suggestion! I'm using WinXP as well Wayne.. Not too sure why yours works, and mine doesn't.. I'll revisit what I'm doing and also check into Steve's suggest

Re: [Tutor] Delete file before function ends

2008-10-06 Thread Adrian Greyling
rstandable question! As a newbie, Alan, I was kinda scared you'd say that "threads" were the answer here! (It sounds like someone is going to get sucked into a worm hole or something...) Looks like the next class in my Python education is going to be "Threads 101"... Tha

[Tutor] Delete file before function ends

2008-10-06 Thread Adrian Greyling
ath = "c:\MyFolder\mytextfile.xyz" #bunch of stuff here to create 'mytextfile.xyz" os.startfile(path) os.remove(path) Thanks everyone, Adrian ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] pysqlite and SQLite

2008-09-29 Thread Adrian Greyling
, it works just fine. When I attempt to use the same executable (including the "dist" directory) on a (virtually) identical PC, I get the following error message: pysqlite2.dbapi2.OperationalError: near ",": syntax error I understand the error, but not why I get it on one PC and not

[Tutor] pysqlite and SQLite

2008-09-29 Thread Adrian Greyling
Probably a really dumb question, but... Do I have to download and install SQLite before pysqlite will work properly? Thanks, Adrian ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Current path (of program)

2008-09-25 Thread Adrian Greyling
a string and returns the directory path portion. If the given filename does not include any path information, os.path.dirname returns an empty string. os.path.abspath is the key here. It takes a pathname, which can be partial or even blank, and returns a fully qualified pathname." Sorry about t

[Tutor] Current path (of program)

2008-09-25 Thread Adrian Greyling
ng to use a "relative path reference" so that the user can install the program to whatever directory he/she wants, but that my program won't "lose track" of the subdirectories it requires for additional files. Anyone run into the same sort of problem? Better yet, any

Re: [Tutor] Is this a "Class" problem?

2008-09-02 Thread Adrian Greyling
I appreciate the feedback! I'll check out the pubsub module and see how that works out and I'll subscribe to the wxPython group too! Thanks again! On Fri, Aug 29, 2008 at 5:31 PM, Kent Johnson <[EMAIL PROTECTED]> wrote: > On Fri, Aug 29, 2008 at 12:19 PM, Adrian Greyling

Re: [Tutor] Is this a "Class" problem?

2008-08-29 Thread Adrian Greyling
from a new function definition, aren't I creating a brand new frame_2 object that has "blank" attributes, so to speak? I'm sure I've made things clear as mud, but hopefully with my blathering, someone will undertand my utter confusion! Thanks everyone! Adrian On Mon, A

[Tutor] Is this a "Class" problem?

2008-08-18 Thread Adrian Greyling
Hi folks! I hope I'm in the right place to ask this question. I'm new to Python and have been working through some tutorials and have made it to the GUI creation stage. All I was hoping to do with the code below, was to open a "secondary" window and have some text end up on a text_ctrl, but I ge