Top "Python-3.x" questions

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

What is the best way to remove accents (normalize) in a Python unicode string?

I have a Unicode string in Python, and I would like to remove all the accents (diacritics). I found on …

python python-3.x unicode python-2.x diacritics
PermissionError: [Errno 13] in python

Just starting to learn some python and I'm having an issue as stated below: a_file = open('E:\Python Win7…

python python-3.x
How to save a dictionary to a file?

I have problem with changing a dict value and saving the dict to a text file (the format must be …

python file dictionary python-3.x
How to install pip3 on my Mac?

I'm trying to install pip3, but I'm not having any luck. Also, I tried sudo install and it did not …

python python-3.x pip
Python Variable Declaration

Learning Python, and has some basic doubts. 1.I have seen variable declaration (path here) as class writer: path = "" sometimes, no …

python python-3.x python-2.7 variable-declaration
What's the correct way to convert bytes to a hex string in Python 3?

What's the correct way to convert bytes to a hex string in Python 3? I see claims of a bytes.hex …

python python-3.x hex
How to pass arguments to a Button command in Tkinter?

Suppose I have the following Button made with Tkinter in Python: import Tkinter as Tk win = Tk.Toplevel() frame = Tk.…

python python-3.x button tkinter arguments
How to use filter, map, and reduce in Python 3

filter, map, and reduce work perfectly in Python 2. Here is an example: >>> def f(x): return x % 2 != 0 …

python python-3.x filter functional-programming reduce
What is an alternative to execfile in Python 3?

It seems they canceled in Python 3 all the easy way to quickly load a script by removing execfile() Is there …

python python-3.x
Cosine Similarity between 2 Number Lists

I need to calculate the cosine similarity between two lists, let's say for example list 1 which is dataSetI and list 2 …

python python-3.x cosine-similarity