Trending questions in Python

0 votes
1 answer

Error executing Jupyter command 'notebook': [Errno 2] No such file or directory

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

Jun 25, 2020 in Python by MD
• 95,460 points
5,551 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,770 points
745 views
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,770 points
529 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,840 points
5,564 views
0 votes
1 answer

What is the best way to remove accents in a Python unicode string?

Hello @kartik, Some languages have combining diacritics as ...READ MORE

May 11, 2020 in Python by Niroj
• 82,840 points
7,446 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,770 points
645 views
0 votes
1 answer

how do i use the enumerate function inside a list?

Enumerate() method adds a counter to an ...READ MORE

Nov 16, 2021 in Python by Ruhan Siddiqui
3,409 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,770 points
2,841 views
0 votes
0 answers

How to convert html to pdf in django

Sep 21, 2020 in Python by karthik
• 120 points
1,659 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,183 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,840 points
707 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,400 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,458 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,197 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,840 points
4,984 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,840 points
3,579 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,770 points
830 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,770 points
818 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,770 points
800 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,840 points
3,575 views
0 votes
1 answer

Can someone tell me what this line of code does?

Hey, Your above-asked query means: Confidence loads one ...READ MORE

Oct 12, 2020 in Python by Gitika
• 65,770 points
583 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,770 points
480 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,331 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,435 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,840 points
4,860 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,840 points
2,911 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,840 points
4,846 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,840 points
4,385 views
0 votes
1 answer
0 votes
0 answers
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,840 points
4,922 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,482 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,840 points
3,017 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
22,779 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,770 points
621 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,840 points
627 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,840 points
3,233 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,840 points
3,753 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
802 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,840 points
3,340 views
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,840 points
4,936 views
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 888 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
7,682 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,539 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,840 points
4,821 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,840 points
4,635 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
4,632 views
0 votes
1 answer

How to clear a database from the CLI with manage.py in Django?

Hello @kartik, To drop the database and run syncdb again. ...READ MORE

Aug 7, 2020 in Python by Niroj
• 82,840 points
2,951 views
0 votes
1 answer

ValueError: could not broadcast input array from shape (4,1) into shape (4)

Hey @Giorgio, You can try this hope this ...READ MORE

Feb 18, 2020 in Python by Gitika
• 65,770 points
10,438 views