[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)

[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
, 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 buttonb=Button(root, text=SUBMIT, command=reveal)b.grid(row=0, column=2) root.mainloop() thanks all,adrian

[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 Westmeath 0879495663

[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(what

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 eire1...@gmail.com

[Tutor] stuck on null values

2012-03-15 Thread ADRIAN KELLY
, the Price will be: ,price print___ main() Adrian Kelly 1 Bramble Close Baylough Athlone County Westmeath 0879495663 ___ Tutor maillist

[Tutor] appending to a file on a new line

2012-01-19 Thread ADRIAN 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: http://mail.python.org/mailman/listinfo

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

2012-01-19 Thread ADRIAN KELLY
the 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: [Tutor] appending to a file on a new line From

[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

[Tutor] reset password program

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

Re: [Tutor] reset password program

2011-12-16 Thread ADRIAN KELLY
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 at the top of the program. Among other things users are given

[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

Re: [Tutor] list, tuple or dictionary

2011-11-29 Thread ADRIAN KELLY
? 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: tutor@python.org On Tue, Nov 29, 2011 at 2:31 PM, ADRIAN KELLY kellyadr

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 kellyadr...@hotmail.com wrote: thanks guy, i

[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] 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] local variable referenced before assignment

2011-11-17 Thread ADRIAN KELLY
totalreturn print exchange() Adrian Kelly 1 Bramble Close Baylough Athlone County Westmeath 0879495663 ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org

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] local variable referenced

[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_inbase: totalreturn=cash_in*dollarelse:

[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_inbase:totalreturn=cash_in*dollarelse:totalreturn=0 return totalreturn

Re: [Tutor] please help - stuck for hours

2011-11-17 Thread ADRIAN KELLY
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...@hotmail.com CC: tutor@python.org On Thu, Nov 17

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 From

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

2011-11-17 Thread ADRIAN KELLY
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 help - stuck for hours To: kellyadr...@hotmail.com CC: tutor@python.org On Thu, Nov 17, 2011

[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=raw_input (Enter

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

[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 unsubscribe

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 bgai...@gmail.com 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: Thats

[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 definitions=definitions.lower() regards adrian

[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

[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 how i would go about printing 6 random numbers, i

[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.

[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

[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 A

[Tutor] guess age programme (please help)

2011-09-30 Thread ADRIAN KELLY
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 help adrian

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

2011-09-30 Thread ADRIAN KELLY
the enter key to exit.) Date: Fri, 30 Sep 2011 14:31:52 +0200 From: cwi...@compuscan.co.za To: kellyadr...@hotmail.com CC: tutor@python.org Subject: Re: [Tutor] guess age programme (please help) On 2011/09/30 02:04 PM, ADRIAN KELLY wrote: Hi all

[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 adrian

[Tutor] guess-my-number programme

2011-09-23 Thread ADRIAN KELLY
. tries = 1, tries +1 etc cant get my head around it... thanks all Adrian Kelly 1 Bramble Close Baylough Athlone County Westmeath 0879495663 ___ Tutor maillist - Tutor@python.org To unsubscribe

[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' print

[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 choice

[Tutor] Delete file before function ends

2008-10-06 Thread Adrian Greyling
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] Delete file before function ends

2008-10-06 Thread Adrian Greyling
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... Thanks for all the input, I might even be learning something! Warmest regards, Adrian On Mon

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 suggestion. Adrian On Mon, Oct 6

[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] pysqlite and SQLite

2008-09-29 Thread Adrian Greyling
. 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 another... Adrian On Mon, Sep 29

[Tutor] Current path (of program)

2008-09-25 Thread Adrian Greyling
, 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, anyone know how to solve this? Thanks everyone! Adrian ___ Tutor maillist - Tutor@python.org http

Re: [Tutor] Current path (of program)

2008-09-25 Thread Adrian Greyling
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 that folks... Adrian On Thu

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 [EMAIL PROTECTED

Re: [Tutor] Is this a Class problem?

2008-08-29 Thread Adrian Greyling
clear as mud, but hopefully with my blathering, someone will undertand my utter confusion! Thanks everyone! Adrian On Mon, Aug 18, 2008 at 3:29 PM, Jeff Younker [EMAIL PROTECTED] wrote: On Aug 18, 2008, at 9:13 AM, Adrian Greyling wrote: def MainToSecond(self, event): # wxGlade

[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 get