Making a money managing program with python

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • compdude
    New Member
    • Jan 2009
    • 1

    Making a money managing program with python

    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:

    Code:
    print "Welcome to Money Manager"
    print "-----------"
    print
    
    ws1 = File "C:\Users\vista user\Desktop\Money Manager.xlsx"
    
    print "What is the month today?"
    print "1 January"
    print "2 February"
    print "3 March
    print "
    print
    
    month = input
    
    if month == 
    
    print "Please select an option:"
    print "1 Money Used"
    print "2 Money Recieved"
    print
    
    option = input
    
    if option == 1:
        Used = input("Please enter the money used: ")
        ws1.Cells(4,2).Value = Used
        Moneyleft = ws1.Cells(3,6) - Used
        ws1.Cells(4,6).Value = Moneyleft
        Why = input("What was the money used for? ")
        ws1.Cells(4,4).Value = Why
        print "You Have", Moneyleft, "left"
    elif option == 2:
        Recieved = input("Please enter the money recieved: ")
        Moneyleft = ws1.Cells(3,6) + Recieved
        
    
    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!! :((
    Last edited by bvdet; Jan 10 '09, 04:51 PM. Reason: Add code tags
  • bvdet
    Recognized Expert Specialist
    • Oct 2006
    • 2851

    #2
    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().
    Code:
    >>> month = int(raw_input("Enter month (1-12)"))
    >>> month
    12
    >>> option = raw_input("Enter Option Number: (1)Money Used, (2)Money Received")
    >>> option
    '1'
    >>>
    HTH

    Comment

    • aberry
      New Member
      • Sep 2008
      • 10

      #3
      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...

      Comment

      Working...