Trending questions in Python

0 votes
3 answers

How do I use raw_input in Python 3?

raw_input() was renamed to input() in Python 3. Another example ...READ MORE

Jan 4, 2021 in Python by Carlos
• 5,152 views
0 votes
0 answers

Python error ValueError size needs to be int width int height while using pygame Surface

I'm trying to make a game on ...READ MORE

Apr 19, 2021 in Python by anonymous

edited Mar 4, 2025 • 728 views
0 votes
0 answers

The program will input a string then display all the letters used in the input with their corresponding number of occurrences in the input.

Sample: Input a String: This is FUN. ...READ MORE

Apr 18, 2021 in Python by anonymous

edited Mar 4, 2025 • 739 views
0 votes
0 answers

How to edit a data frame series

I have the below series in a ...READ MORE

Apr 17, 2021 in Python by Edureka

edited Mar 4, 2025 • 746 views
0 votes
1 answer

How to compare two JSON objects with the same elements in a different order equal?

Hello @kartik, If you want two objects with ...READ MORE

Aug 7, 2020 in Python by Niroj
• 82,800 points
• 11,536 views
0 votes
1 answer

How to convert CSV file to JSON file using Pandas?

Hi@akhtar, You can convert your CSV file to ...READ MORE

Jun 25, 2020 in Python by MD
• 95,460 points
• 13,311 views
0 votes
1 answer

How to terminate a python script?

This can be done by importing the ...READ MORE

Aug 9, 2019 in Python by Arvind
• 3,050 points
• 27,180 views
0 votes
1 answer

How to Install Python packages from local file system folder to virtualenv with pip?

Hello @kartik, You can try the code below: pip ...READ MORE

May 12, 2020 in Python by Niroj
• 82,800 points

edited Oct 7, 2021 by Sarfaraz • 15,241 views
0 votes
0 answers

E: Error, pkgProblemResolver

Good day Please excuse my ignorance as I ...READ MORE

Apr 14, 2021 in Python by gurowar

edited Mar 4, 2025 • 696 views
0 votes
1 answer

Python and pip, list all versions of a package that's available?

The script at Pastebin does work. However, ...READ MORE

Nov 22, 2020 in Python by Gitika
• 65,730 points
• 6,809 views
0 votes
0 answers

No 'Id' in the results of the Orderdict although id field is present in the serializers in Django Rest Framework

I tried to create an update api ...READ MORE

Apr 11, 2021 in Python by anonymous

edited Mar 4, 2025 • 758 views
0 votes
1 answer

How to disable a method in a ViewSet, django-rest-framework

Hello @kartik, You could keep using viewsets.ModelViewSet and define http_method_names on your ...READ MORE

Jun 26, 2020 in Python by Niroj
• 82,800 points
• 13,228 views
0 votes
0 answers

I have a SQS queue when message arrives into queue needs to trigger lamda function and send mail to respective customer

S3 --> SQS --S3 Transfer I need to ...READ MORE

Apr 12, 2021 in Python by JAKIR

edited Mar 4, 2025 • 656 views
0 votes
1 answer

How to perform HTML decoding/encoding using Python/Django?

Hello, For html encoding, there's cgi.escape from the standard library: >> ...READ MORE

May 7, 2020 in Python by Niroj
• 82,800 points
• 15,339 views
0 votes
1 answer

Error: No module named 'django.core.urlresolvers'

Hello @kartik, If you want to import reverse, ...READ MORE

Aug 5, 2020 in Python by Niroj
• 82,800 points
• 11,404 views
0 votes
1 answer

Python: ImportError: No module named Crypto.Cipher

Seems like the pycrypto package is not ...READ MORE

Jul 31, 2019 in Python by Hari
• 27,415 views
0 votes
1 answer

React native for frontend and python is for backend app development it is possible??

Hello @Rithika , Yes, it is possible. For example, you ...READ MORE

Oct 30, 2020 in Python by Niroj
• 82,800 points
• 7,647 views
0 votes
1 answer

What is the purpose of ​#!/usr/bin/python​on the first line in the above code?

Hey, @Roshni, By specifying #!/usr/bin/python you specify exactly ...READ MORE

Jun 23, 2020 in Python by Gitika
• 65,730 points
• 13,216 views
0 votes
1 answer

How do I install a Python package with a .whl file?

I just used the following which was ...READ MORE

Nov 20, 2020 in Python by Gitika
• 65,730 points
• 6,729 views
0 votes
1 answer

Error is '<' not supported between instances of str and int

your dis is obviously not 1.13, it's ...READ MORE

Nov 15, 2020 in Python by Gitika
• 65,730 points
• 6,889 views
0 votes
0 answers

speech_recognition modulehas not working "audio = r.listen(source)" function.how to make it work?

def command1():          r=sr.Recognizer()     with sr.Microphone() as source:         print(random.choice(m))         r.puase_thresshold=1         sound=r.listen(source)     try:         com =r.recognize_google(sound,language='en-in')         print('user:'+ com ...READ MORE

Apr 7, 2021 in Python by python

edited Mar 4, 2025 • 776 views
0 votes
2 answers

what path should I give to the url for showing a pop up when clicking on "more info" button in django?

I think u can use the bootstrap ...READ MORE

Dec 29, 2020 in Python by Carlos
• 4,916 views
0 votes
0 answers

how do i Itterate trough a dictionary for a specific key, then ading it to a new dictionary

i know this is a noob question ...READ MORE

Apr 7, 2021 in Python by Said

edited Mar 4, 2025 • 701 views
0 votes
0 answers

How to save a file to particular folder using selenium webdriver Chrome?

I'm using selenium webdriver for chrome. My ...READ MORE

Apr 6, 2021 in Python by Pushpa

edited Mar 4, 2025 • 670 views
0 votes
1 answer

How to send a correct authorization header for basic authentication

Hello @kartik, Here is how to do Basic ...READ MORE

Aug 13, 2020 in Python by Niroj
• 82,800 points
• 10,747 views
0 votes
1 answer

How to get the latest file in a folder using python?

Hello @kartik,  would suggest using glob.iglob() instead of the glob.glob(), as ...READ MORE

May 27, 2020 in Python by Niroj
• 82,800 points
• 14,084 views
0 votes
1 answer

Import error: No module name urllib2

As stated in the urllib2 documentation: The urllib2 module has been split ...READ MORE

May 11, 2020 in Python by Niroj
• 82,800 points
• 14,724 views
0 votes
1 answer

How do I update pip itself from inside my virtual environment?

Hello, pip is just a PyPI package like any other; you ...READ MORE

Nov 20, 2020 in Python by Niroj
• 82,800 points
• 6,395 views
0 votes
1 answer

What is `related_name` used for in Django?

Hello @kartik, The related_name attribute specifies the name of the ...READ MORE

Jun 26, 2020 in Python by Niroj
• 82,800 points
• 12,743 views
0 votes
2 answers

Deleting DataFrame row in Pandas based on column value

Pandas provide data analysts a way to ...READ MORE

Jan 4, 2021 in Python by Nikita
• 4,391 views
0 votes
0 answers

How to solve the error of Cant execute the script.

Hey!, I am new to python i ...READ MORE

Mar 31, 2021 in Python by anonymous

edited Mar 4, 2025 • 762 views
0 votes
1 answer

Everything in python is object?

In object-oriented programming languages like Python, an ...READ MORE

Jul 30, 2021 in Python by Rachana priyadarshni samal

edited Mar 5, 2025 • 1,828 views
0 votes
0 answers

How to fix AttributeError: 'Turtle' object has no attribute 'xcore'

# setting up the screen import turtle import math wn ...READ MORE

Mar 30, 2021 in Python by Dembabe

edited Mar 4, 2025 • 721 views
0 votes
0 answers

How can store list of id in foreign key django ?

I am trying to store multiple product ...READ MORE

Mar 27, 2021 in Python by usman

edited Mar 4, 2025 • 838 views
0 votes
1 answer

how to solve the error : "ImportError: No module named Tkinter" in python.

Hi@Umama, If you are using Linux system, then ...READ MORE

Apr 27, 2020 in Python by MD
• 95,460 points
• 16,084 views
0 votes
1 answer

Difference between end and sep

end and sep are optional parameters of ...READ MORE

Jul 30, 2019 in Python by Wajiha
• 1,960 points
• 26,947 views
0 votes
1 answer

Running shell command and capturing the output

Modern versions of Python (3.5 or higher): run If ...READ MORE

Dec 28, 2020 in Python by Gitika
• 65,730 points
• 4,600 views
0 votes
1 answer

how do i print only the last two letters in a string using regular expression in python?

S1="string1" S1[-2::] Output: g1 READ MORE

Jan 5, 2023 in Python by anonymous

edited Mar 5, 2025 • 2,792 views
0 votes
1 answer

How to save a Pandas Dataframe to a pickle file?

Hi@akhtar, Python pickle module is used for serializing ...READ MORE

Oct 18, 2020 in Python by MD
• 95,460 points
• 7,684 views
0 votes
1 answer

How to avoid missing module docstring in pylint?

Either write your docs or use a ...READ MORE

Nov 6, 2020 in Python by anonymous
• 65,730 points
• 6,827 views
0 votes
1 answer

Importing files from different folder in python.

By default, you can't. When importing a ...READ MORE

Dec 20, 2020 in Python by Nikita
• 4,928 views
0 votes
1 answer

How to return custom JSON in Django REST Framework?

Hello @kartik, There are 2 ways to custom ...READ MORE

Jun 25, 2020 in Python by Niroj
• 82,800 points
• 12,563 views
0 votes
0 answers

how can I fix this problem AttributeError: '<invalid type>' object has no attribute 'title' on line 11 in main.py

The section I'm having trouble with is ...READ MORE

Mar 25, 2021 in Python by anonymous

edited Mar 4, 2025 • 773 views
0 votes
0 answers

error install mysqlclient on windows

i have that error (dont find answer) ...READ MORE

Feb 7, 2021 in Python by anonymous
• 120 points
• 2,758 views
0 votes
1 answer

Error:django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: No module named MySQLdb

Hello @kartik, It looks like you don't have ...READ MORE

Jun 24, 2020 in Python by Niroj
• 82,800 points
• 12,508 views
0 votes
1 answer

Error like “Your CPU not supported AVX , AVX2”

Cpu avx2 nahi hai kiya kare READ MORE

May 31, 2021 in Python by anonymous

edited Mar 5, 2025 • 2,683 views
0 votes
0 answers

How to read file and match string from content and then download S3 file

I have multiple files in an S3 ...READ MORE

Mar 24, 2021 in Python by Shivam

edited Mar 4, 2025 • 661 views
0 votes
1 answer

Error: Catch a thread's exception in the caller thread in Python

The problem is that thread_obj.start() returns immediately. The child ...READ MORE

Nov 2, 2020 in Python by Gitika
• 65,730 points
• 6,745 views
0 votes
1 answer

How to return None if Dictionary key is not available

Hello @kartik, You can use dict.get() value = d.get(key) which will ...READ MORE

Apr 30, 2020 in Python by Niroj
• 82,800 points
• 14,743 views