-
Notifications
You must be signed in to change notification settings - Fork 38
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
Added hashbang #100
base: master
Are you sure you want to change the base?
Added hashbang #100
Conversation
This allows directly calling the script as executable under any Unix-like system.
Can't do this. Makes it not compatible with the py version management
command on Windows.
…On Mon, 22 Jan 2024, 21:43 Denilson Sá Maia, ***@***.***> wrote:
This allows directly calling the script as executable under any Unix-like
system.
------------------------------
You can view, comment on, or merge this pull request online at:
#100
Commit Summary
- 776b384
<776b384>
Added hashbang
File Changes
(1 file <https://github.com/Kalanyr/gogrepoc/pull/100/files>)
- *M* gogrepoc.py
<https://github.com/Kalanyr/gogrepoc/pull/100/files#diff-58127eb9727a1529f1ec7504e50e2ce92637514923176c5b73a1590ac4e0916a>
(1)
Patch Links:
- https://github.com/Kalanyr/gogrepoc/pull/100.patch
- https://github.com/Kalanyr/gogrepoc/pull/100.diff
—
Reply to this email directly, view it on GitHub
<#100>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABKZ33ZSRCBPYIM2OBYXON3YPZGF7AVCNFSM6AAAAABCFBZXQSVHI2DSMVQWIX3LMV43ASLTON2WKOZSGA4TGNZSGY3DCMQ>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Hmm. Maybe a second dummy file with the hashbang , that imports the main
file and just passes the parameters over unchanged could work. I'll look
into that.
…On Mon, 22 Jan 2024, 21:49 Kalanyr, ***@***.***> wrote:
Can't do this. Makes it not compatible with the py version management
command on Windows.
On Mon, 22 Jan 2024, 21:43 Denilson Sá Maia, ***@***.***>
wrote:
> This allows directly calling the script as executable under any Unix-like
> system.
> ------------------------------
> You can view, comment on, or merge this pull request online at:
>
> #100
> Commit Summary
>
> - 776b384
> <776b384>
> Added hashbang
>
> File Changes
>
> (1 file <https://github.com/Kalanyr/gogrepoc/pull/100/files>)
>
> - *M* gogrepoc.py
> <https://github.com/Kalanyr/gogrepoc/pull/100/files#diff-58127eb9727a1529f1ec7504e50e2ce92637514923176c5b73a1590ac4e0916a>
> (1)
>
> Patch Links:
>
> - https://github.com/Kalanyr/gogrepoc/pull/100.patch
> - https://github.com/Kalanyr/gogrepoc/pull/100.diff
>
> —
> Reply to this email directly, view it on GitHub
> <#100>, or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/ABKZ33ZSRCBPYIM2OBYXON3YPZGF7AVCNFSM6AAAAABCFBZXQSVHI2DSMVQWIX3LMV43ASLTON2WKOZSGA4TGNZSGY3DCMQ>
> .
> You are receiving this because you are subscribed to this thread.Message
> ID: ***@***.***>
>
|
What is that? Why is that? I never heard of it, but also I never wrote Python code under Windows anyway. As a side note, you may want to drop Python 2.x support (it's been four years since it ended official support, and over a decade since Python 3.x was available). It can potentially simplify some code. And, after that, you could write a
Going |
Py is a windows command that lets you set the default python version you
want to run (from those installed) and also run different versions, that is
packaged with the Windows Python install. Unfortunately it also uses a
hashbang syntax to specify the python version inside a .py file (for if you
want a file to use a different version when launched by double clicking
instead of command prompt) and if it finds a Linux hashbang it doesn't
understand it and does weird stuff..
I use a mixed setup for programming but my GOGrepoc use is mainly on
Windows.
…___
I do plan to drop Python 2 support but I want to find a good stable point
to do that on ( I know some people are stuck with Python 2 due to eg use on
a NAS )
__
I'll look into toml, thank you for the suggestion, that sounds like a
sensible thing to do.
On Mon, 22 Jan 2024, 23:16 Denilson Sá Maia, ***@***.***> wrote:
py version management command on Windows
What is that? Why is that? I never heard of it, but also I never wrote
Python code under Windows anyway.
------------------------------
As a side note, you may want to drop Python 2.x support (it's been four
years since it ended official support
<https://devguide.python.org/versions/>, and over a decade since Python
3.x was available). It can potentially simplify some code.
And, after that, you could write a pyproject.toml file, to make this
repository a proper Python package (even if you don't plan on publishing it
on PyPI). This way, it can be easily installed together with all the
dependencies using pip.
- https://packaging.python.org/en/latest/guides/writing-pyproject-toml/
- https://setuptools.pypa.io/en/latest/userguide/quickstart.html
- https://setuptools.pypa.io/en/latest/userguide/entry_point.html
- My project where I recently added a pyproject.toml
<https://github.com/denilsonsa/abn-amro-statement-parser>
Going pyproject.toml is the easiest solution regarding creating a
separate module and then a launcher script, as it's natively supported as *Entry
points*.
—
Reply to this email directly, view it on GitHub
<#100 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABKZ337OPV5P7QMWMTUDHK3YPZRERAVCNFSM6AAAAABCFBZXQSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMBTHE4DOMRXGA>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
I see, it's mentioned in the official docs. I know it is also possible to use git Anyway, if it's too troublesome, feel free to close this. I know I can add the shebang myself on my local copy. (Although running it first without a shebang tries to run the script as a shell script, and bad stuff happens.) Oh, I just noticed this PR tries to fix #65. |
This allows directly calling the script as executable under any Unix-like system.