#🔒 Arguments issue
35 messages · Page 1 of 1 (latest)
@dapper igloo
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.
Can you show an example?
Yep. Show us your script and the input and output in your terminal.
C:\Users\James\Documents\test\bars_extractor.py -h
Should show me help
But i just get ‘error: the following arguments are required: input’ and shown the correct format
It’s a script for unpacking game files. Apparently i should be able to drag and drop but that doesn’t work either (even after editing the registry)
What's the code of bars_extractor.py? Especially how it does the argument parsing.
I’m using these scripts exactly how i’m shown to but everything past that first space is ignored
I can open the script in notepad++. What am i looking for?
I could link you the script if that would be easier. Simple github link
That works
if it's https://gist.github.com/SamusAranX/6eb8b6fd1777b17afc3107a979c2409a, then I don't think you're doing anything wrong. This is the entire help:
usage: bars_extractor.py [-h] [-o OUTDIR] [--bfstp] [--debug]
input [input ...]
BOTW BARS Extractor
positional arguments:
input Input files
options:
-h, --help show this help message and exit
-o OUTDIR, --outdir OUTDIR
Output directory
--bfstp Export BFSTPs as well (they're ignored by default)
--debug Debug Mode (skips file extraction)
Yes that’s it
Various tools for modding BotW. Contribute to Aaaboy97/BotW-Tools development by creating an account on GitHub.
ooh, I think I may see the issue actually, hold on
Feels like i’ve done something wrong in the setup of python. Things simply not working such as the arguments and the drag and drop not working.
no, my guess seems to be wrong. I was thinking maybe it's because of the hashbang, but for me on linux it works even if I do it your way. Though... just to check, is the outcome different depending on whether you do
C:\Users\James\Documents\test\bars_extractor.py -h
or
python C:\Users\James\Documents\test\bars_extractor.py -h
?
the drag and drop not working
Generally speaking it's a terminal-specific thing; if you're using something like vscode's integrated terminal or Windows Terminal it should work; if it's justcmdit might not.
Drag and drop onto the py file. Like you would with an exe or bat file
Ah, that's what you mean. Not sure what's needed for that to work on windows; probably works by file associations
I’m not sure how to do those differently. But the first one says missing arguments
And the second one doesn't?
I dont know how to put python before C:\
Not sure what you mean. Just write it, then paste the path, then add -h ?
(or just copy the entire command into the terminal)
Ayyyy there we go
I sure did take over an hour and need to ask for help to see the help menu :’)
And it works. Thanks so much!
Prefacing it with python and using whole file directory names in quotation marks
I've now done some testing on a windows computer, and for me it seems that when I try to just launch a python file as a script (without an explicit python), it doesn't run at all
i have no idea what this depends on (file associations?..), but anyway, probably just avoid doing that and instead always call python directly
No idea how it worked for others. They did exactly what i was doing and it just worked
Computers are maddening. Especially when windows is involved smh
But yeah it all works! My mod was successful to boot
This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, 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.