questions/python/page/22
Hello @kartik, You can do: var = 1 if type(var) ...READ MORE
Hi@akhtar, It seems Sklearn is not installed properly ...READ MORE
It seems that the problem is not ...READ MORE
from shutil import copyfile copyfile(src, dst) Copy the ...READ MORE
Yep, using the static method decorator class MyClass(object): ...READ MORE
Hello @kartik, Without looking, it sounds like the ...READ MORE
Hi, @Webinar, Are you getting any kind of ...READ MORE
The general pattern is str.split(search).join(replacement) This used to be ...READ MORE
Hello @kartik, Some languages have combining diacritics as ...READ MORE
in is the intended way to test for ...READ MORE
There is no simple built-in string function ...READ MORE
some_list[-1] is the shortest and most Pythonic. In fact, ...READ MORE
Traceback (most recent call last): File "main.py", line ...READ MORE
Here is what you asked for: from functools ...READ MORE
The default implementation is useless (it’s hard ...READ MORE
if "ABCD" in "xxxxABCDyyyy": ...READ MORE
Try hasattr(): if hasattr(a, 'property'): a.property The ...READ MORE
Classes (by default) are instances of the ...READ MORE
The SimpleHTTPServer module has been merged into http.server in Python 3.0. ...READ MORE
You could use in to check if a string ...READ MORE
Hello @Azizjon, You can go through the example ...READ MORE
Python 2.7.9+ and 3.4+ Python 3.4 (released March 2014) ...READ MORE
Variables declared inside the class definition, but ...READ MORE
os.remove() removes a file. os.rmdir() removes an empty directory. shutil.rmtree() deletes a ...READ MORE
Hello @kartik, You could chain your queries as ...READ MORE
Hello @kartik, In your model class add a ...READ MORE
Hello @ Anee, Code: num1 = int(input("Enter First Number: ")) num2 ...READ MORE
Hello @kartik, To trigger a download you need ...READ MORE
can you please help me on this. ...READ MORE
Indentation error. There should be indent before def ...READ MORE
with in: substring in string: >>> substring = "please help ...READ MORE
Hii, Environment variables must be strings, so use os.environ["DEBUSSY"] ...READ MORE
Hello @kartik, You need to use an @api_view decorator ...READ MORE
Yes. Use os.path.splitext >>> import os >>> filename, file_extension = ...READ MORE
Hi, you might have found another way ...READ MORE
Hi@akhtar, You need to use the read function in ...READ MORE
https://www.youtube.com/watch?v=mqaf7vj1AdA This link has the program. It uses ...READ MORE
Hello @kartik, You can use Q objects for this. They ...READ MORE
img_shape = 224 test_data = [] test_labels = [] for ...READ MORE
How to read and generate QR codes ...READ MORE
Hello @kartik, Basically instead of raising exception I ...READ MORE
Hi, @There, Check what are you passing.. the ...READ MORE
>>> x = "Hello World!" >>> x[2:] 'llo World!' >>> ...READ MORE
Hello, Try to downgrade protobuf, this worked for ...READ MORE
Loop through the $forbiddennames array and use stripos to check if ...READ MORE
try import-export library of Django or if you are ...READ MORE
Open cmd and type the command and ...READ MORE
Hello geeks: Here is my models: class Room_Type(models.Model): """Django data ...READ MORE
Hi@akhtar, You can read an HDF file using ...READ MORE
In Python 3, you can use the sep= and end= parameters ...READ MORE
OR
At least 1 upper-case and 1 lower-case letter
Minimum 8 characters and Maximum 50 characters
Already have an account? Sign in.