Challenge
Accept the right files
The upload tool sends telemetry files to the mission archive, but only CSV files from the telemetry/ folder belong there. Last week someone uploaded a photo and a backup file, and the archive's import…
Showing 1–10 of 29
Challenge
The upload tool sends telemetry files to the mission archive, but only CSV files from the telemetry/ folder belong there. Last week someone uploaded a photo and a backup file, and the archive's import…
Challenge
…to mission.log with with open(), one per line, read the file back and print it, then add an append_entry() function that adds lines at the end without wiping what is there.
Challenge
Route an uploaded file to images, telemetry or rejected by its extension with an if/elif chain and endswith(), then cope with capitals, spaces and more extensions without changing the name that is…
Challenge
…a date, then turn a name like Star Tracker A into a safe file name, and put the file in a folder of its own.
Challenge
…a header row, and it changes every few seconds. Read the file itself, with the module made for it, then pick out the hottest reading. csv.DictReader Replace the old parser and its feed string: open…
Challenge
…whose value is not a number, with its line number in the file: the header is line 1, so the first reading is line 2. Keep every other row in readings , as a dict with time ( "HH:MM:SS" ), sensor and…
Challenge
…and a totals line, then save the same data as a CSV file with csv.DictWriter for the spreadsheet people.
Article Mini projects
…or generates securely """ def __init__(self, log_file="medication_log.json"): self.log_file = Path(log_file) self.minimum_interval_seconds = 3 * 3600 self.max_daily_doses = 6 # Load or generate secure…
Challenge
…station's Polish letters readable and sort the keys so the files compare easily.
Challenge
Read a file size in MB and a link speed in Mbit/s with input(), work out the transfer time without forgetting the 8 bits in a byte, show it in minutes and seconds, then count the ground station…