text
stringlengths
256
65.5k
If the image is stored in a BlobProperty, then the data is stored in the datastore, and if profile is your entity, then the height can be accessed as: from google.appengine.api import images height = images.Image(image_data=profile.avatar).height If the image is in the blobstore, (blobstore.BlobReferenceProperty in th...
the au600 device is a usb PSTN gateway that allows using a plain old telephone as VoIP phone. This driver got reverse engineered, so not everything might work as expected yet. Current developer: Markus Rechberger \<mrechberger|at|gmail.com> IRC on freenode: mrec/mrec_ Supported: Probably supported: OEM Page: A note on ...
luc765 Re : Synthèse vocale SVOX Pico Merci à frafra et tuxmuraille, pour votre travail. J'utilisais espeak avec mbrola, la qualité de SVOX est nettement meilleure J'ai installé gSpeech sur Lucid via la compilation pour SVOX. Tout est parfait. Dans l'utilisation est-il possible de modifier la vitesse de lecture par un ...
If you want to write it to disk so that it will be easy to read back in as a numpy array, look into numpy.save. Pickling it will work fine, as well, but it's less efficient for large arrays (which yours isn't, so either is perfectly fine). If you want it to be human readable, look into numpy.savetxt. Edit: So, it seems...
Here's the POST implementation. This has to add a new feed to the user's list of feeds: def post(http): """Update a user's list of feeds with a new feed.""" username = http.user form = util.FieldStorage(http) suggested_feed = form["suggested_feed"] def add_feeds(): try: ...
I have a script that includes opening a file from a list and then doing something to the text within that file. I'm using python multiprocessing and Pool to try to parallelize this operation. A abstraction of the script is below: import os from multiprocessing import Pool results = [] def testFunc(files): for file ...
If I create a global variable in one function, how can I use that variable in another function? Do I need to store the global variable in a local variable of the function which needs its access? You can use a global variable in other functions by declaring it as globvar = 0 def set_globvar_to_one(): global globvar ...
I have some html files that I want to convert to text. I have played around with BeautifulSoup and made some progress on understanding how to use the instructions and can submit html and get back text. However, my files have a lot of text that is formatted using table structures. For example I might have a paragraph of...
Does anybody know where to get list of working long2short service websites? The bigger the better - I need at least 100 of them. The list at http://hjacob.com/blog/2009/07/url-shortener-redirects/ looks pretty good. There are still a lot of dead links. Here are the listed URLs that responded For some reason, my favorit...
Here is an alternative solution: It returns a list tuples of (start,finish), as that's what I needed ;). This mutates the list, so I needed to make a copy. Obviously, that increases the memory usage. I suspect that list.pop() is not super-efficient, but that probably depends on the implementation of list in python. def...
People use SDKs. It's the most manageable way to do it. The Python SDK (facebook) is up to date and has a repo at https://github.com/pythonforfacebook/facebook-sdk. It's not official because Facebook doesn't officially support anymore but it is maintained (last commit 12 days ago) and people do use it. facepy as well i...
I am trying to write chat application, here are some desing thoughts: Django doing main website serving. Sockjs-tornado serves chat and between them I would like to setup redis. When sockjs-tornado receives message in chat, it processes it and sends to other connected clients and also puts it in redis, so Django can sa...
It took me a while, but I figured out how to use SQLAlchemy to model a relationship across two different kinds of databases: Base = declarative_base() class Survey(Base): __tablename__ = 'SURVEY' survey_id = Column("SURVEY_ID", Integer, primary_key=True) term_id = Column("TERM_ID", Integer, nullable=False) ...
I need some help with Python's map function. I am trying to execute this code, though I get an error: Updated Post This is my exact code, along with the outputs of each function: infinity = 1000000 invalid_node = -1 startNode = 0 #Values to assign to each node class Node: def __init__(self): self.distFromSo...
Componentes y Agregados (plugin) Los componentes y los agregados o plugin son características relativamente novedosas en web2py, y existen diferencias entre los desarrolladores sobre qué son o qué deberían ser. La confusión deriva mayormente de los distintos usos de esos términos en otros proyectos de software y del he...
Are there unforeseen problems in mixing different types in a Python list? For example: import random data = [["name1", "long name1", 1, 2, 3], ["name2", "long name2", 5, 6, 7]] name, long_name, int1, int2, int3 = random.choice(data) I'm using this code to randomly set several related parameters within a functi...
I used this example to produce printing service. As the result I get map with too many elements in the legend. Is it possible ti show classes that are visible in the current map extent using python script? There is no need to write any additional ArcPy for this. Simply use i think this code will help: import arcpy impo...
Data models that can be stored in any database or remote service using adapters. It makes the semantic interoperability and standardization of data and web services possible. var resource = require('tower-resource'); attributes: resource('post') .attr('title') // defaults to 'string' .attr('body', 'text') .attr(...
benoitfra [Script] reconnaissance vocale avec google Voilà pas mal de temps que le projet avait été lancé (2012) mais je n'avais pas les compétences et le temps pour amener le projet là où je le désirais. J'ai donc repris tout le projet à 0 afin de fournir un système beaucoup plus souple et rapide de prise en main. Pri...
vince06fr Re : Nettoyage dans les noyaux (kernel) Umuntu : Si tu veux prendre le temps de traduire ce script, surtout ne te gêne pas comme tout est "hardcodé" dans le script, la seule chose à faire est... De modifier l'ensemble des textes en français présents dans le script pour les mettre en anglais. Une fois le scrip...
Linux has come a long way in the last 10 years. At that time, if you were looking through the main audio and music applications on other operating systems, you would have struggled to find comparable, fully developed, apps on Linux. Nowadays, while no one would say the job was done, they could point to an assortment of...
#1001 Le 10/02/2014, à 13:13 daniel38100 Re : [Conky] Alternative à weather.com (3) tu m'as macher le boulot mais au moins c'un fonctionnement que j'ai compris en faite j're repris toute la fonction Recherche et RemplissageListBox j'ai juste changer def OnChercherButton(self, event): self.listVilles, self.ville...
From an efficiency perspective, you're not going to beat translate() - it's performing raw string operations in C with a lookup table - there's not much that will beat that bar writing your own C code.If speed isn't a worry, another option though is: exclude = set(string.punctuation) s = ''.join(ch for ch in s if ch no...
You might have a broken cable and/or connector: Install aLogCat and unplug the USB cable then clear the logs, then re-plug the USB cable. You should see something like this: --------- beginning of /dev/log/system D/Vold ( 132): USB connected D/Vold ( 132): Share method ums now available I/StorageNotification( ...
Bonjour, je me fais la main sur python et j'ai un bug douteux avec python3. Voici un code simple, une espèce de shell : #!/usr/bin/env python # -*- coding: utf-8 -*- import sys prompt='prompt> ' while True: sys.stdout.write(prompt) line = sys.stdin.readline().split('\n', 1)[0] sys.stdout.write('read: "' + l...
Gen dot product Hi, How do you get the angle between two vectors A and B in Gen ? The formulae is the following : acos( dot(A,B) / length(A)*length(B) ) but I can’t make it work ? allof the following text. Then, in Max, select New From Clipboard. ----------begin_max5_patcher---------- 1496.3oc6Z0rbihCD9r8SgJNMIkGGj3Oyb...
“Suppose I say to Fat, or Kevin says to Fat, "You did not experience God. You merely experienced something with the qualities and aspects and nature and powers and wisdom and goodness of God.” This is like the joke about the German proclivity toward double abstractions; a German authority on English literature declares...
Le Farfadet Spatial Re : Petit guide pour aider au choix d'un langage Salut à tous ! Sur amazon, j'ai trouvé ce livre "Python - Les Fondamentaux du langage - La Programmation pour les scientifiques. de Matthieu Brucher" Très bon livre, dans la mesure où tu sais déjà programmer et que tu es intéressé par la partie scien...
The easiest way to do this is probably to overwrite the YAML constructor for tag:yaml.org,2002:map so it returns a custom dictionary class instead of an ordinary dictionary. import yaml class AttrDict(object): def __init__(self, attr): self._attr = attr def __getattr__(self, attr): try: ...
You may try to tackle your problem like: # main ideas described in very high level pseudo code choose suitable base kernel shape and type (gaussian?) while true loop over your array (moving average manner) adapt your base kernel to current sparsity pattern set current value based on adapted kernel ...
This is the output: [USER@SERVER ~] ping localhost PING localhost (127.0.0.1) 56(84) bytes of data. 64 bytes from localhost (127.0.0.1): icmp_seq=1 ttl=64 time=0.037 ms 64 bytes from localhost (127.0.0.1): icmp_seq=2 ttl=64 time=0.024 ms 64 bytes from localhost (127.0.0.1): icmp_seq=3 ttl=64 time=0.030 ms 64 bytes from...
I have a plain text file with some data in it, that I'm trying to open and read using a Python (ver 3.2) program, and trying to load that data into a data structure within the program. Here's what my text file looks like (file is called "data.txt") NAME: Joe SmithCLASS: FighterSTR: 14DEX: 7 Here's what my program looks...
Courtesy Card Usage Hello all, It has been requested that all the libraries review the use of courtesy cards when it comes to helping patrons. Magrath Circulation has a courtesy card with $10 in value in our locked key box. This value is reset to $10 at the beginning of every month. When to use this card to help patron...
I use revision control (Subversion, to be exact) to keep track of the edits to my LaTeX documents. Is there a LaTeX package that interfaces with revision control? Specifically, it would be nice to see the revision number and time and date inside the document. (Obviously, I'd turn this off in the final version.) Also, i...
tshirtman Re : /* Topic des codeurs [8] */ Ça je sais bien C'est juste que j'ai du mal à voir l'intérêt de préciser « si tu a bien mis ton main dans un bloc if __name__ == '__main__' » quand tu parles de concaténer tout dans un même fichier : – Soit il y a du code en vrac et il sera lu dans tous les cas lors de l'exécu...
The Django management commands documentation shows all commands being created in an app/management/commands folder. Is it possible to put commands into subfolders, like app/management/commands/install and app/management/commands/maintenance? How would this be done? Unfortunatly, as of Django 1.4 there seems to be no wa...
When installing mysqldb on mac osx 10.5: sudo ../bin/python /Users/Awais/mysqlpython/setup.py install I get the following error: Traceback (most recent call last): File "/Users/Awais/mysqlpython/setup.py", line 15, in <module> metadata, options = get_config() File "/Users/Awais/mysqlpython/setup_posix.py", line 32, ...
Phoenamandre Re : Suivi des bogues d'Ubuntu 12.10 j'ai le même problème que toi avec mon dell xps ! autre bogue, si vous êtes touchés par un problème de maya qui ne veut pas démarrer https://bugs.launchpad.net/maya/+bug/1047599 Hors ligne vlotho Re : Suivi des bogues d'Ubuntu 12.10 Salut j'ai une ribembelle de warning ...
so I've asked this question on kivy user support (google groups) but haven't got any replies yet, so I'll try here. I've got a set of buttons which are created based on a search tool. Basically the way it works is that the user inputs a search term in a textinput box and based on the input text, my program searches a d...
Here's my code. It opens the webcam, grabs frames, downsizes them to a smaller window, and tries to get the frame rate with GetCaptureProperty. It cannot find the GetCaptureProperty functions, and neither can I (I clicked through every folder in the Opencv modules folder). Any ideas? #include "stdafx.h" #include "openc...
Why don't you just use dic.get('b', 'b') Sure, you can subclass dict as others point out, but I find it handy to remind myself every once in a while that get can have a default value! If you want to have a go at the defaultdict, try this: dic = defaultdict() dic.__missing__ = lambda key: key dic['b'] # should set dic[...
duthen-mac [Résolu] Update Manager - firefox et libgrail => Hash Sum mismatch Bonjour, je n'arrive pas à résoudre mon problème de "Hash Sum mismatch"! Je précise que, si je connais bien Unix, je suis tout nouveau sur Linux. Chaque fois que j'essaie de faire des mises à jour avec l'Update Manager, il échoue toujours ave...
I'm trying to hash a password to dump into a .rdp file. I found a site that (more or less) shows how to do that here but it doesn't work in 3.1. In 2.5.4 I get this: >>> import win32crypt >>> import binascii >>> pwdHash = win32crypt.CryptProtectData(u"password",u'psw',None,None,None,0) >>> print str(binascii.hexlify(pw...
Logistic regression is regression, first and foremost. It becomes a classifier by adding a decision rule. I will give an example that goes backwards. That is, instead of taking data and fitting a model, I'm going to start with the model in order to show how this is truly a regression problem. In logistic regression, we...
We do a lot of component caching and not all of them are updated at the same time. So we set host and timestamp values in a universally included context processor. At the top of each template fragment we stick in: <!-- component_name {{host}} {{timestamp}} --> The component_name just makes it easy to do a View Source ...
aeacides Re : Ultimate Smash Friends: un smash bros like en python Kewl! Bon boulot! De mon côté il me reste une semaine et demi de labeur, et après je devrais pouvoir m'y mettre :- ) @+ http://www.q-be.ca Hors ligne tshirtman Re : Ultimate Smash Friends: un smash bros like en python cool . Mon petit frère (qui a dessi...
The data: list = ['a','b','x','d','s'] I want to create a string str = "abxds". How can I do that? Right now I am doing something like: str = "" for i in list: str = str + i print(str) I know strings are immutable in Python and this will create 7 string object. And this goes out of my memory when I do thousands of...
malbo Re : Windows 8.1+Ubuntu... Ton Boot-Info est là : Boot Info Script e7fc706 + Boot-Repair extra info [Boot-Info 27Sep2013] ============================= Boot Info Summary: =============================== => Grub2 (v1.99) is installed in the MBR of /dev/sda and looks at sector 175118912 of the same hard ...
AnsuzPeorth [HtmlDesktopTools] Tout pour votre bureau en HTML5/JS/CSS3 Bjr, N'ayant pas trouvé une taskbar qui me convienne, j'ai codé, pour le fun, une taskbar html. Plutot que de me faire juste ma taskbar, j'ai plutot développé un outils qui permet de faire ses widgets en html pour le bureau, dont ma taskbar. Ce proj...
I have a script consisting of 3 files and 2 packages. When I run the script in IDLE or via the command line, it executes perfectly. I used cx_freeze to convert the program to an executable, and it still works fine except for text recieved via the input() method is evaluating wrong. This code mirrors my own: x = str(inp...
I have been trying to get Google Appengine running on my Centos 6 box for a while. I get these errors while I try to start up the application. This is Python 2.6.6 python google_appengine/dev_appserver.py pubsubhubbub/hub (on a terminal) [root@test ~]# python google_appengine/dev_appserver.py pubsubhubbub/hub /root/goo...
raspouillas Re : Topic des lève-tôt… Faisons manger leurs caleçons aux couche-tard! [4] Je ne faisait aucune allusion au problème de @souen. Dernière modification par raspouillas (Le 15/06/2012, à 20:37) ljere Re : Topic des lève-tôt… Faisons manger leurs caleçons aux couche-tard! [4] alors voici la première partie du ...
The official documentation here gives the following example: def worker(): while True: item = q.get() do_work(item) q.task_done() q = Queue() for i in range(num_worker_threads): t = Thread(target=worker) t.daemon = True t.start() for item in source(): q.put(item) q.join() ...
I undertook an interview last week in which I learnt a few things about python I didn't know about (or rather realise how they could be used), first up and the content of this question is the use of or for the purposes of branch control. So, for example, if we run: def f(): # do something. I'd use ... but that's ac...
Hello By using python language, what would be a clever / efficient way of generating promotion codes. Like to be used for generating special numbers for discount coupons. like: 1027828-1 Thanks 1027828-1 is extremely small. An attacker can make a ~million guesses using only a couple lines of code and maybe a few days. ...
The following python curl call has the following successful results: >>> import subprocess >>> args = [ 'curl', '-H', 'X-Requested-With: Demo', 'https://username:password@qualysapi.qualys.com/qps/rest/3.0/count/was/webapp' ] >>> xml_output = subprocess.check_output(args).decode('utf-8') % Tot...
dc.SetPen(wx.Pen(wx.BLACK, 0)) dc.SetBrush(wx.Brush("C0C0C0")) dc.DrawRectangle(50,50,50,50) This is my best attempt at drawing a 50x50, gray box with no border. However, setting the pen width to 0 doesn't seem to accomplish anything, and setting the brush only changes the fill from pure white to pure black. Here's it...
I am still running into errors with webapp2 and am at a lost what could be the problem here. ERROR 2011-12-13 11:17:19,059 webapp2.py:1528] 'NoneType' object has no attribute 'route' Traceback (most recent call last): File "/home/user/sdk/google_appengine/lib/webapp2/webapp2.py", line 1511, in __call__ rv = se...
It’s hard to compete with Haskell’s QuickCheck when it comes to having random test cases generated for you from properties. QuickCheck in Haskell is aided by the fact that Haskell has a very rich type system. I wanted something similar when writing tests in Python, but Python is dynamically typed. Fortunately it’s not ...
I have a model with an __init__ method: class Foo(models.Model): name = models.CharField(max_length=50) def __init__(self, *args, **kwargs): self.bar = kwargs.pop('bar', False) super(Foo, self).__init__(*args, **kwargs) if self.bar: # do something pass Now, i nee...
Maisondouf Re : Postfix est en train de me rendre fou ... Pourtant à première vue, ce que tu veux pouvoir gérer n'est pas spécialement complexe mais je ne sais peut-être pas tout. ASUS M5A88-v EVO avec AMD FX(tm)-8120 Eight-Core Processor, OS principal Precise 12.04.1 LTS 63bits½ Bricoleur, menteur, inculte, inadapté s...
I have a Django project containing two apps, Expenses and Sales which both have models named Item. I'm using django-autocomplete-light to ease the selection of Item. This works for either Expenses or Sales depending on which channel I register last but the other one wrongly shows the same Items. autocomplete_light_regi...
I am trying to make a script that gets similar images from google using a url, using a part from this code. The problem is, that I want to get to this link, because from it I can get to the images themselves by cloicking on the “search by image” link, but when I use the script, I get the exact same page, but without th...
I'm just a Hurd dabbler who likes the ideas behind the Hurd: "With the Hurd, users can change anything in their system which doesn't affect other users." And this is one definition of freedom in a community: "Do what you want as long as you don't restrict others from doing what they want." In contrast, current systems ...
I created a many to many relationship with sqlalchemy like this: subject_books = Table('subject_books', Base.metadata, Column('subject_id', Integer, ForeignKey('subjects.id')), Column('book_id', Integer, ForeignKey('books.id')), Column('group', Integer) ) class Subject(Base): __tablename__ = 'subjects' ...
Babdu89 Re : HY-D-V1 un nouveau Desktop Bonjour... Alors, comme j'ai toujours du temps, de la place sur mes hdd, et de la suite dans les idées ... Toujours au sujet de la tentative d'Hybrydiser la Cubuntu 13.04 32 bits ... Voir post ci-dessus . J'ai réinstallé, j'ai fais les maj système en commande, j'ai été obligé d'i...
I am practicing Linux buffer overflow exploitation. when trying to exploit a vulnerability in crossfire, everything works well and I get the shellcode placed in the right place, and the program flow gets redirected to shellcode, however, when start executing the shell code, the program fails. OS version (bt5 R3): Linux...
This question already has an answer here: how can javascript upload a blob? 3 answers When a user logs into the database, he generates a WAV audio file (in the browser) which has to be stored in the database. The problem is that, everything is fine when I store the file for the first time. But, when I store after that,...
I am reading a beginning Python programming book and in it the author says that you want to avoid accessing a class' attributes directly, but instead to create methods that return attribute values. However, I am finding there are times this seems a little redundant and I am wondering if am just going about this in the ...
Are there any experiments I can do to derive the speed of light with only common household tools? I don't know if it qualify as home experiment, but you can use the internet to get access to thousands of kilometres of optical fibres for free. It allows you to measure the speed of light in the fibres, which is From Pari...
I have a multi-threaded Python application that makes use of the built in logging module. To control the logging levels and make it easier to swap the StreamHandler with a FileHandler in the future, I have created a common helper function called by each module to create an identical logger (other than its name). How sh...
I've looked through as many answers on this subject as I could find and all suggested that it's a global - local conflict. I can't see how this would apply in my case but please do explain. Here's the error : "local variable 'CompletelyUniqueName' referenced before assignment" and here is the code, a function I call fr...
gtk.Image — A widget displaying an image class gtk.Image(gtk.Misc): gtk.Image() def set_from_pixmap(pixmap, mask) def set_from_image(gdk_image, mask) def set_from_file(filename) def set_from_pixbuf(pixbuf) def set_from_stock(stock_id, size) def set_from_icon_set(icon_set, size) def set_f...
I found this question( How to display a list of "latest pages visited" ) about how to display a list of latest pages visited for ruby on rails. How would you do this with flask? Do you use url maps? Code looks somehthing like this and i'm also using Heroku. app = Flask(__name__) app.secret_key = 'supersecretkey' def lo...
I'm adding data from a csv file into a database. If I open the CSV file, some of the entries contain bullet points - I can see them. file says it is encoded as ISO-8859. $ file data_clean.csv data_clean.csv: ISO-8859 English text, with very long lines, with CRLF, LF line terminators I read it in as follows and conver...
Following is sample code, aim is just to merges text files from give folder and it's sub folder. i am getting Traceback occasionally so not sure where to look. also need some help to enhance the code to prevent blank line being merge & to display no lines in merged/master file. Probably it's good idea to before merging...
I have an image (sorry cannot link it for copyright purposes) that has a character outlined in a black line. The black line that outlines the character is the darkest thing on the picture (planned on using this fact to help find it). What I need to do is obtain four coordinates that draw a virtual box around the charac...
Overview eLua architecture overview The overall logical structure of eLua is shown in the image below: eLua uses the notion of platform to denote a group of CPUs that share the same core structure, although their specific silicon implementation might differ in terms of integrated peripherals, internal memory and other ...
It's tremendously difficult to argue a RESTful approach to a service-oriented architecture (SOA), when the corporate mindshare is SOAP--where project stakeholders tout the SOA buzzword, nod their heads sagely when you say SOAP, nod their heads again when you say XML-RPC, and then look blankly when you mention REST. At ...
I'm trying to write a numpy array into txt file: a = numpy.array([1,2,3]) numpy.savetxt('a.txt',a,fmt='%.3f') when I open the txt file it looks like: 1.0002.0003.000 but when I paste it in word it looks like: 1.0002.0003.000 The problem is that another program reads the txt file as input line by line: data = fid.readl...
Here are some benchmarks: In [72]: ar_list = [np.random.randint(0, 100, 1000) for _ in range(100)] In [73]: %timeit map(np.unique, ar_list) 100 loops, best of 3: 4.9 ms per loop In [74]: %timeit [np.unique(ar) for ar in ar_list] 100 loops, best of 3: 4.9 ms per loop In [75]: %timeit [pd.unique(ar) for ar in ar_list] # ...
ljere Re : Live Voyager 12.10 merci pour les précisions c'est vraiment cool je plains rodofr si il veut intégrer tout ça Hors ligne metalux Re : Live Voyager 12.10 Le repos aura été de courte durée, qu'est-ce qu'on peut dire des C.....quand on a un coup de barre! Quelqu'un a testé ce que j'ai exposé au post #314? De mo...
After studying the gory details of matplotlib's axes.py, it appears that there are no provisions to autoscale an axes based on a view of the data, so there is no high-level way to achieve what I wanted. However, there are 'xlim_changed' events, to which one can attach a callback: import numpy as np def on_xlim_changed(...
I am following this tutorial. I am trying to retrieve the user properties; first_name but I got None as the result. I am able to retrieve some user properties like name, picture and email though. main.py class User(db.Model): user_id = db.StringProperty(required=True) access_token = db.StringProperty(re...
I was thinking about one of the cool bits of ActiveSupport, Symbol#to_proc, which allows you to do this: [1, 2, 3].map(&:to_s) #=> ["1", "2", "3"] That’s useful for sorting, enumerating, mapping, etc. Quite handy, and it saves you the trouble of writing a block to return a single value. I was recently someplace with a...
After much experimenting and looking at the SDK code I've come up with two ways to test endpoints within python: 1. Using webtest + testbed to test the SPI side You are on the right track with webtest, but just need to make sure you correctly transform your requests for the SPI endpoint. The Cloud Endpoints API front-e...
Phoenamandre Re : Suivi des bogues d'Ubuntu 12.10 j'ai le même problème que toi avec mon dell xps ! autre bogue, si vous êtes touchés par un problème de maya qui ne veut pas démarrer https://bugs.launchpad.net/maya/+bug/1047599 Hors ligne vlotho Re : Suivi des bogues d'Ubuntu 12.10 Salut j'ai une ribembelle de warning ...
Here's my implementation of the algorithm described in the above link.I'm giving my implementation for the example described in Fig. 4 in the aforementioned reference but should be adaptable quite easily to whatever you need, in case anyone asks themselves the same question as I did. Note that the code provided below (...
Module: CGI::HtmlExtension Defined in: lib/laser/standard_library/cgi/html.rb Overview Mixin module providing HTML generation methods. For example, cgi.a("http://www.example.com") { "Example" } # => "<A HREF=\"http://www.example.com\">Example</A>" Modules Http3, Http4, etc., contain more basic HTML-generation method...
Django 1.2 on Google App Engine If you want a solid python web framework on neat hosting infrastructure, Django and Google App Engine form a good match. Requirements Please make sure you already have installed the latest App Engine Python SDK . Being familiar with Django and App Engine is not a must but certainly won't...
gtk.ToolItem — the base class of widgets that can be added to gtk.Toolbar (new in PyGTK 2.4) class gtk.ToolItem(gtk.Bin): gtk.ToolItem() def set_homogeneous(homogeneous) def get_homogeneous() def set_expand(expand) def get_expand() def set_tooltip(tooltips, tip_text=None, tip_private=None) d...
ADcomp Re : ADesk Bar : Barre de lancement rapide [python/gtk/cairo] @sam7 : je suppose que tu parles de mon live "Madbox" .. comme je te l'ai dit sur l'autre post, il n'est pas prévu pour une installation "normale" et les paquet *-fr ne sont pas installés. Sinon , j'ai une mise à jour de mon live en cours ( plus conve...
I have a few ORM mapped tables, which (pared down) look like this: class Tag(Base): __tablename__ = 'tags' tag_name = Column(String, primary_key=True) task2tag_assoc = Table('tasktags', Base.metadata, Column('task_id', UUID, ForeignKey('tasks.task_id', ondelete='cascade'), primary_key=True), ...
The previous advice is nice and reasonable, especially in an ideal world where third-party software is bug free and everything is configured correctly. Unfortunately, the real world is a bit different. For instance, you must be aware that your application doesn't work on some buggy browser, or that it cannot work in sp...
I'm trying to index a model in Solr with django-haystack, but it returns me the following error(when using rebuild_index or update_index) : Failed to add documents to Solr: [Reason: ERROR:unknown field 'django_ct'] I followed step by step the "getting started" of Haystack-Search. I'm using : the latest version of Apach...
I have made a formset like this. class MixedObsCollsForm(forms.Form): def __init__(self, *args, **kwargs): project_id = kwargs.pop('project_id') super(MixedObsCollsForm, self).__init__(*args, **kwargs) project = get_object_or_404(Project, pk=project_id) self.fields['photos_upload'] =...
I want to insert data in MYSQL database using python here my code import MySQLdb #connect to db db= MySQLdb.connect(host= "localhost", user="root", passwd="newpassword", db="new_schema") #setup cursor cursor = db.cursor() #create anooog1 table cursor.execute("DROP TABLE IF EXIS...
Writing and Reading XML with XIST XIST is a very interesting project I've been meaning to dig into for some time. If you've been following the news section at the end of each of these columns, you'll have noticed the steady work that Walter Dörwald, the project leader, has put into this toolkit. It started out as a fra...
Given a tuple (specifically, a functions varargs), I want to prepend a list containing one or more items, then call another function with the result as a list. So far, the best I've come up with is: def fn(*args): l = ['foo', 'bar'] l.extend(args) fn2(l) Which, given Pythons usual terseness when it comes t...
This article is intended for new users of Python. When going from one language to another, some things have to be unlearned (see Transfer of Learning). What you know from other languages may not be always useful in Python. This page contains some idioms used in Python that I particularly like, and I hope others find us...