+ 1

python library "code"

I learnt that the function "interact" in library "code" is used to create a self-defined console in python shell, for example from code import interact interact(banner="MyConsole") #this won't work in sololearn's code playground but I can't really know any more about how to use this library. Can you help me?

22nd Jun 2021, 10:10 AM
Elvish
Elvish - avatar
2 odpowiedzi
+ 2
that cannot work in sololearn playground, as script are executed on server side without realtime interraction ^^
22nd Jun 2021, 10:16 AM
visph
visph - avatar
+ 1
however, you can use it if your run your script locally... have you already read the documenration page about 'code' module? https://docs.python.org/3/library/code.html documentation is the start point for learning any fynctionnality ;)
22nd Jun 2021, 10:23 AM
visph
visph - avatar