Quantcast
Channel: Scripting - McNeel Forum
Viewing all articles
Browse latest Browse all 4146

Os.getwd() returns wrong directory in Rhino8?

$
0
0

The code below returns the path to the folder containing the running script document in Rhino7, which is what I expect. In Rhino8, it returns C:\Program Files\Rhino 8\System (my script is not in that folder).

Is it a bug? Is this just the new way going forward? Is there an alternate way to get the folder of the running script (or even the full path)?

#! python 2
import os
print(os.getcwd())

I generally need the python2 comment, but I get the same results with and without that comment.

import os
print(os.getcwd())

Thanks in advance!

3 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 4146

Trending Articles