Questions tagged [python-3.x]
DO NOT USE UNLESS YOUR QUESTION IS FOR PYTHON 3 ONLY. Always use alongside the standard [python] tag.
python-3.x
343,862
questions
9
votes
2
answers
17k
views
Python 3 smtplib send with unicode characters
I'm having a problem emailing unicode characters using smtplib in Python 3. This fails in 3.1.1, but works in 2.5.4:
import smtplib
from email.mime.text import MIMEText
sender = to = 'ABC@DEF....
1
vote
4
answers
2k
views
web framework compatible with python 3.1 and py-postgresql
I have started learning Python by writing a small application using Python 3.1 and py-PostgreSQL. Now I want to turn it into a web application.
But it seems that most frameworks such as web-py, Django,...
9
votes
5
answers
11k
views
Python - Virtualenv , python 3?
Seems everyone recommends virtualenv for multiple python versions (on osx), but does it even work with python 3.0? I downloaded it, and it doesn't seem to.. And I don't really understand how it works, ...
3
votes
4
answers
2k
views
Should I use pgreloaded? Or subversion of pygame?
I'm using pygame with python 2.6 right now, But I want to use python 3.1.1 instead. The normal pygame only works with 2.x, but the subversion ones work with 3.x I think. But what about pgreloaded? Is ...
0
votes
2
answers
1k
views
Why do I have this TypeError when using tkinter?
so I upgraded to python 3.1.1 from 2.6 and i ran an old program of mine which uses tkinter.
I get the following error message which I don't recall getting in the 2.6 version.
Exception in Tkinter ...
-1
votes
2
answers
254
views
Edit python31 file and it opens notepad and starts python26
I am in python31,
then I go to file open i left click to open file
and it opens in notepad(simple text editor)python31
The moment it opens the notepad, it starts python26
I thought it has ...
6
votes
1
answer
2k
views
Unpickling classes from Python 3 in Python 2
If a Python 3 class is pickled using protocol 2, it is supposed to work in Python 2, but unfortunately, this fails because the names of some classes have changed.
Assume we have code called as ...
0
votes
3
answers
176
views
String formatting
I have a list filter = ['a', 'b', 'c']. I need to frame the following string out of the list
"item -a item -b item -c". Which is the most efficient way to do this? Usually the list filter contains 100 ...
18
votes
3
answers
20k
views
Django session expiry?
From django's documentation, I became under the impression that calling:
request.session.set_expiry(300)
from one view would cause the session to expire after five minutes inactivity; however, this ...
3
votes
1
answer
906
views
Python 3.1 inline division override
I don't know if this is a bug in 3.1, but if I remember correctly "inline" division worked like this in pre-3k versions:
Python 3.1 (r31:73574, Jun 26 2009, 20:21:35) [MSC v.1500 32 bit (Intel)] on ...
2
votes
3
answers
281
views
Generating a list from complex dictionary
I have a dictionary dict1['a'] = [ [1,2], [3,4] ] and need to generate a list out of it as l1 = [2, 4]. That is, a list out of the second element of each inner list. It can be a separate list or even ...
2
votes
4
answers
3k
views
Finding set difference between two complex dictionaries
I have two dictionaries of the following structure:
a) dict1 = {'a':[ [1,2], [3,4] ], 'b':[ [1,2],[5,6] ]}
b) dict2 = {'a':[ [1,2], [5,6] ], 'b':[ [1,2],[7,8] ]}
I need to find the set difference ...
0
votes
2
answers
931
views
How to call super() in Python 3.0?
I have the strangest error I have seen for a while in Python (version 3.0).
Changing the signature of the function affects whether super() works, despite the fact that it takes no arguments. Can you ...
0
votes
1
answer
727
views
dbm.error: db type is dbm.bsd, but the module is not available (Python 3.0)
I'm trying to open a shelve file that I created in 2.5, but I get the error I listed in the question title.
The data aren't essential, but I really want them.
Looking at the lib\dbm\__init__.py ...
2
votes
4
answers
9k
views
Python 3.1.1 on Mac OS X 10.6 Snow Leopard
I've spent some time today playing with getting the source for python 3.1.1 to build on my MacBook Pro using the --enable-framework and --enable-universalsdk options with no success. I will humbly ...