If I don’t use charset_normalizer and use # -- coding: utf-8 -- instead then the scripts works fine and I can use the norwegian extended characters (æøå).
But I thought maybe charset_normalizer was a better solution for other characters as well.
Must admit I have not heard of charset_normalizer before.I would go with the utf-8 encoding decoration. The question you need to ask yourself: do you need to cover characters outside utf-8 range? If not then don’t complicate things.
Other than that it would be useful if you explained howcharset_normalizer fails…
Another thing, when I run a script on my computer through Python 3 in Rhino and it installs a package, shouldn’t that package be easy to reuse next time I use Rhino?
(If Rhino hasn’t been updated since last time)
Reason I ask is that if I run the script embedded in a button then it often fails unless I start ScriptEditor and run it from there once first. Then I can run the embedded script fine afterwards.
@Holo How are your running the embedded script from a button? The scripting runtime in Rhino does not initialize when Rhino is loaded since not everyone uses it. It initializes when ScriptEditor is opened, or a Script component in Grasshopper is used. If I know how you are running your script from a button I can make it initialize there as well
Just a thought, maybe running a python script from a button could be simplified with having it as an option so we don’t have to type in the -_RunPythonScript () thing? (Have a toggle for the different script options):
If it was a function then it could automatically initiate the scripting runtime?
And then it could be intelligent enough to either run a file or the text content.
IF this sounds interesting then please look into the option for running a script from a source like dropbox.
Users install the dropbox folder on different locations. Some use default C: other use D: or move it even further to subfolders.
Yes, when I need extra packages. Should I use that all the time now just to be sure?
The script above that I use for SVG export isn’t very advanced so I didn’t include it, but that one works fine though.
If you want to make sure your script is executed with Python 3 then always include the #! python3 specifier at the top. Otherwise the runtime would not know which Python to use and in case of the older _RunPythonScript command, it defaults to IronPython