Questions tagged [python-3.9]

A version of the Python programming language, first released on October 5, 2020. This tag is for issues that are specific to Python 3.9. For general questions use the more generic [python] and [python-3.x] tags.

3.9 was released on October 5, 2020 (PEP 596).


Use this tag if your question is specifically related to Python 3.9. Otherwise, use the following guidelines to determine which tag(s) you should add to your question:

  • If your question applies to Python in general, use only the tag.
  • If your question applies to Python 3.x but not to Python 2.x, add the tag .
  • If you aren't sure, tag your question with and mention which version you're using in the post.

References

1128 questions
-1
votes
1 answer

Terminal shows wrong version of Python after fresh installation on M1 Mac

I downloaded Python 3.9.7 universal2 installer and installed Python on my M1-chip MacBook. Note that this was the first Python installation on this machine except for Apple-provided Python 2.7.16. Then after running python3 --version line in the…
yol
  • 19
  • 6
-1
votes
1 answer

Printing out spreadsheet data

I want to print some data from spreadsheet. I decided to use python. How can I call out a "Print preview"? For example like this: I tried something like this: os.startfile('test.txt', 'print') but it doesn't make a print preview. I am using Python…
-1
votes
1 answer

How to use the right python command line to run the write version

I recently installed python3.9.6 on kali linux and it all seemed to work but when enter python3 on the terminal it shows python3.9.2, not python3.9.6 . Also when I type python its shows python 2.7.2 . I want to type in python, python3, or python3.9…
-1
votes
1 answer

Resolve list of strings as respective objects

I have a list containing [bool, "string of function name", ["parameters","to","pass"]] but when I pass them, they don't resolve to anything but their string values. The actual project is around 900+400 lines already so for brevity and sanity I have…
Chokehold
  • 67
  • 7
-1
votes
2 answers

How to check if a global variable exists and if not then define it as global?

I wish to do : if var not in globals(): global var var = -1 or try : var except NameError : global var var = -1 The problem is : global var ^ SyntaxError: name 'var' is used prior to global declaration So what can be done to…
-1
votes
1 answer

how to compile pygame in python 3

I don't know exactly the Error of this code I didn't get any Error but my code doesn't execute. when I ran my code just I saw the rect's code run and after runing just I saw yellow rectangel in screen, the code-related print text doesn't…
-1
votes
1 answer

Python-Tkinter trying to delete a label

import time import tkinter from tkinter import * import tkinter as tk stonestotal = 0 def metricimperial(Amount): Amount = stonestotal.get() global gramstotal gramstotal = Amount * 0.00220462 print(gramstotal) final() def…
benjamin
  • 9
  • 1
-1
votes
1 answer

im getting a logical error, how can i fix this?

n = int(input("Enter N number : ")) a = list(map(int,input("\nEnter the numbers : ").strip().split()))[:n] print("\nList is : ", a) list1=a list1.sort() print("Smallest element is:", min(list1)) print("Largest element is:", list1[-1]) def…
-1
votes
1 answer

y.append(sum(x)) modifies x array by adding sum of x array to x array and i don't know why

So bascially I want to have one array(result) to which I add sum of the second array (array) but when I try to add to result sum of array it adds to array what should be added to result def some_function(signature, n): array = result =…
mackotron
  • 1
  • 1
-1
votes
1 answer

TypeError: unsupported operand type(s) for -: 'datetime.datetime' and 'str'

I am trying to build a network monitor using python that continually monitors internet connectivity by sending ping requests to an external resource. It also keeps logs of when the internet is down and the duration of the downtime. While running…
AG1
  • 1
-1
votes
2 answers

Type Error : Unhashable type: 'slice' [python] [dictionaries]

os.chdir("Güvenlik_Hesaplar") files = '' dictionary = {} ant = os.listdir() dict_number = 1 i = 0 while i < len(ant): # If the variable 'i' is less than the length of my files dictionary["{}" : ant[i].format(dict_number)] #e.g = '1':…
Baris_Ertan
  • 23
  • 1
  • 5
-1
votes
1 answer

How do I see the code for python 3.9's math functions?

I'm a beginner programmer trying to code my own version of python 3.9's math.sqrt(), just for fun and as a little challenge. The math.sqrt() is much faster than anything I've created, so I'm curious how the developers created the function. Is there…
nicola
  • 1
-1
votes
1 answer

'int' object has no attribute 'output'

This may be a silly question. I just created a function that divide a number and give remainder if the number is even else do some other mathematical operations in python. def collataz(number): if number % 2 == 0: output = number // 2 …
Alt_2003
  • 17
  • 3
-1
votes
2 answers

Virtual assistant python

Hello everyone I am trying to develop a virtual assistant which will help me with some projects so I am trying to get the basics for the final project however I get an error (UnboundLocalError: local variable 'command' referenced before assignment)…
-1
votes
1 answer

I have python 3.9 and i want to create virtual environment with python 3.7

Just installed kali 2021.1 and it has python 3.9. I need virtual environment of python 3.7 but its not being created. Tried to install 3.7 from deadsnakes repo with ppa but its saying no release file. I want to create a virtual environment with…