Most viewed questions in Python

0 votes
1 answer

How do i kill a thread in python?

In Python, you simply cannot kill a Thread directly. If ...READ MORE

Aug 2, 2019 in Python by Mohammad
• 3,230 points
751 views
0 votes
1 answer

What is the difference between an abstract function and a virtual function?

An abstract function cannot have functionality. You're basically ...READ MORE

Nov 30, 2020 in Python by Gitika
• 65,910 points
750 views
0 votes
2 answers

What are the types of dictionary in python?

There are 4 types of dictionary Empty Integer Mixed Dictionary with ...READ MORE

Feb 14, 2019 in Python by Shashank
• 1,370 points
750 views
0 votes
2 answers

Which IDE should I use for python?

Pycharm or Spyder. You can even use visual ...READ MORE

Jun 23, 2020 in Python by Anjali
749 views
0 votes
1 answer

Using Lists and Tuples in Python

if you are familiar with C programming, ...READ MORE

May 29, 2018 in Python by Nietzsche's daemon
• 4,260 points
749 views
0 votes
1 answer

Removing duplicates in lists

1)To get rid of duplicate items, convert ...READ MORE

Feb 16, 2023 in Python by Rishu
• 300 points
748 views
+1 vote
1 answer

What does [::-1] do?

[::-1] does not reverse the order of ...READ MORE

Jun 6, 2019 in Python by Nisa
• 1,090 points
748 views
0 votes
1 answer

Understanding slice notation

To answer your question let me explain ...READ MORE

Feb 4, 2022 in Python by Nandini
• 5,480 points
746 views
0 votes
1 answer

How do I parse a string to a float or int?

Hii, Python method to check if a string ...READ MORE

Apr 13, 2020 in Python by Niroj
• 82,880 points
746 views
+1 vote
0 answers

ssh db connection using python2.7

I am supposed to use python 2.7 ...READ MORE

Nov 22, 2019 in Python by sweta
• 130 points
746 views
0 votes
1 answer

What are the key differences between python 2 and python 3?

The key differences include changes in the ...READ MORE

Aug 14, 2019 in Python by Mohammad
• 3,230 points
746 views
0 votes
1 answer

openssl_seal() in Python

I think it should be relatively straightforward ...READ MORE

Jul 24, 2019 in Python by SDeb
• 13,300 points
746 views
0 votes
1 answer

How to select a single column in Pandas?

Pandas allows you to index the dataframe ...READ MORE

May 9, 2019 in Python by Suman
746 views
0 votes
1 answer

Need help referencing Python Package when the filename consists of a period key

Hi, it's a very simple answer actually.  You ...READ MORE

Jan 25, 2019 in Python by Nymeria
• 3,560 points
746 views
+1 vote
2 answers

Appending data to a file

First open the file that you want ...READ MORE

Jul 23, 2018 in Python by Omkar
• 69,230 points
746 views
0 votes
3 answers

How to split a string into a list?

Using For loop This approach uses for loop ...READ MORE

Jan 4, 2021 in Python by David Samon
745 views
+1 vote
1 answer

Need some help with Python memory leaks

As far as best practices, keep an ...READ MORE

Nov 26, 2018 in Python by Nymeria
• 3,560 points
745 views
0 votes
1 answer

.pyc files in python

.pyc files contain the bytecode which are ...READ MORE

Jun 22, 2018 in Python by Hamartia's Mask
• 1,580 points
744 views
0 votes
1 answer

Is there an equivalent of C’s (?:) ternary operator in python?

Yes, there is. The syntax is as ...READ MORE

Jul 25, 2019 in Python by Alia
743 views
0 votes
1 answer

How to import other Python files?

importlib is recent addition in Python to ...READ MORE

Jul 27, 2018 in Python by Priyaj
• 58,090 points
743 views
0 votes
1 answer

How to write data to a file in Python?

Refer to the below code. data=’whatever your data ...READ MORE

May 13, 2019 in Python by Shaam
742 views
+1 vote
1 answer

i still can't find http proxy in system setting

Could be because you don't have the ...READ MORE

Jul 29, 2019 in Python by Anvi
741 views
0 votes
1 answer

Please explain the logic of giving a name to lambda function when it is actually a nameless function?

This is done because these functions are ...READ MORE

Jun 12, 2019 in Python by Wajiha
• 1,950 points
741 views
0 votes
1 answer

How to use a global variable in function?

The global variable can be used in ...READ MORE

Sep 27, 2018 in Python by SDeb
• 13,300 points
740 views
0 votes
1 answer

How can I change the data type to string in Python?

You can use str(variablename) This is called conversion ...READ MORE

Dec 18, 2018 in Python by Shuvodip
739 views
+1 vote
2 answers

Static methods in Python?

Static methods are used when we need ...READ MORE

Aug 4, 2018 in Python by Ronaldobessmin
• 160 points

edited Aug 4, 2018 by Vardhan 738 views
0 votes
1 answer

Module turtle has no listen member and module turtle has no onley member

Hi, @Edureka Are you facing this above mentioned ...READ MORE

Sep 15, 2020 in Python by Gitika
• 65,910 points
735 views
+1 vote
1 answer

Reading a large file, line by line in Python

The correct, fully Pythonic way to read ...READ MORE

Aug 21, 2018 in Python by Priyaj
• 58,090 points
735 views
0 votes
1 answer

How can I enable project_id parameter of DJango to be optional?

Hello @kartik, There are several approaches. One is to ...READ MORE

Jul 3, 2020 in Python by Niroj
• 82,880 points
734 views
0 votes
1 answer

Need help to open excel file and read in Python

You can use pandas module to do ...READ MORE

Jul 22, 2019 in Python by Tina
734 views
0 votes
1 answer

Why am I getting the syntax error SyntaxError invalid syntax in a line that contains fully valid syntax?

A "SyntaxError: invalid syntax" is a common ...READ MORE

Oct 18, 2023 in Python by anonymous
• 3,320 points
733 views
0 votes
1 answer

Crawling after login in Python

You missed a few login data forms, ...READ MORE

Sep 14, 2018 in Python by Priyaj
• 58,090 points
733 views
0 votes
0 answers

How do I fix this Set function in python?

I have the following code below I ...READ MORE

May 20, 2020 in Python by Olufemiodubote
• 120 points
732 views
0 votes
1 answer

How I do get the data from the <font> tag from a given tr tag?

This should work: from bs4 import BeautifulSoup html_doc='''<tr id="tr_m_1570:240HJY" ...READ MORE

Sep 18, 2019 in Python by Omkar
• 69,230 points
732 views
0 votes
1 answer

How to sort a Pandas dataframe?

You can do it using the below ...READ MORE

May 13, 2019 in Python by Amulya
732 views
0 votes
1 answer

Reading powershell clixml in python

PowerShell's Extended Type System supports auxiliary properties ...READ MORE

Oct 9, 2018 in Python by Priyaj
• 58,090 points
732 views
0 votes
1 answer

Escaping strings for use in XML

You can try the following: from xml.dom.minidom import ...READ MORE

Apr 15, 2019 in Python by SDeb
• 13,300 points
731 views
0 votes
0 answers

Open Whatsapp Windows app directly from python program using url

According to this FAQ page of Whatsapp on How to ...READ MORE

Apr 18, 2022 in Python by Edureka
• 13,620 points
730 views
+1 vote
1 answer

How to use GUI that comes with Python to test your code?

Hey @alex0809, When your testing a website ...READ MORE

Sep 24, 2018 in Python by Vardhan
• 13,190 points
730 views
0 votes
0 answers

How do you move tree with ignore patterns in python

with the shutil.copytree I can copy an ...READ MORE

Nov 22, 2022 in Python by sarit
• 1,830 points
728 views
0 votes
1 answer

python - get the root from tkinter for turtle

Hey @Haseeb, try something like this: import turtle canvas ...READ MORE

Jul 6, 2019 in Python by Barbara
727 views
0 votes
1 answer

Is arr.__len__() the preferred way to get the length of an array in Python?

my_list = [1,2,3,4,5,6,7] len(my_list) # 7 The same works for ...READ MORE

Oct 8, 2018 in Python by SDeb
• 13,300 points
727 views
0 votes
1 answer

How to draw BoxPlot in Python?

Hi Guys, You can use the plot function ...READ MORE

Jun 26, 2020 in Python by MD
• 95,440 points
726 views
0 votes
1 answer

Is there a way to store a huge dataset as a dataframe using Pandas?

This can be easliy done by using ...READ MORE

Jun 22, 2019 in Python by Taj
• 1,080 points
726 views
0 votes
1 answer

Install pytype from GitHub?

Execute the following command to install pytype ...READ MORE

Jun 7, 2019 in Python by Fatima
726 views
+1 vote
2 answers

How to convert list to string

mylist = [1, 2, 3] ‘’.join(map(str, mylist)) ==> ...READ MORE

Aug 21, 2018 in Python by Omkar
• 69,230 points
726 views
0 votes
1 answer

How to convert each list item into string in a column of data frame. ?

Hey, To split a string you can use ...READ MORE

Feb 5, 2020 in Python by Roshni
• 10,520 points
725 views
0 votes
1 answer

__init__ and self in python

The self variable represents an instance of ...READ MORE

Sep 18, 2018 in Python by SayantiniDeb
• 200 points
725 views
0 votes
1 answer

How to get URL from Python requests response?

Once you get the response, you'll find ...READ MORE

May 14, 2019 in Python by Firoz
723 views
0 votes
0 answers