How to Call a JavaScript Function From Python
Python is a cross-platform programming language that can be used on PCs, Macs and Linux-based computers. It’s also used on .NET and in Java. Python is simple to code and read, making it an attractive option for writing scripts and applications. JavaScript is a coding language used to make interactive Web pages by interacting with the HTML code. You can use your Python script to call a JavaScript-based Web page.
Instructions
-
-
1
Open the Python program from which you want to call the JavaScript function.
-
2
Scroll to the place in the document where you want to add the script.
-
-
3
Type:
“print '<script type="text/javascript">myFunction();</script>'”
-
1