New submission from Wolfram Kraus :
When using tk.createcommand you get a memory leak when you don't explicitly
call tk.deletecommand to remove this command.
See attached file: __del__ never get's called due to the memory leak and
because of that calling tk.deletecommand inside __del__ has
Am 18.07.2008 14:33, antar2 schrieb:
I want to replace each first element in list 5 that is equal to the
first element of the list of lists4 by the fourth element. I wrote
following code that does not work:
list4 = [['1', 'a', 'b', 'c'], ['2', 'd', 't', 'e'], ['8', 'g', 'q',
'f']]
list5 = ['1',
On 09.11.2006 10:52, Lad wrote:
I have a sorted list for example [1,2,3,4,5] and I would like to change
it in a random way
e.g [2,5,3,1,4] or [3,4,1,5,2] or in any other way except being
ordered.
What is the best/easiest
way how to do it?
Thank you for help
L.
use random.shuffel:
On 06.07.2006 12:43, manstey wrote:
Hi,
I often have code like this:
data='asdfbasdf'
find = (('a','f')('s','g'),('x','y'))
for i in find:
if i[0] in data:
data = data.replace(i[0],i[1])
is there a faster way of implementing this? Also, does the if clause
increase the
On 28.06.2006 10:01, Girish Sahani wrote:
Sorry for spamming again, but please also enlighten me with some way to
time a function i.e. to find out how much time each function takes for
execution in a big program.
Hi all,
Can anyone tell me the simplest way to do it (some code snippet that
sandorf wrote:
I'm new to python. Have a simple question.
open function can only open an existing file and raise a IOerror when
the given file does not exist. How can I creat a new file then?
open the new file in write mode: open('foo', 'w')
See: help(open)
HTH,
Wolfram
--
Nico Grubert wrote:
Hi there,
on a Linux machine running Python 2.3.5. I want to create a file
'newfile' in a directory '/tmp' only if there is no file 'transfer.lock'
in '/temp'.
A cronjob creates a file 'transfer.lock' in '/temp' directory every 15
minutes while the cronjob is doing
rock69 wrote:
Hi all :)
I got this address:
http://www.infomedia.it/immagini/riviste/covers/cp/cp137.jpg
and I would like to download that image and save it to a local file.
How do you do that in Python?
Use urllib2:
http://docs.python.org/lib/module-urllib2.html
[EMAIL PROTECTED] wrote:
Hey there all,
i have a question about how to point my python install to my sql
database.
when i enter this: db = MySQLdb.connect(user=user, passwd=pass,
db=myDB)
i get this:
Traceback (most recent call last):
File pyshell#1, line 1, in -toplevel-
db =
nephish wrote:
[...]
Try the following from the shell (NOT the python shell):
mysql -u user -p
[Enter passwd]
mysql show databases;
If MyDB isn't in the list either something went wrong with the xampp
installation or the database for xampp got a different name. (I am no
xampp expert, so
mg wrote:
Hello,
I am writting bindings for a FEM application. In one of my function
'initModulename', called when the module is imported, I would like to
get the argc and argv arguments used in the main function of Python.
So, my question is: does the Python API containe fonctions like
Kay Schluehr wrote:
Wolfram Kraus wrote:
Kay Schluehr wrote:
The last downloadable release is from november 2004. The Windows
installer is configured for Python 2.3(!). The Zope.org main page
announces Zope 2.8 beta 2. Is it stillborn?
Kay
What you see is not Zope 3
Kay Schluehr wrote:
The last downloadable release is from november 2004. The Windows
installer is configured for Python 2.3(!). The Zope.org main page
announces Zope 2.8 beta 2. Is it stillborn?
Kay
What you see is not Zope 3, it is Zope X 3. To quote from the X3
information page: Zope
Malcolm Wooden wrote:
I'm trying to get my head around Python but seem to be failing miserably. I
use RealBasic on a Mac and find it an absolute dream! But PythonUGH!
I want to put a sentence of words into an array, eg This is a sentence of
words
In RB it would be simple:
Dim s
Heiko Wundram wrote:
Am Freitag, 27. Mai 2005 13:31 schrieb Michael:
if(C == 'z') C='a';
else C++;
if C == z:
C = a
else:
C = chr(ord(C)+1)
According to the OP's problem (with the assumption that only characters
from a-z are given) he might even try a lil LC:
s = shiftthis
Malcolm Wooden wrote:
my actual code is:
for x in range(len(l)):
h = string.split(l[x])
where the sentence string is in an array of one element 'l'
Error is:
Traceback (most recent call last):
File string, line 34, in ?
File string, line 27, in SentenceText
File
Duncan Booth wrote:
Michael wrote:
Hi,
I've got a string s, and i want to shift all the letters up by one, eg
a-b, b-c z-a
In c++ i can do this quite simply with
if(C == 'z') C='a';
else C++;
but i can't work out how to do this this in python??
import string
upone =
Mike wrote:
I would like my 'print' statements to send its output to the user's
screen and a log file.
This is my initial attempt:
class StdoutLog(file):
def __init__(self, stdout, name='/tmp/stdout.log',
mode='w',bufsize=-1):
super(StdoutLog, self).__init__(name,mode,bufsize)
Jonas Meurer wrote:
hello,
my script selects a comment saved as VARCHAR in MySQL and displays it
inside an html page.
the problem is, that the comment contains several special characters, as
mysterious utf-8 hyphens, german umlauts, etc.
i could write a function to parse the comment and substitute
[EMAIL PROTECTED] wrote:
O/S: Windows XP Home (with Service Pack 2)
Downloaded python-2.4.msi from python.org (10,632KB). When I double
click on the file from Windows Explorer, the installation process
presents the window in which I am prompted to either install for all
users (the default) or
Felix Hebeler wrote:
Hi all, I am doing some Python scripting for a while, but I'm not too
deep into it yet. So I have a problem I can't solve.
I need to call an object attribute:
value = object.attrName[0]
the problem is, that the attribute name can only be specified at
runtime.
So what I have is
Heyho!
Torsten Mohr wrote:
Hi,
along with my distribution SuSE 9.1 came python 2.3.3.
I'd like to update to 2.4 now, is this an easy thing to do or will
lots of installed modules refuse to work then?
I installed Python 2.4 under SuSE 9.1 and had no problems so far. If you
install it via
22 matches
Mail list logo