Trending questions in Python

0 votes
1 answer

How to change the width of form elements created with ModelForm in Django?

Hello @kartik, The easiest way for your use ...READ MORE

Jul 29, 2020 in Python by Niroj
• 82,840 points
7,588 views
0 votes
0 answers

I can't locate class name in flikart samsung mobiles where i want to list all the samsung mobile price?

<div class="_30jeq3 _1_WHN1">₹14,999</div> .I can't locate the ...READ MORE

Jan 21, 2021 in Python by Monisha

edited Mar 4 25 views
0 votes
1 answer

Error in jarvis project (get url)

Hey, @Zodarlxx, Could you please post your error ...READ MORE

Dec 30, 2020 in Python by Gitika
• 65,770 points
934 views
0 votes
3 answers

Is there a simple way to delete a list element by value?

There are three ways in which you ...READ MORE

Dec 28, 2020 in Python by Thomas Walenta
892 views
0 votes
1 answer

Why is reading lines from stdin much slower in C++ than Python?

tl;dr: Because of different default settings in ...READ MORE

Dec 18, 2020 in Python by Nikita
1,398 views
0 votes
0 answers

joining two images reading from one folder

Hi, i am trying to generating joined ...READ MORE

Jan 3, 2021 in Python by shapna
• 120 points
732 views
0 votes
1 answer

ModuleNotFoundError: No module named 'urllib'

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

Jun 26, 2020 in Python by MD
• 95,460 points
8,935 views
0 votes
1 answer

How can I use Python to get the system hostname?

Hello @Kartik, Use socket and its gethostname() functionality. This will get the hostname of ...READ MORE

Dec 8, 2020 in Python by Niroj
• 82,840 points
1,796 views
0 votes
2 answers

Recursive Pattern Using Python

n = int(input("please enter your no:")) k = ...READ MORE

Jun 28, 2020 in Python by Shaurya Thapliyal
• 340 points
7,571 views
0 votes
1 answer

How to get list from pandas DataFrame column headers?

You can get the values as a ...READ MORE

Dec 23, 2020 in Python by Gitika
• 65,770 points
1,103 views
0 votes
1 answer

How to combine two or more querysets in a Django view?

Hello @kartik, Concatenating the querysets into a list ...READ MORE

Aug 3, 2020 in Python by Niroj
• 82,840 points
7,231 views
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

Jul 7, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 4,695 views
0 votes
0 answers

How can i dynamically mapp models id's in django

ysql> select * from exampleapp_author; +------+-------------------------+---------------+ | id    ...READ MORE

Jan 16, 2021 in Python by anonymous

edited Mar 4 23 views
0 votes
1 answer

How to get the SQL from a Django QuerySet?

Hello @kartik, Try this in your queryset: print my_queryset.query For ...READ MORE

Jun 23, 2020 in Python by Niroj
• 82,840 points
8,927 views
0 votes
1 answer

Explain split() and join() functions in Python?

Hey, @Roshni, You can use split() function to split a ...READ MORE

Jun 23, 2020 in Python by Gitika
• 65,770 points
8,910 views
+1 vote
2 answers

Python error "Python: can't assign to literal"

The way you're assigning variables is not ...READ MORE

Jun 17, 2019 in Python by Priya
16,104 views
0 votes
1 answer

How to update Django session variable in javascript?

Hello @kartik, You can do this via Ajax. ...READ MORE

Jul 30, 2020 in Python by Niroj
• 82,840 points
7,292 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,770 points
2,856 views
0 votes
1 answer

Delete column from pandas DataFrame in python

As you've guessed, the right syntax is del ...READ MORE

Dec 20, 2020 in Python by Gitika
• 65,770 points
1,145 views
0 votes
0 answers

File "<ipython-input-30-eae839ba8312>", line 11 d=dist(queryPoint,X[i]) ^ IndentationError: expected an indented block

for i in range(m):     d=dist(queryPoint,X[i]) &nb ...READ MORE

Jan 15, 2021 in Python by anonymous

edited Mar 4 22 views
0 votes
1 answer

ModuleNotFoundError: No module named 'pymongo'

Hi@akhtar, It seems you don't have a Pymongo module ...READ MORE

Jun 26, 2020 in Python by MD
• 95,460 points
8,705 views
0 votes
1 answer

When i try to install os_sys i get an error when installing backend dependencies

pip install -U os-sys READ MORE

Oct 16, 2020 in Python by anonymous
4,389 views
0 votes
1 answer

pip install mysql-python fails with EnvironmentError: mysql_config not found

It seems mysql_config is missing on your ...READ MORE

Dec 4, 2020 in Python by Gitika
• 65,770 points
1,693 views
0 votes
1 answer

invalid literal for int() with base 10 in python

Hello, You can try this simple code: def getSum(n): ...READ MORE

Nov 23, 2020 in Python by Niroj
• 82,840 points
2,216 views
0 votes
1 answer

Error:'QuerySet' object has no attribute 'remove'

Hello @kartik, You could do this: import itertools ids = ...READ MORE

Aug 12, 2020 in Python by Niroj
• 82,840 points
6,602 views
0 votes
1 answer

Error:Traceback (most recent call last): File "< stdin >", line 1, in ImportError: cannot import name 'path'

Hello @kartik, You need Django version 2 pip install ...READ MORE

Aug 5, 2020 in Python by Niroj
• 82,840 points
6,874 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,770 points
2,568 views
0 votes
1 answer

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

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

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

i am getting this error "TypeError: tuple indices must be integers or slices, not Database"

Hi, @Shabaj, Regarding your query, I hope this ...READ MORE

Dec 10, 2020 in Python by Gitika
• 65,770 points
1,345 views
0 votes
1 answer

How to read a text file into a string variable and strip newlines?

You could use: with open('data.txt', 'r') as file: ...READ MORE

Dec 23, 2020 in Python by Gitika
• 65,770 points
759 views
0 votes
1 answer

For Professional window GUI develepoment which python lib/module/framework is best?

HI, @Ganesh, Tkinter is one of the most ...READ MORE

Dec 24, 2020 in Python by Gitika
• 65,770 points
710 views
0 votes
1 answer

Hey Does anybody know how to fix the unexpected indent error?

Hello, @Aarohan, As the error message indicates, you ...READ MORE

Dec 28, 2020 in Python by Gitika
• 65,770 points
565 views
0 votes
1 answer

Error: wn = trtl.Screen() AttributeError: 'Turtle' object has no attribute 'Screen

Hi, @There, It requires a very simple hack ...READ MORE

Nov 3, 2020 in Python by Gitika
• 65,770 points
2,913 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,770 points
2,760 views
0 votes
1 answer

How to get all links and all elements that are clickable on a page of system dynamically?

Hello, You can do it by using find_elements_by_xpath() driver ...READ MORE

Aug 27, 2020 in Python by Niroj
• 82,840 points
5,824 views
+1 vote
2 answers

Error:Django gives Bad Request (400) when DEBUG = False

Tried this and it resolved all my ...READ MORE

Sep 25, 2020 in Python by Agaba
6,536 views
0 votes
0 answers

python 3 - IndentationError: expected an indented block, can you help me out guys?

import bible import math def shortest_verse_by_word(my_dict): ...READ MORE

Jan 9, 2021 in Python by anonymous

edited Mar 4 41 views
0 votes
1 answer

How to find the index of an item in a list?

One thing that is really helpful in ...READ MORE

Dec 3, 2020 in Python by Gitika
• 65,770 points
1,551 views
0 votes
0 answers

How to convert this python script into tkinter gui

import numpy as np from copy import deepcopy from ...READ MORE

Jan 9, 2021 in Python by Qasim

edited Mar 4 26 views
0 votes
1 answer

how easy is yaml to work with in python compared to json?

Hi, First thing YAML and JSON are not ...READ MORE

Dec 16, 2020 in Python by MD
• 95,460 points
1,001 views
0 votes
1 answer

How do you append to a file in Python?

with open("test.txt", "a") as myfile: ...READ MORE

Dec 20, 2020 in Python by Gitika
• 65,770 points
829 views
0 votes
1 answer

How to remove an element from a list by index?

Use del and specify the index of the element ...READ MORE

Dec 18, 2020 in Python by Gitika
• 65,770 points
882 views
0 votes
0 answers

I can't get accurate value in dictionaries in django

Whenever I try to print the dictionaries ...READ MORE

Dec 25, 2020 in Python by Mohamed
• 170 points
617 views
0 votes
1 answer

please what does print_details do in python?

Hi, @There, The print() function prints the specified message to the ...READ MORE

Dec 23, 2020 in Python by Gitika
• 65,770 points
649 views
0 votes
1 answer

How can I remove a trailing newline?

Try the method rstrip() (see doc Python 2 and Python 3) >>> 'test ...READ MORE

Dec 18, 2020 in Python by Gitika
• 65,770 points
852 views
0 votes
1 answer

HI Mr / Mrs I have problem with my jupiter notebook when i try to learn Your video about Machine Learning. Can You help me please ?

Hi@Herlambang, I think you have a 32-bit system. ...READ MORE

Dec 18, 2020 in Python by MD
• 95,460 points
849 views
0 votes
1 answer

Installing PIL with pip

Install Xcode and Xcode Command Line Tools ...READ MORE

Sep 11, 2020 in Python by FogleBird
5,061 views
0 votes
1 answer

how can I save my output of xml parsing in excel file...?

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

Dec 23, 2020 in Python by Gitika
• 65,770 points
601 views
0 votes
1 answer

Accessing the index in 'for' loops?

Using an additional state variable, such as ...READ MORE

Dec 16, 2020 in Python by Gitika
• 65,770 points
900 views
0 votes
1 answer

How can I count the occurrences of a list item?

If you only want one item's count, ...READ MORE

Dec 18, 2020 in Python by Gitika
• 65,770 points
784 views