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
Different behaviour in TagUI write and TagUI for Python write() - by design #44
Comments
Hi CK, yes you are right! The behaviour is intentional and by design. It can't be standardised because the target users for both projects are different. TagUI is meant more for business users and non-developers, so things are done as much as possible to simplify tasks for them. This includes automatically inserting line break '\r\n' for write step. However, TagUI for Python is meant more for Python users. Thus write() step cannot automatically add the line break characters '\r\n' as that means users cannot write a series of strings to a file sequentially without inserting line breaks in between. That would be very un-Pythonic and non-standard programming language behaviour. In the interim, for TagUI users who want to port to TagUI for Python, they will face this difference. Workaround will be inside the write() function in tagui.py (search for write_output_file.write(_py23_write(text_to_write) to something like write_output_file.write(_py23_write(text_to_write + '\r\n') This seems hacky, but if standardise the two, the group of Python users using this package directly, compared to existing TagUI users who port to Python, will be a much larger group. And they can't be paying the price to address the the smaller group's needs, especially if it is deviating from standard programming languages best practices. If change TagUI write to be without '\r\n' it will also break backward compatibility of its existing user scripts, thus also not a suitable solution. |
Hi Ken, Thanks for the detailed explanation. Know where you're coming from. This is not a big issue in python, because it's now very easy to use You may want to highlight this in your documentation for TagUI-Python though. I'm sure there will some users like me trying to port TagUI script into TagUI-Python and bump into this wondering what's happening. |
That's a good suggestion CK. From your experience so far, other than write() and visible(), have you experienced other differences in behaviour between TagUI for Python functions and TagUI steps that would help to be documented? |
Closing this as CK created a new issue #47 with details of the comparison! |
Hi Ken,
Just tried some
write()
in TagUI-PythonFound out that
write
in TagUI automatically includes new line at the end of the write stringwrite()
in TagUI-Python does notCan I confirm the above behaviour?
Would be great if the two can be standardized - so that it's easier for people who need to port scripts from TagUI to TagUI-Python.
The text was updated successfully, but these errors were encountered: