By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,427 Members | 1,379 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,427 IT Pros & Developers. It's quick & easy.

Making a money managing program with python

P: 1
Hello everyone,
i need some help on my programming in python
i am trying to make a program that can ask for information and document it on a excel spreadsheet. Im a beginner programmer and i am really confused :S

this is what i have so far:

Expand|Select|Wrap|Line Numbers
  1. print "Welcome to Money Manager"
  2. print "-----------"
  3. print
  4.  
  5. ws1 = File "C:\Users\vista user\Desktop\Money Manager.xlsx"
  6.  
  7. print "What is the month today?"
  8. print "1 January"
  9. print "2 February"
  10. print "3 March
  11. print "
  12. print
  13.  
  14. month = input
  15.  
  16. if month == 
  17.  
  18. print "Please select an option:"
  19. print "1 Money Used"
  20. print "2 Money Recieved"
  21. print
  22.  
  23. option = input
  24.  
  25. if option == 1:
  26.     Used = input("Please enter the money used: ")
  27.     ws1.Cells(4,2).Value = Used
  28.     Moneyleft = ws1.Cells(3,6) - Used
  29.     ws1.Cells(4,6).Value = Moneyleft
  30.     Why = input("What was the money used for? ")
  31.     ws1.Cells(4,4).Value = Why
  32.     print "You Have", Moneyleft, "left"
  33. elif option == 2:
  34.     Recieved = input("Please enter the money recieved: ")
  35.     Moneyleft = ws1.Cells(3,6) + Recieved
  36.  
  37.  
  38. input("<press return to end program>")
the elif option == 2 part is not finished because i am confused about wat to do. Also, i would like the program to ask for the date of the month as well and document the date in the spreadsheet link given above. and this program that i made doesnt seem to be working either. :S Please help me!! :((
Jan 10 '09 #1
Share this Question
Share on Google+
2 Replies


bvdet
Expert Mod 2.5K+
P: 2,851
What means do you intend to use to in interface with Excel? An example of writing to an Excel file can be found here.

You can get user input using raw_input().
Expand|Select|Wrap|Line Numbers
  1. >>> month = int(raw_input("Enter month (1-12)"))
  2. >>> month
  3. 12
  4. >>> option = raw_input("Enter Option Number: (1)Money Used, (2)Money Received")
  5. >>> option
  6. '1'
  7. >>> 
HTH
Jan 10 '09 #2

P: 10
your program is not clear to me... it is missing something ...

1) please state clearly what do you want to achieve, use Excel api to read xls.

2) While doing comparison make sure you get input option as 'int' or 'string'
better to have option value as int using
int(raw_input('text here ....'))
3) If you want to end programming by pressing any key ... we have to put input option in ... while loop and certain value it should exit (say pressing 'X' and enter)

it will be great if you attach Excel sheet and mention what do you want to archive...
Jan 13 '09 #3

Post your reply

Sign in to post your reply or Sign up for a free account.