Questions tagged [python-3.4]

The version of the Python programming language released on March 16, 2014. For issues that are specific to Python 3.4. Use the more generic [python] and [python-3.x] tags where possible.

Python is a general-purpose, high-level programming language whose design philosophy emphasizes code readability.

Python 3.4 (released on March 16, 2014), the first beta having been released on November 24, 2013) introduces a new enum module providing an enumerated type, and an improved marshal format. Other new modules include:

3.4 also includes a bundled installer for pip to standardize installation of third-party modules.


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.

2588 questions
33
votes
3 answers

Why does the asyncio's event loop suppress the KeyboardInterrupt on Windows?

I have this really small test program which does nothing apart from a executing an asyncio event loop: import asyncio asyncio.get_event_loop().run_forever() When I run this program on Linux and press Ctrl+C, the program will terminate correctly…
skrause
  • 989
  • 1
  • 9
  • 14
32
votes
2 answers

What is a DynamicClassAttribute and how do I use it?

As of Python 3.4, there is a descriptor called DynamicClassAttribute. The documentation states: types.DynamicClassAttribute(fget=None, fset=None, fdel=None, doc=None) Route attribute access on a class to __getattr__. This is a descriptor, used to…
gerrit
  • 24,025
  • 17
  • 97
  • 170
32
votes
3 answers

cx-freeze, runpy and multiprocessing - multiple paths to failure

This is a bit of a complex one, and may take some of your time. The basic problem is, that on linux (Ubuntu in my test case) a cx-freeze'd version of my program (Omnitool) is not able to create subprocesses. It works on Windows 7, however. Or when…
Berserker
  • 1,112
  • 10
  • 26
31
votes
3 answers

How to list all exceptions a function could raise in Python 3?

Is there a programmatic way to get a list of all exceptions a function could raise? I know for example that os.makedirs(path[, mode]) can raise PermissionError (and maybe others), but the documentation only mentions OSError. (This is just an example…
hiro protagonist
  • 44,693
  • 14
  • 86
  • 111
30
votes
4 answers

How to install pandas for Python 3?

I try to install pandas for Python 3 by executing the following command: sudo pip3 install pandas As a result I get this: Downloading/unpacking pandas Cannot fetch index base URL https://pypi.python.org/simple/ Could not find any downloads that…
Roman
  • 124,451
  • 167
  • 349
  • 456
30
votes
3 answers

Compiling Python 3.4 is not copying pip

I have compiled Python 3.4 from the sources on Linux Mint, but for some reason it is not copying pip to its final compiled folder (after the make install). Any ideas?
Rui Lima
  • 7,185
  • 4
  • 31
  • 42
29
votes
1 answer

Test an object is a subclass of the type of another instance

I have this code: class Item: def __init__(self,a): self.a=a class Sub(Item): def __init__(self,a,b): self.b=b Item.__init__(self,a) class SubSub(Sub): def __init__(self,a,b,c): self.c=c …
A-P
  • 497
  • 1
  • 4
  • 9
28
votes
4 answers

setting up environment in virtaulenv using python3 stuck on setuptools, pip, wheel

Running the following: virtualenv -p python3 venv gives: Running virtualenv with interpreter /usr/bin/python3 Using base prefix '/usr' New python executable in /specific/a/home/cc/students/csguests/taivanbatb/venv/bin/python3 Also creating…
Taivanbat Badamdorj
  • 867
  • 1
  • 10
  • 24
28
votes
5 answers

Finding entries containing a substring in a numpy array?

I tried to find entries in an Array containing a substring with np.where and an in condition: import numpy as np foo = "aa" bar = np.array(["aaa", "aab", "aca"]) np.where(foo in bar) this only returns an empty Array. Why is that so? And is there…
SiOx
  • 478
  • 1
  • 6
  • 13
27
votes
29 answers

Making a collatz program automate the boring stuff

I'm trying to write a Collatz program using the guidelines from a project found at the end of chapter 3 of Automate the Boring Stuff with Python. I'm using python 3.4.0. Following is the project outline: Write a function named collatz() that has one…
DeltaFlyer
  • 461
  • 2
  • 8
  • 17
27
votes
5 answers

System Python conflict between Anaconda and existing Python installation

I've been going with a basic Python3.4 install that I've been installing many modules into for over the past month but have reached a point where pip is coming up short and I'm going to just install the full Anaconda on my system to go deeper into…
jxramos
  • 7,356
  • 6
  • 57
  • 105
27
votes
9 answers

pyttsx: No module named 'engine'

I'm trying to install TTS package by using this. Everything was okay until I tried to execute the following command: import pyttsx I got back this error: File "/usr/local/lib/python3.4/dist-packages/pyttsx/__init__.py", line 18, in module
27
votes
2 answers

Eval scope in Python 2 vs. 3

I came across bizarre eval behavior in Python 3 - local variables aren't picked up when eval is called in a list comprehension. def apply_op(): x, y, z = [0.5, 0.25, 0.75] op = "x,y,z" return [eval(o) for o in…
PattimusPrime
  • 867
  • 8
  • 21
27
votes
1 answer

Reload a Module in Python 3.4

I know this might sound like a really stupid question but whatever. I've made a small script in Python and I've made some changes while in a shell. Normally, on an OS X computer (It's running Python 2.7), I would simply type in reload(the_module)…
Zizouz212
  • 4,908
  • 5
  • 42
  • 66
26
votes
4 answers

How to get text from span tag in BeautifulSoup

I have links looks like this
1 GB
I'm trying to get 1 GB from there. I tried tt = [a['title'] for a in…
GLHF
  • 3,835
  • 10
  • 38
  • 83