#๐ how do i run this cmd command?
103 messages ยท Page 1 of 1 (latest)
@fickle aurora
Remember to:
- Ask your Python question, not if you can ask or if there's an expert who can help.
- Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
- Explain what you expect to happen and what actually happens.
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
iam getting string errors, iam new to python
You probably need to wrap it all in single-quotes
how
because you need a string for the command
and how do i wrap apktool_2.11.1.jar in a string?
I'm confused by your question then
i mean how do i run this command
one sec
import os
os.system("'apktool_2.11.1.jar' d -s -o love-decoded 'love-11.5-android-embed.apk'")
iam getting this error
''apktool_2.11.1.jar'' is not recognized as an internal or external command,
operable program or batch file.
Oh then in that case, you're probably executing your python script in a different working directory than where you have the apktool jar file
i dont think so
wait let me see
you can check what your working directory is using os.getcwd()
how do i change my working directory
?
i tried using cd
Well, the easiest way is to probably copy your python file to the same directory as your .jar file
Then execute it there
But you can also use os.chdir()
what is that
it stands for change directory
let me try
how
do i print it?
@weak cloud sorry for pinging
print what?
os.getcwd
You just call it, and it'll change the current working directory
to what?
To what your specify
isnt os.chdir() used for that?
or both are the same
oh, in that case try adding ./ to the front of 'apktool_2.11.1.jar'
are u sure i typed it right?
ok
like this?
so like
os.system('"./apktool_2.11.1.jar" d -s -o love-decoded "love-11.5-android-embed.apk"')
or so
oh
wrong spot
its now saying
'.' is not recognized as an internal or external command,
operable program or batch file.
Oh right, you need two .\\
Because one is used for things like \n or \t
So two means "ignore one"
its saying this
'.\apktool_2.11.1.jar" d -s -o love-decoded "love-11.5-android-embed.apk' is not recognized as an internal or external command,
operable program or batch file.
You seem to have mismatched ' or "
i did try to put .\ before the love one
double check those
no
os.system('".\\apktool_2.11.1.jar" d -s -o love-decoded "love-11.5-android-embed.apk"')
No, you do
thats what my code currently looks like
os.system('".\\apktool_2.11.1.jar" d -s -o love-decoded "love-11.5-android-embed.apk"')
I know
exactly, i didnt
wait is it the right one
what do i do then?
The error message you posted shows it starting with a single quote
no
but you might not even need the quotes
have you tried
os.system('.\\apktool_2.11.1.jar d -s -o love-decoded love-11.5-android-embed.apk')
?
look
no
Give that a shot, I don't think you need the quotes
but also, you needn't be doing this in Python
wait i think it works
one sec
you could just be doing it on the command line directly
why?
yea ik but i need to run more command lines
thats why
But what's Python specific about this? You could just use a batch file and enter commands directly
i never coded batch files
Yeah but the command in that string there is a batch command
So adding Python (so far) is just adding an extra un-used layer of complexity.
then how do i make it as a batch file
Save .\apktool_2.11.1.jar d -s -o love-decoded love-11.5-android-embed.apk to a text file, then change the file extension from .txt to .bat
thats it?
Yup
oh it actually works lol
lol
This help channel has been closed. Feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.