epoch timestamp converter with millennia range, python
is there an epoch time converter that can deal with millennia? time.gmtime(1000 * 365 * 24 * 60 * 60) throws ValueError: timestamp out of range for platform time_t ...
is there an epoch time converter that can deal with millennia? time.gmtime(1000 * 365 * 24 * 60 * 60) throws ValueError: timestamp out of range for platform time_t ...
on google appengine (http://shell.appspot.com/): >>> time.gmtime(1000*365*24*60*60) (2969, 5, 3, 0, 0, 0, 2, 123, 0) on macosx: >>> time.gmtime(1000*365*24*60*60) Traceback (most recent call last): File "<stdin>", line 1, in <module> ValueError: timestamp out of range for platform time_t is there a platform agnostic implementatio...
I have problem storing a big queryset in the session. This queryset is from a search and I need to store it for paginate inside every result. This is the code in my view: c = queryset.order_by('-order') request.session['query_search'] = c You can see an example in my site: http://www.lukmi.com/classifieds/chicas/escorts/barcelona/ Th...
>>> idmapfile = open("idmap", mode="w") >>> pickle.dump(idMap, idmapfile) >>> idmapfile.close() >>> idmapfile = open("idmap") >>> unpickled = pickle.load(idmapfile) >>> unpickled == idMap False idMap[1] {1537: (552, 1, 1537, 17.793827056884766, 3), 1540: (4220, 1, 1540, 19.31205940246582, 3), 1544: (592, 1, 1544, ...
Is it good practice to treat individual app views as a blocks of HTML that can be pieced together to form a larger site? If not, what is the best way to reuse app views from project to project, assuming each one uses a different set of templates? ...
I'm building a non-browser client-server (XULRunner-CherryPy) application using HTTP for communication. The area I'm pondering now is user authentication. Since I don't have substantial knowledge in security I would much prefer using tried-and-tested approaches and ready-made libraries over trying to invent and/or build something myself....
My python application consists of main program and several modules. Each module contains import logging log = logging.getLogger('myapp.mymodule') on global level. Handlers and other stuff initialized in main program, and typically all messages forwarded to syslog. Now I want to launch multiple instances of application (configuration ...
I have a huge list of data, more than 1M records in a form similar (though this is a much simpler form) to this: [ {'name': 'Colby Karnopp', 'ids': [441, 231, 822]}, {'name': 'Wilmer Lummus', 'ids': [438, 548, 469]}, {'name': 'Hope Teschner', 'ids': [735, 747, 488]}, {'name': 'Adolfo Fenrich', 'ids': [515, 213, 120]} ... ]...
1) When a script gets data from the database using the db.Model.get_element_by_id("id") method, what id does it refer to, and how can you get it from the database. 2) If you get a result using this method, does that result maintain a link to the database so that any changes to the result are reflected on the database? If not, how would y...
I am a noob to Python and have not had any luck figuring this out. I want to be able to keep the tax variable in the code so it would be easily updated should it change. I have experimented with different means but was only able to get it to skip the print tax line and print the same values for the total and subtotal. How do I multiply t...
I'm using python-dbus and cherrypy to monitor USB devices and provide a REST service that will maintain status on the inserted USB devices. I have written and debugged these services independently, and they work as expected. Now, I'm merging the services into a single application. My problem is: I cannot seem to get both services ( cher...
I do html/css by trade, and I have been working on and off django projects as a template designer. I'm currently working on a site that uses Jinja2, which I have been using for about 2 weeks. I just found out through reading the documentation that Jinja2 doesn't support multiple level template inheritance, as in you can't do more than on...
I have three tables (users, articles, and tags) defined in SQLAlchemy and mapped with orm.mapper(). As you can see below, I'm adding a property "author" to each article which ties that article to the user that created it. orm.mapper(User, t_users) orm.mapper(Tag, t_tags) orm.mapper(Article, t_articles, properties={ 'author' : orm.r...
I'm working on a project aimed at system administration for a linux installation. I need to perform some tasks like change the user password... I was planning to use the subprocess module for this. I'm concerned about security so, what are the 'best practices' when doing this via python? is subprocess sufficient, or is there something...
hello world i want an exemple of countor of time with pyqt4 and also how to have a date actuall thx ...
Okay I will try to be as descriptive as possible here, I am using Python-Django server and the pyFacebook helper. I have this callback url on the facebook edit application page: http://panome.eyesee360.com:8000/panomeFbProject/fbLandingPage/ In my project urls.py: urlpatterns = patterns('', (r'^panomeFbProject/', include('panomeF...
Is there an existing python module that can be used to detect which distro of Linux and which version of the distro is currently installed. For example: RedHat Enterprise 5 Fedora 11 Suse Enterprise 11 etc.... I can make my own module by parsing various files like /etc/redhat-release but I was wondering if a module already exists? ...
Is there a way to set up a global variable inside of a module? When I tried to do it the most obvious way as appears below, the Python interpreter said the variable __DBNAME__ did not exist. ... __DBNAME__ = None def initDB(name): if not __DBNAME__: __DBNAME__ = name else: raise RuntimeError("Database name has a...
Is there a Scrum plugin for the Roundup Issue Tracker similar to Agilo for Trac? I realize that Roundup is an issue tracking system, whereas Trac is designed to be an integrated project management, SCM, and issue tracker. Therefore, maybe a better question would be—Is anyone aware of a, preferably Python based, Scrum tool to use in conju...
I have DATA on x and y axes and the output is on z for example y = 10 x = [1,2,3,4,5,6] z = [2.3,3.4,5.6,7.8,9.6,11.2] y = 20 x = [1,2,3,4,5,6] z = [4.3,5.4,7.6,9.8,11.6,13.2] y = 30 x = [1,2,3,4,5,6] z = [6.3,7.4,8.6,10.8,13.6,15.2] how can i find the value of z when y = 15 x = 3.5 I was trying to use scipy but i am very new ...