Nov-29-2021, 04:43 AM
hi, sorry for my bad English,
this is my first post, so sorry if I have mistakes,
currently, I using dl-translate packages to bulk translate all of my txt in a folder,
for this case, the content is a word from "Top 100 most common Spanish words"
so you can guess there are 100 of txt files,
this is the flow chart of the script:
1. load the dl-translate to RAM, because it loaded from Harddisk/not SSD, the average loading time take about 15 seconds,
2. check if the folder contain(s) txt files, if exist: go to step 3, if not exist: go to step 8,
3. read the string from a txt file
4. translate string from step 3,
5. move txt file from step 3 to subfolder "source_done",
6. create txt result file to subfolder "translate_result",
7. go to step 2,
8. end program/script,
this script works flawlessly, except if the source is wrong, the wrong is usually a typo,
each time I found a typo, I need to fix it, then I need to run that "8 steps" script at above again,
somehow to check if the result is right, I must fix 1 file at a time:
if the wrong only 1 or 2 files, waiting only 15-30 seconds is acceptable,
for 4 txt alone it requires 1 minute, but if dozen(s) you can count by yourself,
now my question is:
is possible to create an "always running python script" as a server, in this case, the script does step 1?
then another python script "hook" it as a client, in this case, to do steps 2-8?
an answer as google keyword is good,
an answer as a link or script is great,
thank you for reading, have a nice day.
this is my first post, so sorry if I have mistakes,
currently, I using dl-translate packages to bulk translate all of my txt in a folder,
for this case, the content is a word from "Top 100 most common Spanish words"
so you can guess there are 100 of txt files,
this is the flow chart of the script:
1. load the dl-translate to RAM, because it loaded from Harddisk/not SSD, the average loading time take about 15 seconds,
2. check if the folder contain(s) txt files, if exist: go to step 3, if not exist: go to step 8,
3. read the string from a txt file
4. translate string from step 3,
5. move txt file from step 3 to subfolder "source_done",
6. create txt result file to subfolder "translate_result",
7. go to step 2,
8. end program/script,
this script works flawlessly, except if the source is wrong, the wrong is usually a typo,
each time I found a typo, I need to fix it, then I need to run that "8 steps" script at above again,
somehow to check if the result is right, I must fix 1 file at a time:
if the wrong only 1 or 2 files, waiting only 15-30 seconds is acceptable,
for 4 txt alone it requires 1 minute, but if dozen(s) you can count by yourself,
now my question is:
is possible to create an "always running python script" as a server, in this case, the script does step 1?
then another python script "hook" it as a client, in this case, to do steps 2-8?
an answer as google keyword is good,
an answer as a link or script is great,
thank you for reading, have a nice day.