To make your own file type, just use file I/O.
Ideally you'd make a spec for the file type and then implement a loader and saver for the spec, but you don't have to work that way. Here's a simple map data format:
["key=value" metadata rows, strip spaces]
## BEGIN MAP ##
[csv tile id rows]
CSV is shorthand for comma-separated value.
An example of this would be :
map_name=murdertown
tileset='blood_village.ts'
## BEGIN MAP ##
10,10,10,10,10
1,2,3,4,5,6,7,8
10,10,10,10,10
1,1,1,1,1,1,1,1
It's not what I'd call a good format, but it has the advantage of being very very easy to implement. All of the parsing can be done using knowledge from a one-semester intro to programming or a basic programming tutorial. Here's how:
1. To get the key/value pairs split lines on "=" and store in an appropriate data structure. If you know how to use a hash or dict, use that. Otherwise, either learn how or make an associative array of some sort. If you take my advice to strip spaces, do that before storing. If you think you can handle stripping spaces everywhere but inside quotes, do that instead.
2. Do the above until you reach a line that matches "## BEGIN MAP ##". You could use a nicer separator if you want, but this one has the advantage of being hard to fuck up.
3. Keep going, reading the lines, split by commas, into a 2D array. If you use an array and not a list, you'll have to do an initial pass to determine the max width and max height of the array.
4. Hooray you did it.
5. Writing is the reverse process of the above.
It's not the best format, but I'm pretty sure it's one of the easier ones.