is it possible to read the text written in a sticky note using a script in linux?
I am using sticky notes in ubuntu . And was wondering if it would be possible to read the text written in sticky notes using any scripting language . ...
I am using sticky notes in ubuntu . And was wondering if it would be possible to read the text written in sticky notes using any scripting language . ...
Assuming I have the following: class Person(db.Model): name = db.StringProperty() I would like to print all the names in an html file using a template. template_values = {'list': Person.all()} And the template will look like this: {% for person in list %} <form> <p>{{ person.name}} </p> <button type="button" name="**{{ perso...
I have simple question. How to create user role in Django without creating it in DB manually ? EDIT: I need to create specific permission. So only users with this permission can change specific field of model. I just need make one field 'readonly' for some users. Is it possible in django? ...
I have a sample code looking like this, values (position = 2, object.position = 3) : new_position = position old_position = object.position logging.debug("1. new_position: %s, old_position: %s" % (new_position, old_position)) if old_position != new_position: logging.debug("old position other than new positi...
Is there any way to invoke fragment identifiers from python? I'm currently using python mechanize. ...
I used to open files that were in the same directory as the currently running Python script by simply using a command like open("Some file.txt", "r"). However, I discovered that when the script was run in Windows by double-clicking it, it would try to open the file from the wrong directory. Since then I've used a command of the form ope...
When I try to call a function using a timeout in pyGtk, I receive the error message TypeError: second argument not callable. All I want to do is call a very simple function from within the time out. To illustrate my proble, I have simply prepared the function do_nothing to illustrate my problem. def do_nothing(self): return True # ...
Hello, I have been struggling for a couple hours now with serving jpg's with a python cgi site. For some reason the images always come out distorted. Here is my code: print('Content-type: image/jpg\n') path = 'C:\\Users\\Admin\\Documents\\image.jpg' print file(path, 'rb').read() This post describes a nearly identical problem, howeve...
I have a DB "TimeZoneField" type for users, how do I use that with the "datetime.datetime()" object to get a strftime() string like '%Y-%m-%dT%H:%M:%S.000Z'? ...
I am running into this problem - TypeError: 'int' object is unsubscriptable This happens at the line: (more code below) sectorcalc[i][2]= ((today[2]/yesterday[2])-1) But the object today[2] is , any ideas? Also, I couldn't find a good definition of unsubscriptable for python anywhere? what does this actually mean the problem is? Tha...
I'm trying out a few pygtk tutorials and have run across a seemingly obvious newbie mistake, but for the life of me can't figure out what's going on here. The error: Traceback (most recent call last): File "main.py", line 8, in class Base: File "main.py", line 61, in Base cv.set_line_width(9) NameError: name 'cv' is not ...
I am trying to get simplejson installed on this python 2.4.3 - I cannot upgrade, I know it is old, there is nothing I can do about it, it is not my fault, please help. however when i do the ..\python.exe .\setup.py install i get: File "C:\Program Files (x86)\WorldViz\Vizard30\bin\lib\zipfile.py", line 188, in __init__ raise RuntimeErro...
There have been a number of other questions on AttributeErrors here, but I've read through them and am still not sure what's causing the type mismatch in my specific case. Thanks in advance for any thoughts on this. My model: class Object(db.Model): notes = db.StringProperty(multiline=False) other_item = db.ReferenceProperty(Other...
Is IO more efficient, due to the linux disk buffer cache, when storing frequently accessed python objects as separate cPickle files instead of storing all objects in one large shelf? Does the disk buffer cache operate differently in these two scenarios with respect to efficiency? There may be thousands of large files (generally around...
JSON serialization Python using simpleJSON How do I create an object so that we can optimize the serialization of the object I'm using simpleJSON 1,2 are fixed variables 3 is a fixed dict of category and score 4 is an array of dicts that are fixed in length (4), the array is a length specificed at run-time. The proc...
I have never worked with json before. I am trying: http://api.worldbank.org//topics?format=JSON and make things with it, but I don't even know how to get started. Following some manuals, I did this: import urllib import urllib2 import simplejson urlb = 'http://api.worldbank.org/topics' datab = urllib2.urlopen(urlb+'?'+ param) resultb =...
Possible Duplicate: any way to invoke fragment identifiers '#' in python Is there any way to invoke fragment identifiers from python? I'm currently using python mechanize. ...
Hi there. I am using lxml.html to parse some hmtl to get links, however when it hits a link which contains an image it just returns blank, what it'd really like is to be able to detect if it's an image, and then try and return the image alt text. So it looks like this... from lxml.html import parse, fromstring doc = fromstring('<a hr...
Hi, I'm trying to test my function "def" in a python shell, but when i paste it in there are errors. It seems not to like it when i have multiple return statements inside one "def". For example: def foo(): valid = True if valid: return True return False Does anyone know why? thanks! ...
Hi everybody, I'm using matplotlib to plot some data as 2d curves in a 3d axes. I use the ax=axes3d.Axes3D() to define my axes and ax.plot(x,y, zs='z') to plot my 2d curves in the 3d space. Now I want to add something that looks like what is on this page http://matplotlib.sourceforge.net/examples/mplot3d/polys3d_demo.html, but I want t...