"Steven Reddie" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
news:[EMAIL PROTECTED]
> Hi,
>
> I want to do something like the following, which doesn't work:
>
> modulename = 'module'
> import modulename
>
> The error is that there is no module named 'modulename'. Is there a
> way to get that
Claudio Grondi wrote:
"Steven Reddie" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
news:[EMAIL PROTECTED]
I want to do something like the following, which doesn't work:
modulename = 'module'
import modulename
The error is that there is no module named 'modulename'. Is there a
way to get that v
Steven Reddie wrote:
MODULES = [ 'module1', 'module2' ]
def libinfo():
for m in MODULES:
__import__('libinfo.'+m)
m.libinfo()
CFLAGS+=m.CFLAGS
Does this do what you want?
-- libinfo/__ini
On Sun, 06 Mar 2005 09:44:41 +0100, Patrick Useldinger
<[EMAIL PROTECTED]> wrote:
> Xah Lee wrote:
>
> > globe=0;
> > def myFun():
> > globe=globe+1
> > return globe
>
> The short answer is to use the global statement:
>
> globe=0
> def myFun():
>global globe
>globe=globe+1
>retu
YL wrote:
Try something like this:
for x in plugs:
cmd = "import %s" % x
exec (cmd)
For the sake of others who might have missed the rest of this thread,
I'll point out that this is definitely not the way to go. No need to
use exec when the builtin __import__ function is alre
Hi,
Thanks, that seems to be what I was missing. I'm having some further
related trouble though. I want to do something like this:
MODULES = [ 'module1', 'module2' ]
def libinfo():
for m in MODULES:
__import__('libinfo.'+m)
On 6 Mar 2005 21:34:08 -0800, Steven Reddie <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I want to do something like the following, which doesn't work:
>
> modulename = 'module'
> import modulename
>
> The error is that there is no module named 'modulename'. Is there a
> way to get that variabl
Hi,
I want to do something like the following, which doesn't work:
modulename = 'module'
import modulename
The error is that there is no module named 'modulename'. Is there a
way to get that variable expanded?
Regards,
Steven
--
http://mail.python.org/mailman/listinfo/python-list
On Sat, 05 Mar 2005 15:42:23 +1000, Timothy Smith
<[EMAIL PROTECTED]> wrote:
> i'm trying to setlocale() on 4.10, and it appears the python package
> doesn't support this under 4.10.
>
> Python 2.3.3 (#2, Apr 28 2004, 22:48:37)
> [GCC 2.95.4 20020320 [FreeBSD]] on freebsd4
> Type "help", "copyrigh
Thanks. How do I verify what RPMs I need? I checked with rpm -qa |
python, it only showed the python package. After I included the
/usr/include/sys/io.h in the source package INCLUDE path, it seemed
like the compilation went into a include loop.
(/usr/include/sys/unisted.h:1:10 #include nested too
pls ignore, I got open3 to work, silly mistake on
my part...
dave.
- Original Message -
From:
Dave
Lajoie
To: Python-list@python.org
Sent: Sunday, March 06, 2005 10:32
PM
Subject: Fork on windows
Hello Guys,
I am new to the list and to
Python.
"Gregor" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> There's a DOS console application I am trying to script (in Python), but
> it
> doesn't seem to use stdout or stderr... For example, if I redirect output
> to a file ("cmd > file.txt"), the output still appears on screen.
> Si
Hello Guys,
I am new to the list and to
Python.
I have been reading Oreilly's
Python book and some web page on child process creation
using Python.
Basically, on windows, I want to start a process
and monitor its stdout and stderror.
I have looked at os.py from python lib direct
[The HTML version of this Summary is available at
http://www.python.org/dev/summary/2005-02-01_2005-02-14.html]
=
Summary Announcements
=
--
Giving myself a gold watch
--
As some of you may have already heard o
Try something like this:
for x in plugs:
cmd = "import %s" % x
exec (cmd)
"Dfenestr8" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi.
>
> I have a program which I want a plugin directory for. I figured the way to
> go about that would be to just add a plugin/
Hi there,
I'm pleased to announce the availability of PyKota v1.21 Final.
PyKota is a Print Quota and Accounting solution for CUPS and LPRng,
available from :
http://www.librelogiciel.com/software/PyKota/action_Presentation
PyKota's original distribution method consists in providing Official
This is just a basic of what I have so far. The time , a class I will need
and the print function.
class Account:
def __init__(self, initial):
self.balance = initial
def deposit(self, amt):
self.balance = self.balance + amt
def withdraw(self,amt):
self.ba
Thank both for the help. I understand that I should provide code, I am
still trying to understand what to do, I don't want the work done, just
some ideas of where to go, a general layout perhaps. Thank you.
--
http://mail.python.org/mailman/listinfo/python-list
On Sun, 06 Mar 2005 22:52:10 +, rumours say that Michael Hoffman
<[EMAIL PROTECTED]> might have written:
>Christos TZOTZIOY Georgiou wrote:
>
>> Argument against your "only" in "you can only use goto":
>>
>> http://www.entrian.com/goto/
>
>That is sick.
>
>I'm clearly an amateur at obfuscatin
--
http://mail.python.org/mailman/listinfo/python-list
On Sat, 05 Mar 2005 14:32:27 +, rumours say that Michael Hoffman
<[EMAIL PROTECTED]> might have written:
>BOOGIEMAN wrote:
>> Please include "goto" command in future python realeses
>
>As has been said before, you can only use goto in Python if
>you are using Python with line numbers:
>
>http:
"Xah Lee" <[EMAIL PROTECTED]> writes:
> the Python doc is quite stilted. Where in the python doc is a programer
> supposed read about how the package/module system in Python works?
> (besides the tutorial that touches it)
The python docs at http://docs.python.org/ref/naming.html > are
perfectly c
Funny you said that, because I didn't even bother trying it because I didn't
think it would work either. I figured that python did something internally
when it saw the -i switch. Looks like it just checks for it when it's done
with your code.
One difference between the two methods that I see
Grant Edwards <[EMAIL PROTECTED]> diagnosed
>
> Troll.
>
I first checked my calendar to make sure it wasn't April 1, but some folks just
can't wait, can they.
And another thought: all this use of alphanumeric characters --- aren't we
obfuscating the pure binariness we should all know and l
Christos TZOTZIOY Georgiou wrote:
Argument against your "only" in "you can only use goto":
http://www.entrian.com/goto/
That is sick.
I'm clearly an amateur at obfuscating Python. Although my
implementation is much simpler. ;)
--
Michael Hoffman
--
http://mail.python.org/mailman/listinfo/python-lis
Reinhold,
Interesting.
A key difference between the two is that PYTHONINSPECT will allow you access
to the prompt at the end of your program (assuming no sys.exit or raise
SystemExit) but code.interact() allows you to jump into the program at any
point.
"Reinhold Birkenfeld" <[EMAIL PROTECTE
Michael Hoffman wrote:
> Joe wrote:
>
>> Are there any differences between that and the actual interactve prompt that
>> I should be aware of?
>
> I don't know, unfortunately.
>
>> Would you consider that a better method than using (thanks to those who
>> suggested this other option):
>>
>> i
In <[EMAIL PROTECTED]>, James Stroud
wrote:
> If you are using md5sum, tou can grab the md5 and the filename like such:
>
> myfile = open(filename)
> md5sums = []
> for aline in myfile.readlines():
> md5sums.append(aline[:-1].split(" ",1))
md5sums.append(aline[:-1].split(None, 1))
That wor
On 6 Mar 2005 12:02:42 -0800, rumours say that [EMAIL PROTECTED] (Sean
McIlroy) might have written:
>I'm looking for a widget, to be used with Tkinter, that displays a
>tree whose leaves are strings. I thought there was something like that
>in the Python Megawidgets, but when I look at the documen
John J. Lee wrote:
> [EMAIL PROTECTED] writes:
>
> > I like the way call tips displays argument variables for functions
when
> > you type the "(" after the function name. However, if one of the
> > arguments to the function is something like "SomeMod.attribute",
the
> > intellisense will display
Joe wrote:
Are there any differences between that and the actual interactve prompt that
I should be aware of?
I don't know, unfortunately.
Would you consider that a better method than using (thanks to those who
suggested this other option):
import os
os.environ['PYTHONINSPECT'] = '1'
Actually I
Paul McGuire wrote:
> At the risk of beating this into the Pythonic ground, here is a
> generator version which collapses the original nested loop into a
> single loop, so that break works just fine:
Indeed. For some things I'm still in the pre-generator days of
Python. If I worked at it I think
> I'm trying to use IndexedCatalog
> [http://www.async.com.br/projects/IndexedCatalog/] in my CherryPy
> [http://www.cherrypy.org] application.
> As Zodb support access just from one Python thread, I must either use just
> one CherryPy thread (slow), or use ZEO. However, if I understand it good,
>
Actually it should be here:
http://py.vaults.ca/apyllo.py/808292924.247038364.90387689.96972321
Cheers,
Harlin
--
http://mail.python.org/mailman/listinfo/python-list
Actually the sequences are of the same length. Forgot to mention that.
thanks,
Harlin
--
http://mail.python.org/mailman/listinfo/python-list
Thanks Michael, that's what I was looking for.
Are there any differences between that and the actual interactve prompt that
I should be aware of?
Would you consider that a better method than using (thanks to those who
suggested this other option):
import os
os.environ['PYTHONINSPECT'] = '1'
[EMAIL PROTECTED] writes:
> I like the way call tips displays argument variables for functions when
> you type the "(" after the function name. However, if one of the
> arguments to the function is something like "SomeMod.attribute", the
> intellisense will display all the exposed methods and att
[EMAIL PROTECTED] writes:
> My goal is to install python2.4 using yum (wouldn't you know it, it's a
> dependency for something else).
[...]
You're probably better off asking on a yum or Fedora list or
newsgroup.
John
--
http://mail.python.org/mailman/listinfo/python-list
Almad wrote:
Hello,
I'm trying to use IndexedCatalog
[http://www.async.com.br/projects/IndexedCatalog/] in my CherryPy
[http://www.cherrypy.org] application.
As Zodb support access just from one Python thread, I must either use just
one CherryPy thread (slow), or use ZEO. However, if I understan
Hi Sean,
I downloaded a file called tree.py recently which has this at the top:
# Highly optimized Tkinter tree control
# by Charles E. "Gene" Cash
#
# This is documented more fully on my homepage at
# http://home.cfl.rr.com/genecash/ and if it's not there, look in the
Vaults
# of Parnassus at ht
I'm looking for a widget, to be used with Tkinter, that displays a
tree whose leaves are strings. I thought there was something like that
in the Python Megawidgets, but when I look at the documentation
(http://pmw.sourceforge.net/doc/refindex.html), it doesn't seem to be
there. Any advice will be m
I'm using SWIG to generate glue code for my embedded/extended python app.
There are a couple of very frustrating issues that I would like to see if
anyone else has solutions for:
- Once I have created and initialized a module with SWIG I can call it by
executing a python file with no problems.
Joe wrote:
When you run "python -i scriptname.py" after the script completes you left
at the interactive command prompt.
Is there a way to have this occur from a running program?
In other words can I just run scriptname.py (NOT python -i scriptname.py)
and inside of scriptname.py I decide that I
I posted the following a while back. I think this is what you are
looking for.
This can be done fairly easily by creating a module (lets call it
interactive) with the following code in it.
---
import sys,os
def debug_exception(type, value, traceback):
# Restore redirected standard I
Hi,
I have a date string in the ctime() format ('Sat Mar 5 10:38:07 2005')
and I want to know how long ago that was in whole days.
So far I have:
import time
import datetime
age =
(datetime.date.fromtimestamp(time.mktime(time.strptime(date.strip( -
datetime.date.today()).days
Which is an
Joe wrote:
I want the script to decide whether to fall back to the interactive prompt.
You solution makes it ALWAYS fall back to the interactive prompt.
Actually, using sys.exit() means the program can exit even if python -i
is used.
You can use:
import code
code.interact()
which emulates the inte
msoulier wrote:
Well, broadly, the reason is that it allows version-specific code to
be
included in libraries.
I've actually found this to be a bit of a pain. I build packages
against say, python2.2, and if you upgrade python to 2.3 the package
breaks. The code works fine so saying it requires pyt
Hello,
I'm trying to use IndexedCatalog
[http://www.async.com.br/projects/IndexedCatalog/] in my CherryPy
[http://www.cherrypy.org] application.
As Zodb support access just from one Python thread, I must either use just
one CherryPy thread (slow), or use ZEO. However, if I understand it good,
wh
Giovanni Bajo wrote:
Hello,
I noticed that bultin types like list, set, dict, tuple don't seem to adhere to
the convention of using super() in constructor to correctly allow
diamond-shaped inheritance (through MRO). For instance:
class A(object):
... def __init__(self):
... print "
Hi Pierre,
Thanks for the reply, but I am not on Unix and it even if I was that
solution it does not achieve the desired results.
I want the script to decide whether to fall back to the interactive prompt.
You solution makes it ALWAYS fall back to the interactive prompt.
I want to do somethin
Patrick Useldinger wrote:
Kent Johnson wrote:
globe=0
globe=myfun(globe)
def myFun(var):
return var+1
This mystifies me. What is myfun()? What is var intended to be?
myfun is an error ;-) should be myFun, of course.
var is parameter of function myFun. If you call myFun with variable
globe, all
Very simple is you're on UNIX ...
You juste have to put at the beginnin of your file :
#!/usr/bin/python -i
And it juste does what you want :)
Pierre
Joe a écrit :
When you run "python -i scriptname.py" after the script completes you left
at the interactive command prompt.
Is there a way to have
Kent Johnson wrote:
globe=0
globe=myfun(globe)
def myFun(var):
return var+1
This mystifies me. What is myfun()? What is var intended to be?
myfun is an error ;-) should be myFun, of course.
var is parameter of function myFun. If you call myFun with variable
globe, all references to var will be
>From http://uche.ogbuji.net/tech/akara/nodes/2003-01-01/basic-xpath
"""
NSS = {u'wsdl': u'http://schemas.xmlsoap.org/wsdl/'}
#""processorNss" = "namespace bindings to be used by the processor"
ctx = Context(wsdl_doc, processorNss=NSS)
Evaluate(u'wsdl:description/wsdl:documentation', context=ctx)
Hi,
people here usually tend not to be too helpful when asked to do an obvious
homework task. So if you really want help, provide some code you've already
written and that has actual problems. Then we're glad to help. But don't
expect others to do your work.
--
Regards,
Diez B. Roggisch
--
htt
> > map :!d:\python24\python.exe %
> >
> >
> > but it comes with a new pop-up windowsdame~
>
> I'm no windows expert - but maybe pythonw.exe helps here?
I find that using pythonw.exe and the silent prefix in Vim works best
for me:
map :silent !pythonw.exe %
Regards,
Aaron
--
http://
I.V. Aprameya Rao <[EMAIL PROTECTED]> wrote:
> Hi
>
> I have to implement a flat file dbms. The basic condition is that
> relations will be given in files and i will have to run certain select
> project join queries on those relations.
>
> Can someone tell me as to which language will be faste
I need some ideas of how to accomplish this task.
I was told that I just need to save the input in a file and make the file
searchable, nothing fancy like tying into SQL or Oracle. THis is a basic
program and help is greatly appreciated:
You've been given an assignment by your supervisor to progr
Hello,
Via Xpath, I want to access nodes which have a namespace prefix. THe
document at hand is an Xsl-FO document. I tried the following:
from xml.dom import minidom
from xml.xpath import Evaluate
from xml import sax
parser = sax.make_parser()
parser.setFeature(sax.handler.feature_namespaces,1)
pa
When you run "python -i scriptname.py" after the script completes you left
at the interactive command prompt.
Is there a way to have this occur from a running program?
In other words can I just run scriptname.py (NOT python -i scriptname.py)
and inside of scriptname.py I decide that I want to f
I believe python docs are quite *un*-stilted. Modules and packages are
not complicated. Read chapter 7 of the nutshell, it's only 10 pages
long. 2.3 and 2.4 didn't introduce any fundamental changes in how
modules work AFAIK
--
http://mail.python.org/mailman/listinfo/python-list
Sorry, in writing down the problem and the corresponding solution, I
made a mistake. It's evident, but anyway...
Wrong:
> # ab * cb = dab 35 * 26 = 936
> # + + - + + -
> # ifd + chg = eaf179 + 258 = 437
> # ------
If sequences are not same length:
zip truncates to length of shortest input sequence
map(None, seq1, seq2) pads to length of longest seq.
(can't remember what itertools.izip() does)
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
I'm having some weird issues with Python 2.4 and PyOpenGL 2.0.2.01 (and
also with older versions).
When I call glutGetModifiers from event handler functions (set using
glutMouseFunc, glutMotionFunc etc...), it just says:
"GLUT: Warning in foo: glutCurrentModifiers: do not call outside core
Will McGugan wrote:
Hi,
If I retrieve the hash of an integer, will it always return the same
value across platforms?
This reason I ask is that I want to produce a sequence of pseudo random
numbers using the random module, that I can re-create later on. So I'll
need to store the seed value, but
"Xah Lee" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> globe=0;
> def myFun():
> globe=globe+1
> return globe
>
> apparently it can't be done like that. I thought it can probably be
> done by prefixing the variable with some package context...
You can do this:
globe=0
Hi,
If I retrieve the hash of an integer, will it always return the same
value across platforms?
This reason I ask is that I want to produce a sequence of pseudo random
numbers using the random module, that I can re-create later on. So I'll
need to store the seed value, but Random.seed takes a
Xah Lee wrote:
> is it possible in Python to create a function that maintains a variable
> value?
>
> something like this:
>
> globe=0;
> def myFun():
> globe=globe+1
> return globe
You could work with function attributes:
def myFun():
try:myFun.globe += 1
except: myFun.globe =
|
| Did you perhaps use a list (type(p) == type([])) for p?
|
Alex
Using the coefficients in an array instead of a list
was the key in the solution to my problems
Your other suggestions regarding floating p
and the off-by-one error that I had with the
polynomial degr
and make it a singleton, viz:
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52558
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/66531
http://www.python.org/2.2.3/descrintro.html
(scroll wayyy down)
--
http://mail.python.org/mailman/listinfo/python-list
| In case you are still interested pygsl wraps the GSL solver.
|
|
| from pygsl import poly
|
| pc = poly.poly_complex( 3 )
|
| tmp , rs = pc.solve( ( 2 , 3 , 1 ) )
|
| print rs
|
|
| You get pygsl at http://sourceforge.net/projects/pygsl/
Pierre
Thanks again for the link to the Py
Patrick Useldinger wrote:
The short answer is to use the global statement:
globe=0
def myFun():
global globe
globe=globe+1
return globe
more elegant is:
globe=0
globe=myfun(globe)
def myFun(var):
return var+1
This mystifies me. What is myfun()? What is var intended to be?
Kent
--
http://mai
By using os.spawn* and the os.P_NOWAIT, the spawn function will return
immediately, with the return value being the PID of the new process.
Later, you can use os.kill() to force the program to terminate,
os.waitpid() to retrieve the exit status if it has terminated, or you
could use the signal modu
Stewart Midwinter wrote:
I've got an app that creates an object in its main class (it also
creates a GUI). My problem is that I need to pass this object, a
list, to a dialog that is implemented as a second class. I want to
edit the contents of that list and then pass back the results to the
first
There's a DOS console application I am trying to script (in Python), but it
doesn't seem to use stdout or stderr... For example, if I redirect output
to a file ("cmd > file.txt"), the output still appears on screen.
Similarly, the output pipes returned by popen* don't catch the app's
output. Ho
In message <[EMAIL PROTECTED]>, I.V.
Aprameya Rao <[EMAIL PROTECTED]> writes
OK, i forgot to mention this.
The speed is a critical issue because there will be a competition and
whosever solution is faster wins the prize.
Hence will a python solution be as fast as a C++ solution??
aprameya
On 4 Mar
> Please
include "goto" command in future python realeses> know that proffesional
programers doesn't like to use it, > but for me as newbie it's too hard
to get used replacing it > with "while", "def" or other commands>
--
I believe the bad reputation of 'goto' goes back to
the originators
[EMAIL PROTECTED] (Magnus Lie Hetland) wrote in message news:<[EMAIL
PROTECTED]>...
> In article <[EMAIL PROTECTED]>,
> [EMAIL PROTECTED] wrote:
> >
> >
> >I had a look at the new reference implementation of PEP 246
> >(Object Adaptation) and I feel uneasy with one specific point
> >of this new ve
Hi,
I'm using CGIHTTPServer (via its test() method) to test some CGI on my
Windoze 98 box. I find that the execution is very slow. Is there
anything I can do to make sure I'm getting the best performance out of
CGIHTTPServer?
Thanks in advance,
Johan
On 2005-03-06, Stewart Midwinter <[EMAIL PROTECTED]> wrote:
> I've got an app that creates an object in its main class (it also
> creates a GUI). My problem is that I need to pass this object, a
> list, to a dialog that is implemented as a second class. I want to
> edit the contents of that list a
Harlin Seritt wrote:
> Would I do this like:
>
> buttondict = {button1, "name.txt"}
If you want to but I guess the other way round makes more sense. And the
syntax is wrong, its supposed to be
{key : value, ...}
The point is that you can create buttons as much as you want - in a for loop
f
On Sunday 06 March 2005 13:09, Harlin Seritt wrote:
> for i, f in filelist, self.checkbox:
>if f.get():
> print i
Use:
for i, f in zip(filelist,self.checkbox):
--
--- Heiko.
pgpuQ4Xv4IUj6.pgp
Description: PGP signature
--
http://mail.python.org/mailman/listinfo/python-list
> Both filelist and self.checkbox are the same size (4 items btw). Is
> there any way to get this done?
Use zip:
a, b = [1,2,3], ['a', 'b', 'c']
for i,j in zip(a,b):
print i,j
Or from itertools izip - which should be slightly more performant and less
memory consuming.
--
Regards,
Diez B.
Would I do this like:
buttondict = {button1, "name.txt"}
??
Thanks,
Harlin
--
http://mail.python.org/mailman/listinfo/python-list
I am using the following code:
for i, f in filelist, self.checkbox:
if f.get():
print i
I am getting an error:
Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Python23\lib\lib-tk\Tkinter.py", line 1345, in __call__
return self.func(*args)
File "install.
Actually, lambda forms are quite precisely documented at
http://docs.python.org/ref/lambdas.html if you feel than reading
the tutorial (specifically http://docs.python.org/tut/node6.html
section 4.7.5) is too base for you.
--
http://mail.python.org/mailman/listinfo/python-list
Problem, the focus is on a field which has contents
and I scan the credit card card, which is keyboard input.
The field is altered and a bunch of chars fly acroos the
field. messy.
Ok, I can solve this in a very clumsy manner.
1. I see the first character of the scan, '%',
configure the field to s
Timothy Smith <[EMAIL PROTECTED]> writes:
> something strange is happening, no matter what i try nothing is a
> supported locale
> and yes it's freebsd 4.10
AFAIK, the locale support in FreeBSD 4.1 is incomplete. Support for
LC_NUMERIC was only added in 4.6 - the release notes for 4.6 say:
T
> I've got an app that creates an object in its main class (it also
> creates a GUI). My problem is that I need to pass this object, a
> list, to a dialog that is implemented as a second class. I want to
> edit the contents of that list and then pass back the results to the
> first class. So my
Harlin Seritt wrote:
> I am making use of a Checkbutton widget. However, I would like to add
> an option or method "on the fly." For example I would like to bind a
> filename ("filename.txt") to a particular Checkbutton widget so that I
> call it later as:
>
> widget["filename"]
>
> Is this poss
Here's what I came up with:
#objtest.py
class first:
def __init__(self):
a = 'a'
self.a = a
print self.a
def update(self):
print 'initially, a is', self.a
self.a = second(self.a)
print 'afterwards, a is', self.a.call(self.a)
class secon
"Dfenestr8" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Hi.
I have a program which I want a plugin directory for. I figured the way to
go about that would be to just add a plugin/ dir to sys.path, and import
everything in it. Then my program can just execute the main() method of
ea
I am making use of a Checkbutton widget. However, I would like to add
an option or method "on the fly." For example I would like to bind a
filename ("filename.txt") to a particular Checkbutton widget so that I
call it later as:
widget["filename"]
Is this possible to do?
Thanks,
Harlin
--
http
Michael Hoffman wrote:
>> $ py24 -m timeit -s "floats = map(float, range(1000))" -s"from itertools
>> import starmap, izip" "ints = list(starmap(int, izip(floats)))"
>> 1000 loops, best of 3: 343 usec per loop
>
> Truly evil. Why is that faster than "ints = list(imap(int, floats))"?
> It is on my
Ben Rf wrote:
I'm new to programming and i'd like to write a program that will parse
a list produced by md5summer and give me a report in a text file on
which md5 sums appear more than once and where they are located.
This should do the trick:
"""
import fileinput
md5s = {}
for line in fileinput.in
Am Sat, 05 Mar 2005 20:33:22 -0600 schrieb Chris Gonnerman:
> http://newcenturycomputers.net/projects/wconio.html
I've done this before:
http://www.pythonwiki.de/PythonErweiterungen/WindowsBinaries
greets,
Marek
--
http://mail.python.org/mailman/listinfo/python-list
Xah Lee <[EMAIL PROTECTED]> wrote:
> is it possible in Python to create a function that maintains a
> variable value?
Yes. There's no concept of a 'static' function variable as such, but
there are many other ways to achieve the same thing.
> globe=0;
> def myFun():
> globe=globe+1
> return g
Xah Lee wrote:
globe=0;
def myFun():
globe=globe+1
return globe
The short answer is to use the global statement:
globe=0
def myFun():
global globe
globe=globe+1
return globe
more elegant is:
globe=0
globe=myfun(globe)
def myFun(var):
return var+1
and still more elegant is using classes
Xah Lee wrote:
if i understand correctly, forms such as
(lambda x,y:x+y)(a,b)
can only be gained thru experience? and not documented directly
anywhere in the official docs?
The official documentation can't list every possible permutation of the
various syntactic constructs. It does explain parenth
Xah Lee <[EMAIL PROTECTED]> wrotE:
> i have a bunch of files encoded in GB18030. Is there a way to convert
> them to utf16 with python?
You will need CJKCodecs (http://cjkpython.i18n.org/), or Python 2.4,
which has them built in. Then just use them like any other codec. eg.
f= open(path, 'rb')
1 - 100 of 104 matches
Mail list logo