Top "Python-3.x" questions

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

Relative imports - ModuleNotFoundError: No module named x

This is the first time I've really sat down and tried python 3, and seem to be failing miserably. I have …

python python-3.x package python-import relative-import
SyntaxError: unexpected EOF while parsing

I am getting error while running this part of the code. tried some of the existing solutions, none of them …

python python-3.x python-3.6 eof lint
Python 3 ImportError: No module named 'ConfigParser'

I am trying to pip install the MySQL-python package, but I get an ImportError. Jans-MacBook-Pro:~ jan$ /Library/Frameworks/Python.framework/…

python python-3.x
How to know/change current directory in Python shell?

I am using Python 3.2 on Windows 7. When I open the Python shell, how can I know what the current directory …

python windows python-3.x python-3.2
Getting a map() to return a list in Python 3.x

I'm trying to map a list into hex, and then use the list elsewhere. In python 2.6, this was easy: A: …

python list python-3.x map-function
How to use string.replace() in python 3.x

The string.replace() is deprecated on python 3.x. What is the new way of doing this?

python python-3.x
Is there a 'foreach' function in Python 3?

When I meet the situation I can do it in javascript, I always think if there's an foreach function it …

python python-3.x foreach
Error: " 'dict' object has no attribute 'iteritems' "

I'm trying to use NetworkX to read a Shapefile and use the function write_shp() to generate the Shapefiles that …

python python-3.x dictionary
'str' object has no attribute 'decode'. Python 3 error?

Here is my code: import imaplib from email.parser import HeaderParser conn = imaplib.IMAP4_SSL('imap.gmail.com') conn.login(…

python python-3.x imaplib
How to remove specific substrings from a set of strings in Python?

I have a set of strings set1, and all the strings in set1 have a two specific substrings which I …

python python-3.x