Comments (4)
@fangrouli Tyty 💗 Could you share what a snippet of what the JS & Python looks like that reproduces it?
from node-python-bridge.
py.ex def dummy(): print('Hello\nworld)
;
pydummy()
you can try this (in JavaScript) and run it in Node.js
from node-python-bridge.
py.ex" def dummy(): print('Hello\nworld)"; py"dummy()";
sorry about the format, please replace the " with `
from node-python-bridge.
Ah yea so inside the JavaScript string `...`
goes the Python code, but we're still in JavaScript, so \n
gets converted into a new line.
Try doing switching py.ex
with console.log
to see what the Python code that's going to execute is going to look like.
You can use string interpolation so that "Hello\nworld"
is encoded properly before getting passed to the Python process like this:
await py.ex`
def dummy():
print(${"Hello\nworld"})
`;
await py`dummy()`;
from node-python-bridge.
Related Issues (20)
- PythonBridgeOptions not compatible with Node.js HOT 6
- Purpose: venv & modules management support HOT 2
- stdout/stderr are null? HOT 1
- How to execute py file through node-python-bridge? HOT 8
- python-shell has a broken evaluation parser? HOT 3
- Node.js is broken when python code returns NaN
- python.ex`${src}` is broken HOT 11
- Boolean object property in Python function parameter HOT 1
- ModuleNotFound exceptions HOT 2
- Allow using native promises? HOT 7
- Regex support using rfind()? HOT 3
- Can't import modules HOT 6
- Support for running in worker threads HOT 2
- run a python file ? HOT 2
- Allow to pass python file path as a parameter HOT 5
- How to keep python bridge connected? HOT 1
- Python-Bridge not working after app is built
- Allow passing arbitrary arguments to the python interpreter
- Python-Bridge not working after create package using pkg npm HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-python-bridge.