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

ttml2ssa.cmd #13

Open
lhksoft opened this issue Jun 26, 2023 · 2 comments
Open

ttml2ssa.cmd #13

lhksoft opened this issue Jun 26, 2023 · 2 comments

Comments

@lhksoft
Copy link

lhksoft commented Jun 26, 2023

To get the cmd working from any folder, it should be changed to following :
python "%~dp0src/__main__.py" %*

If one add the folder where ttml2ssa.cmd is located in the PATH, so when calling this app from some other folder it won't give an error that it cannot find src/__main__.py.

This is a very good app, I don't know much about python but as a c++ coder it wasn't much headbreaking to get things working.
And as I like my subs in a bit custom style, it's easy to change the defaults in the ttml2ssa.py to the way I prefer.

@lg188
Copy link

lg188 commented Sep 30, 2023

Is this something on a specific platform?
This doesn't seem to work:

diff --git a/ttml2ssa.sh b/ttml2ssa.sh
index 015236f..a68106a 100755
--- a/ttml2ssa.sh
+++ b/ttml2ssa.sh
@@ -1,2 +1,2 @@
 #!/usr/bin/env sh
-python3 src/__main__.py "$@"
+python "%~dp0src/__main__.py" %*

@lhksoft
Copy link
Author

lhksoft commented Sep 30, 2023

Is this something on a specific platform? This doesn't seem to work:

this one :
python "%~dp0src/__main__.py" %*
is for Windows. Assuming you had Python3 installed (so it's available through the global PATH).
You should create a cmd (batch) file in some folder that's also available in the global path.
In that cmd file you put the line as above. It could look like somthing as following :

@Echo Off
python "%~dp0src/__main__.py" %*

then __main___.py (the actual python script) is located in a subfolder 'src' in the directory where your cmd-file is located. That's the code %~dp0src stands for, call the python script in subfolder src from the directory in which the calling cmd is located. The trailing '%*' means that any parameter you gave with your cmd file, it will be passed through to the python script.

But, this works only in Windows. Most likely, for linux you should write some other bash file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants