Top "Python-3.x" questions

For questions about Python programming that are specific to version 3+ of the language.

Why do I need 'b' to encode a string with Base64?

Following this python example, I encode a string as Base64 with: >>> import base64 >>> encoded = …

python python-3.x base64
How to install python3 version of package via pip on Ubuntu?

I have both python2.7 and python3.2 installed in Ubuntu 12.04. The symbolic link python links to python2.7. When I type: sudo …

python ubuntu python-3.x ubuntu-12.04 pip
Converting int to bytes in Python 3

I was trying to build this bytes object in Python 3: b'3\r\n' so I tried the obvious (for me), …

python python-3.x
pandas: merge (join) two data frames on multiple columns

I am trying to join two pandas data frames using two columns: new_df = pd.merge(A_df, B_df, …

python python-3.x pandas join
NameError: global name 'xrange' is not defined in Python 3

I am getting an error when running a python program: Traceback (most recent call last): File "C:\Program Files (x86)\…

python python-3.x range runtimeexception xrange
Need to install urllib2 for Python 3.5.1

I'm running Python 3.5.1 for Mac. I want to use urllib2 module. I tried installing it but I was told that …

python python-3.x urllib2
How to uninstall a package installed with pip install --user

There is a --user option for pip which can install a Python package per user: pip install --user [python-package-name] I …

python python-3.x pip virtualenv
How can I convert a .py to .exe for Python?

I'm trying to convert a fairly simple Python program to an executable and couldn't find what I was looking for, …

python python-3.x exe py2exe python-3.6
Modulo operator in Python

What does modulo in the following piece of code do? from math import * 3.14 % 2 * pi How do we calculate modulo on …

python python-3.x operators
How to print like printf in Python3?

In Python 2 I used: print "a=%d,b=%d" % (f(x,n),g(x,n)) I've tried: print("a=%d,…

python string python-3.x