17 questions
Filter
- 1 votes2 answers44 views
"with" statement in Python
What is the Python with statement designed to be used for? with open('file_path', 'w') as file: file.write('Something') `
- 0 votes2 answers14 views
Which books are good for self education in Python ?
Which books are good for self education in Python ?
- 1 votes1 answers20 views
For Each in Python
I know in other languages it is a for each loop; however, I am struggling to understand how to do this in python. Assuming I have an Array with a lot of elements, ...
- 0 votes0 answers10 views
How do you call command line from python
I am attempting to call bash commands from inside python. Specifically, I have a 3rd party took that has a command line. I can call this tool perfectly from the ...
- 2 votes1 answers10 views
- 5 votes2 answers62 views
Python Program Printing Pattern
How to write a Program for printing pyramid patterns in Python?
- 0 votes0 answers10 views
How to change Boolean value inside template?
In Django, I am creating a registration form for multiple user types. I have set in models the Boolean field, which is set to false. My form file has registration ...
- 0 votes0 answers12 views
Good Implementation : Isomorphic react app + Python backend
What is the best way to implement an isomorphic react app using webpack with python as a backend to serve Following features are required to be implemented React ...
- 1 votes1 answers11 views
How to get the last element of a list in Python?
In Python, how do you get the last element of a list?
- 1 votes1 answers7 views
Join two lists in Python
How do I concatenate two lists in Python? Example: listone = [1, 2, 3] listtwo = [4, 5, 6] Expected outcome: >>> joinedlist [1, 2, 3, 4, 5, 6] `
- 1 votes1 answers9 views
Check if a list is empty in Python
For example, if passed the following: list = [] How do I check to see if a is empty?
- 0 votes0 answers5 views
How can I safely create a nested directory?
What is the most elegant way to check if the directory a file is going to be written to exists, and if not, create the directory using Python? Here is what I tried: import ...
- 0 votes0 answers6 views
How can I find current directory and file's directory???
In Python, what commands can I use to find: the current directory (where I was in the terminal when I ran the Python script), and where the file I am executing ...
- 0 votes0 answers6 views
How do I download a file over HTTP using Python?
I have a small utility that I use to download an MP3 from a website on a schedule and then builds/updates a podcast XML file, which I've added to iTunes. The text ...
- 0 votes1 answers7 views
Is there a way to run Python on Android?
We are working on an S60 version, and this platform has a nice Python API. However, there is nothing official about Python on Android, but since Jython exists, ...
- 8 votes1 answers6 views
Merge rows in dataframe with different columns
I want to merge rows of dataframe with one common column value and then merge the rest of the column values separated by a comma for string values and convert to ...
- 8 votes3 answers30 views
How can I reverse a list in Python?
How can I do the following in Python? I need to have the elements of an array, but from the end to the beginning.