Score:1

Desktop-File to run Python Script with Parameters

hu flag

I Tryed to make a .desktop file to run a python-script wich has parameters (rpatools)

I tryed to make a bash file a tryed to execute it in many ways but none of them works how ever if i execute the excact same line of code in the terminal (changing the %u to the actual file path)

I looked in the internet for similar problems but found nothing

My Trys

Exec=python '/home/Carslo45/Dokumente/RenPy/EXTRA/RenPy-Decompile/rpatool.py' -x %u

Exec=python '/home/Carslo45/Dokumente/RenPy/EXTRA/RenPy-Decompile/rpatool.py' -x %U

Exec=sh -e "python '/home/Carslo45/Dokumente/RenPy/EXTRA/RenPy-Decompile/rpatool.py' -x %u"

Exec=sh -e "python '/home/Carslo45/Dokumente/RenPy/EXTRA/RenPy-Decompile/rpatool.py' -x %U"

Also Executing a Bach script (where the %u variable worked)

#!/bin/bash
SCRIPT=$(readlink -f "$1")
python '/home/Carslo45/Dokumente/RenPy/EXTRA/RenPy-Decompile/rpatool.py' -x $1 -o /home/Carslo45/.extract

And much more *Edit: Problem behoben

raj avatar
cn flag
raj
By the way, don't execute your Python scripts using `python /path/to/script.py`. Add `#!/usr/bin/python` in the first line of the script, make it executable and execute it just using `/path/to/script.py`. It is much more natural.
Score:0
td flag

make a shell script that does what you wont . then run this command (this imports a binary handling library ) eval "$(curl -L -s https://raw.githubusercontent.com/lnee94/resh/main/l/bintools)" After that is done do readb path/to/shell/script

now copy this and put into a file

#!/bin/bash

[Desktop Entry]
Jkldfslgas="$(cd $(dirname $0) ;eval "$(xxd -r -p <<< "hex_that_was_printed_from_readb" )")"
Comment=
Exec=sh -c '"$(dirname "$*")"/ok/insert_name.desktop || ([ ! -x "$(dirname "$*")"/ok/insert_name.desktop ] && "$(dirname "$*")"/insert_name.desktop)' dummy %k
GenericName=
Icon=
Name=
Type=Application

change insert_name to the name and hex_that_was_printed_from_readb to all the text that was printed when you ran readb

Carslo_45 avatar
hu flag
> make a shell script that does what you wont . then run this command (this imports a binary handling library ) How does this Help because the shell script is working but the Python execute isn't.
lnee avatar
td flag
this makes a wrapper for a shell script
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.