Back to ErlePereira.com
6 years ago
1 changed files
Download Patch File
Download Diff File
@ -0,0 +1,39 @@
This uses the Apache thrift protocol library.
In Debian (and most derivatives) it is available as python-thrift. Alternately, grab a copy and
install it from
This needs unittest
-- Generating the supporting server / client code
If you just want to run the code, just install the python-thrift library.
To re-genrate it (you need the thrift compiler running to do this.
the generated code for client and server is provided in the folder "gen-py"
thrift --gen py atmservice
-- Running code.
** Please, as configured, the server and client as designed to listen on localhost port 8082 only
go to atmcode folder
: start the atm (load the amount of 20$ notes and 50$ notes at start)
Usage: ./atmserver.py <number of 20$ notes> <number of 50$ notes>
: use the client (any amounts other than multiples of 20, 50 will yield an "Invalid amount":
If successul, the client terminal will show the amount withdrawn and the amount of 20$ and 50$ bills
* at start, the server runs a self test, and will fail to start if any of the tests fail.