I have a python dictionary stored in a file which I need to access from a c++ program. What is the best way of doing this?
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
How to do this depends on the python types you’ve serialised. Basically, python prints something like…
…so you need code to parse this. The simplest case is a flat map from one simple type to another, say int to int:
You can build on this, adding parsing error messages, supporting embedded containers, string types etc..
You may be able to find some existing implementation – I’m not sure. Anyway, this gives you a very rough idea of what they must do internally.