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
21
votes
9 answers

pyautogui.locateCenterOnScreen() returns None instead of coordinates

import pyautogui print (pyautogui.locateCenterOnScreen("C:\Users\Venkatesh_J\PycharmProjects\mouse_event\mouse_event.png")) Instead of returning coordinates, it returns None.
Venkatesh J
  • 211
  • 1
  • 2
  • 7
21
votes
3 answers

How do I escape forward slashes in python, so that open() sees my file as a filename to write, instead of a filepath to read?

Let me preface this by saying I'm not exactly sure what is happening with my code; I'm fairly new to programming. I've been working on creating an individual final project for my python CS class that checks my teacher's website on a daily basis and…
cody.codes
  • 1,384
  • 1
  • 18
  • 24
21
votes
4 answers

Compiler problems with pip during numpy install under Windows 8.1, 7 Enterprise and 7 Home Editions

I am unable to install numpy via pip install numpy on my computer running Python 3.4 due to various errors I receive linked to compilation issues (This is only the case on a 64-bit installation of Python). This is a problem that has been reported…
Matt
  • 2,289
  • 6
  • 29
  • 45
20
votes
1 answer

Django 2, python 3.4 cannot decode urlsafe_base64_decode(uidb64)

i am trying to activate a user by email, email works, encoding works, i used an approach from django1.11 which was working successfully. In Django 1.11 the following decodes successfully to 28, where uidb64 =…
Vipin Mohan
  • 1,631
  • 1
  • 12
  • 22
20
votes
3 answers

Python: Handling newlines in json.load() vs json.loads()

According to this answer, newlines in a JSON string should always be escaped. This does not appear to be necessary when I load the JSON with json.load(). I've saved the following string to file: {'text': 'Hello,\n How are you?'} Loading the JSON…
Dirty Penguin
  • 4,212
  • 9
  • 45
  • 69
20
votes
1 answer

python - pip is not working after upgrade

I tried upgrade pip3 with this command: sudo pip3 install --upgrade pip but unfortunately it doesn't work anymore and shows this message: pip3 --version message: Traceback (most recent call last): File …
Shervin Gharib
  • 728
  • 2
  • 14
  • 29
20
votes
6 answers

How to install requests module in python 3.4 version on windows?

What command should I use in command prompt to install requests module in python 3.4 version ??? pip install requests is not useful to install requests module in python 3.4 version. Because while running the script below error is…
user3654181
  • 441
  • 2
  • 4
  • 13
20
votes
1 answer

Difference in package importing between Python 2.7 and 3.4

For this directory hierarchy: . ├── hello │   ├── __init__.py │   └── world │   └── __init__.py └── test.py And the Python source files: test.py: if __name__ == '__main__': import hello hello/__init__.py: import…
pjhades
  • 1,948
  • 2
  • 19
  • 34
20
votes
3 answers

Why 'python3 -m venv myenv' installs older version of pip into myenv than any version of pip I can find anywhere on the system?

This is not causing me any problem that I can't solve by activating the virtual environment and running pip install -U pip, but I always wonder where the older version of pip is coming from. I'm using OS X 10.7.5. When I create a virtual…
dusty
  • 865
  • 9
  • 15
20
votes
5 answers

Python matplotlib Cairo error

I'm using something simpler than the sample code on the pyplot tutorial website: import matplotlib.pyplot as plt plt.plot([1,2,3,4,5]) plt.show() but when I run it, I get the error: TypeError: Couldn't find foreign struct converter for…
JDong
  • 2,304
  • 3
  • 24
  • 42
20
votes
3 answers

PyQt5: Keyboard shortcuts w/ QAction

How do I implement keyboard shortcuts (to run a function) in PyQt5? I see I'm supposed QAction in one way or another, but I can't put the two and two together, and all examples don't seem to work with PyQt5 but instead PyQt4.
Lachlan
  • 1,245
  • 5
  • 18
  • 34
19
votes
3 answers

How to add album art to mp3 file using python 3?

I was wondering what module to use for setting an image as the album art for a particular mp3 file. Mutagen seemed to be a popular choice, but it doesn't seem to work on python 3 and I can't find any documentation.
Lakshay Kalbhor
  • 577
  • 3
  • 7
  • 19
19
votes
4 answers

base64.encodestring failing in python 3

The following piece of code runs successfully on a python 2 machine: base64_str = base64.encodestring('%s:%s' % (username,password)).replace('\n', '') I am trying to port it over to Python 3 but when I do so I encounter the following error: >>> a =…
Vinay Pai
  • 443
  • 1
  • 5
  • 13
19
votes
2 answers

python3: singledispatch in class, how to dispatch self type

Using python3.4. Here I want use singledispatch to dispatch different type in __mul__ method . The code like this : class Vector(object): ## some code not paste @functools.singledispatch def __mul__(self, other): raise…
jiamo
  • 1,406
  • 1
  • 17
  • 29
18
votes
2 answers

Integer division in Python 3 - strange result with negative number

I am new to Python, and I am learning operators right now. I understood that: The / operator is used for floating point division and // for integer division. Example: 7//3 = 2 And 7//-3=-3. Why is the answer -3? I am stuck here.
princess
  • 313
  • 2
  • 8