I am using python and XMLBuilder, a module I downloaded off the internet (pypi). and in the end it returns an object, that works like a string (I can do print(x)) but when I use file.write(x) it crashes and does says that there was an error in the XMLBuilder module. I LOVE the XMLBuilder module aside from that and I do not want to know how I "should do it with "+x+" module" I am just wondering how I can convert the object it returns into a string.
edit, I have confirmed that I am writing to the file write
I have already tried x = y although, as I thought, it just creates a pointer, and also x=x+" "
put I still get an error. Also it returns an string like object with "\n".
Thanks in advance.
|
||||
The Library has
So you just need to use
|
|||
|
will likely work for you. Background information: Most types have a function However, not all functions are as smart as
This will create a new string and assign it to the variable |
|||||
|
I'm not quite sure what your question is, but |
|||
|
When you write:
The So for example you could do: |
|||||
|
file.write(str(x))
– Aamir Adnan 2 days ago