Skip to main content

Questions tagged [python-2.x]

Python 2 is the predecessor of Python 3 and its last version, Python 2.7 was formally released on July 3, 2010. Use this tag along with the main python tag to denote programs that are meant to be run on a Python 2 interpreter only. Do not mix this tag with the python-3.x tag.

1 vote
1 answer
137 views

I created these database tables with the inspiration in NjDevPro github repository. The design uses Closure Table for implementation of hierarchical tagging system in ...
xralf's user avatar
  • 37
3 votes
2 answers
337 views

How does the following look for a json lexer? Are there any things that can be improved upon? Does the pattern look general-purpose enough to be able to generalize it to make it into a useful program, ...
David542's user avatar
  • 479
1 vote
1 answer
2k views

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 ...
JThao's user avatar
  • 57
1 vote
1 answer
190 views

Recently I have been learning Python after years of putting it off, and I am having a really fun time with it. However after I spent a few hours making something that I thought was pretty cool, I ...
Evil2's user avatar
  • 11
1 vote
1 answer
231 views

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 ...
User1974's user avatar
  • 218
1 vote
1 answer
102 views

I am trying to remove files in my directory if they are over 30 days. However, I don't know what other checks I need to do. The examples I found online weren't very thorough besides just subtracting ...
JThao's user avatar
  • 57
1 vote
1 answer
3k views

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 ...
JThao's user avatar
  • 57
1 vote
2 answers
1k views

I have a dictionary that I am writing to a csv file, however I am only writing the values. I want to know if there is a faster way than using a for loop. I am using python 2.7 here is my code. ...
JThao's user avatar
  • 57
3 votes
4 answers
2k views

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 ...
Saya's user avatar
  • 137
8 votes
3 answers
3k views

I am trying to create a code for the Basic evapotranspiration equation by Hargreaves. I have attached a screenshot of the equation to be replicated. I want to create a class wherein I can input data ...
jeronimo dcosta's user avatar
5 votes
1 answer
1k views

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 ...
Alex's user avatar
  • 151
8 votes
2 answers
3k views

I am new to python, and developing a moderate application for which I need to setup a logging mechanism. The below program sets up log handling, which gives the user an option to specify whether log ...
Cheppy's user avatar
  • 83
3 votes
1 answer
79 views

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'...
keves1's user avatar
  • 31
3 votes
0 answers
89 views

I am using a function that returns a list of all files (full path for each of them) with the given extension in the given folder and all subfolders. As the process is quite long and user can get ...
SlavaB's user avatar
  • 31
2 votes
3 answers
704 views

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 <...
Justin's user avatar
  • 2,619

15 30 50 per page
1
2 3 4 5
83