Python: Pass arguments to function which are stored in a file file
Question: We have a databse from which we run queries. Some of these queries take a
(too) long time and and since there seems to be no easy optimization (this has
to do with h5py not supporting fast fancy indexing), we decided to make a
cache, so that once run queries are fast. This works fine so far.

What I would like to do now is to make a textfile which in each row contains
one complete list arguments of the query function. I want to run all these
queries (that is, the query function with the arguments from a line for each
line in the file) from the constructor of the query engine, thus filling up
the cache with important/time consuming queries.

Now, how do I go about this? With pandas, I got almost what I wanted (it gives
you a list of lists, and each of these lists should be passable as *args).

The problem with that approach was that some of the arguments can be lists and
in that case, pandas interprets it as just as a string then, making additional
and tedious work necessary in order to achieve something passable.

Is there a more "professional" way to do this?


Answer: I don't know Python very well, but I think that you simply want to serialize a
list of arguments and deserialize it later. If this is the case, something
like [pickle](https://docs.python.org/2/library/pickle.html) should help.

