questions/python
for word in read: <--- iterating ...READ MORE
Hey, @S, you can have a look at ...READ MORE
You may do like this but it ...READ MORE
The script at Pastebin does work. However, ...READ MORE
TL;DR: pip install -Iv (i.e. pip install -Iv MySQL_python==1.2.2) First, I ...READ MORE
Python 2.7.9+ and 3.4+ Python 3.4 (released March 2014) ...READ MORE
Python3 and pip are most likely pointing ...READ MORE
Hello @Harikrishna, For your query you can refer ...READ MORE
Hello, You can try this simple code: def getSum(n): ...READ MORE
Hi, @Paradox, The error message IndentationError: expected an indented ...READ MORE
The command you're looking for is: python3.7 -m ...READ MORE
Python 3 class MyClass(object): = New-style class class MyClass: = New-style ...READ MORE
Use: >>> import datetime >>> datetime.datetime.now() datetime.datetime(2009, 1, 6, 15, ...READ MORE
First build an Element instance root from the XML, ...READ MORE
I just used the following which was ...READ MORE
Hii, The easiest way is to use shutil.make_archive. It ...READ MORE
Hello, pip is just a PyPI package like any other; you ...READ MORE
Hello, To install requests module for Python2: $ sudo apt-get install ...READ MORE
Hello, Just replace and with , and you're done: try: ...READ MORE
Hii, Environment variables must be strings, so use os.environ["DEBUSSY"] ...READ MORE
There are some good answers here. I ...READ MORE
You need to implement your own __repr__ ...READ MORE
No need to put filename.txt For directory check path ...READ MORE
Classes (by default) are instances of the ...READ MORE
Which python projects are good for beginner ...READ MORE
Hello @golu , Try something like this: with open(yaml_file, 'r') ...READ MORE
Hello, You need to use os.path.expanduser. This will ensure it works ...READ MORE
Hello @kartik, You can use BeautifulSoup: from bs4 import BeautifulSoup x="""<foo> ...READ MORE
Hello @kartik, No there is not. You cannot ...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
Look at the subprocess module in the standard library: import ...READ MORE
One thing you can try is to ...READ MORE
The answer to this is version- and ...READ MORE
Hello, The len() function can be used with several different ...READ MORE
Hello @kartik, To check if the key exists ...READ MORE
Hello, Just wrap it in a list: def Change(self, ...READ MORE
Hii, Try this: import os os.listdir("somedirectory") Thank you!! ...READ MORE
Hello @kartik, You can use itertools.chain(): import itertools list2d = [[1,2,3], ...READ MORE
Hello, Using try except and the right error ...READ MORE
Hello @kartik, Look at the subprocess module in the standard ...READ MORE
Hello @kartik, Try this: def permutations(head, tail=''): ...READ MORE
Hello @kartik, Use join: >>> sentence = ['this','is','a','sentence'] >>> '-'.join(sentence) 'this-is-a-sentence' Hope it ...READ MORE
Hello @kartik, Your problem is more easily addressed ...READ MORE
Hello @kartik, You can use Q objects for this. They ...READ MORE
Go for Django . It's easy and ...READ MORE
#appriciate your helping email = input("enter your email ...READ MORE
I am trying to calculate numerical integration ...READ MORE
One approach just generates random integers up ...READ MORE
Use Markdown to style code: - Use a ...READ MORE
the code after return does not execute. ...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.