Trending questions in Python

0 votes
1 answer

El return solo me devuelve False en este método

Hola amiga como estas La función no devuelve ...READ MORE

Oct 19, 2020 in Python by Gitika
• 65,730 points
891 views
0 votes
1 answer

Reverse a string in Python

You should try to use the following ...READ MORE

Feb 8, 2022 in Python by Rahul
• 9,690 points
1,037 views
0 votes
1 answer

AttributeError: 'numpy.ndarray' object has no attribute 'append'

Hi@Nilesh, You created two empty lists. And in ...READ MORE

Aug 11, 2020 in Python by MD
• 95,460 points
3,857 views
0 votes
1 answer

Error:Can't connect to local MySQL server through socket '/tmp/mysql.sock

Hello @kartik, Try the code below: sudo /usr/local/mysql/support-files/mysql.server start ...READ MORE

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

How to pre-populate FormView with dynamic data?

Hello @kartik, You can override the FormView class's ...READ MORE

Jul 29, 2020 in Python by Niroj
• 82,800 points
4,367 views
0 votes
2 answers

How to upgrade all Python packages with pip?

Open the command prompt and check the ...READ MORE

Jun 7, 2020 in Python by sahil
• 500 points
6,599 views
0 votes
1 answer
0 votes
1 answer

how to use speech_recognition modules as r.listen_in_background()?

Hello Shaurya Thapliyal, Following might be the reason for your error:​ The ...READ MORE

Jun 29, 2020 in Python by Niroj
• 82,800 points
5,739 views
0 votes
1 answer

ModuleNotFoundError: No module named 'tools.nnwrap'

Hi@akhtar, I think you didn't install the torch ...READ MORE

Jun 29, 2020 in Python by MD
• 95,460 points
5,595 views
0 votes
1 answer

Can anyone explain me this error?

It is an Indentation error. There should be ...READ MORE

Oct 14, 2020 in Python by Gitika
• 65,730 points
961 views
0 votes
1 answer

How to call a function from another file in Python?

Hi@akhtar, You can use the import keyword to ...READ MORE

Jun 24, 2020 in Python by MD
• 95,460 points
5,821 views
0 votes
1 answer

ERROR: No matching distribution found for cPickle

Hi@akhtar, There is no cPickle in Python 3. Just import pickle ...READ MORE

Jul 14, 2020 in Python by MD
• 95,460 points
4,907 views
0 votes
1 answer

How can I unit test django messages?

Hello @kartik, Try use: response = self.client.post('/foo/') messages = list(response.context['messages']) self.assertEqual(len(messages), ...READ MORE

Aug 17, 2020 in Python by Niroj
• 82,800 points
3,412 views
+1 vote
1 answer

How do I return JSON without using a template in Django?

Hello @kartik, In the case of the JSON ...READ MORE

Jul 3, 2020 in Python by Niroj
• 82,800 points
5,328 views
0 votes
1 answer

AttributeError: __enter__

Hey, @Archisman, in case of this: with sr.Microphone as ...READ MORE

Aug 24, 2020 in Python by Gitika
• 65,730 points
3,111 views
0 votes
1 answer

Which is the best software for python?

For the python idle 3.8 it's better ...READ MORE

Oct 14, 2020 in Python by Gitika
• 65,730 points
892 views
0 votes
1 answer

How to create Pytest report in html format?

Hi@akhtar, You can create a Pytest report in ...READ MORE

Jun 24, 2020 in Python by MD
• 95,460 points
5,752 views
0 votes
0 answers

How to convert html to pdf in django

Sep 21, 2020 in Python by karthik
• 120 points
1,919 views
0 votes
2 answers

WHY IS IT SHOWING THIS ERROR?

Hello @shrood , If you are trying to find ...READ MORE

Jul 24, 2020 in Python by Niroj
• 82,800 points
4,378 views
0 votes
1 answer

How to install biopyhton if import is not recognised as a command by the system?

Hello, For install biopyhton with proper instruction you can ...READ MORE

Oct 12, 2020 in Python by Niroj
• 82,800 points
953 views
0 votes
1 answer

Solve the quadratic equation using lambda functions in Python

Hello @ Ø§Ù…یرحمزه , from math import sqrt Root = lambda ...READ MORE

Jul 13, 2020 in Python by Niroj
• 82,800 points
4,909 views
0 votes
1 answer

I tried to install this pip cryptography in Pycharm but I'm getting an error

Hello @Dilpreet , Have you tried updating pip version? ...READ MORE

Aug 4, 2020 in Python by Niroj
• 82,800 points
3,913 views
0 votes
1 answer

How to create a generic serializer with a dynamic model in Meta?

Hello @kartik, You can do that by following: serializers.py class ...READ MORE

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

How to print the index of a Pandas Dataframe?

You can do this using the code ...READ MORE

May 13, 2019 in Python by Usha
23,301 views
0 votes
1 answer

What does this Class bicycle(bicycle) actually mean?

A Python class is for defining a ...READ MORE

Oct 7, 2020 in Python by Gitika
• 65,730 points
1,104 views
0 votes
1 answer

I am unable to import pyttsx2 in python. Python is throwing exception ModuleNotFoundError.

Hey, @Athrava Gulve, Hey, @Atharva, Which version of Python your ...READ MORE

Oct 7, 2020 in Python by Gitika
• 65,730 points
1,102 views
0 votes
1 answer

How to change the file name of an uploaded file in Django?

Hello @kartik, The basic way is import os os.rename('a.txt', 'b.html') For ...READ MORE

Jul 3, 2020 in Python by Niroj
• 82,800 points
5,227 views
0 votes
1 answer

Weird Function Using python

input_str = input() input_list = input_str.split(',') a = int(input_list[0]) b ...READ MORE

Jul 28, 2020 in Python by Vin
4,954 views
0 votes
1 answer

.What is the meaning of "while True :" while doing in a loop.

The body of the loop will continue ...READ MORE

Oct 7, 2020 in Python by Gitika
• 65,730 points
1,063 views
0 votes
1 answer

How can we initialise a variable like this a = -2.331*(e**-16)?

Remove stars and brackets. That's all READ MORE

Oct 14, 2020 in Python by anonymous
• 65,730 points
746 views
0 votes
1 answer

How do I do a not equal in Django queryset filtering?

Hello @kartik, Try this code below: >>> from myapp.models ...READ MORE

Jul 3, 2020 in Python by Niroj
• 82,800 points
5,161 views
0 votes
1 answer

How to delete old image when update ImageField?

Hello @kartik, You'll have to delete the old ...READ MORE

Jun 29, 2020 in Python by Niroj
• 82,800 points
5,311 views
0 votes
1 answer

How can I send trace messages to the console (like print) when I'm running my Django app under manage.py runserver?

Hello @kartik, Text printed to stderr will show ...READ MORE

Aug 12, 2020 in Python by Niroj
• 82,800 points
3,404 views
0 votes
2 answers

Tkinter “module not callable” error.

This error statement TypeError: 'module' object is ...READ MORE

Jun 27, 2019 in Python by rahul
• 360 points
22,234 views
0 votes
1 answer

ModuleNotFoundError: No module named 'pymc3'

Hi@akhtar, You need to install this module in ...READ MORE

Jun 30, 2020 in Python by MD
• 95,460 points
5,168 views
0 votes
0 answers
0 votes
0 answers

TypeError: unsupported operand type(s) for *: 'CommentedMap' and 'CommentedMap' Hatam bu nasıl çözebilirim ?

from ruamel import yaml from scipy import spatial import ...READ MORE

Sep 29, 2020 in Python by anonymous
• 120 points

edited Sep 29, 2020 by Gitika 1,247 views
0 votes
1 answer

How to Creat a JSON response using Django and Python?

Hello @kartik, I usually use a dictionary, not ...READ MORE

Aug 6, 2020 in Python by Niroj
• 82,800 points
3,522 views
0 votes
1 answer

What to do ?

Hello @Aashi, pd_csv.(...) the dot after csv For more information ...READ MORE

Oct 6, 2020 in Python by Niroj
• 82,800 points
890 views
0 votes
1 answer

Why self is used in methods or init() method in python?

its a constructor like in C++. In c++ ...READ MORE

Oct 6, 2020 in Python by Gitika
• 65,730 points
854 views
0 votes
1 answer

ImportError: cannot import name 'PILLOW_VERSION' from 'PIL' (unknown location)

Hi@akhtar, I think there is a problem in ...READ MORE

Apr 22, 2020 in Python by MD
• 95,460 points
8,057 views
0 votes
1 answer

How to extend the User model with custom fields in Django?

Hello @kartik, Define an object manager for your ...READ MORE

Aug 3, 2020 in Python by Niroj
• 82,800 points
3,618 views
+1 vote
1 answer

How to save image/file through django shell?

Hii @kartik, You will end up with the ...READ MORE

Jun 29, 2020 in Python by Niroj
• 82,800 points
5,020 views
0 votes
1 answer

ImportError: No module named requests

To install requests module on Debian/Ubuntu for Python2: $ sudo ...READ MORE

Sep 11, 2020 in Python by Deming
1,856 views
0 votes
0 answers

NLPAlgorithm

Hi Everyone, Can anyone please help to find ...READ MORE

Oct 1, 2020 in Python by santhosh
• 120 points
1,002 views
0 votes
1 answer

How do you serialize a model instance in Django?

Hello @kartik, If you're dealing with a list ...READ MORE

Jun 26, 2020 in Python by Niroj
• 82,800 points
5,143 views
0 votes
1 answer

How to redirect to named url pattern directly from urls.py in django?

Hello @kartik, You can try this: from django.views.generic import ...READ MORE

Aug 12, 2020 in Python by Niroj
• 82,800 points
3,090 views
0 votes
2 answers

Get key by value in dictionary

I have slightly modified your program to ...READ MORE

Nov 25, 2021 in Python by Python Coder
1,692 views
0 votes
11 answers

“pip install unroll”: “python setup.py egg_info” failed with error code 1

rm -rf node_modules READ MORE

Jun 27, 2019 in Python by anonymous
26,176 views