All Questions
Tagged with python-2.7 or python-2.x
1,235 questions
1 vote
1 answer
137 views
Database design using Closure Table for tagging system
I created these database tables with the inspiration in NjDevPro github repository. The design uses Closure Table for implementation of hierarchical tagging system in ...
1 vote
1 answer
2k views
Function to add a new key pair value to my JSON file
As you can see I am using a counter variable to iterate through my JSON file and it's a dictionary that has a list of dictionaries. Once I find the key normalHours I divide it and add it to my ...
1 vote
1 answer
230 views
Loop through polyline vertices and update coordinate
I have a Python 2.7 script that loops through GIS polylines and updates a coordinate. The coordinate is called an "M" coordinate (aka a "Measure-value"). M coordinates are similar ...
1 vote
1 answer
3k views
What is the pythonic way to update my nested dictionary?
So I need to update my nested dictionary where the key is "compensationsDeltaEmployee". I created a string cost_perhour to hold the value of my conditional statements. Now that I am done ...
3 votes
4 answers
2k views
Find differences between two directories
Coming from another language than Python, I would like to see if my code is "pythonic" enough and follows good practices. It compares two directories, showing all files that are in one and ...
5 votes
1 answer
1k views
Send email with attachments, including in memory zipped attachments
The below class implementing a simple way to create emails with attachments, including the option to create in-memory zip files and attach them to the email. Because I am not a professional programmer ...
3 votes
1 answer
79 views
Interactive, real-time bikeshare web application with Bokeh
As a side project, I'm working on a Bokeh web application to display public bikeshare data on a map. The data is updated every 2 minutes using a periodic callback. Below is the full implementation. I'...
2 votes
3 answers
702 views
Bifurcating recursive calculation with redundant calculations
def T(n): if n <= 0: return 1 else: return T(n-1) + (n-1) * T(n-2) print T(4) I need an effective way to print out the output of the function <...