text
stringlengths
256
65.5k
Using Python, how do you add a new field to your shape file and calculate the area in km2? this is an example import arcpy from arcpy import env env.workspace = "D:/" fc = "test.shp" arcpy.AddField_management(fc,"area","Double") expression1 = "{0}".format("!SHAPE.area@SQUAREKILOMETERS!") arcpy.CalculateField...
chaoswizard Re : TVDownloader: télécharger les médias du net ! Une idée ca pourrait sympas aussi de récupérer a partir de daylimotion ou youtube : vous savez genre des chaines de groupe : http://www.youtube.com/user/ProdigyChannel exemple france inter : http://www.dailymotion.com/franceinter C'est jouable. Dans ce cas ...
IS it possible to define that specific languages characters would be considered as word. I.e. re do not accept ä,ö as word characters if i search them in following way Ft=codecs.open('c:\\Python27\\Scripts\\finnish2\\textfields.txt','r','utf–8') word=Ft.readlines() word=smart_str(word, encoding='utf-8', strings_onl...
I am trying to make an application in Python using PyQt that can fetch the generated content of a list of URLs and process the fetched source with the help of multiple threads. I need to run about ten QWebViews at once. As ridiculous as that might sound, when it comes to hundreds of URLs, using threaded QWebViews gets ...
I’ve been working on serialising a n-dimensional array into a 1-dimensional “array” database: from collections import Iterable, Mapping import sqlite3 def pass_many(vals, some_funct, args=()): if not vals: return if isinstance(vals, Iterable) and not isinstance(vals, (basestring, Mapping)): for ...
#2676 Le 15/02/2013, à 19:14 mulder29 Re : TVDownloader: télécharger les médias du net ! Et je reçois python: can't open file alors que j'ai installé Python 2.7.3, hier. Hors ligne #2677 Le 15/02/2013, à 19:26 k3c Re : TVDownloader: télécharger les médias du net ! si tu tapes which python ça affiche quoi ? Dernière mod...
Not quite sure I have the question fully formed, but what I'm trying to do is basically this: # where the indices correspond to attributes fore example: # [type, status] x = %w(a b) y = %w(c d) combine(x, y) #=> [["a", "b"], ["a", "d"], ["c", "a"], ["c", "b"]] The order of the array is always the same, so the reverse ...
Tales of Rescuing Old Hardware by Mikhail Zakharov 05/05/2005 Everything began one fine day when I visited our storage room to see if there was anything interesting for me to look at. Soon I came across an old shabby dark-gray Toshiba notebook thrown there amidst different computer rubbish long ago, from the time when ...
I need to use a bi-directional relationship in Mongoengine which is something like the below. from mongoengine import * class Notification(Document): desc = StringField() from_user = ReferenceField('User') class User(Document): Name = StringField() notifications = ListField(EmbeddedDocumentField(Notific...
I recently published ec2metadata which provides a simple CLI and Python interface to the metadata of an Amazon EC2 instance. In that post I mentioned that "one of the most useful pieces of data is user-data, which can be used to pass configuration information or even initialization scripts to the instance upon launch"....
devphp [résolu] Fail2ban et scanlogd, difficulté au redémarrage Bonjour, Je configure fail2ban, de façon a pouvoir bannir les personnes qui scan les ports (une de trop) J'ai donc installer scanlogd et j'ai pris mon autre serveur et lance un scan cat /var/log/syslog | grep scanlogd Jan 26 22:35:38 stock scanlogd: 88.191...
So, I’ve been trying to revamp my logo for a little while and I’ve been really inspired by ASCII lately. The thing I love about it is the fact that I can pimp out my BASH configs to display awesome ASCII art. So… I wanted a logo that I could easily ASCII-fy. Here is the ASCII version: ___ ___ ___ /__/\ / /\ / /\ \ \|\ ...
Hizoka Re : [g2s] GUI d'extraction de fichiers mkv En fait la fonction qui permet d'extraire dans le même dossier, il faut cliquer dessus à chaque fois. Tu pourrais pas mettre une option à cocher dans préférences qui permettrait de la garder toujours active ? Réinitialise les préférences. Par contre il n'y a plus l’icô...
If I save my code files as .pyw, no console window appears - which is what I want - but if the code includes a call to os.system, I still get a pesky console window. I assume it's caused by the call to os.system. Is there a way to execute other files from within my .pyw script without raising the console window at all?...
Sorry for the long title, but it seems most descriptive for my question. Basically, I'm having a difficult time finding exception information in the official python documentation. For example, in one program I'm currently writing, I'm using the shutil libary's move function: from shutil import move move('somefile.txt',...
If you have two numpy matrices, how can you join them together into one? They should be joined horizontally, so that [[0] [1] [[0][1] [1] + [0] = [1][0] [4] [1] [4][1] [0]] [1]] [0][1]] For example, with these matrices: >>type(X) >>type(Y) >>X.shape >>Y.shape <class 'numpy.matrixlib.defmatrix.matrix'> <class 'numpy.mat...
maltamirano wrote: Can I modify iRedAdmin-Pro LDAP code to access filesystem and remove folders? Please, point out which file/files should be modified. I'm not a Python geek, but understand MVC architecture and can code... Alright, here we go: *) WARNING: Please test your code on a testing machine first, don't do it on...
Since having set the drives attached to an LSI SAS 2008 controller to "Power up in standby", these drives are no longer being detected. Power up in standby is also known as PUIS, POIS or "ATA6 power up in standby mode". In the Super Micro X8SI6-F BIOS "Load onboard SAS Option Rom" is set to "Disabled'. Loading of kerne...
Ok I seem to have TKLPatch working. Now instead of using overlay with fixed config settings I would like to use di-live. There seem to be two things I need to get sorted. 1 - di-live file 2 - system config applier file DI-LIVE FILE Drop this in /usr/lib/di-live.d WHAT shuld I call the file? The TurnKey ISO file in this...
On bound methods, you can use three special read-only parameters: im_func which returns the (unbound) function object im_self which returns the object the function is bound to (class instance) im_class which returns the class of im_self Testing around: class Test(object): def foo(self): pass instance = Test...
I have a project that I've been working on for a while, which is written in Flask, and uses SQLAlchemy with the Declarative extension http://flask.pocoo.org/docs/patterns/sqlalchemy/. I've recently decided to start unit testing my project, but for the life of me, I can't seem to figure out how to make it work. I looked...
#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...
#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...
I have a problem that i really can't solve like anyhow. All i want is, to get from api/epg the channels that have their shows in the range of now and 2 hours later. Somehow i get all the channels with all the shows, not anything in the time range. What am i doing wrong? Thanks models.py class Channels(models.Model): ...
I'm trying to make a 3D plot in matplotlib with three circles on it, each centered at the origin and with a radius of 1, pointing in different directions - to illustrate a sphere of radius 1, for example. In 2D I would make a circle patch collection and add it to the axes. In 3D I'm having trouble getting the patches t...
Function calculate_attribute does not return a value; it only works through side effects. Often within that function I have to write these few lines: print('some message') set_attribute(value) return So I decided to put this into a different function: def report_and_set(value, message): print(message) set_attribut...
The HTTP specification will be changing soon. Our old friend HTTP/1.1 will soon be replaced by HTTP/2.0. The new specification includes a lot of cool new mechanisms and goodies but all previous implementations for HTTP/1.1 will be incapable of handling them. Hyper is a pure Python implemenation of the current draft (9)...
I'm using Ubuntu-Server 12.04, but I wasn't sure if this was an Ubuntu specific question, so I'm posting it here. I got myself a graphical user interface by installing xinit and openbox (using apt-get install). I installed guake as well (again using apt-get install). However, when I try to run guake in my terminal emul...
gtk.AccelGroup — a group of accelerators for a Window hierarchy class gtk.AccelGroup(gobject.GObject): gtk.AccelGroup() def lock() def unlock() def connect(accel_key, accel_mods, accel_flags, callback) def connect_group(accel_key, accel_mods, accel_flags, callback) def connect_by_path(accel_path...
I am new at scripting ... I can do very basic stuff, but now I need a hand. I have a local filesystem that only will be mounted when I need to do a backup. I'm starting with this. #!/bin/bash export MOUNT=/myfilesystem if grep -qs $MOUNT /proc/mounts; then echo "It's mounted." else echo "It's not mounted."; then ...
Given a reference to a method, is there a way to check whether the method is bound to an object or not? Can you also access the instance that it's bound to? def isbound(method): return method.im_self is not None def instance(bounded_method): return bounded_method.im_self In Python 2.6 and 3.0: In python 3 the ...
I am new to linux. My first installation was xubuntu 12.04 just a few weeks back, but I decided to try an upgrade because I was having trouble with some video drivers. Now I just installed Lubuntu 13.10, followed by XFCE4 & XFCE4-goodies metapackages. As soon as I log into a new XFCE4 session, I get an error message wi...
Can anyone tell me if this is possible? I want to do a slideshow like this (with the “back” and “next” feature), but let’s say you have the slideshow designed inside a horizontal box, but the images are both horizontal and vertical. Since the vertical images will look a lot smaller compared to the horizontal, I want th...
I use a vim that has Python interpreter compiled in. I source a python file that has this function: def pyterm(filename="", interactive=1): cmd = "%s %s %s " % (PYTHON, "-i" if interactive else "", filename) if "DISPLAY" in os.environ: return run_config(os.environ.get("XTERM"), cmd) else: re...
Since version 1.22, streaming is the default method used by web2py to serve files from the following directories: [web2py working folder]/application/[your app]/static/ [web2py working folder]/application/[your app]/uploads/ For customised file serving function that overrides the default download behavior, web2py...
What's New in Python 2.3? by Alex Martelli , author of Python in a Nutshell 03/27/2003 Editor's note: When Alex Martelli said he wanted to write an article about what he was "unable to include in Python in a Nutshell," my first thought was "why would we want to tell readers what they will not find when they purchase th...
The radapy is the python implementation for the radare remote protocol. This module is distributed in the scripts/ directory of radare. For better understanding, here's an example: $ cat scripts/radapy-example.py import radapy from string import * PORT = 9999 def fun_system(str): print "CURRENT SEEK IS %d"%rada...
gmli Cerise 0.8 - TPE, freelances, artisans Hello, je me suis dit qu'une petit présentation pourrait intéresser du monde ici. Je viens de sortir aujourd'hui la version 0.8 de mon petit soft de gestion d'entreprise (cf. l'article sur le blog http://leblog.cfait.fr/post/2008/09/07/Cerise-08) Vous pouvez trouver une liste...
Programming All 30 entries tagged View all 89 entries tagged Programming on Warwick Blogs | View entries tagged Programming at Technorati | There are no images tagged Programming on this blog January 21, 2011 It is possible to create Flash applications from Linux using only free tools. It’s also easy! Downloading the...
I want to implement a symbol type, which keeps track of the symbols we already have(saved in _sym_table), and return them if they exist, or create new ones otherwise. The code: # -*- coding: utf-8 -*- _sym_table = {} class Symbol(object): def __new__(cls, sym): if sym not in _sym_table: return s...
I am very new to Python.Here is a copy of what one of many txt files looks like. Class 1: Subject A: posX posY posZ x(%) y(%) 0 2 0 81 72 0 2 180 63 38 -1 -2 0 79 84 -1 -2 180 85 95 . . . . . Subject B: posX posY posZ x(%) y(%) 0 2 0 71 73 -...
Is there a possibility to test if the connection still exists before executing a transport.write()? I have modified the simpleserv/simpleclient examples so that a message is being send (written to Protocol.transport) every 5 seconds. The connection is persistent. When disconnecting my wifi, it still writes to transport...
You are probably importing the wrong os.py module. Try starting python2.6and then >>> import os >>> print os.__file__ That should be /usr/lib64/python2.6/os.py or /usr/lib64/python2.6/os.pyc.If it is not remove (or rename) the file that you found.If it is try: >>> os.urandom(3) This should give you a string of 3 char...
The following code: import numpy as p myarr=[[0,1],[0,6],[0,1],[0,6],[0,1],[0,6],[0,1],[0,6],[0,1],[0,6],[0,1],[0,6],[0,1],[0,6],[0,1],[0,6],[0,1],[0,6]] copy=p.array(myarr) p.mean(copy)[:,1] Is generating the following error message: Traceback (most recent call last): File "<pyshell#3>", line 1, in <module> p.m...
xxkirastarothxx MegaUpload : BotMU v1.0.1 Bonjour à tous Et bien voila, depuis quelques temps j'ai remarqué que le capcha de Megaupload a disparu. Comme il s’agissait du point le plus bancale du développement d'une automatisation de téléchargement sur Megaupload, le projet était en attente. Maintenant que ce point n'ex...
I'm receiving an error when trying to hit my newly migrated Google App Engine HRD app. Traceback (most recent call last): File "/base/python_runtime/python_lib/versions/1/google/appengine/ext/webapp/_webapp25.py", line 710, in __call__ handler.get(*groups) File "/base/data/home/apps/s~***-hrd/1.3614848264076660...
If you use django 1.5 and newer use: {% verbatim %} {{if dying}}Still alive.{{/if}} {% endverbatim %} If you are stuck with django 1.2 on appengine extend the django syntax with the verbatim template command like this ... from django import template register = template.Library() class VerbatimNode(template.Node)...
I want to have a absolute/complete url when i call my models get_absolute_url method in template. in my entry model i have below: def get_absolute_url(self): return ('blog_entry_detail', (), { 'year': self.pub_date.strftime("%Y"), 'month': self.pub_date.strftime("%b").lowe...
I don't know why I am having so much trouble creating a 3 dimensional list. I need the program to create an empty n by n list. So for n = 4: x = [[[],[],[],[]],[[],[],[],[]],[[],[],[],[]],[[],[],[],[]]] I've tried using: y = [n*[n*[]]] y = [[[]]* n for i in range(n)] Which both appear to be creating copies of a re...
I'm having a problem with displaying the contents within the block tags of a child template. I have a base.html and a dash.html which extends the base. When I go to the dash.html page the base.html is extended but the contents set within the block tags of dash.html do not show up. So I get the same thing when I go base...
Related Reading As mentioned in Chapter 4, Integrated Development Environments for Python, PythonWin is a framework that exposes much of the Microsoft Foundation Classes (MFC) to Python. MFC is a C++ framework that provides an object-based model of the Windows GUI API, as well as a number of services useful to applicat...
I use the AppEngine-OAuth-Library to get user information from LinkedIn, but how do I grant for more permissions than the default basic profile. The LinkedInClient class has this constructer: OAuthClient.__init__(self, LINKEDIN, consumer_key, consumer_secret, "https://api.linkedin.com/uas/oauth/requestT...
I know this has been answered before, but it seems that executing the script directly "python filename.py" does not work. I have Python 2.6.2 on SuSE Linux. Code: #!/usr/bin/python # -*- coding: utf-8 -*- from multiprocessing import Pool p = Pool(1) def f(x): return x*x p.map(f, [1, 2, 3]) Command line: > python e...
How can I make two decorators in Python that would do the following? @makebold @makeitalic def say(): return "Hello" which should return <b><i>Hello</i></b> I'm not trying to make HTML this way in a real application, just trying to understand how decorators and decorator chaining works. If you are not into long exp...
lekokeliko Tictactux jeu en Python Je tient a vous présenter ma grande réalisation : le Tictactux en python développé depuis la nuit du 24 decembre 2007 morpion like parametrable a souhait quelques précisions : versions antérieures : -1.07.29 beta test -1.07.30 détails des modifs plus bas (post 7) -1.07.31 modification...
am trying to deploy my application on google app engine but getting following error Starting update of app: timezzzzpass, version: 4 Scanning files on local disk. 2011-06-06 17:46:22,095 ERROR appcfg.py:1965 An unexpected error occurred. Aborting. Traceback (most recent call last): File "C:\Program Files\Google\goog...
What's the right way to turn off all grids in Rpy2 while using the theme_bw theme? I know I can turn on theme_bw as follows: ggplot2.theme_set(ggplot2.theme_bw(12)) but unsure how to turn off the grids. thanks. It is basically done the same way one would do it when using ggplot2 from R. Here is an example that turn off...
Shanx Re : /* Topic des codeurs [8] */ Gnagnagna... J'ai corrigé l'indentation, par contre pour découper le main je vais attendre que le programme fonctionne... /**** PENDU ****/ #include<stdio.h> #include <stdlib.h> #include <string.h> #include <time.h> #include <ctype.h> #define TAILLE_MAX 50 void clean_stdin(void); ...
It appears that what happens is that your file disappears (basically). Try this, create a file test.py and put the following in it: import os f = open('out.txt', 'w') # Open file for writing f.write("Hi Mom!") # Write something os.remove('out.txt') # Delete the file try: while True: # Do forever f.write("Si...
I'm new to Python and GAE, but years of procedural programming. I have this code, but I know that there must be some better solution to avoid retyping code. The first and last section of code are identical in both GET and POST methods, so I suppose there must be another way to share the identical code. # This class man...
Trying to redirect a subprocess' output to a file. server.py: while 1: print "Count " + str(count) sys.stdout.flush() count = count + 1 time.sleep(1) Laucher: cmd = './server.py >temp.txt' args = shlex.split(cmd) server = subprocess.Popen( args ) The output appear on screen, temp.txt remains empty.Wha...
johnatan57950 Re : [tuto]Installation de Dofus 2.0 par paquet debian et rpm (pour la doc) bj quand je clique sur l'icone dofus je suis venue a telcharger dofus mise a jours et tout le reste et une fois fini je clique sur jouer et sa me met adobe air L'installation de cette application est endommagée. Essayez de la réin...
A Painless Introduction To Finite State Machines Lamson uses the concept of a Finite State Machine to do the internal processing and keep track of what it should do next. You don’t necessarily need to know the details of how a FSM works, but it helps you if you want to know enough about Lamson to do advanced work. Most...
I'm running into some repeated problems in my geodjango apps that seem to be originating with GEOS. I am receiving errors that do not include stack trace information so I'm not sure how to go about debugging them. I've been able to isolate the issue to specific commands that utilize GEOS. UPDATE: below is an even simpl...
HappyColibris [Résolu] Le téléchargement des infos du dépôt a échoué 404 Not Found Bonjour à tous, Depuis quelques jours, j'ai un souci au niveau de la mise à jour. En passant par le gestionnaire de mise à jour, j'ai : "Le téléchargement des informations du dépôt a échoué" : W:Failed to fetch http://ppa.launchpad.net/p...
I'm trying to go through a file line by line (each line is no more than 50 characters), shift each character by 10 or -10 (to encrypt and decrypt) and then print the shifted string where the old string was. But I'm getting some really funny output. heres the code: #include <stdio.h> int main(void){ FILE *fp; fp...
I'm trying to create a basic blogging application in Python using Web.Py. I have started without a direcotry structure, but soon I needed one. So I created this structure: Blog/├── Application/│  ├── App.py│  └── __init__.py|├── Engine/│  ├── Connection/│  │  ├── ...
Dump realization lies here http://coverage.livinglogic.de/Lib/sqlite3/dump.py.html (local path: PythonPath/Lib/sqlite3/dump.py) You can modify it a little: # Mimic the sqlite3 console shell's .dump command # Author: Paul Kippes <kippesp@gmail.com> def _iterdump(connection, table_name): """ Returns an iterator t...
I have a webservice that is supposed to read a list from a caller, do some work, and then return a response. @endpoints.method(ARequestMessage, AResponseMessage, name="call", path="call") def call(self, request): aList = request.in_list for stuff in aList: "do work here" return ...
Bionet [Résolu] configurer modem interne ISDN RNIS Numeris Bonjour, tout d'abord je voulais préciser que je suis à Mayotte (île aux moyens de communication préhistoriques où l'on se connectes en bas débit 56K ou en Numéris 64K). Alors voilà, j'ai un modem interne ISDN (RNIS, NUMERIS) qui fonctionne très bien sous Windo...
(This is distinct and unrelated to Steve Dekorte's "Io" programming language.) The original paper, which I don't have a copy of, is: Raphael Levien, 1989, "Io: a new programming notation", SIGPLAN Notices 24(12) December 1989 There is a little material about Io online, including quotes from the paper. From http://hopl....
Depending on your needs it may be helpful to know that a significant amount of time is spent converting a Graphics expression to output Box forms. Example: graphics = Import["http://exampledata.wolfram.com/usamap.zip", "Graphics"]; Timing[cell = Cell[BoxData@ToBoxes@graphics, "Output"];] {1.466, Null} It is now signif...
The Script Runner plugin allows you to manage and execute a collection of scripts in QGIS to automate tasks and perform custom processing. Version 0.6 of Script Runner has been released and includes these changes: Arguments can be passed to a script using keyword arguments Script output is logged to the Script Runner w...
This is the second part of the two-part series. First part can be found here. Here are some more tips that every django developer should know in order to write faster apps. Lets say we need company id of an employee. We can get it with employee.department.company.id Here, we have an employee object. And we are querying...
before you look my code , see http://www.b-list.org/weblog/2007/sep/22/standalone-django-scripts/ i want to be a Standalone Django scripts' this is my code : from django.db import models from djangosphinx.models import SphinxSearch,SphinxQuerySet import os os.environ["DJANGO_SETTINGS_MODULE"] = "sphinx_test.settings" f...
I have a multidimensional array a with shape (nt, nz, ny, nx). The dimensions are time, z, y, x. For each time, x and y, I've selected the appropriate z in a new index array J with shape (nt, ny, nx). J contains the indices along the height dimension that I'd like to select. Using Python, I could do this in a loop: b=J...
L4ur3nt Accéder au NAS DNS320 depuis toutes les applications sur Ubuntu 12.10 Bonjour, j'ai un soucis de connection à mon NAS DNS 320 sur Ubuntu 12.10. J'arrive à y avoir accès en recherchant dans le réseau local mais je parviens pas à "accéder au NAS depuis toutes les applications" J'ai déjà consulté plusieurs anciens...
I'm looking for a module that will remove any HTML tags from a string that are not found in a whitelist. Here's a simple solution using BeautifulSoup: from BeautifulSoup import BeautifulSoup VALID_TAGS = ['strong', 'em', 'p', 'ul', 'li', 'br'] def sanitize_html(value): soup = BeautifulSoup(value) for tag in sou...
Simple core command line tools like nc, socat seem not to be able to handle the specific HTTP stuff going on (chunks, transfer encodings, etc.). As a result this may produce unexpected behaviour compared to talking to a real web server. So, my first thought is to share the quickest way I know of setting up a tiny web s...
class Map(Group): members = models.ManyToManyField(User, related_name='maps', verbose_name=_('members')) class Position(models.Model): map = models.ForeignKey(Map) LatLng = models.CharField(max_length=2000) and the Group is : class Group(models.Model): """ a group is a group of users with a common ...
Advanced OOP: Multimethods by David Mertz 05/29/2003 Introduction This article continues a review of advanced object-orientedprogramming concepts. In this installment I examine multipledispatch, which is also called multimethods. Most objectoriented languages--including Python, Perl, Ruby, C++, and Java--areintellectua...
hectorau_ben Re : [tuto]Installation de Dofus 2.0 par paquet debian et rpm (pour la doc) Même si tu m'as toujours pas répondu, dofus marche parfaitement, sans AUCUN ralentissement, mais le son ne marche pas ... Même si l'Updater est ouvert et que j'ai activé le son dans le options et biensûr, je n'ai pas trouvé la solu...
I'm getting a really weird problem in my long experience with python.. In advance i want to say that i want to know WHY does this happen, and not how to change my code or how to fix it because i can do it too. I'm using python2.7.3 and using the __future__ absolute_import feature. I have a little complex module structu...
Migrate from Libvirt KVM to Virtualbox I was recently trying to migrate some VM from our KVM server to my laptop to run in my VirtualBox install locally. As I was going through the process I realized it’s not a very easy process, so I decided to jot down my process. It’s probably not perfect, but it worked for me. Loca...
Module languages source code | This file is part of the web2py Web Framework | Copyrighted by Massimo Di Pierro <mdipierro@cs.depaul.edu> | License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html) | Plural subsystem is created by Vladyslav Kozlovskyy (Ukraine) <dbdevelop@gmail.com> Translation system -------------------...
When I control different type of pages, I move my code to another python file. But this way has disadvantage : each time I want to change url hander, I must comback to main.py to config bottom lines about url handler. for example : app = webapp2.WSGIApplication([('/', MainPage), ('/thanks...
Author Rekrul Submission date 2011-07-14 14:20:09.781178 Rating 7655 Matches played 4025 Win rate 74.96 Use rpsrunner.py to play unranked matches on your computer. import random SIZE = 5 WEIGHT_FACTOR = 6. class HistoryNode(object): def __init__(self, parent=None): if parent is not None: self.de...
I'm using Glade to write a PyGI app, and I've come across a problem whereby I've got a Gtk.ComboBoxText with a Gtk.Entry, but I cannot make the entry editable for some reason. I.e. when the UI is loaded, there is no way to input text in it. I've looked at all the entry's properties and also those of the comboboxtext pa...
django REST redux This is the third post in a series exploring how to create a basic tagging application, and how to do so in the Django framework so that I may better understand Django as well as other technologies and development approaches that are at least somewhat new to me. For convenience, here are the first two...
So say I have some classes X, Y and Z using SQLAlchemy declarative syntax to define some simple columns and relationships Requirements: At the class level, (X|Y|Z).primary_keysreturns a collection of the respective class' primary keys' (InstrumentedAttributeobjects) I also want(X|Y|Z).relationsto reference the class' r...
Today is the first time I've used Python, so I'm sure this'll be an easy question. I need to convert this Python script from a command line application: webkit2png. The end result will be a URL that returns an image of the webpage passed into it as a querystring param. I've achieved this on Windows with .NET and IE, Ge...
I get the following error: Failed to look for applications online GDBus.Error:org.freedesktop.DBus.Python.xdg.Exceptions.ParsingError: Traceback (most recent call last): File "/usr/lib/python2.7/dist-packages/defer/__init__.py", line 489, in _inline_callbacks result = gen.send(result) File "/usr/lib/pyt...
benjou Re : Aidez moi s'il vous plait pour mon projet benoit@laptop-benoit:~$ picard Traceback (most recent call last): File "/usr/bin/picard", line 2, in ? from picard.tagger import main; main('/usr/share/locale') File "/usr/lib/python2.4/site-packages/picard/tagger.py", line 73, in ? from picard import ev...
Manipulating ResultSet You can delete a row by moving cursor to the row position and calling the deleteRow() method on the WebRowSet instance. Similarly, you can update one or more values in a row by moving the cursor to the row position and calling the appropriate update method. The following code example does both. ....
I'm trying to use synonyms in a mix in for a declarative class model. class MyMixin(object): __my_field = Column(Boolean, name='my_field', index=True, default=True) def __get_my_field(self): return self.__my_field @declared_attr def my_field(cls): # @NoSelf return synonym('__my_field', ...
Is there a way to turn of the grid for polar plots in matplotlib? I tried matplotlib.pyplot.rgrids([], []), but it doesn't work. From your import matplotlib.pyplot as plt import numpy as np fig = plt.figure() ax = fig.add_subplot(111, polar=True) ax.grid(False) r = np.arange(0,1,0.001) theta = 2*2*np.pi*r ax.plot(theta...
I'm trying to figure out a good practice for designing a function with (many) optional components. For a specific example, say I am interested in designing a feature extractor function that takes as input a document and returns a list of features extracted from the document. Question If there are many optional componen...
fenix122 Re : erreur avec apache2 : « Unable to open logs » [RESOLU] non non je sais faire les serveur sans interface j'ai fait sa surtout pour simplifier après non je ne suis pas tout a lettre car le tuto que j'ai suivi avait des erreurs pour certaine chose surtout pour c'est source pas bonne j'ai du aller sur le site...
Just very quickly, another possible workaround: Check Index of /doc/startup-notification-devel-0.12/examples and get test-monitor.c; modify the file so it matches: ... //#include <config.h> #ifndef SN_API_NOT_YET_FROZEN #define SN_API_NOT_YET_FROZEN #endif #include <libsn/sn.h> ... int main (int argc, char **argv) { ...
Corzntin error /boot/grub/i386-pc/normal.mod not found Bonsoir ! En tentant d'installer Ubuntu depuis une clef USB faite avec Unetbootin, l'erreur "error /boot/grub/i386-pc/normal.mod not found" apparaît (le LiveUSB ne démarre pas du tout, donc impossible d'essayer Boot Repair). J'ai essayé à plusieurs reprises de "ref...