R python - general

Set working directory

The default working directory for both R and Python is "C:/User/ABC/Documents"


LanguageCode
Rsetwd("C:/User/ABC/Documents")
Pythonimport os
os.chdir("C:/User/ABC/Documents")



Get the existing working directory



LanguageCode
Rgetwd()
Pythonimport os
print(os.getcwd())

Write comments in code


LanguageCode
R#The following text is treated as comment
Python#The following text is treated as comment





Comments

Popular Posts