C859 Python 2023
C859 Python 2023 f1 = open("/my_path/my_", "r") - ANSWER to open and read a file f1 = open("/my_path/my_", "w") - ANSWER to open and write a file (all previous material discarded) f1 = open("/my_path/my_", "a") - ANSWER to open and add to a file () - ANSWER read a file into a string ("hello!") - ANSWER writes to a file ine() - ANSWER reads next line () - ANSWER closes a file (must always close a file!) with open("/my_file...etc) as f: - ANSWER opens, allows work, and automatically closes a file timedelta - ANSWER time library function to calculate time amounts from datetime import timedelta - ANSWER grabs timedelta from the datetime library import datetime as dt - ANSWER imports a library as a specified variable ().month - ANSWER to print current month (aka .day or .year for those) beautiful soup - ANSWER HTML parsing library NumPy - ANSWER scientific computing, matrices, array creation library pandas - ANSWER data manipulation and analysis library pillow (PIL) - ANSWER work with and manipulate images; python imaging library pyglet - ANSWER multimedia / gaming creation library pytz - ANSWER time zone data library
Document information
- Uploaded on
- September 9, 2023
- Number of pages
- 3
- Written in
- 2023/2024
- Type
- Exam (elaborations)
- Contains
- Questions & answers