GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • About
  • Blog
  • My Account
  • Home page

This view

  • Original page
  • New address

GeezerVison is showing extendsclass.com — Python to javascript converter

ExtendsClass
Free Online Toolbox for developers

Python to javascript

 
It would be nice to disable adBlock, advertising is the only resource of this website :)

Python code


Option:
ECMAScript version:

Results

This tool allows to convert Python to javascript online. You can get the js code (ES6 or ES5) corresponding to your Python code.

You can see the user guide to help you.

User guide

How to convert Python code to Javascript:

  • Fill in the editor above with your Python code. You can Drag and drop your file, copy and paste your code, or type directly into the editor above.
  • Choose the ECMAScript version (In "option" section) between ES6 (All modern browsers support it) and ES5.
  • Click on "Convert" button to execute the conversion of your source code.
  • You can get your js source code by clicking on the "Download file" or "Copy to clipboard" buttons.


Python to javascript compiler

This tool allows you to convert your python source code into javascript code. For this conversion it uses JavaScripthon, a Python 3 to ES6 JavaScript translator. And it uses Babel to convert ES6 to ES5, it is a JavaScript compiler.

JavaScripthon is a simple Python 3.5+ translator to JavaScript. It aims to be able to translate most of the Python's core semantics without providing a full python-in-js environment.
JavaScripthon does not handle everything yet, current todo list (As of this writing):

  • refactor the comprehensions conversion to use the snippets facility
  • refactor snippets rendering to write them as a module and import them in the module when tree conversion is enabled
  • convert dict() calls to ES6 Map object creation
  • convert set literals to ES6 Set objects. Also, update "foo in bar" to use bar.has(foo) for sets

If you choose es5, then it uses babel to convert es6 code to es5.

Why convert Python code to Javascript ? As many developers develop in Python, we may have snippets of Python code that we would like to run in a browser or on the server side via nodejs. It can also be useful for those who do not know python better than javascript. This allows for example to see the code corresponding to certain instructions in python.
If you find other reasons to do this type of code conversion, you can let me know in a comment (I am curious).

If you find a bug or think of interesting options, please indicate it in a comment.


You can report a bug or give feedback by adding a comment (below) or by clicking "Contact me" link (at the top right hand corner of the page).

Comments

Captcha

Enter the code (case insensitive) *

If you can not read the code, click here to generate a new code




a-2022-02-15 20:26
Cannot convert classmethods
Reply

Answer
Captcha

Enter the code (case insensitive) *

If you can not read the code, click here to generate a new code




Conditions of Use
These tools might interest you:
convert:
PHP to PythonKotlin to javaTypeScript to JavaScriptXPath to CSS selectorjson to python object onlineJSON to PHPXML to JSON Converter
Playgrounds:
MongoDB onlineSQL to MongoDB ConverterSQL onlineOracle onlineSQL Server onlineJavaScript validatorJSONPath TesterXPath TesterRegex TesterSQLite browserMySQL onlinePostgreSQL online
API tools:
Fake APIJSON storageMock RESTWeb service testingOnline REST clientOnline SOAP client
Random Data Generator:
Data generatorXML generatorCSV generatorJSON generator
Code checkers:
Python Code CheckerRuby Code CheckerPHP Code Checker
Code testers:
Lua testerSQL syntax checkerPython testerOnline Golang CompilerOnline Java CompilerPHP tester
Diff:
XML diffJSON diffJSON PatchCSV diffText diffPDF diff
Converters:
SQL to SQLParquet to CSV ConverterParquet viewerAvro viewerJSON to Excel ConverterCSV to Excelbase 64 encryptorYAML to JSONImage to base64
Formatters:
PHP FormatterCSV editorXML FormatterJSON FormatterReact FormatterPython FormatterJavaScript formatterSQL formatterHTML Formatter
Validators:
Query builderJSON Schema Validator And GeneratorXML ValidatorXSD Validator
Minifiers:
JavaScript minifyCSS formatter
Generators:
Robots.txt GeneratorFree Sitemap Generator
Encoders:
HTML encodeJWT decoderURL encode
Other:
CSV splitterMerge CSVTAR to ZIP OnlinePDF ViewerGUID GeneratorNotepad OnlineUUID GeneratorExcel viewerZip filesUnzip filesDeveloper resourcesheight and width compressor

Disclaimer: The tools are provided "as is", without warranty of any kind, either express or implied.
Any links to third-party website or software available on this website are provided "as is",
without warranty of any kind, either express or implied and are to be used at your own risk.


You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.