questions/python
From Python Documentation: An except clause may name multiple ...READ MORE
d = {'key': 'value'} print(d) # {'key': 'value'} d['mynewkey'] = ...READ MORE
Using an additional state variable, such as ...READ MORE
It's safer to use a try around the attempt ...READ MORE
To understand what yield does, you must understand what generators are. ...READ MORE
Regarding your query, it must relate to ...READ MORE
IndexError The IndexError is raised when you attempt to retrieve ...READ MORE
Hi, @There, Try this: Rollback pip to an older ...READ MORE
motion_detection.ipynb # Python program to implement # Webcam ...READ MORE
Hi, First thing YAML and JSON are not ...READ MORE
Hi, @Webinar, Are you getting any kind of ...READ MORE
While I'm Trying to Compare Two dates ...READ MORE
from nsepy import get_history from datetime import date import ...READ MORE
can you please help me on this. ...READ MORE
Hi, @Shabaj, Regarding your query, I hope this ...READ MORE
Hi@Aditya, It is working fine in my python ...READ MORE
Hello @kartik, Try this out: import socket s = socket.socket(socket.AF_INET, ...READ MORE
Hello @kartik, Just replace and with , and you're done: try: ...READ MORE
Hello @Kartik, Use socket and its gethostname() functionality. This will get the hostname of ...READ MORE
Hello @kartik, use os.chdir like this: os.chdir("/path/to/change/to") By the way, if you ...READ MORE
Hello @kartiK, If you need to pass UUID ...READ MORE
Hi, @There, Regarding your query I would suggest ...READ MORE
Hello @kartik, You can import isfunction from the inspect module. >>> from inspect ...READ MORE
If i understand your question correct then ...READ MORE
Hello @kartik, Try this out: >>> import os >>> os.path.abspath("mydir/myfile.txt") 'C:/example/cwd/mydir/myfile.txt' Also ...READ MORE
Hello @kartik, You can do: var = 1 if type(var) ...READ MORE
Hello @kartik, For Python 2.6 and later and ...READ MORE
Hello @Muhammad Umer, As per the Beautiful Soup Documentation: AttributeError: ...READ MORE
from shutil import copyfile copyfile(src, dst) Copy the contents ...READ MORE
import shutil shutil.rmtree('/folder_name') By design, rmtree fails on folder trees containing ...READ MORE
With new_list = my_list, you don't actually have ...READ MORE
os.remove() removes a file. os.rmdir() removes an empty directory. shutil.rmtree() deletes a ...READ MORE
from shutil import copyfile copyfile(src, dst) Copy the ...READ MORE
Hello geeks: Here is my models: class Room_Type(models.Model): """Django data ...READ MORE
It seems mysql_config is missing on your ...READ MORE
This works for me: $ pip install -r ...READ MORE
As of pip 1.3, there is a pip show command. $ ...READ MORE
Having tested this using Python 3.5 and ...READ MORE
I've found this snippet as an alternative ...READ MORE
Here is what you asked for: from functools ...READ MORE
some_list[-1] is the shortest and most Pythonic. In fact, ...READ MORE
One thing that is really helpful in ...READ MORE
You can use the + operator to combine them: listone ...READ MORE
Here's a generator that yields the chunks ...READ MORE
Use: pip install --install-option="--prefix=$PREFIX_PATH" package_name You might also want ...READ MORE
Use __import__ function to import the module by giving ...READ MORE
Use "getattr": obj = MyClass() try: ...READ MORE
I'm not sure that anything much could ...READ MORE
Use the type() builtin function: >>> i = 123 >>> type(i) <type ...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.