Python Exception Handling, File Handling (CSV & Binary), and MySQL Introduction

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/96

flashcard set

Earn XP

Description and Tags

Comprehensive vocabulary flashcards covering Python exception handling, CSV file manipulation, MySQL fundamentals and datatypes, and binary file handling with pickling.

Last updated 10:26 AM on 10/12/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
Chat

No analytics yet

Send a link to your students to track their progress

97 Terms

1
New cards

Exception

An error that occurs during program execution (runtime) that disrupts and interrupts the normal flow of a program.

2
New cards

try block

A block in Python used to enclose suspicious lines of code that might cause or raise an exception during execution.

3
New cards

except block

A block in Python used to catch and handle exceptions that occur within an associated try block.

4
New cards

finally block

A block in Python placed at the end of a try block that is always executed regardless of whether an exception occurs, is caught, or if return, break, or continue statements are executed.

5
New cards

else clause (try-except)

An optional clause placed with try-except that executes only if no exception is raised in the try block.

6
New cards

raise and assert statements

Statements used in Python to deliberately raise exceptions during code execution.

7
New cards

SyntaxError

A built-in Python parsing error that is raised when there is an error in the syntax of the code.

8
New cards

ValueError

A built-in Python exception raised when a built-in method or operation argument receives the right data type but an inappropriate value.

9
New cards

IOError

A built-in Python exception raised when a file specified in a program cannot be opened.

10
New cards

KeyboardInterrupt

A built-in Python exception raised when the user interrupts program execution by accidentally hitting an interrupt key such as the Delete key.

11
New cards

ImportError

A built-in Python exception raised when a requested module definition is not found.

12
New cards

EOFError

A built-in Python exception raised when the end of file condition is reached without reading any data from input.

13
New cards

ZeroDivisionError

A built-in Python exception raised when the denominator in a division operation is zero.

14
New cards

IndexError

A built-in Python exception raised when an index or subscript in a sequence is out of range.

15
New cards

NameError

A built-in Python exception raised when a local or global variable name is not defined.

16
New cards

TypeError

A built-in Python exception raised when an operator or function is supplied with a value of an incorrect data type.

17
New cards

CSV (Comma Separated Values)

A human-readable text file format extensively used to store tabular data in a spreadsheet or database, where each line represents a record consisting of fields.

18
New cards

Delimiter

The separator character in CSV files that separates fields, with comma (',') being the default, and others including Tab ('\t'), Colon (':'), Pipe ('|'), and Semicolon (';').

19
New cards

csv.reader()

A Python csv module function that returns a reader object which loads and parses delimited data from a CSV file into an iterable.

20
New cards

csv.writer()

A Python csv module function that returns a writer object to convert user data into a delimited string for writing into CSV files.

21
New cards

writerow()

A CSV writer object method that writes a single row of data to the open CSV file.

22
New cards

writerows()

A CSV writer object method that writes multiple rows of data to the open CSV file.

23
New cards

MySQL

A freely available open-source Relational Database Management System (RDBMS) that operates on a client-server architecture and uses Structured Query Language (SQL).

24
New cards

DDL (Data Definition Language)

A category of SQL commands (such as CREATE, ALTER, and DROP) that allow users to perform tasks related to table structure and definitions.

25
New cards

DML (Data Manipulation Language)

A category of SQL commands (such as SELECT, UPDATE, INSERT, and DELETE) that allow users to perform tasks related to data stored inside tables.

26
New cards

TCL (Transaction Control Language)

A category of SQL commands (such as SAVEPOINT, COMMIT, and ROLLBACK) that allow users to manage and control database transactions.

27
New cards

Character Literal

Fixed text or character data values that are enclosed in quotation marks in SQL (such as 'computer' or '10').

28
New cards

Numeric Literal

Fixed numbers in SQL not enclosed in quotation marks, comprising integer literals (without a decimal point) and real literals (with a decimal point).

29
New cards

CHAR

A fixed-length string data type in MySQL where values shorter than the declared length are padded with blank spaces while retaining the specified storage size.

30
New cards

VARCHAR

A variable-length string data type in MySQL where no blank spaces are added if a value is shorter than the declared length, allowing unused space to be reused.

31
New cards

Null (SQL)

A marker indicating that a specific column or row contains no value.

32
New cards

Binary File

A file stored in binary format (bits and bytes) that is computer-readable but not human-readable, where each byte is written in ASCII code.

33
New cards

Pickling (Serializing)

The process in Python where a Python object (such as a list, dictionary, or tuple) is converted into a byte stream.

34
New cards

Unpickling (Deserializing)

The reverse process of pickling in Python, where a byte stream is converted back into an original Python object.

35
New cards

pickle.dump()

A function in the Python pickle module used to write a pickled byte-stream representation of an object to an open file object using the syntax pickle.dump(object, file_object).

36
New cards

pickle.load()

A function in the Python pickle module used to read one record at a time from a binary file and reconstruct the original Python object.

37
New cards

seek()

A binary file method in Python that moves the file pointer to a specified byte position, taking arguments for byte offset and reference position (0 for start, 1 for current, 2 for end).

38
New cards

tell()

A file method in Python that returns the current byte position of the file pointer.

39
New cards

Exception

An error that occurs during program execution (runtime) that disrupts and interrupts the normal flow of a program.

40
New cards
41
New cards

try block

A block in Python used to enclose suspicious lines of code that might cause or raise an exception during execution.

42
New cards

except block

A block in Python used to catch and handle exceptions that occur within an associated try block.

43
New cards

finally block

A block in Python placed at the end of a try block that is always executed regardless of whether an exception occurs, is caught, or if return, break, or continue statements are executed.

44
New cards

else clause (try-except)

An optional clause placed with try-except that executes only if no exception is raised in the try block.

45
New cards

raise and assert statements

Statements used in Python to deliberately raise exceptions during code execution.

46
New cards

SyntaxError

A built-in Python parsing error that is raised when there is an error in the syntax of the code.

47
New cards

ValueError

A built-in Python exception raised when a built-in method or operation argument receives the right data type but an inappropriate value.

48
New cards

IOError

A built-in Python exception raised when a file specified in a program cannot be opened.

49
New cards

KeyboardInterrupt

A built-in Python exception raised when the user interrupts program execution by accidentally hitting an interrupt key such as the Delete key.

50
New cards

ImportError

A built-in Python exception raised when a requested module definition is not found.

51
New cards

EOFError

A built-in Python exception raised when the end of file condition is reached without reading any data from input.

52
New cards

ZeroDivisionError

A built-in Python exception raised when the denominator in a division operation is zero.

53
New cards

IndexError

A built-in Python exception raised when an index or subscript in a sequence is out of range.

54
New cards

NameError

A built-in Python exception raised when a local or global variable name is not defined.

55
New cards

TypeError

A built-in Python exception raised when an operator or function is supplied with a value of an incorrect data type.

56
New cards

FileNotFoundError

A built-in Python exception raised when an attempt to open or access a file that does not exist fails.

57
New cards

Parsing Error

Another name for a Syntax Error occurring during code parsing prior to program execution.

58
New cards

Multiple except blocks

A Python structure where several except blocks follow a single try block to catch distinct types of exceptions independently.

59
New cards

CSV (Comma Separated Values)

A human-readable text file format extensively used to store tabular data in a spreadsheet or database, where each line represents a record consisting of fields.

60
New cards

Delimiter

The separator character in CSV files that separates fields, with comma (',') being the default, and others including Tab, Colon, Pipe, and Semicolon.

61
New cards

csv.reader()

A Python csv module function that returns a reader object which loads and parses delimited data from a CSV file into an iterable.

62
New cards

csv.writer()

A Python csv module function that returns a writer object to convert user data into a delimited string for writing into CSV files.

63
New cards

writerow()

A CSV writer object method that writes a single row of data to the open CSV file.

64
New cards

writerows()

A CSV writer object method that writes multiple rows of data to the open CSV file.

65
New cards

Record (CSV)

A complete horizontal row in a CSV file that comprises one set of related data fields.

66
New cards

Field (CSV)

An individual item of data within a CSV record separated from other items by a delimiter.

67
New cards

newline parameter in open()

An argument in Python's open() function set to an empty string when writing CSV files to prevent blank lines between rows.

68
New cards

MySQL

A freely available open-source Relational Database Management System (RDBMS) that operates on a client-server architecture and uses Structured Query Language (SQL).

69
New cards

DDL (Data Definition Language)

A category of SQL commands (such as CREATE, ALTER, and DROP) that allow users to perform tasks related to table structure and definitions.

70
New cards

DML (Data Manipulation Language)

A category of SQL commands (such as SELECT, UPDATE, INSERT, and DELETE) that allow users to perform tasks related to data stored inside tables.

71
New cards

TCL (Transaction Control Language)

A category of SQL commands (such as SAVEPOINT, COMMIT, and ROLLBACK) that allow users to manage and control database transactions.

72
New cards

MySQL Server

The database component that processes incoming requests from clients over a network and provides controlled access to database contents.

73
New cards

MySQL Client

A program or interface that connects to a database server to submit queries and instructions in a prespecified format.

74
New cards

Character Literal

Fixed text or character data values that are enclosed in quotation marks in SQL (such as 'computer' or '10').

75
New cards

Numeric Literal

Fixed numbers in SQL not enclosed in quotation marks, comprising integer literals and real literals.

76
New cards

Integer Literal (SQL)

A numeric constant in SQL without a decimal point, such as 17 or 25.

77
New cards

Real Literal (SQL)

A numeric constant in SQL containing a decimal point, such as 17.5 or 25.2.

78
New cards

CHAR

A fixed-length string data type in MySQL where values shorter than the declared length are padded with blank spaces while retaining the specified storage size.

79
New cards

VARCHAR

A variable-length string data type in MySQL where no blank spaces are added if a value is shorter than the declared length, allowing unused space to be reused.

80
New cards

Null (SQL)

A marker indicating that a specific column or row contains no value.

81
New cards

SQL Keywords

Reserved words with predefined, specific meanings in SQL syntax, such as WHERE, SELECT, and FROM.

82
New cards

Single-line SQL comments

SQL documentation markers that start with a hash (#) or double dashes (--) to comment out the rest of the line.

83
New cards

Multi-line SQL comments

An SQL commenting style enclosed between /* and */ spanning one or more lines.

84
New cards

DATE data type

A MySQL data type used to store calendar dates in the standard format YYYY-MM-DD.

85
New cards

TIME data type

A MySQL data type used to store time values in the format HH:MM:SS.

86
New cards

DATETIME data type

A MySQL data type used to store combined date and time values in the format YYYY-MM-DD HH:MM:SS.

87
New cards

Binary File

A file stored in binary format (bits and bytes) that is computer-readable but not human-readable, where each byte is written in ASCII code.

88
New cards

Binary mode indicator

The character 'b' appended to file access modes in open() (such as 'rb' or 'wb') to designate binary stream handling.

89
New cards

Pickling (Serializing)

The process in Python where a Python object (such as a list, dictionary, or tuple) is converted into a byte stream.

90
New cards

Unpickling (Deserializing)

The reverse process of pickling in Python, where a byte stream is converted back into an original Python object.

91
New cards

pickle.dump()

A function in the Python pickle module used to write a pickled byte-stream representation of an object to an open file object using the syntax pickle.dump(object, file_object).

92
New cards

pickle.load()

A function in the Python pickle module used to read one record at a time from a binary file and reconstruct the original Python object.

93
New cards

seek()

A binary file method in Python that moves the file pointer to a specified byte position, taking arguments for byte offset and reference position.

94
New cards

tell()

A file method in Python that returns the current byte position of the file pointer.

95
New cards

seek() offset reference point 0

The reference position parameter in seek() specifying that movement is calculated from the beginning of the file.

96
New cards

seek() offset reference point 1

The reference position parameter in seek() specifying that movement is calculated relative to the current file pointer location.

97
New cards

seek() offset reference point 2

The reference position parameter in seek() specifying that movement is calculated relative to the end of the file.