Skip to content

Tag: python

How to change working directory in Jupyter Notebook?

I couldn’t find a place for me to change the working directory in Jupyter Notebook, so I couldn’t use the pd.read_csv method to read in a specific csv document. Is there any way to make it? FYI, I’m using Python3.5.1 currently. Thanks! Answer Running os.chdir(NEW_PATH) will change the workin…

How can I get the cursor’s position in an ANSI terminal?

I want to get the cursor’s position in a terminal window. I know I can echo -e “33[6n” and read the output -s silently as in this answer, but how can I do this in Python? I’ve tried this contextmanager like this: but it only captures the e[6n (‘x1b[6n’) escape sequence I wr…