I had a script that needed the use of __file__, and so I learned that IDLE doesn’t set this. Is there a way from my script that I can detect the presence of IDLE?
I had a script that needed the use of __file__ , and so I
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
if you want to do something special if
__file__isn’t set. Or,if you want to do something then raise an error anyway, or
if you want to have a default.