Im trying to create a booking system for a cinema, What i want to do is :
open my csv with available seats, print it then ask the user what seat it wants, then the csv need to update taking away the seat, and then that seat gets added to the customers csv.
Any code, any ideas would be great THANKYOU
No one is going to give you code.
Well you have your problem explain, now start coding.
Opening: reading/writing: Click Here
Here's a small example of a csv file:
*,*,*,*,*,*,*,*,*,*,* *,*,*,*,*,+,*,x,*,*,* *,*,*,*,*,+,*,x,*,*,* *,*,*,x,*,+,*,x,*,*,* *,*,*,*,*,+,*,x,x,*,* *,*,*,*,*,+,*,x,x,*,* *,*,*,*,*,+,*,*,*,*,*
'*' character marks an empty chair,
'x' marks an occupied chair, and
'+' marks the corridor.
Edited 3 Years Ago by Lucaci Andrew
Design your data structures, then the process.
We have two files:
available.csv at first is:
customer.csv at first is:
customerid, seatrow, seatcolumn
So the process at first is:
open available.csv for reading ask user the customerid check choosen customerid (no spaces, no commas) print out available seats as user the seatrow and seatcolumn, store if the choice is illegal ask again store useid, chooosen seatrow and seatcolumn close available.csv delete choosen seatcolumn, seatrow from available.csv append choosen userid, seatrow, seatcolumn to customer.csv
Now you can begin writing the code (unfinished)
#open available.csv for reading with open(available.csv) as fa: #ask user the customerid customerid=raw_input("What is your customerid?:") #check choosen customerid left for the user #print out available seats #read in seats seats=set() for line in fa: row,column=str.map(int,line.split(",")) seats.add((row,column)) #printing
Lets suppose we are ready with printing. We can see, that we cannot display the corridor for the user. We forgot to mention what we really want...
So we must change available.csv
seatrow, seatcolumn, status
status can be 0: free, 1 corridor.
We change the process, change the code, and again.
After a while we begin to design the process without coding. So we do not need to run into walls to see, what we need.
how about putting alphaNumeric in your script...
you put something like "A1 -o" then it shows A1 as taken with a X when you input someting like "A1 -c" the it clear it.... will post when I get back another suggestion
you can make a dictionary (that will be the easiest way.) I will have a look into doing some code for this kind of thing... looks interesting.... If I may ask. What is your intentions? is it just for practice or is it for commercial or home use... just curios. I think you will get some open source gui stuf you you are doing it for commercial use
it was just for fun, just trying to get better at python
Did you do it then... I would love to read te code.... I am just a nub so I am still verymuch learning
nope, my dad thought it would be a good project for me to do but i gave up :/
give "how to think like a computer sientists learning with python" a try. Just get the right version for the version of python you have. When you get to the end try this again... it sound cool to me. I did a bit mockup that will work but it doesnt save in file
write a C++ program which take inputs from the user/keyboard and calculate his ZAKAT.
get the input from user may include
-Amount invested in business
-Amount given to other business partners as loan
-Amount payable to others
I made a prime number finder, it finds the nearest prime that is above and below any integer (Does not work that well with giant numbers.)
Made this in cpp.sh
Why would I need the x=y+1-1;?
x=y; just doesnt seem to work
Why is this?
And I know my coding ...
there are five tables (personTb, addressTb,churchTb) each holds data pertinent to an individual; (personAddress,personChurch) each hold the primary key for the person table and corresponding table IE personAddress holds primary key for addressTb.
both snippets work, my question is; Is my join correctly formatted?
select concat(personTb.p_fName,' ',personTb.p_mName,'. ',personTb.p_lName) ...