questions/python/page/12
Hello @ Try this code: import math x, y = ...READ MORE
variable = [] Now variable refers to an empty list*. Of ...READ MORE
Hello @kartik, Set show_change_link to True (False by default) in your inline ...READ MORE
Hi@Umama, If you are using Linux system, then ...READ MORE
Example of implicit line continuation: a = some_function( ...READ MORE
Hello @kartik, You can use itertools.chain(): import itertools list2d = [[1,2,3], ...READ MORE
You can open a file for simultaneous ...READ MORE
Hii kartik, To get rid of the error, roll ...READ MORE
There isn't any need to add file.py while importing. ...READ MORE
Hi@akhtar, You may get this error if you ...READ MORE
Using scan should do the trick: string.scan(/regex/) READ MORE
Seems like the pycrypto package is not ...READ MORE
ERROR: Command errored out with exit status ...READ MORE
Hello, I had numpy installed on the same ...READ MORE
There are two string methods for this, find() and index(). ...READ MORE
Hello @kartik, Python you can write your own ...READ MORE
Using For loop This approach uses for loop ...READ MORE
Instead of doing a import like __import__ you can ...READ MORE
You can go through this: from django.contrib.auth.models import ...READ MORE
Python 3.5+: import pathlib pathlib.Path('/my/directory').mkdir(parents=True, exist_ok=True) pathlib.Path.mkdir as used above ...READ MORE
Strings in Python are immutable (can't be changed). Because ...READ MORE
Hello @kartik, Using a modelserializer might be an ...READ MORE
Hello @kartik, If you don't need to query ...READ MORE
Hii, In express 4.x: req.get('Referrer') This will also check both spellings of ...READ MORE
There is no add() , append() , or insert() method ...READ MORE
for word in read: <--- iterating ...READ MORE
Use the original df1 indexes to create ...READ MORE
IndexError The IndexError is raised when you attempt to retrieve ...READ MORE
Hello @kartik, You need to install the following ...READ MORE
Another way could be: color_dict = {'red':'#FF0000', 'green':'#008000', 'black':'#000000', 'white':'#FFFFFF'} for ...READ MORE
Hello @kartik, On the basis of your information provided ...READ MORE
While I'm Trying to Compare Two dates ...READ MORE
Hi@akhtar, If you are trying to install with pip ...READ MORE
Hello @kartiK, If you need to pass UUID ...READ MORE
Hi@akhtar, You need to install the bs4 package ...READ MORE
Use: pip install --install-option="--prefix=$PREFIX_PATH" package_name You might also want ...READ MORE
Check if it's installed properly, It will work ...READ MORE
This somewhat depends on what platform you ...READ MORE
Hi, @Henll, You should download the version that ...READ MORE
This can be done by importing the ...READ MORE
Hello @kartik, Using a form in a view can ...READ MORE
Hi, i am trying to generating joined ...READ MORE
Simple: st = "abcdefghij" st = st[:-1] There is ...READ MORE
parameters = pd.read_csv(params_filename, sep="\t") free_parameters = parameters.columns.get_values().to_list() free_parameters = ...READ MORE
I think the general idea of the ...READ MORE
Try this: pip uninstall pyttsx3 Then: pip install pyttsx3==2.71 READ MORE
They do a similar thing but not ...READ MORE
Hello, Try this: return HttpResponse(status=204) Hope it works!! ...READ MORE
For Python 3.5+ use: import importlib.util spec = importlib.util.spec_from_file_location("module.name", ...READ MORE
Hi, I am very new to Python ...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.