Most viewed questions in Python

0 votes
2 answers

ModuleNotFoundError: No module named 'pythoncom' in pyttsx3

even i faced the same problem ...just ...READ MORE

Jun 2, 2020 in Python by anonymous
13,024 views
+2 votes
3 answers

How can I play an audio file in the background using Python?

down voteacceptedFor windows: you could use  winsound.SND_ASYNC to play them ...READ MORE

Apr 4, 2018 in Python by charlie_brown
• 7,720 points
12,974 views
0 votes
1 answer

BeautifulSoup: How to get the text between p tag?

Find all the the paragraph tags and ...READ MORE

Apr 3, 2019 in Python by Esha
12,968 views
0 votes
1 answer

How to get Request.User in Django-Rest-Framework serializer?

Hello @kartik, You cannot access the request.user directly. You need ...READ MORE

Aug 12, 2020 in Python by Niroj
• 82,880 points
12,937 views
0 votes
1 answer

How to change a Django form field to a hidden field?

Hello @kartik, If you have a custom template ...READ MORE

Jul 29, 2020 in Python by Niroj
• 82,880 points
12,923 views
0 votes
1 answer

Error saying "TypeError: descriptor object needs an argument"

The error is pretty straight forward, toy ...READ MORE

May 28, 2019 in Python by Alisha
12,916 views
0 votes
1 answer

How to check if list is ascending?

You can go through the example given:  # ...READ MORE

Oct 12, 2020 in Python by Gitika
• 65,910 points
12,874 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,440 points
12,792 views
0 votes
1 answer

How to output text from database with line breaks in a django template?

Hello @kartik, Use linebreaks or linebreaksbr filter: {{ text|linebreaks }} Or surround the text ...READ MORE

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

What is the full form of oops?

To answer your doubt, the programming paradigm ...READ MORE

Feb 8, 2022 in Python by Soham
• 9,700 points
12,780 views
+1 vote
1 answer

tensorflow is installed but theres an error while importing

Hi@Christlan, This problem is related to version. Follow ...READ MORE

Dec 22, 2020 in Python by MD
• 95,440 points
12,780 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,880 points

edited Oct 7, 2021 by Sarfaraz 12,740 views
0 votes
1 answer

Python Pandas: selecting element in array column

pa.loc[row] selects the row with label row. pa.loc[row, ...READ MORE

May 13, 2019 in Python by SDeb
• 13,300 points
12,654 views
0 votes
1 answer

Error:“CSRF token missing or incorrect” while post parameter via AJAX in Django

Hello @kartik, The simplest way to include the {{csrf_token}} value ...READ MORE

Aug 13, 2020 in Python by Niroj
• 82,880 points
12,644 views
0 votes
1 answer

Convert string to unicode in Python

Suppose you have a string in ASCII form ...READ MORE

Jul 23, 2019 in Python by Gani
12,634 views
0 votes
1 answer

'str' object has no attribute 'read'

Hi@zena, In the below section you are trying ...READ MORE

Jun 29, 2020 in Python by MD
• 95,440 points
12,619 views
0 votes
2 answers

ModuleNotFoundError: No module named 'folium'

Following Command install it will work: conda install ...READ MORE

Aug 28, 2020 in Python by Sunil Patil
12,585 views
0 votes
1 answer

What is the easiest way to implement 'IN' and 'NOT IN' in Pandas dataframe?

You can use pd.Series.isin. For "IN" use: something.isin(somewhere) Or for "NOT ...READ MORE

Aug 23, 2019 in Python by Arvind
• 3,040 points
12,578 views
0 votes
2 answers

How to call perl script in Python script?

If you just want to open a ...READ MORE

Oct 7, 2020 in Python by Reshma
12,576 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,880 points
12,539 views
0 votes
1 answer

How to call function that takes an argument in a Django template?

Hello @kartik, You cannot call a function that ...READ MORE

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

How to Clone Conda environment?

Hi@akhtar, You can use the --clone command to ...READ MORE

Jun 22, 2020 in Python by MD
• 95,440 points
12,489 views
0 votes
1 answer

How to web scrape using python without using a browser?

Yes, you can use the headless mode. ...READ MORE

Apr 2, 2019 in Python by Yogi

edited Oct 7, 2021 by Sarfaraz 12,481 views
0 votes
1 answer

Compress and decompress string in Python

You can use the zlib module available in ...READ MORE

Jul 23, 2019 in Python by Bhagavath

edited Oct 7, 2021 by Sarfaraz 12,469 views
0 votes
1 answer

How to set NotebookApp.iopub_data_rate_limit and others NotebookApp settings in JupyterHub?

Open the command line and enter jupyter notebook ...READ MORE

Jun 10, 2019 in Python by SDeb
• 13,300 points
12,445 views
0 votes
1 answer

Can we access Outer class member from an Inner class in Python?

If you want to access outer class ...READ MORE

Feb 13, 2019 in Python by Omkar
• 69,230 points
12,415 views
0 votes
1 answer

Import Error: No module named numpy?

Hello, I had numpy installed on the same ...READ MORE

Apr 14, 2020 in Python by Niroj
• 82,880 points
12,404 views
+3 votes
2 answers

sum of 1/2+2/3+3/4+...+n/n+1

num = int(input("Enter a number: ")) newnum = ...READ MORE

Dec 27, 2019 in Python by Nisha
• 200 points
12,350 views
0 votes
1 answer

How to find if a value exists in Pandas dataframe?

Try this:​ for name in df['Name']: ...READ MORE

Apr 8, 2019 in Python by Tina
12,333 views
0 votes
1 answer

The equivalent of a GOTO in python ​​

Gotos are universally reviled in computer science ...READ MORE

Sep 3, 2018 in Python by Priyaj
• 58,090 points
12,327 views
0 votes
1 answer
0 votes
1 answer

How can I get all the request headers in Django?

Hello @kartik,  You can use request.headers to access the HTTP ...READ MORE

Jun 30, 2020 in Python by Niroj
• 82,880 points
12,295 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,880 points
12,267 views
0 votes
1 answer

Python Selenium: ConnectionRefusedError: No connection could be made because the target machine actively refused it

When you use driver.quit(), it closes the ...READ MORE

Apr 6, 2019 in Python by Tina
12,228 views
0 votes
1 answer

How to measure time elapsed in Python?

If you just want to measure the ...READ MORE

Dec 4, 2018 in Python by SDeb
• 13,300 points
12,168 views
0 votes
1 answer

How do I perform query filtering in django templates?

Hello @KARTIK, Just add an extra template tag ...READ MORE

Jul 4, 2020 in Python by Niroj
• 82,880 points
12,093 views
0 votes
1 answer

Error: current transaction is aborted, commands ignored until end of transaction block?

Hii kartik, To get rid of the error, roll ...READ MORE

Apr 23, 2020 in Python by Niroj
• 82,880 points
12,057 views
0 votes
1 answer

Error:Django Rest Framework — no module named rest_framework

Hello @kartik, You just need to install django ...READ MORE

Jun 25, 2020 in Python by Niroj
• 82,880 points
12,023 views
0 votes
1 answer

Getting this error Error sqlite3.InterfaceError: Error binding parameter 0 - probably unsupported type

Found out that the problem was that ...READ MORE

Oct 1, 2018 in Python by Priyaj
• 58,090 points
11,954 views
0 votes
2 answers

How do I check if a variable exists in python?

Python doesn’t have a specific function to ...READ MORE

Dec 28, 2020 in Python by Carlos
11,952 views
+1 vote
1 answer

Error:Getting Site Matching Query Does Not Exist Error after creating django admin

Hello @kartik, The Site object for your Django project is ...READ MORE

Jun 22, 2020 in Python by Niroj
• 82,880 points
11,952 views
0 votes
1 answer

Error: persisting 'ProgrammingError: column does not exist'

Something I like to try when my ...READ MORE

Sep 28, 2018 in Python by Priyaj
• 58,090 points
11,935 views
+1 vote
1 answer

Python script to compare 2 files

Refer the given code and let us ...READ MORE

Jul 31, 2019 in Python by Arpit
11,909 views
0 votes
1 answer

Python: Megre multiple dataframes into single data frame

You can merge the data frame using ...READ MORE

Jul 14, 2019 in Python by Sharan
11,895 views
0 votes
1 answer

What is the procedure to update spyder on Anaconda?

This is a pretty simple thing to ...READ MORE

Aug 19, 2019 in Python by Arvind
• 3,040 points
11,873 views
+1 vote
2 answers

How to print first character of each word in upper case of a string in Python

class Solution:     def firstAlphabet(self, s):             self.s=s              k=''              k=k+s[0]              for i in range(len(s)):                     if ...READ MORE

Oct 28, 2020 in Python by Anurag
11,798 views
0 votes
0 answers

TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'

Hi guys i have below code . ...READ MORE

Oct 30, 2019 in Python by sumanth
• 190 points
11,716 views
0 votes
1 answer

How to access specific columns from a csv file?

Instead of using csv module in Python, ...READ MORE

Jul 15, 2019 in Python by Neel
• 3,020 points
11,707 views
+1 vote
2 answers

Cannot install tensorflow on 32-bit Python

Unfortunately tensorflow is not supported on 32 ...READ MORE

Jan 13, 2020 in Python by jaakko
• 160 points

edited Apr 18, 2022 by Sarfaraz 11,689 views
0 votes
1 answer

Error:AttributeError: 'module' object has no attribute 'tests'

Hello @kartik, The problem was that test couldn't find ...READ MORE

Aug 7, 2020 in Python by Niroj
• 82,880 points
11,663 views