[GH-ISSUE #308] Arguments are not being read by output EXE #268

Closed
opened 2026-02-26 12:21:01 +03:00 by kerem · 3 comments
Owner

Originally created by @PoshoDev on GitHub (Sep 7, 2022).
Original GitHub issue: https://github.com/brentvollebregt/auto-py-to-exe/issues/308

Originally assigned to: @PoshoDev on GitHub.

Hello there, big fan of this tool. It has made my life much simpler. 🙂

The Python script I want to convert uses sys.argv for command line arguments, they are being read when I do python myscript.py foo but not when I do ./myscript.exe foo using the output EXE file. It does work when I use the --console flag though, but since my script is meant to run in the background when run without arguments or double-clicked from Explorer, it is not optimal.

Is there any workaround for this?

Originally created by @PoshoDev on GitHub (Sep 7, 2022). Original GitHub issue: https://github.com/brentvollebregt/auto-py-to-exe/issues/308 Originally assigned to: @PoshoDev on GitHub. Hello there, big fan of this tool. It has made my life much simpler. 🙂 The Python script I want to convert uses `sys.argv` for command line arguments, they are being read when I do `python myscript.py foo` but not when I do `./myscript.exe foo` using the output EXE file. It _does_ work when I use the `--console` flag though, but since my script is meant to run in the background when run without arguments or double-clicked from Explorer, it is not optimal. Is there any workaround for this?
kerem 2026-02-26 12:21:01 +03:00
  • closed this issue
  • added the
    Stale
    label
Author
Owner

@brentvollebregt commented on GitHub (Sep 8, 2022):

I just ran this script and it worked fine:

import sys
import requests

url = "https://webhook.site/c24306fb-4cc8-4201-96e4-e44a3552718d" # Generate from webhook.site
data = {"sys.argv": sys.argv}
r = requests.post(url, json=data, verify=False)

To use this

  1. Generate a new webhook.site URL and put it in `url
  2. Test the script locally using python demo.py my args are here, you should see the args appear in the latest request on the site
  3. Bundle the script using auto-py-to-exe
  4. Test the executable using demo.exe are my args here, you should see the args appear in the same way
<!-- gh-comment-id:1240361959 --> @brentvollebregt commented on GitHub (Sep 8, 2022): I just ran this script and it worked fine: ```python import sys import requests url = "https://webhook.site/c24306fb-4cc8-4201-96e4-e44a3552718d" # Generate from webhook.site data = {"sys.argv": sys.argv} r = requests.post(url, json=data, verify=False) ``` To use this 1. Generate a new webhook.site URL and put it in `url 2. Test the script locally using `python demo.py my args are here`, you should see the args appear in the latest request on the site 3. Bundle the script using auto-py-to-exe 4. Test the executable using `demo.exe are my args here`, you should see the args appear in the same way
Author
Owner

@github-actions[bot] commented on GitHub (Nov 1, 2022):

This issue is stale because it has been open for 60 days with no activity. Remove stale label or comment on this issue or it will be closed in 5 days.

<!-- gh-comment-id:1297912917 --> @github-actions[bot] commented on GitHub (Nov 1, 2022): This issue is stale because it has been open for 60 days with no activity. Remove stale label or comment on this issue or it will be closed in 5 days.
Author
Owner

@github-actions[bot] commented on GitHub (Nov 7, 2022):

Closing issue due to no activity in more than 60 days.

<!-- gh-comment-id:1304970094 --> @github-actions[bot] commented on GitHub (Nov 7, 2022): Closing issue due to no activity in more than 60 days.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/auto-py-to-exe#268
No description provided.