Jay Taylor's notes
back to listing indexPython: get string representation of PyObject?
[web search]
I've got a C python extension, and I would like to print out some diagnostics. I'm receiving a string as a PyObject*. What's the canonical way to obtain a string rep of this object, such that it usable as a const char *? update: clarified to emphasize access as const char *. |
||||
Use
This method is OK for any
|
|||||||||||||||||||||||||||
|
Try Docs:
|
|||||||||||||||
|
Your Answer
Not the answer you're looking for? Browse other questions tagged python string pyobject or ask your own question.
asked |
5 years ago |
viewed |
7183 times |
active |
Related
Hot Network Questions
- A prefix notation calculator that asks about everything step by step
- Do Republican legislatures tend to relax gun laws after mass shootings?
- Object appearance changes after Scale transformation applied
- Prove that a function attains every real number as its value exactly once
- Prime number printer stops at 251, why?
- creating contacts from remote websites
- Why didn't Germany blockade the Strait of Gibraltar during WW2?
- The metallic plate behind >2010's CPU's heatspreading plate is the actual chip die substrate?
Technology | Life / Arts | Culture / Recreation | Science | Other | ||
---|---|---|---|---|---|---|