external-application-button icon indicating copy to clipboard operation
external-application-button copied to clipboard

Trying to run a Python script with URL as a parameter

Open inputsh opened this issue 5 years ago • 2 comments

I have a Python script that takes a URL as a parameter and does some processing. I can successfully execute it from a terminal by running:

/usr/bin/python3 /home/<user>/path/to/script.py https://example.com

I've set up the application like this:

Screenshot from 2020-02-23 12-25-36@2x

I have installed the native-client and I can successfully check the connection. However, upon clicking it, I receive the following error:

If you still get this page even when the "Check Button" reports successful connection, it means the application cannot be accessed (path is not correct in the options page). If the path to the executable is correct and the native client is connected, you can debug the connection by enabling console logs in Chrome and Opera or Firefox.

In my console logs, I see an unhandled exception:

stderr output from native app com.add0n.node: events.js:183
stderr output from native app com.add0n.node:       throw er; // Unhandled 'error' event
stderr output from native app com.add0n.node:       ^
stderr output from native app com.add0n.node: 
stderr output from native app com.add0n.node: Error: write callback called multiple times
stderr output from native app com.add0n.node:     at Transform.afterTransform (_stream_transform.js:81:22)
stderr output from native app com.add0n.node:     at Transform.observe [as handler] (/home/<user>/.config/com.add0n.node/host.js:432:5)
stderr output from native app com.add0n.node:     at Transform._transform (/home/<user>/.config/com.add0n.node/messaging.js:107:10)
stderr output from native app com.add0n.node:     at Transform._read (_stream_transform.js:186:10)
stderr output from native app com.add0n.node:     at Transform._write (_stream_transform.js:174:12)
stderr output from native app com.add0n.node:     at doWrite (_stream_writable.js:397:12)
stderr output from native app com.add0n.node:     at writeOrBuffer (_stream_writable.js:383:5)
stderr output from native app com.add0n.node:     at Transform.Writable.write (_stream_writable.js:290:11)
stderr output from native app com.add0n.node:     at Input.ondata (_stream_readable.js:639:20)
stderr output from native app com.add0n.node:     at emitOne (events.js:116:13)

...which doesn't really help me to debug the application. What am I doing wrong?

inputsh avatar Feb 23 '20 11:02 inputsh

try:

Executable Name: /usr/bin/python3 Arguments: /home/<user>/path/to/script.py https://example.com

andy-portmen avatar Feb 23 '20 13:02 andy-portmen

stderr output from native app com.add0n.node: events.js:183 stderr output from native app com.add0n.node: throw er; // Unhandled 'error' event stderr output from native app com.add0n.node: ^ stderr output from native app com.add0n.node: stderr output from native app com.add0n.node: Error: write callback called multiple times stderr output from native app com.add0n.node: at Transform.afterTransform (_stream_transform.js:81:22) stderr output from native app com.add0n.node: at Transform.observe [as handler] (/home//.config/com.add0n.node/host.js:432:5) stderr output from native app com.add0n.node: at Transform._transform (/home//.config/com.add0n.node/messaging.js:107:10) stderr output from native app com.add0n.node: at Transform._read (_stream_transform.js:186:10) stderr output from native app com.add0n.node: at Transform._write (_stream_transform.js:174:12) stderr output from native app com.add0n.node: at doWrite (_stream_writable.js:397:12) stderr output from native app com.add0n.node: at writeOrBuffer (_stream_writable.js:383:5) stderr output from native app com.add0n.node: at Transform.Writable.write (_stream_writable.js:290:11) stderr output from native app com.add0n.node: at Input.ondata (_stream_readable.js:639:20) stderr output from native app com.add0n.node:

christian7877 avatar Apr 25 '20 13:04 christian7877