[Tutor] Need help printing a pickled data

Matt D md123 at nycap.rr.com
Tue Jun 25 19:03:15 CEST 2013


> 
> Well I think self.data is some kind of container with a pickled string, 
> given the code to unpickle it is:
> 
Exactly!  This is what the C++ file 'pickle.h' creates to send to the
Python GUI:


/**
 * A pickled Python dictionary. Used to pass stuff to the UI.
 */
class pickle
{

public:

   /**
    * pickle constructor.
    *
    * \param frame_body A const_bit_queue representing the frame body.
    */
   pickle();

   /**
    * pickle virtual destructor.
    */
   ~pickle();

   /**
    * Add a key/value pair to the pickled dictionary
    */
   void add(std::string key, std::string value);

   /**
    * Returns a string describing the Data Unit ID (DUID).
    */
   std::string to_string() const;

private:

   typedef std::map<std::string, std::string> stringmap;

   stringmap map_;

};

#endif /* INCLUDED_PICKLE_H */

I am pretty sure that it sends a C++ map of strings in a form that
Python understands as a pickle.  I put the code you gave me into the
file so ill have to wait and see.
meanwhile can you please take a look at this update() and tell me if you
see something wrong because ever sense I tried using the array for
logging the values from the TextCtrls the program is not updating
meaning when the program receives the c++ map, or the pickle, I get
nothing in the UI and I get nothing in the log.  There got to be
something wrong with the loop that I can not see.  I attached the file
so its not too much code here.  I am pretty sure the problem is in the
update(0) starts at line 210.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: op25_traffic_pane.py
Type: text/x-python
Size: 9432 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/tutor/attachments/20130625/c6a99b7e/attachment.py>


More information about the Tutor mailing list