I’ve gathered that Python has file-handling commands, but it also appears that Panda has its own file-handling system. Wanting to perform some file writing (of a fairly basic file, not an egg or bam, for which there seem to be specialised classes), and finding the use of Panda’s system more attractive, I tried last night (technically this morning) to figure out how to write out to a file using it.
Unfortunately, this didn’t go terribly well.
After a variety experimentations, forum searches, local searches for and within files and source code skimming, I still have little idea of how to go about it. It looks as though it might involve some or all of VirtualFileSystem, VirtualFile, Filename, StringStream and StreamWriter.
For one thing, while there appear to be a number of methods involved in reading files, there seem to be fewer that look as though they write to files.
According to the documentation, and supported, as I recall, (albeit not fully confirmed) by source code, Filename should have the methods openAppend, openRead, openReadWrite and openWrite. None of which exist, according to SPE, at least as I’m using them.
When used like so:
fn = Filename("cat.txt") fn.openWrite(a_stream)
I receive an error of the form:
Does Panda have file writing functionality, or should I turn to built-in python commands and/or Pickle? If Panda does have this functionality, how do I use it?