5 Replies - 1866 Views - Last Post: 13 March 2014 - 07:47 PM Rate Topic: -----

#1 poli577   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 7
  • Joined: 05-March 14

Bank teller program help/ database MySQL

Posted 12 March 2014 - 06:56 PM

okay guys well im new here and i need help creating a bank teller program in python some of the things i dont really undestand is how to do that in the code someone can sign in by writing its information like name an id and create a bank account for him so the balance would be saved it should work for at least 5 users i downloaded MySQL and i have read a lor about bur=t i dont reaaly understand what to do in this case help
Is This A Good Question/Topic? 0
  • +

Replies To: Bank teller program help/ database MySQL

#2 jon.kiparsky   User is online

  • Beginner
  • member icon


Reputation: 11937
  • View blog
  • Posts: 20,243
  • Joined: 19-March 11

Re: Bank teller program help/ database MySQL

Posted 12 March 2014 - 07:12 PM

If you want to persist the data across sessions, you're going to need to use some sort of storage, and a database like MySQL is certainly one way to do that. I suggest, though, that mysqlite might be a better choice. It's an sql-like database, but it writes to a local file, and it's a lot easier to work with. There's a lot of admin stuff in MySQL that you can avoid with mysqlite.

That being said, if you're just getting started, this is a relatively ambitious project, so you're going to have to work a bit to manage the complexity. If you really don't know how to start with this, then I suggest you fall back to simpler projects, and work your way up to this.

If you don't have some code to get started with, we're probably not going to be able to help you much. We certainly can't do anything for you unless you make your question more specific. I really don't know what you're asking about here.

This post has been edited by jon.kiparsky: 12 March 2014 - 07:13 PM

Was This Post Helpful? 0
  • +
  • -

#3 poli577   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 7
  • Joined: 05-March 14

Re: Bank teller program help/ database MySQL

Posted 12 March 2014 - 07:45 PM

thank you for the advice, i want to try to do it but i dont really get the part of saving information like the name an id number from python to mysqlite i already downloaded and it really looks easier to use but how do i save from python to mysqlite what commands or functions do i need? an example will be useful thanks
Was This Post Helpful? 0
  • +
  • -

#4 jon.kiparsky   User is online

  • Beginner
  • member icon


Reputation: 11937
  • View blog
  • Posts: 20,243
  • Joined: 19-March 11

Re: Bank teller program help/ database MySQL

Posted 12 March 2014 - 08:03 PM

There are a number of tutorials. Perhaps you should work through three or four of them until you feel like you have some idea of what's going on.

Try searching on "python sqlite tutorial" and see what you find.
Was This Post Helpful? 0
  • +
  • -

#5 MentalFloss   User is offline

  • .
  • member icon

Reputation: 619
  • View blog
  • Posts: 1,590
  • Joined: 02-September 09

Re: Bank teller program help/ database MySQL

Posted 12 March 2014 - 10:48 PM

There is a really nice tutorial on here: http://www.dreaminco...ite3-in-python/
Was This Post Helpful? 0
  • +
  • -

#6 poli577   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 7
  • Joined: 05-March 14

Re: Bank teller program help/ database MySQL

Posted 13 March 2014 - 07:47 PM

hey guys thanks for the tutorials i've been looking at them and reading to understand and the bank teller project its going well but as im progressing with it i got into a trouble
 if opcion==2:
        t=int(raw_input("ingrese cantidad"))
        import sqlite3
        con = sqlite3.connect('Base datos.sql')
        cur = con.cursor()
        
        cur.execute("""UPDATE users SET cantidad=5 WHERE cantidad=5000""")
        con.commit()


what i've been trying is to change the amount in the column of "cantidad" that is the amount of money each account will have for default but i was trying to use t as the new amount instead of 5000 and i was looking what happens if i wrote 5 to change and it chanhes but a cant progress and do a math operation inside for example (5000-t) for the new value in the database for the column "cantidad"
Any suggestions guys or a function that will me to deal with these also im using mysqlite
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1