#🔒 Arguments issue

35 messages · Page 1 of 1 (latest)

neat wraithBOT
#

@dapper igloo

Python help channel opened

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.

thin grove
#

Can you show an example?

cinder eagle
#

Yep. Show us your script and the input and output in your terminal.

dapper igloo
#

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)

thin grove
#

What's the code of bars_extractor.py? Especially how it does the argument parsing.

dapper igloo
#

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

cinder eagle
#

That works

thin grove
#

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)
dapper igloo
#

Yes that’s it

thin grove
#

ooh, I think I may see the issue actually, hold on

dapper igloo
#

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.

thin grove
# thin grove ooh, I think I may see the issue actually, hold on

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

?

thin grove
dapper igloo
#

Drag and drop onto the py file. Like you would with an exe or bat file

thin grove
#

Ah, that's what you mean. Not sure what's needed for that to work on windows; probably works by file associations

dapper igloo
thin grove
#

And the second one doesn't?

dapper igloo
#

I dont know how to put python before C:\

thin grove
#

Not sure what you mean. Just write it, then paste the path, then add -h ?

#

(or just copy the entire command into the terminal)

dapper igloo
#

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

thin grove
#

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

dapper igloo
#

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

neat wraithBOT
#
Python help channel closed

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.