| View previous topic :: View next topic |
| Author |
Message |
froomzer
Joined: 23 May 2006 Posts: 148
|
| I want to embed a small amount of binary data into my python program. what's the best way to do this? |
| |
|
|
|
|
Shirley Kidman
Joined: 21 Jun 2006 Posts: 30
|
| froomzer, Binary data? |
| |
|
|
froomzer
Joined: 23 May 2006 Posts: 148
|
| Something that can be expressed as ascii |
| |
|
|
BigDaddy
Joined: 26 May 2006 Posts: 147
|
| froomzer, why embed, why not use a separate file? |
| |
|
|
Shirley Kidman
Joined: 21 Jun 2006 Posts: 30
|
froomzer, Probably to create a .bin file and then read from it
I meant to ask what does the binary data consist of? |
| |
|
|
froomzer
Joined: 23 May 2006 Posts: 148
|
| It would be best if it was embeded because I only want to distribute only one file |
| |
|
|
BigDaddy
Joined: 26 May 2006 Posts: 147
|
| froomzer, you could store it as base64 encoded, or as digits, and convert it inside the file |
| |
|
|
froomzer
Joined: 23 May 2006 Posts: 148
|
| Base64 sounds good |
| |
|
|
BigDaddy
Joined: 26 May 2006 Posts: 147
|
| There's base64 support in the standard library notw afaik |
| |
|
|
froomzer
Joined: 23 May 2006 Posts: 148
|
| Do I just use a unicode string and encode/decode it with this? |
| |
|
|
| Page 1 of 2 |
Goto page 1, 2 Next |
|