text
stringlengths
256
65.5k
#1001 Le 25/04/2010, à 17:05 oGu Re : [ VOS SCRIPTS UTILES ] (et eventuelles demandes de scripts...) Bonjour à tous ! Tout d'abord félicitations pour l'excellente tenue de ce forum et pour tous les scripts que j'ai piqué sur ce topic!! Etant passé de Firefox à IceCat dernièrement, j'aimerais qu'un Ubuntero sachant scri...
cherrak Re : A quoi ressemble votre environnement - automne/hiver 2011/2012 Ok merci pour la precision ! Dernière modification par cherrak (Le 07/03/2012, à 03:09) Major Grubert Re : A quoi ressemble votre environnement - automne/hiver 2011/2012 Question bête : quel est le paramètre à modifier pour avoir un affichage "...
The easiest way that I have found was to do something along the lines of: el = driver.find_element_by_id('id_of_select') for option in el.find_elements_by_tag_name('option'): if option.text == 'The Options I Am Looking For': option.click() # select() in earlier versions of webdriver break This may ...
In my ongoing effort to learn more about python, I am trying to add a right click event to my mp3 manager program. What currently works is that it shows the menu and all of the options. What is not working is the functions selected from the menu are not executing as I think they should be. Much of this code was taken f...
This expanded procedure accounts for most of the complications that could occur, including problems connecting to the Internet in the chroot, not knowing which kernel package to install (before Ubuntu 12.10, it will not always be linux-image-generic), not knowing at the outset which partition or even which physical dri...
AuthorPosts August 22, 2012 at 6:03 pm #15612 Hello: Cannot figure out how to turn on the column view for my home page. Would like to see four columns just like in your Avisio demo under “Why Avisio?” Also… How/Where do we download the latest version of Avisio? Thanks August 23, 2012 at 6:53 am #88226 Kriesi just uses ...
I have a simple tastypie resource: class EntryResource(ModelResource): class Meta: queryset = POI.objects.all() resource_name = 'poi' This resource contains a field geom, which is a geometryfield. Tastypie outputs it as WKT (string). I would like to output it as geoJSON. Is there a simple way to ma...
C, Twelve Days of Xmas Style New version: main(Z,_){Z?(_=Z[" $X,X3Y<X@Z@[<XHZHX," "` \\(Z(X0Z0Z8[@X@^8ZHZHX(Z(`#Y(Z(X3[8" "\\@_8ZHXHXHX(Z(` \\(Z(X0Z0Z8\\@_8ZIXI" "X(Z(` \\,X0Z0Z8\\@_8ZHZHX,"])?main(0,_ -32),main(Z+1,_):0:(putchar((_>>3)["kt" "wy~|tE/42"]-37),(_&7)?main(0,_-1):0);} Output: FFFFF OOOOO RRRR TTTTT Y Y...
I'm trying to build a system for managing the various types of content in a page. For example, a page may have text content, hyperlink content, video content, ect. In my modeling code, I have a base class: class ContentItem(models.Model): title = models.CharField(max_length=1000) page_order = models.IntegerFiel...
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...
Let's say I want to implement an event bus using a OO programming language. I could do this (pseudocode): class EventBus listeners = [] public register(listener): listeners.add(listener) public unregister(listener): listeners.remove(listener) public fireEvent(event): for (listene...
Possible Duplicate: How to initialize a two-dimensional array in Python? In solving a simple problem regarding a two dimensional array I came across a solution on this site that explained how to declare one in Python using the overload operator. Example: Myarray = [[0]*3]*3 this would produce the following array (list)...
I have a simple Flask web application I am playing around with. A lot of the design comes from the Flask mega tutorial. It's using the Flask-SQLAlchemy plugin hosted with Apache and the WSGI module and everything works rather well. Except that on one web page, I am instantiating new elements in the database using a for...
I am trying to implement a simple UDP client and server. Server should receive a message and return a transformed one. My main technique for server is to listen UDP messages in a loop, then spawn multiprocessing.Process for each incoming message and send the reply within each Process instance: class InputProcessor(Proc...
I'm having trouble with processing some csv data files for a project. Someone suggested using python/csv reader to help break down the files, which I've had some success with, but not in a way I can use. This code is a little different from what I was trying before. I am essentially attempting to create an array. In th...
g_barthe interface python et apprentissage boa constrictor Bonjour, Je voudrais commencer à developper qq applications (avec interfaces graphiques) en python (pour windows et linux). Je recherche donc un éditeur qui permettrait de realiser l'interface de maniere simple et non en code pur. J'ai bien trouvé "wxglade" mai...
I am writing a web app that will use HTML to display a form. Then the user completes the form, and on submit the form is sent to PHP. In the PHP file I have it set up to call and exec() command to a Python file that will return data. But for some reason I am not getting anything back. When I execute the command in term...
Hmm, bug in iRedAPD-1.3.8. Please find below lines in /opt/iredapd/libs/ldaplib.py (about line 209 to 212): # Return if recipient account doesn't exist. if recipientDn is None or recipientLdif is None: self.logger.debug('Recipient DN or LDIF is None.') return SMTP...
I'm in a situation to replace some functionalities from a client that operates directly on a CSV file, which used as a config file for a system. Most of the cases available on search is about reading from CSV to other formats. Other takes the whole CSV into memory, attaching the dedicated rows and changes, then write t...
Is there a a good python library for training boosted decision trees ? You can use R decision tree library using Rpy(http://rpy.sourceforge.net/). Also check the article "building decision trees using python"(http://onlamp.com/pub/a/python/2...). there is also I had good success with the tree-based learners in Milk: Ma...
Arek edit: so I'm trying what Andrew Wilkinson suggested in his answer - extending my django app with a command which is based on original django shell command. As far as I understand code which starts ipython in original version is this: from django.core.management.base import NoArgsCommand class Command(NoArgsCommand...
Consider this - a base class A, class B inheriting from A, class C inheriting from B. What is a generic way to call a parent class constructor in a constructor? If this still sounds too vague, here's some code. class A(object): def __init__(self): print "Constructor A was called" class B(A): def __init_...
The function is below. I'd like to use a while loop for this and no methods, as I want to get more practice using the while loop and if-statements. def remove_leading_zeros(s): '''(str) -> str Return s, but without any extra leading zeros e.g. given "007", return "7" Precondition: Each character of s is a number. ''' i...
I'm trying to build a simple ftp server with python, but I get an error: "An attempt was made to access a socket in a way forbidden by its access permissions" As I understand, it's because of the port number, but what should I do? Here is the code: import socket HOST = '' PORT = 21 s = socket.socket...
The inner loop logic is wrong but particularly, this line: image[c:c+3], image[-c-3: -c] = image[-c-3: -c], image[c:c+3] You are changing the image variable in-place, but you seemed to forget the row variable r. So right now, you are changing rows. And your negative slicing is a bit off. For c=0, you'll get image[-3:0...
I'm trying to get MySQL-Python 1.2.3 running under Leopard on my MacBook Pro for Python 2.7 (64 bit). I've tried building and installing from source along with easy_install with no luck. When installing from source, I have modified mysql_config.path in setup_posix.py as suggested in another related answer to mysql_conf...
You're not actually adding a new axes. Matplotlib is detecting that there's already a plot in that position and returning it instead of a new axes object. (Check it for yourself. ax and newax will be the same object.) There's probably not a reason why you'd want to, but here's how you'd do it. (Also, don't call newax =...
I'm using Facebook Graph API on Google App Engine. I was able to fetch all the basic info from an user. However when I tried to fetch any user info that requires permission, email for exemple, it always appears as None. I've followed the whole tutorial available at the developers blog. Here's my code: class User(db.Mod...
I have a script where I ask the user for a list of pre-defined actions to perform. I also want the ability to assume a particular list of actions when the user doesn't define anything. however, it seems like trying to do both of these together is impossible. when the user gives no arguments, they receive an error that ...
Module info source code Commands for listing TurboGears default and extension packages info retrieve_pkg_info(distribution) Retrieve parsed package info from distribution. source code retrieve_url(distribution) Retrieve URL from distribution. source code add_link(distribution) Add link to distribution. source code retr...
I don't really know what happened... I clicked "install updates" in the update manager window, it failed, and next thing I know I can't apt-get install any packages, it just suggests I try apt-get -f install, which fails with the following message. doug@doug-lubuntu:~$ sudo apt-get -f install Reading package lists... D...
Let's say I have an equation: x**2 + y**2 - 4 = 0 How can I see the circle using sympy, matplotplib or another python solution? I know in sympy I can from sympy import Plot from sympy import Symbol x = Symbol('x') y = Symbol('y') Plot(x**2 + y**2 - 4) But then I get z = x**2 + y**2 - 4, a 3D graph instead of the plan...
toma222 [HOW TO] adesklets : installation sous Ubuntu Dapper et Edgy Il existe désormais un article sur le wiki concernant Adesklets donc je vous conseille de vous y fier, ce tutoriel n'étant plus mis à jour. Je poste ce sujet en complément du sujet sur l'installation de adesklets sous Breezy. Je ne reviendrais pas sur...
loic_e Kubuntu Dapper sur Sony VAIO VGN-FE28H Voici la procédure d'installation utilisée pour installer Kubuntu Dapper sur un Vaio VGN-FE28H: Caractéristiques: Processeur Intel Core Duo Fréquence 1.67 GHz Quantité de RAM 1 Go Type de RAM DDR2-SDRAM Disque dur 160 Go Puce graphique nVIDIA GeForce 7400 Turbo Cache Taille...
Hizoka Re : [glade2script-GTK2] Interface graphique pour script bash ou autre. bah le principe en lui même je le pige. mais c'est son application où j'ai du mal. Il va falloir que je me penche bien sur tes exemples. Hors ligne frafa Re : [glade2script-GTK2] Interface graphique pour script bash ou autre. CouCou ! oulah ...
What are the available libraries for creating pretty charts and graphs in a Python application? I'm the one supporting CairoPlot and I'm very proud it came up here. Surely matplotlib is great, but I believe CairoPlot is better looking. So, for presentations and websites, it's a very good choice. Today I released versio...
I have the following model: class House(models.Model): Name = models.CharField(max_length=200, unique=True) Reference = models.CharField(max_length=50, unique=True) class Booking(models.Model): House = models.ForeignKey(House, related_name='booking') InitialDate = models.DateField() FinalDate= models....
/****************************************************** * A Simple Tic-Tac-Toe Game. * ******************************************************/ #include <iostream> #include <cstdio> #include <cstdlib> using namespace std; void reDraw(); bool bNotGameOver(); bool bCheckValid(int, int, i...
ehmicky Stego++, projet de bibliothèque de stéganographie Salut à tous, [Message mis à jour 19/11/11] Je suis actuellement sur un projet de stéganographie (art de dissimuler un message secret dans "quelque chose" (fichier, phrase, etc.) d'apparence banal). Il s'agit de faire une bibliothèque C++, Stego++, qui permette ...
Composite Manager Retained Drawing Protocol RFC Robert Carr 02/28/07 Outline and justification: Results from development in the creation of 'first generation' mainstream composite window managers has outlined the need for several reconsiderations in regards to applications interacting and communicating with the composi...
I've been trying to find a more pythonic way of generating random string in python that can scale as well. Typically, I see something similar to ''.join(random.choice(string.letters) for i in xrange(len)) It sucks if you want to generate long string. I've been thinking about random.getrandombits for a while, and figur...
fran.b Re : [Résolu] Sources de Logiciels ne veut plus démarrer… À mon avis, ce qui suit devrait fonctionner: * edition du sources.list * Virer le dépot $ sudo apt-get update * Remettre le dépot $ sudo apt-get update $ sudo apt-get install jpegtoavi (par exemple) Si tout se passe bien (ce que je crois), c'est que le mo...
I have a model Question - class Question(models.Model): title = models.CharField(max_length=1024) content = models.TextField() answer = models.TextField() pub_date = models.DateTimeField(auto_now=True) category = models.CharField(max_length=512) flags = models.IntegerField() def __unicode__(...
i am trying to write a competition code that will get a list of competitors and then will randomly decide who they must face at each round, round-robin style without eliminations. wiki article about this type of competition at the end of each round the winner of each match will receive a point. when all possible fights...
Okay, here is an actual solution that seems to work. I do not understand your code, and I hadn't heard of DNF, so I started out by studying the problem some more. The Wikipedia page on DNF was very helpful. It included a grammar that describes DNF. Based on that, I wrote a simple set of recursive functions that I belie...
I have searched the SO before I post this question here and hopefully this is not a duplicated one. def print_me(): a_list = range(1, 10) for idx, aa in enumerate(a_list): pass print(idx) if __name__ == '__main__' : print_me() Output is as follows: 8 I came from C++ world and could not figure out w...
Basically I just need to figure out how to produce modes (numbers occurring most frequently) from a list in Python, whether or not that list has multiple modes? Something like this: def print_mode (thelist): counts = {} for item in thelist: counts [item] = counts.get (item, 0) + 1 maxcount = 0 maxitem = Non...
Let's say I am using a framework that has a class called Animal. class Animal(object): def speak(self): logging.info(self.sound) I have to subclass this object in order to use it and it might look something like this: class Dog(Animal): def __init__(self): self.sound = 'Woof Woof' The way I se...
I'm writing a report for my physic experiment. For this I use PyLab64bit, XeLaTex, Excel. I write the measurements in an excel sheet and then use import -xlrd to get the data for the .py script with which I do the plots and calculations. The plots are saved as .pdf and included in the .tex file later. Now most of the s...
Simple question: I am using pyplot, I have 4 subplots. How to set a single, main title above all the subplots? title() sets it above the last subplot. Use plt.suptitle: import matplotlib.pyplot as plt import numpy as np fig=plt.figure() data=np.arange(900).reshape((30,30)) for i in range(1,5): ax=fig.add_subplot(2,...
I want to load the Firefox Addon RequestPolicy. This is how i tried it: rp = open(wd + "/requestpolicy.xpi") firefoxProfile = FirefoxProfile() firefoxProfile.add_extension(rp) self.driver = webdriver.Firefox(firefoxProfile) self.usr = user.User(self.driver, username, password, world) self.usr.login() No error, accordi...
How do I change specific colors in a pixmap? For example, I have a pixmap with white and black pixels, and I want to change all white pixels to blue, but leave the black ones alone. Or maybe change the black to white and the white to blue... [I am searching for a solution in Qt/PyQt, but maybe this is a general questio...
Adding Messages Messages are added by calling the mailbox's add(msg) method. The msg parameter can be one of several different types: a string containing both headers and body of an RFC-2822 message. a file-like object: the file will be read completely and its contents treated as an RFC-2822 message. (If the object is ...
The two options I can think of are: Add an svn:externals link to the remote project (which you already know about). Extend Sphinx with a custom directive to include files from remote subversion repositories. I'm no expert on Sphinx internals but was able to cobble together a quick extension which embeds files from a re...
Python Bindings for the Hurd (PyHurd) Contact information Name: Arne Babenhauserheide E-Mail Address: arne_bab@web.de IRC-nick: ArneBab @ freenode Jabber-ID: arne@jabber.fsfe.org Phone-number: XXXXXXXXX GnuPG key: http://draketo.de/inhalt/ich/pubkey.txt Who I am I am a physics student from Heidelberg, Germany, a passio...
I have a list of strings that contain letters and numbers. I want to search for the numbers and have them returned to me. What is the best way to do this? I'm pretty new to Python and I looked into regular expressions and I'm in the process of learning them now, but I don't know when I'll be good enough in regular expr...
There are some questions discuss about how to use Twitter API to get tweets from a user. (e.g., Twitter API getting any user's all tweets, Is there a way to get all tweets from twitter for a specified user?) I know I should use user_timeline. But my questions is that Twitter put a rate limit, if I want to download say ...
The Python garbage collector is useful for collecting reference cycles, but objects are collected by default when their reference count reaches 0, so, most of the time objects will be collected properly and the collector is only useful when you have a cycle. Also, there's no guarantee when it'll bump in to do a collect...
I want to start out by saying I'm aware new.instancemethod doesn't exist in python 3 and overloading functions doesn't technically either. However, I am looking at an old python package which uses new.instancemethod in a script that effectively allows for overloaded functions. The specific package can be found from thi...
EDIT: stupid logic of mine got ahead of me. The none are just the returns from the comprehension call. Ok, I'm running some tests in python, and I ran into a bit of a difference in execution orders, which leads me to an understanding of how it is implemented, but I'd like to run it by you fine people to see if I'm righ...
snowvinc Réponses : 5 Bonjour, Ne voulant pas encombrer la partie configuration materiel quand semble être plus dédier aux drivers, je me suis dit, pourquoi ne pas poster ici. Je voulais avoir vos avis sur quelle quantité de ram a ne pas dépasser inutillement et la puissance d'un processeur. De facon général si vous vo...
anonym_user Re : Besoin de testeurs pour Pap'rass Salut, Excellente idée ce soft ! J'ai juste un petit problème : les doc ne se classe pas dans les chemises que je crée. Après chaque tentative de classement la recherche sur le classeur m'indique qu'il est vide. La recherche par mot clé retrouve le doc mais le document ...
I need a temporary table in my programme. I have seen that this can be achieved with the "mapper" syntax in this way: t = Table( 't', metadata, Column('id', Integer, primary_key=True), # ... prefixes=['TEMPORARY'], ) Seen here But, my whole code is using the declarative base, it is what I understand, a...
The following C++ library was successfully compiled in VS2008 When I open it in VS2010, it goes through the conversion wizard process without any errors. Now, when I attempt to compile it in VS2010, I get some weird STL errors like these: 1>TimXmlRpc.cpp(1018): error C2039: 'back_insert_iterator' : is not a member of '...
sputnick [JEU] #! /challenge/bash #8 << challenge bash #8 Le challenge est ouvert à tous les langages de scripting ! scripteurs bash, python, perl, ruby… à vos claviers ! Robot web pour récupérer les nouveaux fils des sous-forums Ubuntu de son choix. L'objectif est de réaliser un script qui va parser le forum afin d'y ...
spyke Re : La communauté du jeux sous Linux http://www.JeuxLinux.fr jerhum oki mais alors je ny arrive pas a les faire tourner justement est ce normale comme wolfenstein , quake4 etc..... Hors ligne foxylechou Re : La communauté du jeux sous Linux http://www.JeuxLinux.fr il faut autoriser le fichier a être exécuter dan...
This version upgrade of flash-player fixes multiple security issues that could potentially be exploited to cause a crash or even execute arbitrary code. Updated packages are available from download.opensuse.org. SUSE Security Update: Security update for flash-player _____________________________________________________...
Simply, but memory inefficiently, The Python 3 way: def binaryedit(fn): f=open(fn,mode='rb') fc=f.read() f.close() return b'rawr'+fc[4:] The Python 2 way: def binaryedit(fn): f=open(fn,mode='rb') fc=f.read() f.close() return 'rawr'+fc[4:] If the files are huge, you can memory map them and edit/write just the ...
Altre ricette Aggiornamenti Nella pagina "site" dell'interfaccia amministrativa è presente un pulsante "upgrade now". In caso che questa opzione non funzioni (per esempio a causa di un lock su un file) l'aggiornamento manuale di web2py è comunque estremamente semplice: Decomprimere l'ultima versione di web2py sull'inst...
I am relatively new to the ArcGIS-Python environment and want to calculate elevation raster slope. But it says "ValueError: setting an array element with a sequence". Below code is what I have. Any help would be highly appreciated. import arcpy, numpy, math from numpy import * from arcpy import env arcpy.env.workspace ...
no_spleen Re : Petit guide pour aider au choix d'un langage Le fichier de maillage est trops gros à poster ! Hors ligne tshirtman Re : Petit guide pour aider au choix d'un langage un code permettant de générer un fichier de ce type alors? je vais regarder ton code voir si je voit quelque chose de choquant pour les perf...
How can I assign the maximum value for a long integer to a variable, similar, for example, to C++'s LONG_MAX. How can I assign the maximum value for a long integer to a variable, similar, for example, to C++'s Long integers: There is no explicitly defined limit. The amount of available address space forms a practical l...
#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...
benney [Resolu] Firefox fait planter mon ordi après passage de 12.04 à 14.04 Bonjour, je viens de passer (de tenter) de la version 12.04 à la version 14.04 de xubuntu via un CD d'installation. au préalable, lors de l'installation j'avais utilisé sans incident le navigateur Firefox lors de la sécession live sur le CD. j...
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); ...
UPDATE: 2.x support is now mainline! Please read the wiki page for important information about the update. A warm welcome to you, traveller. You have arrived at the home of Py-StackExchange, the library definitively proven† to be the best library for using the SE API from Python. If you are still interested (and by gol...
For one, I almost never just sit there and write unit tests. Unit tests are a means to an end, not an end in themselves. They are a way of answering "does this code do the basic task that it is supposed to." For instance, some people will write a function, and then open an interactive session to test it out on a few va...
Chris__ Re : gReemote, télécommande + prog TV pour Freebox HD Hmmm l'upload du fichier deb a raté... Désolé :-) Cette fois il a réussi Hors ligne tocks Re : gReemote, télécommande + prog TV pour Freebox HD Pour la barre sa fonctionne très bien. Moi aussi en regardant, je ne trouve pas vraiment d'endroit pour rajouter c...
Possible Duplicate: How does the Google “Did you mean?” Algorithm work? Suppose you have a search system already in your website. How can you implement the "Did you mean:<spell_checked_word>" like Google does in some search queries? Suppose you have a search system already in your website. How can you implement the...
Case in point, it only took me about an hour to automatically add my most recent Twitter updates to this blog. (Yes, the Twitter badges would have worked, but for performance and consistency reasons I try not to depend on third party Javascript.) If you're reading this in a blog reader, then you can view the new Twitte...
I have a JSON file that I want to covert to a CSV file. How can I do this via Python? 0 vote down check I tried: import json import csv f = open('data.json') data = json.load(f) f.close() f = open('data.csv') csv_file = csv.writer(f) for item in data: f.writerow(item) f.close() However, it did not work. I a...
#0 Re : -1 » Arte +7 recorder version 4 » Le 16/04/2009, à 16:03 bobuse Réponses : 886 Hello, je viens de démarrer une version en python. Je voulais une version console et reprendre la version bash me semblait trop compliqué. J'ai donc commencé par faire une API pour obtenir les vidéos et leur infos (dont l'URL) dans C...
bipede Re : Besoin de testeurs pour Pap'rass Merci bipede Il n'y a pas de quoi Ca fonctionne pour ton scanner ? Hors ligne jeremix Re : Besoin de testeurs pour Pap'rass Oui, ça fonctionne, mais je retape la valeur voulu à chaque fois (au cas où ça provoquerais un problème), car cela m'affiche 2 résolutions différentes....
I'm trying to upload a file to S3 (actually the upload works) but my app crashes and throws the error saying: fp is at EOF. Use rewind option or seek() to data start. I saw that some ways people have solved the problem was adding rewind=True to their set_contents_from_string call. However this throws the following erro...
Basically I need over a million points on x-y plane. I am thinking about first generating 1 million points in range -x to x, another million in range y to -y and then coupling them together. What will be optimized and fast way to do this? In random.randrange good enough? I would use NumPy for that. In my quick test In ...
Currently, I have a python script which takes in a text file, checks for passages enclosed by a tag ##Somethinghere## and asks the user how many times does he/she want to copy it. So for instance if I have the text file: Random Text File##RandomLine1##Random Line 1##RandomLine1##Random Line 2##RandomLine3##Random Line ...
Fizzbuzz seemed like fun... My 5 min attempt in python: for i in range(1, 101): fizz = "Fizz" if not (i%3) else "" buzz = "Buzz" if not (i%5) else "" print (fizz + buzz) or i This is just a short list of technologies I'd like to try out, or am trying out now. Basically just some links I want to remember =D...
I'm trying to create a simple python script and import a couple of custom classes. I'd like to do this as one module. Here is what I have: point/point.py class Point: """etc.""" point/pointlist.py class PointList: """etc.""" point/__init__.py from . import point, pointlist script.py import sys, point verbose =...
I have downloaded a bunch of videos from coursera.org and have them stored in one particular folder. There are many individual videos in a particular folder (Coursera breaks a lecture into multiple short videos). I would like to have a python script which gives the combined length of all the videos in a particular dire...
I searched a lot and did not find any answer to this problem =( I have a CentOS 5 as a server, following this How To: http://wiki.osqa.net/display/docs/RHEL%2C+CentOS+5+Installation+Guide#RHEL%2CCentOS5InstallationGuide-Python I'm able to install python 2.6 separated from the yum version. But when I run ./easy_install ...
senjy Erreur fatal postfix sur email en spam ou pas Bonjour, J'ai installé un serveur postfix et j'utilise un script php maison qui marche, mais le résultat est un peu étrange. 1. Certains mails envoyés partent dans la boite spam de l'utilisateur 2. D'autres envoyés fonctionnent Dans /var/log tout semble tres bien se p...
Is there not a way to figure out when a object should be destroyed? The short answer is no. It is not possible for compilers to figure out at compile time when objects need to be freed, in the general case. Consider the following pseudo-code: def my_function(some_input): A = allocate_some_object(some_input) B =...
Virtualici Re : [Tuto] - Ma personnalisation Xubuntu (et autres variantes) j'ai tout tenté ! au mieux j'ai ça : ): [sudo] password for boubou: Sorry, try again. sudo: 3 incorrect password attempts boubou@boubou-M51SE:~$ ******* ******* : commande introuvable boubou@boubou-M51SE:~$ les : ******* c'est mon pass. Hors l...
All, This is probably very basic, but I cannot find an answer that works for me. Simple enough -- I want to rotate an image around an endpoint, not the center. I know that all I really need is to be able to set the anchor point of the image and then apply the transform. I cannot, however, figure out how to set the anch...
Is it possible to carry out a PyMinuit function minimisation by passing a dictionary of parameters to the minimiser? For example, the usual use of PyMinuit would be called using something like: def f(x, a, b): return a + b*x def chi2(a,b): c2 = 0. for x, y, yerr in data: c2 += (f(x, a, b) - y)**2 / yerr...
I'm using Python's minidom library to try and manipulate some XML files. Here is an example file : <document> <item> <link>http://www.this-is-a-url.com/</link> <description>This is some information!</description> </item> <item> <link>http://www.this-is-a-url.com/</link> ...
After studying this page: I am hoping to find some setup.py files to study so as to make my own (with the goal of making a fedora rpm file). Could the s.o. community point me towards some good examples? Complete walkthrough of writing If you'd like a real-world example, I could point you towards the These aren't simple...
Introduction From time to time I encounter devices that still require some old kind legacy partitioning scheme and filesystem: Namely MBR type partitioning and the VFAT filesystem. One of these devices is the Canon Selphy CP800 photo printer, which reads photos from various kinds of storage mediums, like USB sticks, SD...
Alright, I have a fairly simple design. class Update(models.Model): pub_date = models.DateField() title = models.CharField(max_length=512) class Post(models.Model): update = models.ForeignKey(Update) body = models.TextField() order = models.PositiveIntegerField(blank=True) class Media(models.Model):...
I have this script which processes lines containing windows file paths. However the script is running on Linux. Is there a way to change the os library to do Windows file path handling while running on linux? I was thinking something like: import os os.pathsep = '\\' (which doesn't work since os.pathsep is ; for some ...