https://github.com/codewithswastik/javascript-py
This package lets you use Javascript like objects in python
https://github.com/codewithswastik/javascript-py
javascript python
Last synced: 11 months ago
JSON representation
This package lets you use Javascript like objects in python
- Host: GitHub
- URL: https://github.com/codewithswastik/javascript-py
- Owner: CodeWithSwastik
- Created: 2021-07-21T11:49:21.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-07-30T07:47:39.000Z (over 4 years ago)
- Last Synced: 2025-04-15T14:21:39.897Z (11 months ago)
- Topics: javascript, python
- Language: Python
- Homepage:
- Size: 48.8 KB
- Stars: 8
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Javascript.py
This package lets you use javascript like objects in python.
## Installation
Stable version:
```
pip install javascriptpy
```
Working version:
```
pip install git+https://github.com/CodeWithSwastik/javascript-py
```
## Example Usage
```python
from javascript import *
array = Array('apple', 'orange', 'cherry')
index = Math.floor(Math.random() * array.length)
console.info('Random element:', array[index])
console.table(array)
```
## Console
```py
from javascript import console, Array
console.clear()
console.error("Syntax Error!")
console.warn("Forgot an import!")
console.table(Array(['earth', 'venus']))
```

## What's new?
- Added RegExp, Date, JSON