0

I m using Python 2.5. The dll i imported is created using clr.
The dll function is returning a string. I m trying to apply "partition" attribute to it. I m not able to do it. Even the partition is not working.
I think "all stringd returned from clr are returned as unicode". Help me please.Its very urgent.

2
Contributors
3
Replies
4
Views
8 Years
Discussion Span
Last Post by Rejinacm
0

Perhaps you need to do something like:

# Assuming returned string is named inp_chrs
inp_chrs = str( inp_chrs )
inp_chrs.partition( my_sep )

Does that make sense? Simply convert it to a pure python string using the str() method.

0

Thank you for your reply.

It's not possible to convert unicode strings to string using str().
It wil not be able to encode some characters.

Can you find me help using encode()

0

Perhaps you need to do something like:

# Assuming returned string is named inp_chrs
inp_chrs = str( inp_chrs )
inp_chrs.partition( my_sep )

Does that make sense? Simply convert it to a pure python string using the str() method.

Thank you for your reply jlm699 .I want to know another issue. The exact problem is the string that is being returned from VB .NET contains strings seperated with '\r'.But while reaching Python '|r' becomes '\\r'.So i was not getting the right string aftr conversion also.Now i managed by giving '\\r' in my split function.I want to know about this.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.