- This is not really a grading script because you didn't see any grading
- The evaluation giving you True / False something is somewhat partial credits for each task
- This is the simplest version of the core part of the grading script, but it doesn't contain any real test case
- You may regard it as a super client (who has the power of starting a server) as well.
- If you pass this script with ordinary manner, then you should be fine
- Don't try to fool our grading script by hard-coding any answer inside, the real test cases are totally different
- We have much stronger checking points that what is listed in evaluate.py, please do not try to fool our script by hacking the criterias.
- SEASnet has some servers where the environment e.g. path is not the same as what we've tested upon, and couldn't recognize
lsof
. To make it work, consider trying:
PATH="/usr/sbin/:$PATH" python3 client_basic.py
- This is for UCLA CS131 (Programming Languages) Project (instructor: Prof. Paul Eggert)
- This project is on Python, specifically aiming at the use of asyncio and aiohttp
- To complete the project a Google Map API Key is needed, I tried, in order to get rid of the limit you need payment information attached.
- Thanks to previous-year TA, Wenhao's code
- Following discussion online, to kill the process occupying port 8000 we could run:
lsof -ti:8000 | xargs kill
- To find who is listening to port
8000
:
lsof -i:8000
- To run a script in the background I used nohup
- To execute command line within Python:
import os os.system('sox input.wav -b 24 output.aiff rate -v -L -b 90 48k')
- under hint code repo I put my hint code for you to get started with this project there.
- put your
server.py
and all other needed.py
files under the sample_submission folder - modify the port number in
client_basic.py
(or keep them the same if you run on local machine --- the easiest way to test your code is to change your port number to around 800X and then test them on your local machine)- If you run on your local environment and see error of ssl, please try replacing
aiohttp.ClientSession()
withaiohttp.ClientSession(connector=aiohttp.TCPConnector(ssl=False))
.
- If you run on your local environment and see error of ssl, please try replacing
- could run single evaluation by
python client_basic.py
- Guaranteed to work on mac and linux, not 100% sure about Windows.
- Once it works, feel free to add your own test cases in
client_basic.SuperClient.test
- Before final submission, remove your
server.py
, and test whether or not your file could be successfully unzipped by:- Putting your project.tgz file under sample_submission
- Come back to this directory, and run
python preprocess.py
.
You might want to have a look at os.mkdir and os.path.exists
- Unzip your file, by putting your file for submit (preferrably project.tgz) under sample_submission folder, and then running
python preprocess.py
. - After you unzip your files into the sample_submission folder, with no extra effort required (e.g. don't need to create an empty folder manually, etc.), we can always make
client_basic
run (I mean if you occupy others' port then it is not guaranteed to work).