text
stringlengths
256
65.5k
Other recipes Upgrading In the "site" page of the administrative interface there is an "upgrade now" button. In case this is not feasible or does not work (for example because of a file locking issue), upgrading web2py manually is very easy. Simply unzip the latest version of web2py over the old installation. This will...
Ok. What I was exactly looking for does not seem to exist. So, I found a solution-a workaround for this problem. Instead of profiling memory, I'll profile objects. This way, I'll be able to see how many objects exist at a specific time in the program. In order to achieve my goal, I made use of metaclasses with minimal ...
#2351 Le 09/11/2012, à 00:58 bibichouchou Re : TVDownloader: télécharger les médias du net ! salut, @11gjm je ne comprends pas trop ce que tu comptes faire du plugin xbmc pour m6. je peux me tromper mais je ne pense pas qu'il soit utilisable tel quel tout seul. si tu veux t'en servir, il faut le faire depuis xbmc (c'es...
mars Connaissances de base pour Kubuntu Bienvenue à tous les lecteurs. Ce sujet a pour but d'apporter les connaissances de base à toute personne débutant sous Kubuntu. Il est très bon pour tout débutant de lire ce post, mais il est aussi très conseillé aux personnes plus expérimenté, car il contiendra des conseils de b...
All right, still with these integration problems, and I don't know all the subtleties of passing extra-arguments to Maxima (ok, I reckon that @kcrisman doesn't stop pointing out Maxima flags now and then when some expert uses them but some list would be very handy). What I want is to integrate a function with the domai...
Many python IDE's will start you with a template like: print 'hello world' That's not enough... So here's my skeleton code to get this question started: My Module Skeleton, Short Version: #!/usr/bin/env python """ Module Docstring """ # ## Code goes here. # def test(): """Testing Docstring""" pass if __name__=...
Abstract This workshop will give delegates the opportunity to discover and try some of the recent R / Bioconductor developments for proteomics. Topics covered will including support for open community-driven formats for raw data and identification results, packages for peptide-spectrum matching, quantitative proteomics...
nesthib [JEU] challenge bash #6 Espaçeur de paragraphes Imaginons un texte, celui-ci est composé de différents paragraphes. La plupart du temps un paragraphe sera coupé en deux à la fin d'une page. Le but de ce challenge est de réaliser un script qui formate le texte de façon à ce qu'un paragraphe ne soit jamais coupé ...
I was thinking about generating passwords with combination of English, Arabic, Chinese charac. Is this pass secure enough against brute force attacks? Selecting characters from a larger character set should increase security; if you use a rare character like ♥ or ಠin your password that a brute force isn't trying to...
You are here: Home ‣ Dive Into Python 3 ‣ Difficulty level: ♦♦♦♦♦ 2to3 ❝ Life is pleasant. Death is peaceful. It’s the transition that’s troublesome. ❞ — Isaac Asimov (attributed) So much has changed between Python 2 and Python 3, there are vanishingly few programs that will run unmodified under both. But don’t despair...
I am searching for a good way to get relative paths of files and (sub)folders within a specific folder. For my current approach I am using os.walk(). It is working but it does not seem "pythonic" to me: myFolder = "myfolder" fileSet = set() # yes, I need a set() for root, dirs, files in os.walk(myFolder): for fileN...
Hagar de l'Est [How-To] Installer OpenOffice.org avec les RPMs officiels Si vous n'avez pas la patience d'attendre que les dépôts soient mis à jour pour installer la dernière version d'OOo, voici la méthode manuelle à partir des RPMs officiels. NB: avant d'installer, si vous avez modifié la configuration des dictionnai...
siscard Re : Open Office, Reconnaissance de caractères, Xsane, Kooka et Cie... L'erreur de segmentation est revenue comme elle avait disparue. Si quelqu'un a une idée, je suis preneur. Tout ce que j'ai trouvé, c'est que le logiciel essaie d'utiliser un espace de mémoire qui ne lui est pas attribué; alors cela provient ...
Introduction Addressing the Cppcheck's authors Comparison methodology Errors detected in Doom3 by Cppcheck Errors detected in Doom3 by PVS-Studio Summary table of detected errors (quantity) in Doom 3 Errors detected in Quake 3: Arena by Cppcheck Errors detected in Quake 3: Arena by PVS-Studio Summary table of detected ...
bidou10 mise à jour de sécurité importante bonjour à tous, depuis un petit moment, j'ai une mise à jour de sécurité importante qui ne veut pas se faire, elle apparait à chaque fois décochée. j'ai essayé cette commande dans le terminal, mais je ne suis pas très fort dans ce domaine et j'aimerai avoir un petit coup de ma...
I have the following python module: from google.appengine.ext import db from user import User class Post(db.Model): content = db.TextProperty() time = db.DateTimeProperty(auto_now_add=True) user = db.ReferenceProperty(User) topic = db.ReferenceProperty(Topic) class Forum(db.Model): parent_ = db.Self...
For whatever it's worth, you code works fine on my system even without the for loop to set the label colors. Just as a reference, here's a stand-alone example trying to follow essentially exactly what you posted: import matplotlib.pyplot as plt import numpy as np # Generate some data num = 200 x = np.linspace(501, 1200...
import numpy import rpy2 from rpy2 import robjects import rpy2.robjects.numpy2ri r = robjects.r rpy2.robjects.numpy2ri.activate() x = numpy.array( [1, 5, -99, 4, 5, 3, 7, -99, 6] ) mx = numpy.ma.masked_values( x, -99 ) print x # works, displays all values print r.sd(x) # works, but uses -99 values in calculat...
Serialization Dataflow Iterators source => 8 bit bytes => 6 bit integers => encode to base64 characters => insert line breaks => destination We would prefer the solution that is: typedef insert_linebreaks< // insert line breaks every 72 characters base64_from_binary< // convert binary values ot ...
I've been developing a django app with south for a while, and doing a sort of loose continuous deployment. Very shortly after my initial migration, I did a couple data migrations that looked like this: def forwards(self, orm): from django.core.management import cal...
The django configuration file is pure python code, this gives us a lot of flexibility to setup settings when the application starts. Actually you could even modify settings in runtime, but promise me you won't do this, ever! Imagine you have an open-source django project, you have your code in github or something like ...
I'm having a problem sorting a numpy array that has numbers as strings. I need to keep these as strings because there are other words after the integers. It's sorting negative numbers in reverse order: >>> import numpy as np >>> a = np.array(["3", "-2", "-1", "0", "2"]) >>> a.sort() >>> a array(['-1', '-2', '0', '2', '...
#2851 Le 19/03/2013, à 02:35 M@dinko12 Re : TVDownloader: télécharger les médias du net ! Bonjour, je ne comprends pas si le projet tvdownloader est au point mort à cause des fragmentations de M6Replay (les fichiers téléchargés font 0 octets même après MAJ des plugins) ? Et pas envie de lire 114 pages, j'ai lu les dern...
cocoubuntu [Resolu]duplicate sources.lits Aprés un téléchargement de paquets , j'ai eu le message suivant : " W : duplicate sources.list entry http://fr archive.ubuntu.com breezy/universe.Packages(/var/lib/apt/list/fr.archive.ubuntu.com_ubuntu_dists_breezy_universe_binary-i386_Packages) J'ai édité la sources.list ....s...
I've been looking for a way of seeing what I've actually installed on my system for some time. I found a couple of solutions that didn't really get me where I wanted to go. I think the fundamental problem is that the particular information I want isn't logged on the system by default. I've come up with the following wa...
Ce cours est visible gratuitement en ligne. Ce cours existe en livre papier. Ce cours existe en eBook. Vous pouvez obtenir un certificat de réussite à l'issue de ce cours. J'ai tout compris ! Les objets… vaste sujet ! Avant d'en créer, nous allons d'abord voir de quoi il s'agit. Nous allons commencer avec les chaînes d...
Here's my ORM entity class. The primary key is composite cause 'id_string' may be the same for different users (identified by uid). One thing I understood from Postgres SQL error when creating a table based on this class ( ProgrammingError: (ProgrammingError) there is no unique constraint matching given keys for refere...
I want to be able to at first call a simple script to enable or disable an external monitor from my netbook. I am running Fedora 17 with XFCE as my desktop. I see that I should be able to use python and python-dbus to flip toggle active on and off. My problem is that I can't figure out how to emit a signal to get the n...
Bybeu [résolu] Problème veille carte nvidia 4200 nvidia96 EDIT 27 mars 2013: j'ouvre un nouveau fil ici: http://forum.ubuntu-fr.org/viewtopic.php?id=1210781 Bonjour Mon portable 12.04 plante en sortie de veille; J'ai essayé sudo s2ram -n Machine matched entry 222: sys_vendor = 'Dell Computer Corporation' sys_...
When running my script using AndroidViewClient on some Android application I distinguish a view indicating the application is still loading. I start a While loop with internal delay & refresh like this: while LoadingApp is not None: print "Application is still not ready.\nWaiting 5 seconds" print The Applic...
wlourf Postez vos scripts Lua pour Conky ! Bonsoir à tous ceux pour qui chaque pixel du bureau compte, J'ouvre ce topic suite aux discussions sur le topic des conky pour discuter des scripts Lua dans conky. Lua est un langage de script léger et facile a utiliser qui permet d'ajouter de nouvelles fonctionnalités à nos c...
I'm not aware that I changed anything and am running Ubuntu 10.10. Mercurial had been working fine and then all of a sudden when I started pushing commits this morning I started receiving the following error: ** unknown exception encountered, details follow ** report bug details to http://mercurial.selenic.com/bts/ ** ...
What is a good tool for PDF report generation in Python? I've checked out ReportLab, but it seems to be awfully low-level for what I want to do. My current hunch is to call TeX on the command-line and let it produce the PDF, but if there is something that is easier to work with, I'd very much like a prod in the right d...
I need to be able calculate the average of the weights in a dictionary. This also needs to be a function. Here is the code I have animal=dict() animal['1']={'ID': '21012', 'plot':4, 'year':'1993', 'species': 'DM', 'weight': 42, 'hindfoot': 36, 'tag':'1EA0F9'} animal['2']={'ID':'22012', 'plot':4, 'year':'1995', 'species...
pandageek MCedit pour minecraft bonjour a tous, je joue à minecraft version linux sous xubuntu et j'aimerai pouvoir utiliser le logiciel MCedit qui sert a éditer les cartes du jeu. or il ne fonctionne pas malgré mes tentatives : panda@panda-USB:~/Bureau/MCEdit-stable33-linux$ ./mcedit.sh RuntimeError: Bad magic number...
Displaying a text picture Hello, I'm going to make a game, and I'm having some trouble. I'm trying to cout a picture of a car... here is my script. #include <iostream> using namespace std; int main(int argc, char *argv[]) { cout<<" ___________"<<endl; cout<<" // ||| \\"<<endl; cout<<" __//____|||____\\_...
abelthorne The Humble Voxatron Debut Après la concurrence de l'IndieRoyale Bundle pas pour Linux, Wolfire revient dans la course avec le Humble Voxatron Debut. C'est la saison des bundles ! Bon, après un bundle d'un seul jeu (Frozen Synapse) récemment, voilà qu'ils nous refont le coup du jeu unique (Voxatron, donc) et ...
Back on November 11th, 2009 we confirmed Laurent Gaffié’s remote exploit for Windows that causes a kernel crash. The operating system actually freezes creating a denial of service when, for example, a user is tricked into clicking on a link on a web page to a malicious SMB share request. The SMB client goes into an inf...
I am setting up Ubuntu with gnome for my grandma. How can I make firefox start ALWAYS maximized. It is possible to achieve this with a python script. The script requires python-wnck and python-gtk to be installed in order to work, although I think these are installed by default anyway. Copy and paste this into a text e...
ogaby Re : [ATTENTION] Faille de sécurité critique dans le noyau Linux ! vi... Avec cette simple ligne, on peut bénéficier des mises-à -jour de sécurité plus rapidement que sur un dépà´t européen. Je dis "européen" car je vis en Allemagne et mon dépà´t "normal" n'a pas encore cette mise-à -jour. Hors ligne zappinggg Re...
Hi I have 2 models A and B class A(models.Model): ref = models.ForeignKeyField(B) class B(models.Model): name = models.CharField(...) when I order result like this: A.objects.all().order_by('ref__name') The result is not strictly ordered by the name field. eg. ABCABCDBCDE*1230233adasADFEW any ideas?
I'm trying to use Python to run pdftotext, but for some reason, my code isn't working. If I run the below, I expect that the content variable would contain the contents of the PDF, but the result I am getting is just an empty string. Does anybody know what I'm missing? def getPDFContent(path): path = "/path/to/a va...
hlou [Résolu]Xubuntu echec du traitement des paquets Bonjour, J'ai installé xubuntu 12.04.1 et à par les mises à jour systemes, je ne peux plus rien installer via la logithèque ou synaptic. Le téléchargement de paquets se lance et au bout de quelques minutes, un message me dit "échec de traitement des paquets :l'instal...
Mathieu11 Re : [ VOS SCRIPTS UTILES ] (et eventuelles demandes de scripts...) Désactivation du touchpad lors d'un branchement de souris Le crédit va à l'auteur du blog (un Cyril apparement ) Dernière modification par Mathieu11 (Le 17/04/2008, à 17:44) Vostro 1400 Hors ligne kuri Re : [ VOS SCRIPTS UTILES ] (et eventuel...
What are the situations where "yield from" is useful? Every situation where you have a loop like this: for x in subgenerator: yield x As the PEP describes, this is a rather naive attempt at using the subgenerator, it's missing several aspects, especially the proper handling of the .throw()/.send()/.close() mechanism...
When I tried to add a new table to python/flask - class UserRemap(db.Model): name = db.Column(db.String(40)) email = db.Column(db.String(255)) password = db.Column(db.String(64)) flag = db.Column(db.String(1)) def __init__(self, name, email, password): self.email = email self.name = ...
i hope this request is legit. i'm taking a programming course in python for engineers, so i'm kinda new at this business. anyway, in my homework i was requested to write a function with receive two strings and check if one is a (permutation/Anagrm) of the other. (which means if they both have exactly the same letters a...
I'm running on 10.8.2. All of a sudden, traditional nameserver lookups are failing on my machine: $ nslookup www.att.com ;; connection timed out; no servers could be reached $ dig www.att.com ; <<>> DiG 9.8.3-P1 <<>> www.att.com ;; global options: +cmd ;; connection timed out; no servers could be reached But operation...
I'm a Linux n00b, and I want to install SciPy to help me on a homework asignment. This page has confused me more than helped me. I have been guiding myself on the INSTALL.txt file I got from sourceforge, which says PREREQUISITES ============= SciPy requires the following software installed: 1) Python__ 2.4.x or newer ...
cmarcx Re : [Script] Client Hubic pour linux ;) Bonjour, J'ai essayé de monter hubic avec la commande : ./hubicmount -l <email> -p <passwd> -o umask=022 -o uid=1000 /media/hubic Mais j'obtiens toujours l'erreur "Unable to login to hubic". Pourtant les logins indiqués sont bons, je fais un copier-coller, et ils fonction...
I've been reading a lot lately about the next release of Java possibly supporting closures. I feel like I have a pretty firm grasp on what closures are, but I can't think of a solid example of how they would make an Object-Oriented language "better". Can anyone give me a specific use-case where a closure would be neede...
I'm having some trouble sorting data from a text file by a certain field. Possibly by multiple fields later. The .txt is several thousands of lines of code. I'm brand new to python so my code is probably a bit messy. For example, this is the textfile i would read from: stuff 123 1200 id-aaaa stuart@test.com 322 1812 id...
I had two .ui files that I converted to python files with pyuic. What I am trying to do now is open one from the other. Code for the main window: # -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'text.ui' # # Created: Thu May 30 11:40:12 2013 # by: PyQt4 UI code generator 4.10 # # WARNI...
I'm using a script to test if a website runs smoothly, basically I open the site every 20 minutes or so and check the response time and so on. Like this: while True: MechBrowser = mechanize.Browser() Response = MechBrowser.open("http://example.com") time.sleep(1000) I know python will do garbage collection...
I find most short interview problems quite contrived. This post is devoted to the one interview problem that I have found most interesting, due to the simplicity of its statement and the subtlety of its solution. Consider the following function, intended to generate points uniformly distributed on the unit circle, \(x^...
Python Decorators What are Python decorators? Python decorators are special syntax of the language that allows for functions to be applied to other functions or classes. The Python Enhancement Proposal (PEP) 318 describes the syntax used by these decorators as applied to functions. The Python Enhancement Proposal (PEP)...
I don't get any errors with my code but after i hit the spam button it freezes and nothing happens. Anyone see anything wrong with the code? import Skype4Py, wx, time as t skype = Skype4Py.Skype() skype.Attach() name = "" chat = "" message = "" class skyped(wx.Frame): def __init__(self,parent,id): wx.Frame....
Greetings, I'm having difficulty getting the desired results on a particular join, so I thought I'd post this question here The query I'm running is as follows: SELECT adSched.adScheduleNo , adSched.adNo , adSched.zoneNo , adSched.positionNo , adSched.slotGroupNo , TopAdImpressions.maxImpressionDateTime FROM core.dbo.a...
If you review the sidebar "wxPython Window Layout," you'll see a number of choices available, but we have chosen to use the brute-force mechanism for the Edit Transaction dialog: # Create some controls wxStaticText(self, -1, "Date:", wxDLG_PNT(self, 5,5)) self.date = wxTextCtrl(self, ID_DATE, "", ...
I am getting an error and I don't know how to refine my code. Basically, what I am trying to do is pseudo echo command in a terminal app. while True: foo = input("~ ") bar = str if foo in commands: eval(foo)() elif foo == ("echo "+ bar): print(bar) else: print("Command not fo...
I am a python beginner and I am trying to average two NumPy 2D arrays with shape of (1024,1024). Doing it like this is quite fast: newImage = (image1 + image2) / 2 But now the images have a "mask" that invalidate certain elements if set to zero. That means if one of the elements is zero, the resulting element should al...
It made the most sense to me to break this problem into two parts (well, that and I misread the question the first time through..'S) transformation The first part transforms the [key, list1, list2] data structure into nested dictionaries: def recdict(elements): """Create recursive dictionaries from [k, v1, v2, ...]...
What is a pythonic way of making list of arbitrary length containing evenly spaced numbers (not just whole integers) between given bounds? For instance: my_func(0,5,10) # ( lower_bound , upper_bound , length ) # [ 0, 0.5, 1, 1.5, 2, 2.5, 3, 3.5, 4, 4.5 ] Note the Range() function only deals with integers. And this: de...
I've got alot of plugins enabled when using vim which I've collected over the years. I'm a bit fed up with how long vim takes to start now so I'd like to profile it's startup and see which of the many plugins I have are responsible. Is there anyway to profile vim startup or script running? Ideally I'd like to know how ...
I'm a newb trying to write a Selenium script using Python. There's a section of the script where I'm asking the program to wait until the iframe has appeared before selecting another element. I've got and error: NameError: global name 'browser' is not defined I understand the nature of the problem - the variable needs ...
Dark42100 [Résolu] Plus de bureau Bonjour à tous. Suite à une mise à jour et un redémarrage, le bureau est devenu gris, les icônes ont disparu. J'ai accès via un click droit au navigateur et au terminale. J'ai regardé différents topic via ce site ou d'autres mais aucun n'a résolu mon problème. En plus je suis loin d'êt...
Consider the following: >>> import re >>> a = "first:second" >>> re.findall("[^:]*", a) ['first', '', 'second', ''] >>> re.sub("[^:]*", r"(\g<0>)", a) '(first):(second)' re.sub()'s behavior makes more sense initially, but I can also understand re.findall()'s behavior. After all, you can match an empty string between f...
cmarcx Re : [Script] Client Hubic pour linux ;) Bonjour, J'ai essayé de monter hubic avec la commande : ./hubicmount -l <email> -p <passwd> -o umask=022 -o uid=1000 /media/hubic Mais j'obtiens toujours l'erreur "Unable to login to hubic". Pourtant les logins indiqués sont bons, je fais un copier-coller, et ils fonction...
UPDATE2: A better title (now that I understand the problem) would be: What is the proper syntax for input in scipy optimize.fmin? UPDATE: runnable code was requested, so the function definitions have been replaced with runnable code. Sample input data has been hard-encoded as the numpy array 'data'. I'm trying to optim...
I'm looking for a better way to call functions based on a variable in Python vs using if/else statements like below. Each status code has a corresponding function if status == 'CONNECT': return connect(*args, **kwargs) elif status == 'RAWFEED': return rawfeed(*args, **kwargs) elif status == 'RAWCONFIG': ret...
So I decided to learn python this weekend and I started with my default hello world, the prime solver. This code shouldn't work... But for whatever reason it does (for numbers 5 and higher.) #!/usr/bin/python a = 2 while a < 65535: c = 0 a = a + 1 b = 2 while b != a: if a % b == 0: #...
Here's a Python thing I found on www.nerdparadise.com: import random def find_pi(): hits = 0 trials = 0 while 1: x = random.random() y = random.random() trials += 1 if x * x + y * y < 1: hits += 1 if trials % 100 == 1: print hits * 4.0 / trials find_pi() Yay Pi! I'm currently making one that uses th...
I am using Selenium WebDriver and coding in Python I have looked all over the place and the best I could find were things written in different languages. I also tried to use the export tool on Selenium IDE but when I look at the data says that the function is not supported for export. EDIT: The reason I need the browse...
I have a python class as follow class Application(models.Model): name = models.CharField(help_text="Application's name",max_length=200) current_status = models.IntegerField(null=True, blank=True) class Meta: ordering = ["name"] @property def status(self): """Returns the current Appli...
I'd like to create a file with path x using python. I've been using os.system(y) where y = 'touch %s' % (x). I've looked for a non-directory version of os.mkdir, but I haven't been able to find anything. Is there a tool like this to create a file without opening it, or using system or popen/subprocess? I'd like to crea...
Is there a list somewhere of recommendations of different Python-based REST frameworks for use on the serverside to write your own RESTful APIs? Preferably with pros and cons. Please feel free to add recommendations here. :) Something to be careful about when designing a RESTful API is the conflation of GET and POST, a...
wlourf Postez vos scripts Lua pour Conky ! Bonsoir à tous ceux pour qui chaque pixel du bureau compte, J'ouvre ce topic suite aux discussions sur le topic des conky pour discuter des scripts Lua dans conky. Lua est un langage de script léger et facile a utiliser qui permet d'ajouter de nouvelles fonctionnalités à nos c...
I want to highlight the current page in the navigation menu. Obviously I need to give the menu links a class like 'active' when you are on their page. This is a classic problem and I've seen many solutions proposed. My problem is I hate all of them and consider none of them to be very DRY. For example: @register.simple...
I'm experimenting with sympy and I've hit upon an issue I can't work out. Using scipy I can write an expression and evaluate it for an array of x values as follows: import scipy xvals = scipy.arange(-100,100,0.1) f = lambda x: x**2 f(xvals) Using sympy I can write the same expression as follows: import sympy x = sympy...
I've got a stored procedure in a MySQL database that simply updates a date column and returns the previous date. If I call this stored procedure from the MySQL client, it works fine, but when I try to call the stored procedure from Python using MySQLdb I can't seem to get it to give me the return value. Here's the code...
simohamed5130 bureau 3d bonjour, j ai iinstallé ubuntu 12.04 et je veux personnliser mon bureau en 3d, puisque je suis debutant , j ai cru que j ai tout fais, j ai suivi les instructions au: http://doc.ubuntu-fr.org/bureaux_3d pour glxinfo | grep "direct rendering" , la reponse etait : direct rending : yes puis , j ai ...
Pylades /* Topic des codeurs couche-tard [1] */ Bienvenue dans le TdCCT 0x1. Ceci est la suite de ce fil. Voici le rappel des règles du jeu, formulées par le message initial de samuncle : Bienvenue dans ce nouveau topic psychédélique, ou le but est de coder le plus tard possible (oui, c’est bien connu, il est plus faci...
Linux-Esperanto-HOWTO Kelkaj helpindikoj por uzi Esperanton sub Linukso Kompilita de Wolfram Diestel ( This e-mail address is being protected from spambots. You need JavaScript enabled to view it ) helpita dealiaj. v1.30, August 1999 Cxar tiu cxi teksto estas verkita per linuxdoc-sgml, gxi ne povas uzi esperantajn sign...
I am trying to set a cursor location and pivot point with bpy.types.SpaceView3D.pivot_point='CURSOR'bpy.types.SpaceView3D.cursor_location = (0.0, 0.0, 0.0) and I see I am not doing it right. How to do it correctly? See Adhi's answer here as to why this won't work the way you are doing it. What you want to use is For th...
I don't know why so many comments above contain the correct answer and no one dared to write an actual answer, so I'll do it hereby. class ThisWorksNow(object): def outer(self): acc = [] def inner(msg): acc.append(msg) inner("Why doesn't") inner(" this work?") print "".join(acc) ThisWorksNow...
I have a overritten save_model() method in my django ModelAdmin class. This model has a ManyToMany field.My save_model looks like this: def save_model(self, request, obj, form, change): creating = False to_delete = False if not obj.pk: creating = True obj.save() form....
samefab problème exercice python notes salut tout le monde, j'apprends en ce moment à programmer en python avec python notes Ce livre est très bien fait mais j'ai un petit problème. Je suis au paragraphe "8.3.1 Exemple graphique : tracé de ligne dans un canevas" le programme se lance normalement, je peux tracé une lign...
If I run compix-switch or fusion-icon, and then select xfwm4 from its menu, it refuses to load, terminal gives me these errors: Code: * Setting window manager to Xfwm4 ** (xfwm4:6218): CRITICAL **: Xfconf could not be initialized ** (xfwm4:6218): WARNING **: Missing data from default files * Setting window manager to X...
I want to get a similarity percentage of two words, eg) abcd versus zzabcdzz == 50% similarity Don't need to be very accurate. Is there any way to do that? I am using python but feel free to recomment other languages. You can get a rough idea of similarity by calculating the edit distance between the two strings divide...
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...
Table of Contents resolv.conf and nsswitch.conf Before we dive into configuring various aspects of network setup, we want to walk through the necessary bits that have to or can be present in the kernel. See Chapter 32, Compiling the kernel for more details on compiling the kernel, we will concentrate on the configurat...
I am trying to learn how to build a basic Flask application with Python. I first followed their excellent tutorial to make a simple blog. The tutorial has you import session from flask. This is later set to "logged in," and only when it is such can the user write posts. For instance, the login function is as follows: @...
#2626 Le 05/01/2013, à 15:18 rvhm Re : TVDownloader: télécharger les médias du net ! bjr j'ai commencé à mettre les dépendance de tvdownloader il me manque "libkrb53 (>= 1.6.dfsg.2)" ou je pourrais le trouver ? merci Hors ligne #2627 Le 06/01/2013, à 18:23 rvhm Re : TVDownloader: télécharger les médias du net ! bonjour...
Antichoc [Résolu] Installation en ligne Bonjour, je souhaites savoir si sous ubuntu il existe une commande qui permette de télécharger un pakage sur le serveur de ubuntu et qui l'installe automatiquement avec les dépendances ? En bref, je souhaites installer VLC avec ces nombreuses dépendances en puisant directement su...
gtk.TreeIter — An object that points at a path in a gtk.TreeModel. class gtk.TreeIter(gobject.GBoxed): def copy() def free() def copy() a copy of the treeiter. The copy() method returns a copy of thetreeiter. This iter must be freed with the free()method. def free() This method is deprecated and should not be...
I'd like to write kind of CPS code higher functions. They should take a function code, encapsulate it in the object and add means for combining this objects. Something like this: myFunction=MyFunction( a = b+c print(c) return a) But there is only one pythonic expression for anonymous functions - lambda statement...
This program is supposed to calculate the number of degrees below 60 on a given day then create a running sum of degrees. count equals the sum of degrees below 60. However, when I run it I get this error: cool = 60 - temp TypeError: unsupported operand type(s) for -: 'int' and 'str' Any ideas on why it's doing this? T...
I was trying to send image with poster module. I followed the example, but it doesn't work for me My code: from poster.encode import multipart_encode from poster.streaminghttp import register_openers import urllib, urllib2 def decaptcha(hash): register_openers() params = { "file": open("captcha.jpg", "rb"),...
from xml.sax.saxutils import escape def pyAST2XML(pyAST): if isinstance(pyAST, str): return escape(pyAST) if isinstance(pyAST, tuple): result = "<" + pyAST[0].replace("_", "-") + ">" for e in pyAST[1:]: result += pyAST2XML(e) result += "</" + pyAST[0].replace("_", "-"...
malbo Re : Installation Ubuntu MSI GE70 Ton Boot-Info est là : Boot Info Script e7fc706 + Boot-Repair extra info [Boot-Info 23Dec2013] ============================= Boot Info Summary: =============================== => No boot loader is installed in the MBR of /dev/sda. => Syslinux MBR (3.61-4.03) is installed i...