By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,594 Members | 1,570 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,594 IT Pros & Developers. It's quick & easy.

Algorithm for Python's pack function

P: 2
I'm looking into how the Python's pack function is implemented. Does anyone know where the source is located? I grep the entire lib folder but couldn't find it. I have the unfortunate task of converting some python code which uses pack extensively into C++ :(
Nov 7 '08 #1
Share this Question
Share on Google+
3 Replies


YarrOfDoom
Expert 100+
P: 1,247
I believe that function is located in (starting from your python install folder): Lib/struct.pyc
Which is, unfortunately, compiled python code. So you can't read it, unless you can find a python decompiler.
Nov 7 '08 #2

P: 2
I believe that function is located in (starting from your python install folder): Lib/struct.pyc
Which is, unfortunately, compiled python code. So you can't read it, unless you can find a python decompiler.
That's really unfortunately. Is there a better description what the function does other than what is given in the manual for struct module pack?
Nov 7 '08 #3

Expert 100+
P: 671
You could always download the Python source code. It is available on the website along with the binary installer.
Nov 7 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.