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
3
votes
1 answer

How do you open a submenu automatically in a tkinter menu?

I know that menu.tk_popup() can be used to open a context menu at a certain coordinate, but don't know how to open a submenu out of it too, if that makes sense. This is the code I made: import tkinter as tk root =…
3
votes
2 answers

How do I install Tensorflow 2.4.0?

Noob question. Thanks for bearing with me. I have Tensorflow 2.4.1 installed on my computer, but I need 2.4.0 version for compatibility with a specific project. I tried the following without success: conda install tensorflow==2.4.0 conda install -c…
Jim O.
  • 1,091
  • 12
  • 31
3
votes
1 answer

Python: what does Thread.is_alive *exactly* mean?

In Python 3.9.10, I am stumbling on the following very unsettling behaviour: class MyThread(threading.Thread): def run(self): liveness = self.is_alive() logging.debug(f"Am I alive? {liveness}") # prints FALSE!!! ... #…
fonini
  • 2,989
  • 3
  • 21
  • 39
3
votes
1 answer

Union for dictionaries at a key

I have two dictionaries that I'm trying to perform a union based on a key within the "dta" dictionary. dta = { "msg": { "success": "This was a successful email sent on 01/26/2022 at 11:44 AM" }, "detailType": { …
SpindriftSeltzer
  • 322
  • 3
  • 12
3
votes
1 answer

make error in conda env need libpython3.9.a but only have libpython3.9.so

I'm using centos7 and latest anaconda release with python3.9 to build a web server, but pip install uwsgi returned an error: "libpython3.9.a" not found. Only "libpython3.9.so" was provided by anaconda3. Seems that there are some solutions for macos…
Denghao Li
  • 33
  • 3
3
votes
2 answers

Why are python sets "sorted" in ascending order?

Let's run the following code: st = {3, 1, 2} st >>> {1, 2, 3} st.pop() >>> 1 st.pop() >>> 2 st.pop() >>> 3 Although sets are said to be unordered, this set behaves as if it was sorted in ascending order. The method pop(), that should return an…
mykhailohoy
  • 442
  • 4
  • 15
3
votes
0 answers

No module named 'pywintypes'

so as the title says, I can't import pywintypes. I read through all the existing questions but failed to find a solution that works. Here's my setup: Python install: C:/Users/Username/AppData/Local/Programs/Python/Python39 Pip install directory:…
3
votes
2 answers

Remove emoji from string doesn't works for some cases

I am working on some data received from google big query which contains some special emoji in the data. I have a code that removes the emoji but it is not working for below specific emoji. sample code that removes all emoji but not for the below…
Binit Amin
  • 481
  • 2
  • 18
3
votes
0 answers

How to use pycdc for python 3.9.x

I am trying to decompile some .pyc files and after some research, I found that the only usable tool for python 3.9 is pycdc (uncompyle6 and decompyle3 are only supported up to 3.8), though I can't seem to get it to work, I tried bin\pycdc…
Zeperox
  • 196
  • 2
  • 13
3
votes
1 answer

Issue while creating Foreign Key constraint

Issue Details 'Can't create table django.clientauth_tblusers (errno: 150 "Foreign key constraint is incorrectly formed")') What am I doing? I created a tinyint auto increment field below but when referencing it in another table causing issue. Code…
Pankaj
  • 9,749
  • 32
  • 139
  • 283
3
votes
1 answer

AWS Lambda Doesn't Have A Python3.9 Runtime Context When Running Terraform Plan?

The specific error in question is Error: expected runtime to be one of [nodejs nodejs4.3 nodejs6.10 nodejs8.10 nodejs10.x nodejs12.x nodejs14.x java8 java8.al2 java11 python2.7 python3.6 python3.7 python3.8 dotnetcore1.0 dotnetcore2.0 dotnetcore2.1…
AlexLordThorsen
  • 8,057
  • 5
  • 48
  • 103
3
votes
1 answer

How add circle markers to a rendered folium map embedded in a QWebEngineView?

I want to develop a desktop application that involves receiving a geographic coordinate every second from a serial port and adding to a map in real-time. The map should look like the below link: I have written a piece of code to test Folium's…
Amir
  • 65
  • 1
  • 2
  • 7
3
votes
0 answers

Linting to enforce PEP-585

I'd like to be able to run some linting that fails if my code uses from typing import List x: List[str] instead of x: list[str] for example. I currently use mypy, so ideally there'd be some way to achieve this with that.
UtterlyConfused
  • 983
  • 1
  • 10
  • 18
3
votes
1 answer

What is the purpose of bitwise_or in Python PEG?

What does bitwise_or mean in PEG grammar? More accurately, there are lots of bitwise_or in contexts where it's not even parsing for | yet there are occurrences. Does bitwise_or serve any other purpose in PEG other than being the | in Python? Example…
Shreyan Avigyan
  • 183
  • 1
  • 11
3
votes
1 answer

In python 3.9+, how to write a type alias for the builtin tuple type with ellipsis? (mypy bug?)

Short version tuple[int, ...] is a valid type in python 3.9+ but mypy rejects a type alias for that. E.g. consider: Thing = tuple[int, ...] This results in "error: Unexpected '...'" (though python itself will load the module just fine). Is this a…
gimboland
  • 1,926
  • 2
  • 19
  • 28