Get name of current script in Python?

I'm trying to get the name of the Python script that is currently running. I have a script called foo.py and I'd li...

Difference between web-based and executable installers for Python 3 on Windows?

The downloads page for Python for Windows offers a "web-based" installer and an "executable" installer. What's the d...

how to create dummies for certain columns by pandas get_dummies() method??

df = pd.DataFrame({'A': ['x', 'y', 'x'], 'B': ['z', 'u', 'z'], 'C': ['1', '2', '3'], ...

Printing one character at a time from a string, using the while loop?

Im reading "Core Python Programming 2nd Edition", They ask me to print a string, one character at a time using a "wh...

How to check if a value exists in a dictionary (python)?

I have the following dictionary in python: d = {'1': 'one', '3': 'three', '2': 'two', '5': 'five', '4': 'four'} ...

How to draw smily (arc) using python turtle?

I want to draw a smily using python turtle. Circle extent will be 120. I am trying following import turtle turtle...

How do I get the opposite (negation) of a Boolean in Python??

For the following sample: def fuctionName(int, bool): if int in range(...): if bool == True: ...

Plot 4D graph in python2.7?

I want to plot red, blue and green colors on the three axis and an array which stores the value corresoding to each ...

How do I do a case-insensitive string comparison??

How can I do case insensitive string comparison in Python? I would like to encapsulate comparison of a regular stri...

How do I print bold text in Python??

How do I print bold text in Python? For example: print "hello" What should I do so that the text “hello” is ...

checking if a string is in alphabetical order in python?

I've put together the following code to check if a string/word is alphabetically ordered: def isInAlphabeticalOrder...

How do I do a case-insensitive string comparison??

How can I do case insensitive string comparison in Python? I would like to encapsulate comparison of a regular stri...

Choosing between Scons and Waf in Large Projects?

We are thinking about converting a really large project from using GNU Make to some more modern build tool. My curre...

How to rename a virtualenv in Python??

I misspelled the name of the virtualenv while initializing it using: $ virtualenv vnev I actually intended to cre...