Arash.g
Arash.g

Reputation: 47

How to figure out where is my python installed using OS or Sys

Is there a way to find out where is my python installed using OS?

Well i know that if we open a shell and run this:

import os
os.getcwd()

it will work but can we do this in idle too ?

when its saved on desktop for example ?

actually I'm looking for this output for example:

C:\Users\user\AppData\Local\Programs\Python\Python37

Upvotes: 0

Views: 108

Answers (1)

sujeet14108
sujeet14108

Reputation: 568

Try :

>>> import sys
>>> print sys.prefix

Upvotes: 3

Related Questions