Latest questions in Python

0 votes
1 answer

ValueError: must have exactly one of create/read/write/append mode

You can open a file for simultaneous ...READ MORE

Nov 15, 2020 in Python by Gitika
• 65,910 points
3,158 views
0 votes
1 answer

While debugging in visual studio it runs but it doesn't show any error

You're sending infinitely increasing data. Maybe it's ...READ MORE

Nov 15, 2020 in Python by Gitika
• 65,910 points
276 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,910 points
5,311 views
0 votes
1 answer

Why do we not follow the "off by one" rule in python

It's because of the way in which ...READ MORE

Nov 15, 2020 in Python by Gitika
• 65,910 points
485 views
0 votes
1 answer

How to enter this command “py -3 -m pip install -r requirements.txt”

Open cmd and type the command and ...READ MORE

Nov 15, 2020 in Python by Gitika
• 65,910 points
906 views
0 votes
1 answer

How can I test if a string can be converted to another type dynamically?

You can use isinstance() function to check ...READ MORE

Nov 15, 2020 in Python by Gitika
• 65,910 points
302 views
0 votes
1 answer

Error: showing database is locked

ah, sqlite3 stuff... remove .session file and ...READ MORE

Nov 15, 2020 in Python by Sheema
454 views
0 votes
1 answer

Distance calculator

Hello @ Try this code: import math x, y = ...READ MORE

Nov 13, 2020 in Python by Niroj
• 82,880 points
3,353 views
0 votes
1 answer

TypeError: 'float' object cannot be interpreted as an integer

Hi, @There, The “TypeError: ‘float’ object cannot be ...READ MORE

Nov 13, 2020 in Python by Gitika
• 65,910 points
41,858 views
0 votes
1 answer

AttributeError: 'Group' object has no attribute 'user'

You can go through this: from django.contrib.auth.models import ...READ MORE

Nov 12, 2020 in Python by Gitika
• 65,910 points
3,074 views
0 votes
1 answer

How to implemented the custom user model?

Yes, pip install my plugin and check ...READ MORE

Nov 12, 2020 in Python by Gitika
• 65,910 points
307 views
0 votes
1 answer

How to connect my app to mongo?

Most users try to use NoSQL-like DBs ...READ MORE

Nov 12, 2020 in Python by Gitika
• 65,910 points
309 views
0 votes
1 answer

Deployed Django project on heroku But I don't know which database is it using. Is there a way to know that So that I can login to admin page?

If you don't configure one you might ...READ MORE

Nov 12, 2020 in Python by anonymous
• 65,910 points
426 views
0 votes
1 answer

Tried setting up Django-shop on my system, but when I try to run pipenv install , I get this:404 Snippet not found

Uninstall all python first then install python ...READ MORE

Nov 12, 2020 in Python by Gitika
• 65,910 points
504 views
0 votes
1 answer

How to insert value by one post method in 2 table with Django?

try  import-export   library of Django or if you are ...READ MORE

Nov 12, 2020 in Python by Gitika
• 65,910 points
971 views
0 votes
1 answer

How to give local path instead of media URL?

If u are using iframe, you can ...READ MORE

Nov 12, 2020 in Python by Gitika
• 65,910 points
315 views
0 votes
1 answer

How do I build a website with referral link on Django?

simple solution.. import hashlib Refferal(Model): user ...READ MORE

Nov 12, 2020 in Python by Gitika
• 65,910 points
2,171 views
0 votes
1 answer

Error in Django 2.1.5 Method Not Allowed

UpdateView only allows GET and POST... if ...READ MORE

Nov 12, 2020 in Python by Gitika
• 65,910 points
3,895 views
0 votes
1 answer

Unable to create a project in django.

I think u didn't install Django. python -m ...READ MORE

Nov 12, 2020 in Python by Gitika
• 65,910 points
588 views
0 votes
1 answer

Unable to access UserProfile model fields in templates in Django.

Use {{ request.user.get_profile.whatever }}. Django's templating language ...READ MORE

Nov 13, 2020 in Python by Gitika
• 65,910 points
431 views
0 votes
1 answer

what is the output of m = np.array([2,4,6]) n = np.array([2, True, False]) print(m+n)

Hi. @Nandini, The above code will give you ...READ MORE

Nov 11, 2020 in Python by Gitika
• 65,910 points
359 views
0 votes
0 answers

NameError: name 'genomic_dna_4' is not defined

I use python for biology and I got ...READ MORE

Nov 10, 2020 in Python by skylar
• 120 points
1,083 views
0 votes
1 answer

How to divide one number to another multiple times, untill it will be about 0?

You can do something like this:  while num ...READ MORE

Nov 10, 2020 in Python by Gitika
• 65,910 points
2,467 views
0 votes
1 answer

what does this line fout.write("</{}>\n".format(opentags.pop())) do?

It closes one tag actually, opentags is ...READ MORE

Nov 10, 2020 in Python by Gitika
• 65,910 points
401 views
0 votes
1 answer

How to see more rows in a dataframe?

You can go through the given below: pd.set_option('display.max_rows', ...READ MORE

Nov 10, 2020 in Python by anonymous
• 65,910 points
357 views
0 votes
1 answer

How to install module in virtual environment?

The Python installers for Windows include pip. ...READ MORE

Nov 10, 2020 in Python by Gitika
• 65,910 points
440 views
0 votes
1 answer

How to iterate a Json file which has multiple key value pairs and also nested list as part of the file?

I think you need to create some ...READ MORE

Nov 10, 2020 in Python by Gitika
• 65,910 points
1,795 views
0 votes
1 answer

Support vector Regresson

Hi,@ Manoj, I would suggest you go through ...READ MORE

Nov 9, 2020 in Python by anonymous
• 65,910 points
326 views
0 votes
1 answer

Is there anyway to get the total count of times of a Generator?

Generators are originally created to return an ...READ MORE

Nov 6, 2020 in Python by Gitika
• 65,910 points
461 views
0 votes
1 answer

How to print error in web browser if there is error in code?

You can try to catch these errors ...READ MORE

Nov 6, 2020 in Python by Gitika
• 65,910 points
788 views
0 votes
1 answer

ImportError: cannot import name 'API_KEY' from 'forwarder'

The AWS package in PyPI is not AWS's official ...READ MORE

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

why is the dcount and tcount 0 and 0 in the output?

Because the dcount and tcount variables you ...READ MORE

Nov 6, 2020 in Python by Gitika
• 65,910 points
536 views
0 votes
1 answer

Error: Can't import matplotlib library.

Install the older version of python, I also ...READ MORE

Nov 6, 2020 in Python by Gitika
• 65,910 points
930 views
0 votes
1 answer

How to add properties while installing GOTO?

You can follow a few steps: click advanced ...READ MORE

Nov 6, 2020 in Python by Gitika
• 65,910 points
340 views
0 votes
1 answer

How to install pip?

'pip' is not recognized as an internal ...READ MORE

Nov 6, 2020 in Python by anonymous
• 65,910 points
328 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,910 points
5,364 views
0 votes
0 answers

ValueError: could not broadcast input array from shape (224,224,9) into shape (224,224)

img_shape = 224 test_data = [] test_labels = [] for ...READ MORE

Nov 6, 2020 in Python by Eyosiyas
• 120 points
1,431 views
0 votes
1 answer

ERROR: Could not build wheels for line-profiler which use PEP 517 and cannot be installed directly.

Hi@akhtar, If you are trying to install with pip ...READ MORE

Nov 5, 2020 in Python by MD
• 95,440 points
3,161 views
0 votes
1 answer

ModuleNotFoundError: No module named 'line_profiler'.

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

Nov 5, 2020 in Python by MD
• 95,440 points
1,884 views
+1 vote
1 answer

Can anyone help me with this error: TypeError: list indices must be integers or slices, not str

Hi, @Varshap  It’s a TypeError, which tells us ...READ MORE

Nov 5, 2020 in Python by anonymous
• 65,910 points
2,055 views
0 votes
1 answer

Could you please help to write a code for this program

Hello, @Hitesh, You can follow the below: print("List of ...READ MORE

Nov 4, 2020 in Python by Roshni
• 10,520 points
1,658 views
0 votes
1 answer

ImportError: No module named mpmath. But mpmath has been installed.

You should use conda to install Python ...READ MORE

Nov 4, 2020 in Python by Gitika
• 65,910 points
1,059 views
0 votes
1 answer

Is there any built in sorted data structure in python?

Yes. List is sortable. Dict is also ...READ MORE

Nov 4, 2020 in Python by Richa sharma
566 views
0 votes
1 answer

How to print only the line which starts with P?

Hi, you might have found another way ...READ MORE

Dec 2, 2020 in Python by Tyler
• 140 points
860 views
0 votes
1 answer

What is selenium in python?

It is known as Web automations, It is ...READ MORE

Nov 4, 2020 in Python by Gitika
• 65,910 points
383 views
0 votes
1 answer

How to convert doc file into pdf using python?

A simple example using com types, converting ...READ MORE

Nov 4, 2020 in Python by Gitika
• 65,910 points
1,698 views
0 votes
1 answer

How to make this add every number %a == 0 in the loop?

You can go through the given below ...READ MORE

Nov 4, 2020 in Python by Gitika
• 65,910 points
300 views
0 votes
1 answer

How to take user input python3?

Use a while True: loop, to take input forever, ...READ MORE

Nov 4, 2020 in Python by anonymous
• 65,910 points
461 views
0 votes
1 answer

I am getting output - "def"

You can make a change to your ...READ MORE

Nov 4, 2020 in Python by Gitika
• 65,910 points
307 views
0 votes
1 answer

How to convert list into 2 tuple pair list?

This should work: L = [1, 2, 3, ...READ MORE

Nov 4, 2020 in Python by Gitika
• 65,910 points
5,914 views