Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New command line parameter --py-args (Request in QGIS) #9544

Open
qgis-bot opened this issue Jan 13, 2025 · 0 comments · May be fixed by #9556
Open

New command line parameter --py-args (Request in QGIS) #9544

qgis-bot opened this issue Jan 13, 2025 · 0 comments · May be fixed by #9556
Labels
3.28 QGIS 3.28 new features
Milestone

Comments

@qgis-bot
Copy link
Collaborator

Request for documentation

From pull request qgis/QGIS#50092
Author: @domi4484
QGIS version: 3.28

New command line parameter --py-args

PR Description:

This PR will allow to pass arguments to the script provided via --code parameter and more generally to each python execution. All arguments after --py-args till -- are passed over to the python interpreter and ignored by QGIS.

Note: After --code-args is not possible to pass any other parameter than -- to QGIS

For example:

qgis --code /home/domi/test.py --py-args --specialScriptArguments "a text arg" 'and another arg' -- layer1 layer2
  • test.py will have this content in sys.argv: ['/home/domi/test.py', '--specialScriptArguments', 'a text arg', 'and another arg']
  • layer1 and layer2 will be normally handled by QGIS as layers to load

Commits tagged with [need-docs] or [FEATURE]

@github-actions github-actions bot added the 3.28 QGIS 3.28 new features label Jan 13, 2025
@github-actions github-actions bot added this to the QGIS 3.48 milestone Jan 13, 2025
@DelazJ DelazJ modified the milestones: QGIS 3.48, QGIS 3.34 Jan 13, 2025
@DelazJ DelazJ linked a pull request Jan 14, 2025 that will close this issue
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.28 QGIS 3.28 new features
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants