Title: Double digit args prefix not passing properly · Issue #280 · extrabacon/python-shell · GitHub
Open Graph Title: Double digit args prefix not passing properly · Issue #280 · extrabacon/python-shell
X Title: Double digit args prefix not passing properly · Issue #280 · extrabacon/python-shell
Description: Describe the bug Due to logic and variable number using double prefix args (--lt, --ed etc) is required. Python code ` parser = ArgumentParser() parser.add_argument( "--es", type = float, dest = "e_start", action="append", required = Tru...
Open Graph Description: Describe the bug Due to logic and variable number using double prefix args (--lt, --ed etc) is required. Python code ` parser = ArgumentParser() parser.add_argument( "--es", type = float, dest = "e...
X Description: Describe the bug Due to logic and variable number using double prefix args (--lt, --ed etc) is required. Python code ` parser = ArgumentParser() parser.add_argument( "--es", type = float,...
Opengraph URL: https://github.com/extrabacon/python-shell/issues/280
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Double digit args prefix not passing properly","articleBody":"**Describe the bug**\r\nDue to logic and variable number using double prefix args (--lt, --ed etc) is required. \r\n\r\n**Python code**\r\n`\r\nparser = ArgumentParser()\r\nparser.add_argument(\r\n \"--es\",\r\n type = float,\r\n dest = \"e_start\",\r\n action=\"append\",\r\n required = True,\r\n help = \"e_start\"\r\n )\r\n\r\n parser.add_argument(\r\n \"--ee\",\r\n type = float,\r\n dest = \"e_end\",\r\n action=\"append\",\r\n required = True,\r\n help = \"e_end\"\r\n )\r\n\r\n parser.add_argument(\r\n \"--eu\",\r\n type = float,\r\n dest = \"e_suitei\",\r\n action=\"append\",\r\n required = True,\r\n help = \"e_suitei\"\r\n )\r\n`\r\n\r\n**Javascript code**\r\n\r\n`return new Promise(async (resolve, reject) =\u003e {\r\n let arg = [];\r\n stations.forEach(st =\u003e {\r\n arg.push(`--es${st.es}`);\r\n arg.push(`--ee${st.ee}`);\r\n arg.push(`--eu${st.eu}`);\r\n\r\n });\r\n\r\n let options = {\r\n mode: 'text',\r\n pythonOptions: ['-u'],\r\n scriptPath: `${PROJECT_DIR}/src/scripts/algorithm`,\r\n args: arg,\r\n };\r\n}`\r\n \r\n\r\n**Expected behavior**\r\nRun the python script by given args\r\n\r\n**Actual behavior**\r\n\r\nPythonShellError: usage: *.py [-h] --ee LAT --es LON --eu N \r\n0|index | \r\n0|index | lagrange.py: error: the following arguments are required: --es, --ee, --eu\r\n0|index | at PythonShell.parseError (/workspace/node_modules/python-shell/index.js:268:21)\r\n0|index | at terminateIfNeeded (/workspace/node_modules/python-shell/index.js:139:32)\r\n0|index | at ChildProcess.\u003canonymous\u003e (/workspace/node_modules/python-shell/index.js:131:13)\r\n0|index | at ChildProcess.emit (node:events:513:28)\r\n0|index | at ChildProcess._handle.onexit (node:internal/child_process:291:12) {\r\n0|index | executable: 'python3',\r\n0|index | options: [ '-u' ],\r\n0|index | script: '/workspace/src/scripts/algorithm/lagrange.py',\r\n0|index | args: [\r\n0|index | '--ee 35.96691467421596',\r\n0|index | '--es 140.0746095366776',\r\n0|index | '--eu 36.1061130',\r\n\r\n\r\n**Other Information (please complete the following information):**\r\n - OS: [e.g. Windows10]\r\n - Python Version [e.g. 3.6]\r\n - Node Version [e.g. 12]\r\n\r\n**Additional context**\r\n\r\nData validity or why using args with double-digit naming such a small number of inputs is not essential. The above is only for reproducing the error. The actual code and log are too long. \r\n\r\nWhen using single digit args -e instead of --ee, there is no issue. ","author":{"url":"https://github.com/baagiiSW","@type":"Person","name":"baagiiSW"},"datePublished":"2023-01-06T16:16:09.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/280/python-shell/issues/280"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:1382b76c-7e97-e543-e214-8ca0f04553d7 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9F1E:3CECC8:2EA01CB:3DC21C7:69743E8A |
| html-safe-nonce | 05bf81287f6cd7e2d055971bf29d6e9bfc3bc50e663a9acdd6ab879408f10daa |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5RjFFOjNDRUNDODoyRUEwMUNCOjNEQzIxQzc6Njk3NDNFOEEiLCJ2aXNpdG9yX2lkIjoiMjM0NTI1NTAzOTY0MDI4ODkwNiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 4d35a672b6ed7b8aea512f065cbe7c1542301814b9f3d21178b6b9410494253f |
| hovercard-subject-tag | issue:1522821501 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/extrabacon/python-shell/280/issue_layout |
| twitter:image | https://opengraph.githubassets.com/f1023e15bf99e4e86838761fa09098818b85296abdc6202ff000f9563986d605/extrabacon/python-shell/issues/280 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/f1023e15bf99e4e86838761fa09098818b85296abdc6202ff000f9563986d605/extrabacon/python-shell/issues/280 |
| og:image:alt | Describe the bug Due to logic and variable number using double prefix args (--lt, --ed etc) is required. Python code ` parser = ArgumentParser() parser.add_argument( "--es", type = float, dest = "e... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | baagiiSW |
| hostname | github.com |
| expected-hostname | github.com |
| None | e0b95d743b7672c9ac0e1032d5f117950182dc164a83434a7db86510e8f0b37c |
| turbo-cache-control | no-preview |
| go-import | github.com/extrabacon/python-shell git https://github.com/extrabacon/python-shell.git |
| octolytics-dimension-user_id | 1558613 |
| octolytics-dimension-user_login | extrabacon |
| octolytics-dimension-repository_id | 17671651 |
| octolytics-dimension-repository_nwo | extrabacon/python-shell |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 17671651 |
| octolytics-dimension-repository_network_root_nwo | extrabacon/python-shell |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 56fe7e2e8de6e57740bca50402351ea656f7a4bf |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width