Re: for statement on empty iterable

2007-08-21 Thread james_027
hi, > Oh I see. You have to combine a couple of concepts but for this > example you'd say: > >name = 'james' # 'l' looks too much like the digit 1 >for i,c in enumerate(name): > print i, c >print i > > enumerate(name) generates the sequence > >(0,'j'), (1,'a'), (2,'m'),

Re: urllib2.urlopen(url) pulling something other than HTML

2007-08-21 Thread Stefan Behnel
Gabriel Genellina wrote: > On 21 ago, 18:36, [EMAIL PROTECTED] (John J. Lee) wrote: >> Gabriel Genellina <[EMAIL PROTECTED]> writes: >> >> [...]> Don't even try to understand it - it's a mess. Use the HTMLParser >>> module instead. >> [...] >> >> Module sgmllib (and therefore module htmllib also) i

redirect or cover .bat log

2007-08-21 Thread vedrandekovic
Hello, e.g I need run my my_scripts_setup.bat that contain: python myscript_setup.py py2exe Can I cover or redirect log of that process into my wx program? I'am using Windows XP SP2, and Python 2.5. Regards, Vedran -- http://mail.python.org/mailman/listinfo/python-list

Re: for statement on empty iterable

2007-08-21 Thread Paul Rubin
james_027 <[EMAIL PROTECTED]> writes: > Yes i am new to python :). I am sorry I should be clarify myself ... > for example > > l = ['j', 'a', 'm', 'e', 's'] > > for i in l > # i want to know the nth number of times it has loop thru or > something like counter? Oh I see. You have to combine a c

Re: for statement on empty iterable

2007-08-21 Thread Amit Khemka
On 8/22/07, james_027 <[EMAIL PROTECTED]> wrote: > hi Paul, > > > > > That doesn't crash or anything like that, but it also doesn't > > set the index variable, which can cause confusion in some situations. > > Thanks for your quick answer ... Actually I was thinking how do I > access the index insi

Re: for statement on empty iterable

2007-08-21 Thread james_027
hi, > It sounds like you're just starting to learn the language... have you > read the online tutorial yet? That is a pretty easy introduction. > > See:http://python.org/doc/ > > Anyway, you can say > >for i in (1,2,3): > print i*5 > > to print 5, 10, and 15 on separate lines, for examp

Re: for statement on empty iterable

2007-08-21 Thread Paul Rubin
james_027 <[EMAIL PROTECTED]> writes: > Thanks for your quick answer ... Actually I was thinking how do I > access the index inside a for statement? Can you help It sounds like you're just starting to learn the language... have you read the online tutorial yet? That is a pretty easy introduction.

Re: for statement on empty iterable

2007-08-21 Thread james_027
hi Paul, > > That doesn't crash or anything like that, but it also doesn't > set the index variable, which can cause confusion in some situations. Thanks for your quick answer ... Actually I was thinking how do I access the index inside a for statement? Can you help Thanks james -- http://mai

Re: for statement on empty iterable

2007-08-21 Thread Paul Rubin
james_027 <[EMAIL PROTECTED]> writes: > for i in []: > #do something > is this safe? or should I put a if statement to test it first? That doesn't crash or anything like that, but it also doesn't set the index variable, which can cause confusion in some situations. -- http://mail.python.org/mail

Re: IDE for Python

2007-08-21 Thread I V
On Tue, 21 Aug 2007 21:23:25 -0300, Ricardo Aráoz wrote: > Do you know if for in-house development a GPL license applies? (Qt4 > and/or Eric4). (I'm not sure if I've understood your question right) If you distribute an app that _uses_ PyQT, you have to comply with the GPL (or buy a license

for statement on empty iterable

2007-08-21 Thread james_027
hi, I need to do some for loop on iterables which could be empty sometimes, for example a_list = [] for i in a_list: #do something is this safe? or should I put a if statement to test it first? Thanks james -- http://mail.python.org/mailman/listinfo/python-list

Re: Free Air Conditioners!!!!!!

2007-08-21 Thread Scott M.
Oh my God! How did you know?!! You were so smart to post that here! <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > http://freeairconditioners.blogspot.com/ > -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 2.51 install on Vista "files in use"

2007-08-21 Thread Martin v. Löwis
Steve Mavronis schrieb: > I tried to install Python 2.51 on Microsoft Vista Ultimate 32-bit > because I use the 3D modeler software Blender 2.44, in case I needed > additional Python support in the future for add-on scripts. > > I got a warning about "files in use" during installation that needed

Re: defaultdict of arbitrary depth

2007-08-21 Thread Paddy
On Aug 17, 4:25 am, Paul McGuire <[EMAIL PROTECTED]> wrote: > In responding to another post on defaultdict, I posted an > implementation of a 2-level hashtable, by creating a factory method > that returned a defaultdict(dict). The OP of that other thread was > trying to build a nested tree from a

Re: Chaining programs with pipe

2007-08-21 Thread Steve Holden
Grant Edwards wrote: > On 2007-08-21, avishay <[EMAIL PROTECTED]> wrote: > >> I'm trying to chain two programs with a pipe (the output of >> one feeding the input of the other). I managed to capture the >> output and feeding the input of each program independently >> with popen, but how do I tie t

Re: IDE for Python

2007-08-21 Thread Michael L Torrie
Ricardo Aráoz wrote: > Hi, > Do you know if for in-house development a GPL license applies? (Qt4 > and/or Eric4). If your programs are used in-house and never released, then you don't have to abide by the terms of the GPL. BUT (this is a big but) if you ever release your code or distribute

Re: File Read Cache - How to purge?

2007-08-21 Thread Steve Holden
Hrvoje Niksic wrote: > Nick Craig-Wood <[EMAIL PROTECTED]> writes: > >> If you are running linux > 2.6.18 then you can use >> /proc/sys/vm/drop_caches for exactly that purpose. >> >> http://www.linuxinsight.com/proc_sys_vm_drop_caches.html > > That URL claims that you need to run "sync" before

Threads and racing conditions

2007-08-21 Thread Flavio Preto
Hi, I have a doubt. Supose that i have the minimun class below: class db: def __init__(self): self.db = {} def read(self, key): return self.db[key] def write(self, key, value): self.db[key] = value and an object of this class is shared among some threads. Is

Re: File Read Cache - How to purge?

2007-08-21 Thread Hrvoje Niksic
Nick Craig-Wood <[EMAIL PROTECTED]> writes: > If you are running linux > 2.6.18 then you can use > /proc/sys/vm/drop_caches for exactly that purpose. > > http://www.linuxinsight.com/proc_sys_vm_drop_caches.html That URL claims that you need to run "sync" before dropping the cache, and so do oth

Re: Server-side scripting in python

2007-08-21 Thread Nagarajan
On Aug 21, 6:40 pm, [EMAIL PROTECTED] (Cameron Laird) wrote: > In article <[EMAIL PROTECTED]>,Nagarajan <[EMAIL PROTECTED]> wrote: > >Hi group, > >I need to develop a web application. I am in a fix as to choose among > >the various server-side scripting options. I want to explore python > >(am a n

Re: Chaining programs with pipe

2007-08-21 Thread Karthik Gurusamy
On Aug 21, 8:33 pm, Grant Edwards <[EMAIL PROTECTED]> wrote: > On 2007-08-22, Karthik Gurusamy <[EMAIL PROTECTED]> wrote: > > > Not sure on non-unix platforms, but in unix like platforms it's best > > to reuse shell's power. > > import commands > commands.getoutput('ls | wc') > > ' 4

Re: Chaining programs with pipe

2007-08-21 Thread Grant Edwards
On 2007-08-22, Karthik Gurusamy <[EMAIL PROTECTED]> wrote: > Not sure on non-unix platforms, but in unix like platforms it's best > to reuse shell's power. > import commands commands.getoutput('ls | wc') > ' 4 4 24' Executing a shell just because you want a pipe see

Re: Chaining programs with pipe

2007-08-21 Thread Grant Edwards
On 2007-08-21, avishay <[EMAIL PROTECTED]> wrote: > I'm trying to chain two programs with a pipe (the output of > one feeding the input of the other). I managed to capture the > output and feeding the input of each program independently > with popen, but how do I tie them together? On Unix, you d

Re: urllib2.urlopen(url) pulling something other than HTML

2007-08-21 Thread Gabriel Genellina
On 21 ago, 18:36, [EMAIL PROTECTED] (John J. Lee) wrote: > Gabriel Genellina <[EMAIL PROTECTED]> writes: > > [...]> Don't even try to understand it - it's a mess. Use the HTMLParser > > module instead. > > [...] > > Module sgmllib (and therefore module htmllib also) is more tolerant of > bad HTML t

Re: Chaining programs with pipe

2007-08-21 Thread Gabriel Genellina
On 21 ago, 21:40, Karthik Gurusamy <[EMAIL PROTECTED]> wrote: > On Aug 21, 3:09 pm, avishay <[EMAIL PROTECTED]> wrote: > > > I'm trying to chain two programs with a pipe (the output of one > > feeding the input of the other). I managed to capture the output and > > feeding the input of each program

Re: Fast socket write

2007-08-21 Thread Bikal KC
Greg Copeland wrote: > I'm having a brain cramp right now. I can't see to recall the name of Is your cramp gone now ? :P -- http://mail.python.org/mailman/listinfo/python-list

Re: Trouble with CGI code from Code Example 7.3 of the "Python Interactive CGI Tutorial"

2007-08-21 Thread Gabriel Genellina
On 21 ago, 20:10, Steve Holden <[EMAIL PROTECTED]> wrote: > Gabriel Genellina wrote: > > [...]working crystall balls are hard to find nowadays :) > > Well, judging by the OP's response you appear to be in possession of a > pair :-) Great-grandmother's legacy, and not for sale! -- Gabriel Genellin

Re: How to optimise this code?

2007-08-21 Thread Basilisk96
David, If your true design intent is to run X number of test cases, unittest is the biggest bang for your buck, like shown by Peter's example. You just subclass unittest.TestCase, and def your test methods in the class body; they will simply be executed in the order you list them. It's just nice h

Re: Extracting the traceback

2007-08-21 Thread Evan Klitzke
On 8/21/07, codesite-noreply <[EMAIL PROTECTED]> wrote: > On 22 Ago, 02:09, "Evan Klitzke" <[EMAIL PROTECTED]> wrote: > > On 8/21/07, billiejoex <[EMAIL PROTECTED]> wrote: > > > > > > > > > Hi there, > > > I'm facing a case where I need to get the traceback outptut when > > > occurring an exception

Fast socket write

2007-08-21 Thread Greg Copeland
I'm having a brain cramp right now. I can't see to recall the name of a module. I know there is a python module which allows for optimized socket writes on Linux. It uses a syscall to obtain its benefit. IIRC, it is a fast path for I/O bound servers. Can someone please refresh my memory? What

Re: Extracting the traceback

2007-08-21 Thread codesite-noreply
On 22 Ago, 02:09, "Evan Klitzke" <[EMAIL PROTECTED]> wrote: > On 8/21/07, billiejoex <[EMAIL PROTECTED]> wrote: > > > > > Hi there, > > I'm facing a case where I need to get the traceback outptut when > > occurring an exception. > > I solved such problem by using traceback module in conjunction wit

Python 2.51 install on Vista "files in use"

2007-08-21 Thread Steve Mavronis
I tried to install Python 2.51 on Microsoft Vista Ultimate 32-bit because I use the 3D modeler software Blender 2.44, in case I needed additional Python support in the future for add-on scripts. I got a warning about "files in use" during installation that needed updating. I aborted the install

Re: IDE for Python

2007-08-21 Thread Ricardo Aráoz
king kikapu wrote: > On Aug 21, 12:00 pm, Joel Andres Granados <[EMAIL PROTECTED]> > wrote: >> Hello list: >> >> I have tried various times to use an IDE for python put have always been >> disapointed. > > > I have also tried a lot of them (IDEs) in the last year. I was finally > happy with Eclip

Re: defaultdict of arbitrary depth

2007-08-21 Thread Daniel
Any reason why this wouldn't work? >>> from collections import defaultdict >>> def rdict(*args, **kw): ... return defaultdict(rdict, *args, **kw) ... >>> d = rdict() >>> d[1][2][3][4][5] # ... defaultdict(, {}) ~ Daniel -- http://mail.python.org/mailman/listinfo/python-list

Re: IDE for Python

2007-08-21 Thread billiejoex
On 21 Ago, 22:36, Brad Johnson <[EMAIL PROTECTED]> wrote: > Joel Andres Granados gmail.com> writes: > > > > > Hello list: > > > I have tried various times to use an IDE for python put have always been > > disapointed. > > Not sure which platform you're on, but I've really liked PyScripter for the

Re: Chaining programs with pipe

2007-08-21 Thread Karthik Gurusamy
On Aug 21, 3:09 pm, avishay <[EMAIL PROTECTED]> wrote: > Hello > I'm trying to chain two programs with a pipe (the output of one > feeding the input of the other). I managed to capture the output and > feeding the input of each program independently with popen, but how do > I tie them together? Is

Re: subprocess (spawned by os.system) inherits open TCP/UDP/IP port

2007-08-21 Thread Seun Osewa
Is it possible to cause this sort of thing to happen on Windows. Specifically, I'm looking for a way to cause multiple processes to accept new connections on a bound socket. on UNIX, I can just fork() after binding the server socket to a port and the children can accept() on that same socket, but

Re: IDE for Python

2007-08-21 Thread Ricardo Aráoz
king kikapu wrote: > On Aug 21, 12:00 pm, Joel Andres Granados <[EMAIL PROTECTED]> > wrote: >> Hello list: >> >> I have tried various times to use an IDE for python put have always been >> disapointed. > > > I have also tried a lot of them (IDEs) in the last year. I was finally > happy with Eclip

Re: Extracting the traceback

2007-08-21 Thread Evan Klitzke
On 8/21/07, billiejoex <[EMAIL PROTECTED]> wrote: > Hi there, > I'm facing a case where I need to get the traceback outptut when > occurring an exception. > I solved such problem by using traceback module in conjunction with > StringIO: > > import StringIO, traceback > try: > raise Exception >

Extracting the traceback

2007-08-21 Thread billiejoex
Hi there, I'm facing a case where I need to get the traceback outptut when occurring an exception. I solved such problem by using traceback module in conjunction with StringIO: import StringIO, traceback try: raise Exception except: f = StringIO.StringIO() traceback.print_exc(file=f)

Re: Submit Your Python Scripts

2007-08-21 Thread Steve Holden
[EMAIL PROTECTED] wrote: > Hi, just wanted to invite any Python script authors to submit their > Python script to our popular software site > at [http:elided] > > We have just today added a "Scripts" directory which includes a Python > subdirectory > [http:elided] > > The first submissions usuall

Free Air Conditioners!!!!!!

2007-08-21 Thread managerrrr
http://freeairconditioners.blogspot.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Trouble with CGI code from Code Example 7.3 of the "Python Interactive CGI Tutorial"

2007-08-21 Thread Steve Holden
Gabriel Genellina wrote: [...]working crystall balls are hard to find nowadays :) Well, judging by the OP's response you appear to be in possession of a pair :-) regards Steve -- Steve Holden+1 571 484 6266 +1 800 494 3119 Holden Web LLC/Ltd http://www.holdenweb.com Skype

Re: Symbolic Link

2007-08-21 Thread Ian Clark
Hyuga wrote: > On Aug 19, 4:29 pm, mosscliffe <[EMAIL PROTECTED]> wrote: >> The source file is in an area which python can see, but not the >> browser. I am trying to make a link in a browser friendly area so I >> can use it to display an image file. > > You might want to try using an .htaccess f

Re: libgmail failure

2007-08-21 Thread [EMAIL PROTECTED]
Thanks for the suggestion. I've tried logging in and sending email manually and it works just fine. Thanks though, James -- http://mail.python.org/mailman/listinfo/python-list

Re: Tokenizer for python?

2007-08-21 Thread Nathan Harmston
Hi, >From your description I think something like PyParsing might be useful to you. http://pyparsing.wikispaces.com/ If not then I guess I m not understanding your question right. Hope this helps Nathan On 21/08/07, Robert Dailey <[EMAIL PROTECTED]> wrote: > Hi, > > I am looking for a sort of

python debugging under emacs?

2007-08-21 Thread Dan Stromberg - Datallegro
Is there a debugging mode in emacs that works well with python? I tried gud, but it was giving me errors, so I thought I'd ask before I try to get it to work: Is there an emacs mode (perhaps gud) that'll give a view of the python source, and currenly executing line, the ability inspect datastruct

Re: Logging module gives duplicate log entries

2007-08-21 Thread Shiao
Maybe my question wasn't very clear. What I meant is that these four lines lead in my case to two entries per logged event: applog = logging.getLogger() applog.setLevel(logging.DEBUG) hdl = logging.FileHandler('/tmp/foo.log') applog.addHandler(hdl) However if I REPLACE the above by: logging.basi

Re: Adjusting the names of custom exceptions (since raising strings is deprecated)

2007-08-21 Thread Silfheed
On Aug 21, 1:53 pm, Peter Otten <[EMAIL PROTECTED]> wrote: > Silfheed wrote: > > On Aug 21, 1:32 am, James Stroud <[EMAIL PROTECTED]> wrote: > >> Silfheed wrote: > >> > Heyas > > >> > So this probably highlights my lack of understanding of how naming > >> > works in python, but I'm currently using

Re: 'REPL' style IDE

2007-08-21 Thread pyscottishguy
How about embedding ipython in your script with: from IPython.Shell import IPShellEmbed ipshell = IPShellEmbed() ** your set up code ** ipshell() # this call anywhere in your program will start IPython see: http://ipython.scipy.org/doc/manual/node9.html#sec:embed Here are some ipython tips: h

Chaining programs with pipe

2007-08-21 Thread avishay
Hello I'm trying to chain two programs with a pipe (the output of one feeding the input of the other). I managed to capture the output and feeding the input of each program independently with popen, but how do I tie them together? Is there a solution that works equally on all platforms? Thanks, Av

Re: libgmail failure

2007-08-21 Thread billiejoex
On 21 Ago, 23:07, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Hey all, > > I've been using libgmail to send out automated notification emails for > my company's nightly regression testing. Last night these emails > started failing, though the python code has not changed. I updated to > the l

Re: Logging module gives duplicate log entries

2007-08-21 Thread Peter Otten
Shiao wrote: >> You need to remove the handler from the logging object >> >> # remove the handler once you are done >> applog.removeHandler(hdl) > I'm not sure how this could help. If you have multiple handlers you'll get a logged message for every handler. In your code logging.basicConfig() im

Re: urllib2.urlopen(url) pulling something other than HTML

2007-08-21 Thread John J. Lee
Gabriel Genellina <[EMAIL PROTECTED]> writes: [...] > Don't even try to understand it - it's a mess. Use the HTMLParser > module instead. [...] Module sgmllib (and therefore module htmllib also) is more tolerant of bad HTML than module HTMLParser. John -- http://mail.python.org/mailman/listinfo

Re: Latest models of Gibson guitars

2007-08-21 Thread kaldrenon
On Aug 21, 5:11 pm, John McGaw <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > Reviews of latest models of best guitars, fender, gibson, yamaha, and > > many more, with pictures and prices. > > Are these new guitars made of SPAM like your message and your "blog"? That'd be bloody terribl

Re: Logging module gives duplicate log entries

2007-08-21 Thread Shiao
> > You need to remove the handler from the logging object > > # remove the handler once you are done > applog.removeHandler(hdl) > > Cheers, > amit. > I'm not sure how this could help. -- http://mail.python.org/mailman/listinfo/python-list

Re: Latest models of Gibson guitars

2007-08-21 Thread John McGaw
[EMAIL PROTECTED] wrote: > Reviews of latest models of best guitars, fender, gibson, yamaha, and > many more, with pictures and prices. Are these new guitars made of SPAM like your message and your "blog"? -- http://mail.python.org/mailman/listinfo/python-list

libgmail failure

2007-08-21 Thread [EMAIL PROTECTED]
Hey all, I've been using libgmail to send out automated notification emails for my company's nightly regression testing. Last night these emails started failing, though the python code has not changed. I updated to the latest libgmail, but that isn't helping. I've logged in to the email account

Re: Call for advice on how to start PyOpenGL!

2007-08-21 Thread John
On Aug 20, 1:53 am, math2life <[EMAIL PROTECTED]> wrote: > I work with python for two years, are familiar with image processing, > but beginner on PyOpenGL and OpenGL. > > Any advice appreciated! Here's a little "hello world" PyOpenGL program I had lying around that might be useful: http://www.mi

Re: Latest models of Gibson guitars

2007-08-21 Thread Robert Dailey
lol... On 8/21/07, Tony <[EMAIL PROTECTED]> wrote: > > I don't who is posting here stupid shit about guitars > who ever is do self fever hang your self with one of strings > > > "kaldrenon" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > On Aug 20, 8:54 pm, Twisted <[EMAIL PROTEC

Tokenizer for python?

2007-08-21 Thread Robert Dailey
Hi, I am looking for a sort of "tokenizer" for python. I've taken a look at the tokenize module, but that seems to parse python code from what I read. I want a tokenizer that works a little like boost::tokenizer, however for python. Basically I want to be able to pass in an arbitrary string (or li

Re: How to optimise this code?

2007-08-21 Thread Wayne Brehaut
On Tue, 21 Aug 2007 21:56:18 +0200, Hrvoje Niksic <[EMAIL PROTECTED]> wrote: >Christof Winter <[EMAIL PROTECTED]> writes: > >> To get rid of the if statements, replace __init__ function with: >> >> def __init__(self, tc): >> functionToCall = eval("self.testCase%s" % tc) > >Or functio

Re: Adjusting the names of custom exceptions (since raising strings is deprecated)

2007-08-21 Thread Peter Otten
Silfheed wrote: > On Aug 21, 1:32 am, James Stroud <[EMAIL PROTECTED]> wrote: >> Silfheed wrote: >> > Heyas >> >> > So this probably highlights my lack of understanding of how naming >> > works in python, but I'm currently using FailUnlessRaises in a unit >> > test and raising exceptions with a st

Re: IDE for Python

2007-08-21 Thread Brad Johnson
Joel Andres Granados gmail.com> writes: > > Hello list: > > I have tried various times to use an IDE for python put have always been > disapointed. Not sure which platform you're on, but I've really liked PyScripter for the Windows platform. -- http://mail.python.org/mailman/listinfo/python

Re: IDE for Python

2007-08-21 Thread Joel Granados
Thanks to all for the valuable suggestions. On 8/21/07, Benjamin <[EMAIL PROTECTED]> wrote: > > On Aug 21, 5:00 am, Joel Andres Granados <[EMAIL PROTECTED]> > wrote: > > Hello list: > > > > I have tried various times to use an IDE for python put have always been > > disapointed. > > I haven't rev

Re: How to optimise this code?

2007-08-21 Thread Hrvoje Niksic
Christof Winter <[EMAIL PROTECTED]> writes: > To get rid of the if statements, replace __init__ function with: > > def __init__(self, tc): > functionToCall = eval("self.testCase%s" % tc) Or functionToCall = getattr(self, "testCase" + tc) eval can introduce unwanted side effects. --

Re: Microsoft Vista and os.exec

2007-08-21 Thread brad
franko353 wrote: > I have wxPython programs that work fine in Win2000/XP using os.exec(). > > They do not work in MS Vista. Has anyone else had any luck with > exec()? > > I keep getting an 'invalid option' error. > > It turn out it was really a security issue and I had to move to a > "win32proc

Re: Problem with Thread.join()

2007-08-21 Thread Greg Copeland
On Aug 20, 11:12 am, "Robert Dailey" <[EMAIL PROTECTED]> wrote: > Hey guys, > > Sorry for taking so long to respond. I had actually figured out what > this issue is over on the wxPython mailing list. The issue was that I > was attempting to configure wxPython controls from a remote thread, > which

Re: Partial Blur

2007-08-21 Thread Diez B. Roggisch
[EMAIL PROTECTED] schrieb: > Hello, > > I'm looking for an image manipulation library which would allow me to > blur an oval-shaped part of my picture, instead of the whole thing. I > couldn't find a way to do this using the > tools I see in the API of Python Imaging Library. Create a copy of the

Re: Shed Skin Python-to-C++ compiler 0.0.23

2007-08-21 Thread Greg Copeland
On Aug 20, 7:31 am, "Mark Dufour" <[EMAIL PROTECTED]> wrote: > Hi all, > > I have just released Shed Skin 0.0.23. It doesn't contain the type > inference scalability improvements I was working on, but it does have > quite a few bug fixes and minor feature additions. Here's a list of > changes: > >

Re: Shed Skin Python-to-C++ compiler 0.0.23

2007-08-21 Thread Greg Copeland
On Aug 20, 7:31 am, "Mark Dufour" <[EMAIL PROTECTED]> wrote: > Hi all, > > I have just released Shed Skin 0.0.23. It doesn't contain the type > inference scalability improvements I was working on, but it does have > quite a few bug fixes and minor feature additions. Here's a list of > changes: > >

Re: Python Path Dictionary

2007-08-21 Thread Chris Mellon
On 8/21/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > On 21 Aug, 17:42, Gary Herron <[EMAIL PROTECTED]> wrote: > > [EMAIL PROTECTED] wrote: > > > Hi, > > > > > Do the Python Paths come in the form of a dictionary where I can > > > access a particular path my its key in the registry? > > > > >

Microsoft Vista and os.exec

2007-08-21 Thread franko353
I have wxPython programs that work fine in Win2000/XP using os.exec(). They do not work in MS Vista. Has anyone else had any luck with exec()? I keep getting an 'invalid option' error. It turn out it was really a security issue and I had to move to a "win32process.CreateProcess" solution to fix

py2app and eggs

2007-08-21 Thread franko353
This may be common information, but I had trouble finding it. I was getting an ImportError whenever I tried to run a built app from py2app. It turns out that using py2app version "0.3.6", it was having trouble with zipped egg installs. I had to move my zipped egg file to a temporary location (fr

Partial Blur

2007-08-21 Thread chicorbleak
Hello, I'm looking for an image manipulation library which would allow me to blur an oval-shaped part of my picture, instead of the whole thing. I couldn't find a way to do this using the tools I see in the API of Python Imaging Library. If you know how to do this, I'd appreciate it if you left a

Re: Adjusting the names of custom exceptions (since raising strings is deprecated)

2007-08-21 Thread Silfheed
On Aug 21, 1:32 am, James Stroud <[EMAIL PROTECTED]> wrote: > Silfheed wrote: > > Heyas > > > So this probably highlights my lack of understanding of how naming > > works in python, but I'm currently using FailUnlessRaises in a unit > > test and raising exceptions with a string exception. It's wor

Re: Python Path Dictionary

2007-08-21 Thread aine_canby
On 21 Aug, 17:42, Gary Herron <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > Hi, > > > Do the Python Paths come in the form of a dictionary where I can > > access a particular path my its key in the registry? > > > For example, in PythonWin Tools>>Edit Python Paths shows the name as > >

Re: How to optimise this code?

2007-08-21 Thread Christof Winter
David N Montgomery wrote: > class testCase: > def __init__(self, tc): > if tc == 1:self.testCase1() > if tc == 2:self.testCase2() > if tc == 3:self.testCase3() > if tc == 4:self.testCase4() > if tc == 5:self.testCase5() > if tc == 6:self.testCase6

Re: Latest models of Gibson guitars

2007-08-21 Thread Tony
I don't who is posting here stupid shit about guitars who ever is do self fever hang your self with one of strings "kaldrenon" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Aug 20, 8:54 pm, Twisted <[EMAIL PROTECTED]> wrote: >> If the message then >> says something absurd, lik

Re: confused about why i get a type error when i call an object's method

2007-08-21 Thread pepper
Ha! I knew it was obvious. Thank you. -- http://mail.python.org/mailman/listinfo/python-list

Re: C# and Python

2007-08-21 Thread subeen
On Aug 21, 7:24 pm, "Chris Mellon" <[EMAIL PROTECTED]> wrote: > On 8/21/07, Ant <[EMAIL PROTECTED]> wrote: > > > On Aug 21, 11:01 am, subeen <[EMAIL PROTECTED]> wrote: > > > Hi, > > ... > > > But I want to write the GUI and number generation program in C#.net. > > > When the user clicks Quick Sort

Re: File Read Cache - How to purge?

2007-08-21 Thread Nick Craig-Wood
Wolfgang Draxinger <[EMAIL PROTECTED]> wrote: > Marc 'BlackJack' Rintsch wrote: > > > You mean reading the file without actually reading it!? :-) > > Linux provides its specific syscall 'readahead' that does exactly > this. It isn't in the posix module, but you can use it with ctypes like th

Re: Newbee Question

2007-08-21 Thread Dave Hansen
On Aug 21, 2:57 am, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: [...] > > pay = min(num, 22) * 0.4 + max(num-22, 0) * 1.4 pay = num*0.4 + (num>22)*(num-22) ;-) -=Dave -- http://mail.python.org/mailman/listinfo/python-list

Re: confused about why i get a type error when i call an object's method

2007-08-21 Thread Duncan Smith
[EMAIL PROTECTED] wrote: > I'm confused about why i get a type error when i call an object's > method. Here's the example code: > class Foo: > > def __init__(self): > self.foo = [] > def foo(self): > print "in foo!" > > > f = Foo() dir(f) >

Re: confused about why i get a type error when i call an object's method

2007-08-21 Thread Jonathan Gardner
On Aug 21, 11:07 am, [EMAIL PROTECTED] wrote: > I'm confused about why i get a type error when i call an object's > method. Here's the example code:>>> class Foo: > > def __init__(self): > self.foo = [] > def foo(self): > print "in foo!" > > >>> f =

confused about why i get a type error when i call an object's method

2007-08-21 Thread pepper
I'm confused about why i get a type error when i call an object's method. Here's the example code: >>> class Foo: def __init__(self): self.foo = [] def foo(self): print "in foo!" >>> f = Foo() >>> dir(f) ['__doc__', '__init__', '__module__', 'foo']

Re: Regarding Classes

2007-08-21 Thread Colin J. Williams
Lamonte Harris wrote: > What is the main reason of "self" when it involves classes/functions > "self" provides a semi-standard way of addressing the current instance of a class. It is used in an instance's method. It is not typically used in functions. Colin W. -- http://mail.python.org/mail

Re: Python is removing my quotes!

2007-08-21 Thread Nils Oliver Kröger
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Robert Dailey schrieb: > Thank you for your response. The back slashes work! It's a bit annoying; but > I have Microsoft to thank for that. It's not Microsoft, you would experience the same problems under any Unix I know of. At least the bash treats q

Submit Your Python Scripts

2007-08-21 Thread andrew . sain
Hi, just wanted to invite any Python script authors to submit their Python script to our popular software site at http://www.myzips.com We have just today added a "Scripts" directory which includes a Python subdirectory http://www.myzips.com/category/Scripts/ The first submissions usually maintai

Re: Manipulating raw data in Python

2007-08-21 Thread Chris Mellon
On 8/21/07, Looney, James B <[EMAIL PROTECTED]> wrote: > > > > How do I get access to a data buffer in Python so that I can directly > view/modify the data? My buffer size is 256 (for this specific case) bytes. > Most of the time, I access want to access that data in 4-byte chunks, > sometimes in

Re: Module level descriptors or properties

2007-08-21 Thread Steven Bethard
Floris Bruynooghe wrote: > When in a new-style class you can easily transform attributes into > descriptors using the property() builtin. However there seems to be > no way to achieve something similar on the module level, i.e. if > there's a "version" attribute on the module, the only way to chan

Re: How to optimise this code?

2007-08-21 Thread Nils Oliver Kröger
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 David N Montgomery schrieb: > class testCase: > def __init__(self, tc): > if tc == 1:self.testCase1() > if tc == 2:self.testCase2() > if tc == 3:self.testCase3() > if tc == 4:self.testCase4() > if tc == 5:sel

Re: Retrieving a variable's name.

2007-08-21 Thread Simon Brunning
On 8/21/07, rodrigo <[EMAIL PROTECTED]> wrote: > How would I go about retrieving a variable's name (not its value)? http://effbot.org/pyfaq/how-can-my-code-discover-the-name-of-an-object.htm -- Cheers, Simon B. [EMAIL PROTECTED] http://www.brunningonline.net/simon/blog/ GTalk: simon.brunning | M

Re: Newbee Question

2007-08-21 Thread sentientholon
On Aug 21, 11:52 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > I tryed your code and got an error message #I use Wing IDE: > Python 2.2.3 (#42, May 30 2003, 18:12:08) [MSC 32 bit (Intel)] > Type "help", "copyright", "credits" or "license" for more information. > > Evaluating lines 1-16 from

Re: str().join() isn't working

2007-08-21 Thread kyosohma
On Aug 20, 8:18 pm, Asun Friere <[EMAIL PROTECTED]> wrote: > On Aug 21, 4:34 am, [EMAIL PROTECTED] wrote: > > > to concatenate 2 lists to each other before it does the join, ... is > > impossible in Python. The "+" operator is only for addition and for > > two or more strings. > > Really? > > >>> [

Re: Retrieving a variable's name.

2007-08-21 Thread Steve Holden
rodrigo wrote: > How would I go about retrieving a variable's name (not its value)? I > want to write a function that, given a list of variables, returns a > string with each variable's name and its value, like: > > a: 100 > b: 200 > > I get the feeling this is trivial, but I have been unable to

Re: str().join() isn't working

2007-08-21 Thread Steve Holden
[EMAIL PROTECTED] wrote: > On Aug 20, 1:16 pm, "Robert Dailey" <[EMAIL PROTECTED]> wrote: [...] > When you use join, you join the items in the list with each other to > form one long string. In your statement, your script tries to > concatenate 2 lists to each other before it does the join, which i

Re: Newbee Question

2007-08-21 Thread [EMAIL PROTECTED]
On Aug 21, 4:38 am, Ant <[EMAIL PROTECTED]> wrote: > On Aug 20, 11:47 pm, [EMAIL PROTECTED] wrote: > ... > > > Thanks for the help. By the way I am trying to learn the python after > > work and on weekends. If it was a dumb question, to this group, I will > > not bother you all again. > > It's not

Re: yet another indentation proposal

2007-08-21 Thread [EMAIL PROTECTED]
On Aug 18, 2:22 pm, "Aaron" <[EMAIL PROTECTED]> wrote: > Hello all. > > I realize that proposals dealing with alternatives to indentation have been > brought up (and shot down) before, but I would like to take another stab at > it, because it is rather important to me. > > I am totally blind, and

Re: How to optimise this code?

2007-08-21 Thread Dustan
On Aug 21, 11:20 am, "J. Cliff Dyer" <[EMAIL PROTECTED]> wrote: > I suspect lambda might be your friend here too for making the code less > verbose, though I never really got the hang of lambdas, even though my > first programming experience was a scheme class way back when Ah well. That's be

  1   2   >