You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This has been an issue for users who are getting started with Grasshopper. It's an easy fix and we need to implement it to all the components with string inputs. Here is an example.
The text was updated successfully, but these errors were encountered:
@mostaphaRoudsari Should we strip all white spaces, or just beginning and end?
Just the beginning and end:
filenamestr = " hello world\n\t "
filenamestr = filenamestr.strip() # removes whitepsace from beginning and end
>> print filenamestr
>> "hello world"
All white spaces:
"".join(filenamestr.split()) # removes all white space from string
>> print filenamestr
>> "helloworld"
The argument for stripping all white spaces is to prevent white spaces in your path creating trouble with the way python reads file paths. Unless we treat file names very carefully with raw strings, or the python os.path module, we can quickly run into very hard-to-detect interoperability issues with white spaces. We will have to explicitly tell users not to use white spaces in their file names, but it could cause us less headaches in the future...
@saeranv we should use re to catch all these cases and give a warning. Fixing it for user without giving proper warning can end up creating other issues. Here is how it's implemented in honeybee[+].
This has been an issue for users who are getting started with Grasshopper. It's an easy fix and we need to implement it to all the components with string inputs. Here is an example.
The text was updated successfully, but these errors were encountered: