|
@ -654,16 +654,23 @@ Bytes |
|
|
``` |
|
|
``` |
|
|
|
|
|
|
|
|
```python |
|
|
```python |
|
|
<Bytes> = b''.join(<list_of_bytes>) |
|
|
|
|
|
|
|
|
<Bytes> = b''.join(<list_of_Bytes>) |
|
|
``` |
|
|
``` |
|
|
|
|
|
|
|
|
### Read Bytes from file: |
|
|
|
|
|
|
|
|
### Read Bytes from file |
|
|
```python |
|
|
```python |
|
|
def read_bytes(filename): |
|
|
def read_bytes(filename): |
|
|
with open(filename, 'rb') as file: |
|
|
with open(filename, 'rb') as file: |
|
|
return file.read() |
|
|
return file.read() |
|
|
``` |
|
|
``` |
|
|
|
|
|
|
|
|
|
|
|
### Write Bytes to File |
|
|
|
|
|
```python |
|
|
|
|
|
def write_bytes(filename, bytes): |
|
|
|
|
|
with open(filename, 'wb') as file: |
|
|
|
|
|
file.write(bytes) |
|
|
|
|
|
``` |
|
|
|
|
|
|
|
|
Struct |
|
|
Struct |
|
|
------ |
|
|
------ |
|
|
**This module performs conversions between Python values and C structs represented as Python bytes objects:** |
|
|
**This module performs conversions between Python values and C structs represented as Python bytes objects:** |
|
|