Questions tagged [python-3.2]
For issues that are specific to Python 3.2. Use the more generic [python] and [python-3.x] tags where possible.
334
questions
-1
votes
1
answer
36
views
input2 as length, input1 are in the range [1, n] and each integer appears once/ twice, return arrqy of integers that appears twice
class UserMainCode(object):
@classmethod
def range(cls, input1, input2):
pass
Example:
input1: (1,1,2)
input2: 3
Output: {1}
2
votes
1
answer
313
views
Cannot install Pip for a fresh Python 3.2 installation "No matching distribution found for pip<8"
I created a fresh Python 3.2.2 installation on Windows 10.
I got get_pip.py from here: https://bootstrap.pypa.io/pip/3.2/
I ran: C:\Python32\python.exe get-pip.py
My output:
Collecting pip<8
Could ...
-1
votes
4
answers
81
views
How to remove ' ' from my list python 3.2
newlist=['21', '6', '13', '6', '11', '5', '6', '10', '11', '11', '21', '17', '23', '10', '36', '4', '4', '7', '23', '6', '12', '2', '7', '5', '14', '3', '10', '5', '9', '43', '38']
Now what I want to ...
1
vote
3
answers
102
views
Pygame runs slow after excecuting program
Im making a space invaders type of game and I have a function called bulletboost where I load an image and paste it onto the screen at random x and y points.
def bulletboost():
fastbullets....
0
votes
2
answers
188
views
Game Wont Restart after Game Over
I made a game on python pygame similar to space invaders but instead the aliens shoot at you. So if I manage to get hit by an alien. The game is over, I have two options, Menu, and quit. If I quit and ...
2
votes
1
answer
531
views
How to fix the errors while compiling Python 3.2.0
I am trying to create Python-3.2.0 virtual environment for upgrading my tool.
The tool was earlier built with 2.7.15 version. Now I want to upgrade it to Python-3.2.0
These are the steps which I ...
-1
votes
4
answers
842
views
i want to remove all zero from one list and append all of them to another list but not all of them remove
i want to remove all zero from one list and append them to another list,but when more than one zero come after each other,one of them,does not remove.
zero=[]
l=[2,3,6,0,0,5,6,0,7]
for i in l:
if ...
5
votes
1
answer
956
views
Popen.stdout.readline() works in Python 3.2 but returns empty string in Python 3.6
I am using Popen to start a telnet process over ssh, send commands through the telnet and check the process for output to monitor the state of the telnet. The weird thing I encountered is that the ...
1
vote
0
answers
18
views
I am trying to connect a radiobutton to a listWidget
I am not an experienced python programmer at all.
I am using an application called PyQt4 to create GUI's.
In this instance, I have to line a radio button (displaying male or female) to a child's ...
-1
votes
1
answer
1k
views
get-pip.py script not running.i am using python 3.2.1.getting the error. i have tried repairing,uninstall/reinstalling everything
here is the error message i am getting while running the script on IDLE.i have downloaded the get-pip.py file from the pypi.org.
Traceback (most recent call last):
File "C:\Users\hp1\Desktop\get-...
1
vote
1
answer
2k
views
Python 3.2 in anaconda
I'm trying to create an anaconda environment with Python3.2 but it seems that anaconda only supports 3.4+.
Is it possible to use Python3.2 with anaconda environment? How?
okuoub@iMac>> conda ...
5
votes
1
answer
4k
views
Pycharm says "tarfile.ReadError: file could not be opened successfully"
Today I tried to create a new python project unsing Pycharm, with Python3.2. But I figured out that something is wrong.
When I tried to find the path of my python interpreter, I get that one:
...
2
votes
1
answer
3k
views
How to align the text in textrect.center to the left?
I have some code that will blit text to the screen, but I can only align it to the, but I want it on the left.
Here is what i have right now:
smallText = pygame.font.Font('freesansbold.ttf', 25)
...
1
vote
1
answer
472
views
TypeError: Rect argument is invalid, but syntax looks fine
I had a function to draw a health bar, using a global variable to set the width of a green rectangle to cover a preset red one. When I changed my code to be able to have monsters actually damage the ...
0
votes
2
answers
28
views
Im trying to make a maths quiz on python but it says a speech mark is a Syntax Error
print ("Congratulations for Completing the School Subject Quiz.")
print (" ")
print ( name " Your score is " + score )
print (" ")
print ("Thank you ...
-1
votes
1
answer
344
views
How to save input from a text box to a variable in python? [duplicate]
I'm creating a simple game to try to learn pygame, and I currently have a game where the user controls a car and has to dodge trucks on a highway.
The game starts off pretty slowly, but I want to add ...
-4
votes
1
answer
63
views
how to use variebles in list[variable]
import sys
sort = [] #list
def myMax(mylist): # function instead of max()
listadd = 0
plus1 = listadd + 1
for listadd in range(a):
if sort[listadd] > sort[plus1, a]: # where i ...
0
votes
2
answers
308
views
How to see if a given array is between two arrays
I am using python 3.2.0 and numpy. I would like to check if one of the arrays is in between two other specified arrays. I would like it if you suggest a function or few of them together. Any help is ...
2
votes
1
answer
4k
views
How do you call a Function from a Variable? (Python)
Before you claim as a duplicate
I have looked at the following: python function call with variable
Calling a function of a module from a string with the function's name
Executing a function by ...
0
votes
1
answer
610
views
Django Migration: prevent base model creation after abstract inheritance
I am creating a BaseModel and inheriting it in Channel.This BaseModel would have more logic while performing save(). I am facing an issue while migrations are completed and tables are generated.
My ...
0
votes
1
answer
50
views
Index Error: list index out of ranged (python 3.2)
Me and my friends are working on a project at school and we understand why the error comes up but we can not see where we made that error. We are sure that we have counted it right and we know that in ...
1
vote
2
answers
994
views
pygame.mouse.get_pos() into two separate strings
I'm using pygame and am using the code pygame.mouse.get_pos(), but need to turn this into two seperate strings: one where x = the x coordinate, and one where y = the y coordinate. Thanks for the help.
8
votes
3
answers
2k
views
How to find the latest *compatible* version of a Pypi package?
On a production server, I am forced to use python3.2. Sadly several of my dependencies require >=python3.4.
Is there a way to find out what the latest version of a package is that can be used with ...
0
votes
0
answers
89
views
Calling a function when MP3 ends in pygame Python 3.2.1 Windows [duplicate]
I've hit a stand still in my python programming. Im looking at making a very basic GUI for a music player. I have got the program to play the sound, pause it and skip to next song but now i'm looking ...
0
votes
1
answer
89
views
How do you go to the beginning of an if statement in the else section? Python 3.2
The question is in the title: How do you go to the beginning of an if statement in the else section?
Code:
p1 = int(input())
if p1 <= 9 and p1 >= 1:
pass
else:
print('Invalid input. ...
0
votes
1
answer
568
views
unittest for both python 2 and 3
I'm struggling to make a unittest work in both 2.7.3 and 3.2.3 (the versions that come with ubuntu 12.04)
Basically the problems are:
I need to assertEqual strings that have unicode, so python2 uses ...
0
votes
1
answer
34
views
Loop malfunction
The loop of my programme does not fully work, there seems to be a logical error to where it prints out the outcome more then once, I want it to only print out the outcome once. I have researched alot ...
-2
votes
1
answer
34
views
Don't know why this code works (use alternative dictionary class with __missing__ method)
this question arises when i read the book "Python cookbook" by David Beazley, Brian K. Jones, in page 61, 62. I summarize:
>>> s = '{name} has {n} messages.'
>>> name = 'Guido'
>...
5
votes
3
answers
4k
views
Why does `(33).to_bytes(2, 'big')` return `b'\x00!'` instead of `b'\x00\x21'`?
I'm having a problem converting int to bytes in Python.
This works -
>>> (1024).to_bytes(2, 'big')
b'\x04\x00'
However this does not work as I would expect -
>>> (33)....
0
votes
2
answers
45
views
Specific Pip installation problems
I'm trying to install pip, but I need to install a version that is compatible with python 3.2 32 Bit.
I saw that pip versions above 8.0.0 removed support for Python 3.2. I need some help installing ...
5
votes
1
answer
5k
views
Can a Thread not be daemonized in python3.2?
I am running a script in python-3.2 on a Raspberry Pi 2 Model B
The thread looks like this:
myThread = threading.Thread(target=someFunction, args=(arg1,arg2,arg3),
daemon=True)
myThread....
3
votes
2
answers
7k
views
Install pip<v8 in python3.2
I fail to install pip in python3.2.
The newest version of pip (v8.x) seems to not support python3.2 any more.
So i tried: sudo python3 get-pip.py 'pip<8' but it still seems to install v8.x.
...
1
vote
0
answers
112
views
ipython installation on Python 3.2 32bit Windows
I downloaded ipython 1.x for Python 3.2.5 and copied extracted file to sitepackages folder in C drive. I went to command prompt and changed the directory to locate ipython folder and then issued '...
0
votes
2
answers
48
views
Communicating among functions
Here I have this code which calculates the distance a bouncing ball would travel. The problem lies in the functions display summary and the 3 functions that follow it. On line three while I am ...
2
votes
1
answer
131
views
Confusing name error
I have a question. I ran this program below and I got this unusual error that said that the name 'mean' is not defined. Here is the error:
Traceback (most recent call last):
File "C:/Python32/...
0
votes
1
answer
20
views
imported module.submodule namespaces interfering with eachother
So I'm pretty deep into making a custom job/process custom manager module, and when i got to integrating it I came across an interaction I hadn't seen before with modules and namespaces.
Code speaks ...
0
votes
1
answer
97
views
Any later versions of python 3 that are compatible with python 3.2.5?
my school told me to use python 3.2.5 for compatibility reasons as that's the version that they use, but I've found that a few modules I would like, don't work with python 3.2
I was wondering if ...
2
votes
1
answer
5k
views
Moving turtle according to the arrow keys [duplicate]
I am trying to make my turtle move according to the arrow keys on my keyboard. Does anybody know how to make a turtle in python 3.2.2 move according to the command of my arrow keys? By the way, my ...
4
votes
2
answers
9k
views
Change appearance of turtle
I am programming in python 3.2.2 turtle. I am able to make the turtle follow my cursor when I clack but now I have trouble changing the appearance of the turtle. In my code you will see a tank, and I ...
1
vote
2
answers
281
views
Running Python pip and easy_install throwing up errors
I'm tying to install a new package I have been recommended using either pip or easy_install and both are throwing up the below error and I can figure out why.
I have cleared the temp folder as ...
3
votes
1
answer
1k
views
Can't create virtualenv using Python 3.2. Whodunnit? Pip or setuptools or Python 2.7?
I can't properly install a Python 3.2 based virtual environment using virtualenvwrapper. I have hit a mystery wall and now I am looking for more options to solve my WHODUNNIT? predicament.
Some ...
1
vote
1
answer
52
views
Trouble with the 'or' operator with strings in Python 3.2 [duplicate]
I'm having some serious issues with getting the 'or' operator to work with strings in python 3.2
My code is similar to this:
def choose_colour():
cmd = input("Enter command here: ")
if ...
0
votes
1
answer
52
views
Character creator in Python issue
I'm having serious trouble solving hat seems like a really basic problem and I don't know why it won't work.
Basically, I'm making a character creator for a text based game and there's one part where ...
3
votes
1
answer
381
views
What kind of exception does Python 3.2 throw in case of [Errno 32] Broken pipe
I try to patch a library to catch [Errno 32] Broken pipe.
The library is coded to run in Python 2 and Python 3. In Python 2 the exception is a
socket.error: [Errno 32] Broken pipe
in Python >= 3.3 ...
0
votes
0
answers
123
views
Forgetting a text widget in python
root = Tk()
S = Scrollbar(root)
T = Text(root, height=4, width=50)
S.pack(side=RIGHT, fill=Y)
T.pack(side=LEFT, fill=Y)
S.config(command=T.yview)
T.config(yscrollcommand=S.set)
quote = """HAMLET: To ...
0
votes
2
answers
3k
views
Unable to install PIP for python on windows 8 pc
I have python 3.2 on my pc and i want to be able to run the following:
'pip install requests' and 'pip install selenium'.
To do this i know i need to install pip from here -> https://pip.pypa.io/en/...
1
vote
1
answer
260
views
Python list pop
I have a list called all_questions:
all_questions={
{
'question': "Mac and Pc share which of the following things:",
'answer1': "They are both expensive",
'answer2': "They are both Touch ...
23
votes
3
answers
9k
views
Why do I get "ImportError: cannot import name find_spec" when I start a new Django project?
I'm learning Python in tandem with Django. I initially installed Python 3 on my machine (Debian Wheezy), but read about possible conflicts and removed it with some difficulty.
Now I'm using ...
2
votes
1
answer
2k
views
How do I store the sound generated in this pyaudio stream into a WAV or MP3 file?
"""Play a fixed frequency sound."""
from __future__ import division
import math
from pyaudio import PyAudio
def sine_tone(frequency, duration, volume=1, sample_rate=22050):
n_samples = int(...
4
votes
0
answers
307
views
Why use concurrent.futures instead of multiprocessing pools? [duplicate]
I'm having trouble understanding why I would use the concurrent.futures module. The ProcessPoolExecutor seems comparable to the multiprocessing pool for processes, and likewise for the ...