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

unable to upload autopy in python-VSCode in windows 10

C:\Users\SB>pip install autopy Defaulting to user installation because normal site-packages is not writeable Collecting autopy Using cached autopy-4.0.0.tar.gz (20 kB) Preparing metadata (setup.py) ... done Using legacy 'setup.py install' for…
-1
votes
1 answer

i want to load text from a file and arrange the text 4 words on each line

i want to load text from a file and arrange the text 4 words on each line with open(text_file, 'r') as f: size_to_read = 100 lines = f.read(size_to_read) while len(lines) > 0: print(lines, end="") …
-1
votes
1 answer

Is there a way to test the results of an os.system() command in Python?

This is not an exact copy of my code, but it's the only idea I have regarding going about this: import os import re while True: com = input() if com == "break":#Doesn't matter break run = os.system(com) if run == "'" + com…
user18209545
-1
votes
1 answer

How can I install flask-mysqldb on Python 3.9 on Linux?

I tried installing the package flask-mysqldb on Pop!_OS 20.04. Below is the command I ran and the error I got: [user]@[host]:~$ python3.9 -m pip install flask-mysqldb Defaulting to user installation because normal site-packages is not…
manyet1k
  • 23
  • 1
  • 5
-1
votes
1 answer

Time limit exceeded(TLE) Error in Python code

I'm trying a code on Hackerearth which is to Find special number. A number n is said to be special if the sum of its digits is divisible by 4 For a given integer a, find a number such that: n is a special number, n>=a, n is minimum possible. I have…
-1
votes
1 answer

Typehint generic type variable

How can I typehint that something should have the same type as earlier? def mymap(xs: [T], func: T -> V): -> [V]: return [func(x) for x in xs]
theonlygusti
  • 11,032
  • 11
  • 64
  • 119
-1
votes
1 answer

Is there a function in python 3, that returns a pixel size of .bmp file? (not using special library)

I have a white-small.bmp file (32 x 32 px) and i need to get its pixel size to use it later in code. I wonder if there is a function for example: get_size_of_bmp('white-small.bmp') which returns int: 32*32 which is 1024 or list [32, 32], (1024 is…
-1
votes
1 answer

Even after install the panadas I am unable to use it

after using the command: pip install pandas this is the message I got: Requirement already satisfied: pandas in c:\users\pathu\appdata\local\packages\pythonsoftwarefoundation.python.3.7_qbz5n2kfra8p0\localcache\local-packages\python37\site-packages…
MadNit
  • 13
  • 2
-1
votes
1 answer

python launch.json file not passing

enter image description here I upgraded from python 3.10 to pyton 3.9 and got this error what is the solution
sankadel
  • 9
  • 2
-1
votes
1 answer

What is the difference between cv2.videocapture(1) and cv2.videocapture(0)?

import cv2 cap= cv2.VideoCapture(0) while True: ret,frame= cap.read() cv2.imshow('Our live sketch',frame) if cv2.waitKey(1)==13: break cap.release() When I use cv2.VideoCapture(1), the programs shows error but the program…
-1
votes
1 answer

Why do I get a "unterminated quoted string at or near" error using python postgresql, and not in pgadmin, whith the same request?

I have this query : INSERT INTO lytnobjects.devices (id,idedge,uniqueref,constructeur,ipaddress,macaddress, hostname,devicetype,isfirewall,isvisible,iscorporate, …
Jmcambot
  • 19
  • 6
-1
votes
1 answer

pyinstaller isn't converting (or generate a corrupted exe) when pwn package is imported

i am working on reverse shell project using pwn as Client/Server instead of using socket because it's more comfortable in receiving (recvuntil) messages ,but when ever i tried to convert it to EXE using pyinstaller to onefile it ended up failing ,…
YCS VENOM
  • 1
  • 2
-1
votes
2 answers

Python3 Merge two dictionaries based on sub dictionaries keys w/o for loop

Maybe this is impossible but without a for loop through each key in a given dictionary merge the two based on the key in the dictionary Given : dict1 = { 'APPL' : { 'cp': 1, 'sed': 'bull'}, 'BAC' : { 'cp': 1, 'sed': 'bull'}} dict2 = { 'APPL' : {…
-1
votes
1 answer

How to webscrape virustotal to get results python

I want to get my scan's malicious detections thru Python bs4 here is my scan result the code and what I want my scan result to show: What I've wanted: 8 Scan Result Code: import requests from bs4 import BeautifulSoup headers = {'User-Agent':…
-1
votes
1 answer

How to Make calculator With out if else?

I tried to make a calculator in python with out if else statements . i can't find how to fix a issue in present code def add(n1, n2): return n1+n2 def sub(n1, n2): return n1-n2 def mul(n1, n2): return n1*n2 def div(n1, n2): return…
Abdul Haq
  • 62
  • 1
  • 7