Questions tagged [python-3.3]

For issues that are specific to Python 3.3. Use the more generic [python] and [python-3.x] tags where possible.

Python is a dynamically and strongly typed programming language whose design philosophy emphasizes code readability. Two significantly different versions of Python (2 and 3) are in use.

Use this tag if your question is specifically about . If your question applies to Python in general, use the tag . If your question applies to Python 3.x but not to Python 2, use the tag . If you aren't sure, tag your question and mention which version you're using in the body of your question.

Python 3.3 was released on September 29, 2012, and has a number of new features:

Syntax:

  • The yield from expression for generator delegation is introduced.
  • The u'unicode' syntax (which disappeared in Python 3.0) returns.

New standard library modules:

  • faulthandler - helps debugging low-level crashes.
  • ipaddress - high-level objects representing IP addresses and masks.
  • lzma - compress data using the XZ / LZMA algorithm.
  • unittest.mock - replace parts of your system under test with mock objects.
  • venv - Python virtual environments, as in the popular virtualenv package.

... as well as a reworked I/O exception hierarchy, rewritten import machinery based on importlib, more compact unicode strings, and more compact attribute dictionaries.

The C Accelerator for the decimal module has also been significantly improved, as has the unicode handling in the email module.

Finally, for security reasons, hash randomization is now switched on by default.

1158 questions
35
votes
3 answers

Is python package virtualenv necessary when I use python 3.3?

I was looking in Cristoph Gohlke's python packages and I noticed that there is a package Virtualenv for Python 3.3. Since there is a package venv in the standard python library v3.3, I was wondering if there is an advantage to install this package…
aristotelis
  • 353
  • 3
  • 6
34
votes
2 answers

whats the difference between python 3.3 and 3.3m

What's the difference between python 3.3 and 3.3m I'm using Ubuntu 13.04 Raring and on my system I have python2.7 and python3.3 (I know the differences between 2 and 3) But I also have installed python3.3m (and it's not a symlink to 3.3). So what…
willix
  • 615
  • 6
  • 12
34
votes
4 answers

My scipy.misc module appears to be missing imsave

I open the python3 interpreter and type import scipy.misc scipy.misc.imsave with the result Traceback (most recent call last): File "", line 1, in AttributeError: 'module' object has no attribute 'imsave' Has the name changed? It…
Cramer
  • 1,745
  • 1
  • 12
  • 20
32
votes
6 answers

Can't catch mocked exception because it doesn't inherit BaseException

I'm working on a project that involves connecting to a remote server, waiting for a response, and then performing actions based on that response. We catch a couple of different exceptions, and behave differently depending on which exception is…
30
votes
0 answers

Does pyvenv replace virtualenv in python3.3 +?

I just read about pyvenv which is included in Python 3.3 per PEP 405. It looks like it provides the same directory structure and the same usage as virtualenv. Is there some difference I'm missing or starting with Python 3.3, does pyvenv replace…
dm03514
  • 50,477
  • 16
  • 96
  • 131
28
votes
4 answers

Non-blocking multiprocessing.connection.Listener?

I use multiprocessing.connection.Listener for communication between processes, and it works as a charm for me. Now i would really love my mainloop to do something else between commands from client. Unfortunately listener.accept() blocks execution…
28
votes
2 answers

How can I more easily suppress previous exceptions when I raise my own exception in response?

Consider try: import someProprietaryModule except ImportError: raise ImportError('It appears that is not installed...') When run, if someProprietaryModule is not installed, one sees: (traceback data) ImportError:…
Hammerite
  • 19,804
  • 4
  • 65
  • 82
27
votes
3 answers

Format time string in Python 3.3

I am trying to get current local time as a string in the format: year-month-day hour:mins:seconds. Which I will use for logging. By my reading of the documentation I can do this by: import time '{0:%Y-%m-%d…
markmnl
  • 10,001
  • 7
  • 64
  • 102
26
votes
4 answers

Getting exception details in Python

I have to open & write to about 10 different files all within the same loop. e.g: for i in range(0,10): try: a=5 file1 = open("file1.txt",'w+') file2 = open("file2.txt",'w+') #... etc …
user891876
  • 433
  • 1
  • 4
  • 16
25
votes
1 answer

python: Is there a downside to using faulthandler?

Python 3.3 includes a module named faulthandler that displays helpful traceback information if a segfault occurs. (For Python versions prior to 3.3, the module can be obtained from PyPI.) The module is not enabled by default. It is enabled like…
Stuart Berg
  • 13,992
  • 10
  • 54
  • 87
25
votes
3 answers

Why do distribute and pip install to my virtualenv's ./local/bin?

I create and activate a virtualenv (venv) using Python 3.3's built-in way of doing it: $ python3.3 -m venv env $ source env/bin/activate At this point python is the python in my virtualenv, which I expect: (env) $ which…
Frank T
  • 6,116
  • 5
  • 40
  • 62
25
votes
3 answers

itertools.accumulate() versus functools.reduce()

In Python 3.3, itertools.accumulate(), which normally repeatedly applies an addition operation to the supplied iterable, can now take a function argument as a parameter; this means it now overlaps with functools.reduce(). With a cursory look, the…
JAB
  • 19,150
  • 4
  • 64
  • 78
23
votes
4 answers

How do I compile my Python 3 app to an .exe?

How do I convert my Python app to a .exe? I made a program with tkinter and was wondering how to make it possible for others to use. I use Python 3.3. I searched for a bit but could not find anything.
S.E. Chahine
  • 1,166
  • 1
  • 13
  • 38
22
votes
2 answers

SyntaxError: unexpected EOF while parsing

I have no idea why this does not work please help import random x = 0 z = input('?') int(z) def main(): while x < z: n1 = random.randrange(1,3) n2 = random.randrange(1,3) t1 = n1+n2 …
Quar
  • 369
  • 3
  • 4
  • 10
22
votes
5 answers

Installing pip for python3.3

I downloaded pip from Package Index > pip 1.2.1 Then I installed it using sudo python3.3 setup.py install Still, when I try to use pip-3.3 the terminal complains -bash: pip-3.3: command not found However, pip-2.7 works swimmingly. I have also…
The Unfun Cat
  • 23,164
  • 22
  • 90
  • 133
1
2
3
77 78