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.
2,595
questions
-2
votes
0
answers
7
views
How does importlib.util.spec_from_file_location Python built-in method work?
Could someone please explain me what the below code is doing?
from importlib import util
spec = importlib.util.spec_from_file_location("module", "/path/to/file.py")
foo = importlib....
0
votes
0
answers
8
views
is there a way i can display a sprite with tsapp or pygame?
i am trying to create a tag game where it will become someones turn (randomly generated) and the tagger has to move there car to get the runner and the runner has to avoid them but i cant figure out ...
0
votes
0
answers
26
views
event loops wont work on this can some tell me why please
I have spent half of my eighth grade year on this and i cant even use an event loop can some please help me find out why i thought it wouldn't work because i had to get it out of the loop with a ...
0
votes
1
answer
23
views
How to select a random word from a txt file in python version 3.4?
**
I have a txt file called 'All_Words' and it consist of 2000 words and i'm making a hangman so i needed to choose a random word i've already thought of picking a random number from 0 to 2000 and ...
0
votes
0
answers
38
views
pip install failing with no error on private pypi and normal pypi
with and without a pip.ini file my pip install is failing. when running an individual pip install with -vvv I get this as the trace output, the output is the same when trying to pip install -r req.txt....
-1
votes
1
answer
21
views
Assign a object to the pointer the node is referring
class BinarySearchTree:
def __init__(self, value=None, left=None, right=None):
self.value = value
self.left = left
self.right = right
def insert(self, value) -> ...
0
votes
0
answers
34
views
Unable to play song using playsound
When I want to play a song using the python module 'playsound' it does not work. I don't know what is the problem here, I have no idea about this.
File "C:/Users/AMRUT/Coding/languages/MyPython/...
0
votes
1
answer
90
views
Python program I wrote in python3.7/Windows 7 won't run in Windows XP
I wrote a python 3.7 script under Windows 7 and compiled it using auto-py-to-exe. I can run the .exe with no problem in my computer but when my co-worker tries to run it under Windows XP there is an ...
0
votes
0
answers
162
views
Python multiprocessing and KeyboardInterrupt during spawn phase
My challenge is to handle KeyboardInterrupts / CTRL+C during the spawn phase of multiprocessing processes.
I wrote a program to discover hosts on a network by simultaneously ping them to be fast. I ...
1
vote
2
answers
101
views
Python3.4 convert int16_t string to signed float
I apologise if this question has already been answered here. My searches have turned up similar questions but I have been unsuccessful in applying them to my situation.
I receive data via serial ...
-4
votes
2
answers
34
views
Identifying and recording data from screen [closed]
I am new to coding and I might be in over my head. I want to write a program that automatically generates the best optimal in-game choice for me to make. I can manage the calculations, but I need a ...
-4
votes
2
answers
81
views
I can't run a while loop in Python 3.9
So I am a beginner in python and I have found a book about its basics. The book is based on python 3.4. The book is trying to teach me while loops. When I try to enter the code which is:
counter = 5
...
0
votes
1
answer
939
views
Python3.4 installation erroring out on MacOS Big Sur
After installing python 3.4.3 and on running the command python3.4, it gives an error:
dyld: Library not loaded: /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
...
0
votes
3
answers
494
views
.bat file doesn't work | Shows invalid syntax when .bat file is run | Python 3.4.0
The .bat file:
@py C:\Users\Universal Sysytem\Desktop\Python Scripts (Automate the Boring Stuff)\Automate the Boring Stuff with Python\TestProgram(.bat batch file and shebang line usecase).py %*
@...
0
votes
1
answer
61
views
Why do different python versions have different behaviors on stand output print?
The Python 3.4 and Python 3.8/3.9 are different when I try execute below statement:
print('\u212B')
Python 3.8/3.9 can print it correctly.
Å
Python 3.4 will report an exception:
Traceback (most ...
0
votes
0
answers
164
views
RuntimeError: Python 3.5 or later is required while doing any kind of PIP operation
I am new to python, started to learn a week ago. I installed Python 3.4.
Installed Eclipse and Pydev and configured the environment.
My current task is to communicate to an instrument, I downloaded ...
1
vote
0
answers
868
views
PIP RuntimeError: Python 3.5 or later is required
I have been trying to install PIP on my python 3.4.0 on windows but none of the solutions work. I have tried python get-pip.py pip==19.1 and getting get-pip.py from https://bootstrap.pypa.io/3.4/get-...
1
vote
2
answers
53
views
I defined my funtion but it wont run. why not?
My function that asks the user to input a 7 character number. but when i define it, it wont run. reason why? any help is appreciated.
def eticketNum():
while True:
eTickNum = input('please ...
0
votes
0
answers
565
views
Python3 -- 256 AES decryption and encryption + brute force is what I am attempting to acheive. Why am I running into an error?
The Error Is:
** Traceback (most recent call last): File "256AESKeyCracker.py", line 10, in cipher = AES.new(key,AES.MODE_EAX) AttributeError: module 'Crypto.Cipher.AES' has no attribute '...
2
votes
1
answer
79
views
Python 3.4 Syntax error and how to fix it
While the following line is accepted on Python 3.6, On Python 3.4 I am getting a syntax error:
struct.pack_into('q' * len(GeoFence_lat_list)*2,buff,264,*GeoFence_lat_list, *GeoFence_lon_list)
Where ...
1
vote
3
answers
178
views
Unable to install pip package on Python3.4.0 windows 7 64 bit
I am using the command python -m pip install on the python34 folder but its giving me the following error:
Error while finding specs for 'pip._main_'{<class attribute error'>: 'module' object ...
0
votes
0
answers
103
views
Python3.4 venv - Global packages included
I'm using a project where python3.4 is required for some other dependencies.. Downloaded version 3.4.10 from python.org, installed it and it works fine. Then I'm creating a Pyhthon3.4.10 venv and ...
0
votes
0
answers
125
views
Error when creating new environment with python 3.4 in Anaconda
I'm trying to set up a Anaconda environment with Python=3.4 but I have been having a hard time to do it.
I have tried it with and without default packages
(base) C:\Users\Fabio Diuana>conda create -...
0
votes
1
answer
259
views
Pandas corresponding column values when using min
I am having a dictionary-like below. I want to find the minimum by age and need to find the corresponding first name and last name of it.
[ {
"firstname": "abc",
"...
3
votes
1
answer
114
views
How to play only one music file in pygame?
I've loaded 2 music files as a wav into my program, but when I do pygame.mixer.music.play(-1) it plays both over the top of each other, but I only want one to play, and then the other at another time.
...
0
votes
1
answer
216
views
Starting a new line of text in pygame
How would I make it so that I can start a new line of text with pygame? For example if I have a variable and it has lots of text that doesn't all fit on the screen, how can I make it so that it ...
1
vote
1
answer
55
views
How to add an object according to a variable?
I was wondering how would I add "thing" (name of object) onto the screen each time the "dodged" (score) increases by 1? So I would want the number of "things" to be equal ...
0
votes
1
answer
153
views
Can't downgrade Python 3.4's sqlite3.sqlite_version on Ubuntu 20.04 via pyenv to run tox test
Setup:
Ubuntu 20.04
Pyenv
libsqlite3-dev v3.31.1
I'm trying to downgrade sqlite3.sqlite_version for Python 3.4 to run some tox tests, and am having no luck. I'm on Ubuntu 20.04. I was able to ...
1
vote
0
answers
96
views
How to handle Spring Security Authentication popup in Robot framework
How to feed the Username and password values in Spring security authentication Popup using Robot framework(python,selenium),as html body is blank and i am unable to inspect the elements of the popup....
1
vote
3
answers
6k
views
How to downgrade Python 3.6.9 to 3.4.x on Ubuntu 18.04?
Ubuntu 18.04 comes with Python 3.6.9 by default. In order to run a project, I need to install Python 3.4.x. Is there a way to downgrade Python 3.6.9 to 3.4.x? Many thanks in advance!
0
votes
1
answer
34
views
Refer output to hashtable : Error Handling
How can i handle the error if the key is not available in eqType
i mean like if its not in the eqType dict then return the equip['type'] value
eqType ={
10023: 'ONT-SFU',
10040: 'OLT1T3',
...
0
votes
1
answer
1k
views
pip doesn't work after upgrade on Python 3.4 (Windows 10). How to downgrade?
I upgraded pip on Python 3.4 to last version (20.1.1) and new pip doesn't work with message
RuntimeError: Python 3.5 or later is required
How to return back old version of pip?
I can't upgrade ...
0
votes
1
answer
285
views
How to get $0 value in Webbot using python
Please find below code am trying to get Seller Proceeds value in Website, but it has $0, when i tried in console $0.value am getting 598.08 but am getting Calculate when i tried using this
sel_proc = ...
0
votes
0
answers
38
views
Can a Python program with a file run on any computer?
I'm at the very start of my journey of Python learning.
We were given a .csv file for an assignment. I wrote the program, it's working fine but I have to send my program to my professor.
The ...
2
votes
6
answers
506
views
How to print two lists of different size side by side?
I have two lists of different length that I want to print side by side, separated by a tab. As an example:
a_list = ["a","b","c","d","e"]
b_list = ["f","g","h","i","j","k","l","m","n"]
I tried:
...
0
votes
1
answer
40
views
Fetch hourly data
I am calculating the hour delta as below
ct = time.time() * 1000 // milliseconds
pt = ct - (1000*60*60*1) // 1 hour
The above code will give me the hour timestamp. How can I use the above code to ...
0
votes
1
answer
515
views
How to install additional pip for python3.4?
I usually use python 3.7 on my ubuntu but in order to run a brainfuck jupyter notebook (from https://github.com/robbielynch/ibrainfuck) I need to run python3.4. So I installed python3.4 using
wget ...
0
votes
1
answer
2k
views
Ignoring ensurepip failure: pip requires SSL/TLS - Python 3.4.X with pyenv on OS X
I am trying to install python version 3.4.10 via pyenv but I get the error Ignoring ensurepip failure: pip 9.0.1 requires SSL/TLS. For python versions after 3.4.10 (e.g.: 3.5.9), it did succeed ...
0
votes
2
answers
2k
views
builtins.NameError: name 'answer' is not defined
This is the problem that I was getting.
I know I have to define answer globally, and I did it.
I don't know where did I do wrong.
Here is the part of code I wrote.
Please help me with this, I've just ...
0
votes
1
answer
91
views
How to install justext package using Conda install when virtual environment is created?
I created virtual environment for python 3.4 version.I cant able to use pip from my network. I cant able to download files even. So i created virtual environment and started to install packages using ...
0
votes
1
answer
444
views
How would you delete a specific row without using panda in Python 3.4.4?
I've tried to find ways to delete a selected row but the only way I could do so is with panda.
What I want to do is to delete an entire row that matches with the csv library (errors are fine since I'...
1
vote
3
answers
118
views
Create Multiple Python Dictionaries from a List?
I am having a difficult time splitting an LDIF file with thousands of entries into multiple dictionaries. For example, my LDIF file looks like:
dn: value
ou: value
objectClass: value
entryUUID: value
...
-1
votes
1
answer
124
views
tkinter button different command for loop in dictionary not working [duplicate]
I'm using a dictionary to store my buttons as you can see in the main method. The 'self.tables' is a list with the names of tables. Therefore 'i' in the for loop is the name of a table, which is shown ...
1
vote
1
answer
61
views
Iterate dictionary parallelly to reduce processing time and improve performance
I am having a dictionary like this:
{
"ABC": {
"Name": "ABC",
"dates": {
"2019-12-13": [
{
"Status": "P"
},
{
"Status": "A"
}
...
1
vote
1
answer
267
views
Decode cp1252 stdout with umlauts
I want to list the services running on the local Windows machine. For that, I am using this code:
with Popen(["net", "start"], stdout=PIPE, stderr=PIPE) as p:
stdout, stderr = p.communicate() # ...
-2
votes
1
answer
115
views
How to Print a string from a specific line in a text file based off if my input exists in an alternate text file
I am making a program that is almost like a chatbot. That being said, there are 3 modes to it: menu mode, teach mode, and chat mode.
In teach mode, it asks for the user to enter some input (ex. what ...
2
votes
0
answers
209
views
Python: Variable type annotations and default initialization to None
I am refactoring a small codebase from Python 2 to 3 (3.4 specifically), and one of the ways I can make the codebase better and more maintainable is by solving all the little PEP based complaints that ...
0
votes
1
answer
135
views
How do i multiply certain elements in a list by 0?
I am wondering how i would multiply certain items in a list to 0 to make the list blank again. I need to do this because of a round system I have implemented into my code.
totalround1 = [coupleAtotal ...
0
votes
1
answer
55
views
Onekeypress AttributeError?
(Python 3.4, in Windows XP Professional)
In a turtle program that I started recently, Onekeypress doesn´t work. I tried other things like "onekey" or "onekeyrelease", but they don´t work either. It ...
0
votes
1
answer
112
views
Variable type annotations leading to warnings
I'm new to Python development, and trying to get a fix on things. I am using Pycharm for development. I am currently trying to annotate the types of variables for easier access with autocompletion and ...