No basic input function and Python class acting weird
Is there any built in funciton to take input from the user? I've been importing it from python for now, and it's just been a bit annoying to deal with.
Second question (so I don't litter this channel with my questions), I wanted to convert a python object given from the Python input function into a mojo string, but this happened:
And I get this error:
I have been creating an instance of the Python class to convert it into a string reference, which works, but I wasn't sure if this was a feature or an issue, so I wanted to check in here before adding an issue on the github.
5 Replies
I can't think of a reason why Python.__str__ would need a struct instance. Probably should file an issue
mmm I've faced the same problem..
@manuell_191 in the meantime you can use the function input() I have implemented in pure mojo if that helps: https://github.com/gabrieldemarmiesse/mojo-stdlib-extensions#complete-list-of-what-is-available-here
since you have imported the builtins module you can call py.input() and that should work as an input function
yeap, the library from @gabrieldemarmiesse works. 👍