InteractiveInterpreter runsource() in Python Last Updated : 26 Mar, 2020 Summarize Comments Improve Suggest changes Share Like Article Like Report With the help of InteractiveInterpreter.runsource() method, we can compile and run the source having single or multiple lines by using InteractiveInterpreter.runsource() method. Syntax : InteractiveInterpreter.runsource(code) Return : Return the Output if compile successful else false with error. Example #1 : In this example we can see that by using InteractiveInterpreter.runsource() method, we are able to compile and run the piece of code and if run is successful we can get the result else false by using this method. Python3 1=1 # import code and InteractiveInterpreter from code import InteractiveInterpreter code = 'print("GeeksForGeeks")' # Using InteractiveInterpreter.runsource() method InteractiveInterpreter().runsource(code) Output : GeeksForGeeks Example #2 : Python3 1=1 # import code and InteractiveInterpreter from code import InteractiveInterpreter code = 'a = 8; b = 2.5; -a = a + b' # Using InteractiveInterpreter.runsource() method InteractiveInterpreter().runsource(code) Output : SyntaxError: can't assign to operator False Comment More infoAdvertise with us Next Article Python | page_source method in Selenium J jitender_1998 Follow Improve Article Tags : Python Python code-module Practice Tags : python Similar Reads InteractiveInterpreter runcode() in Python With the help of InteractiveInterpreter.runcode() method, we can only execute the pre-compiled source code having single or multiple lines by using InteractiveInterpreter.runcode() method. Syntax : InteractiveInterpreter.runcode(code) Return : Return the result of executed source else error. Example 1 min read InteractiveConsole runcode() in Python With the help of InteractiveConsole.runcode() method, we can get the output of the single or multiple lines of code, if we want to see the result of some part of code then we can use InteractiveConsole.runcode() method. Syntax : InteractiveConsole.runcode(code) Return : Return the output of the code 1 min read Python | page_source method in Selenium page_source method is used retrieve the page source of the webpage the user is currently accessing. The main use of this method to find something in the page source like finding any data or keyword. Page source : The source code/page source is the programming behind any webpage. Syntax : driver.page 1 min read page_source driver method - Selenium Python Seleniumâs Python Module is built to perform automated testing with Python. Selenium Python bindings provides a simple API to write functional/acceptance tests using Selenium WebDriver. To open a webpage using Selenium Python, checkout â Navigating links using get method â Selenium Python. Just bein 2 min read Python VLC Instance - Creating MediaPlayer Instance In this article we will see how we can create a MediaPlayer instance from the Instance class in the python vlc module. VLC media player is a free and open-source portable cross-platform media player software and streaming media server developed by the VideoLAN project. Instance act as a main object 2 min read Usage of __main__.py in Python Many of us have worked with creating their own custom module in Python and is well familiar with the candidate '__init__.py'. If you do not know then let's get a brief and short description of '__init__.py' before diving deep into the concerned topic. Actually, when we try to import a module to Pyth 3 min read Like