Roy Smith wrote in news:[email protected] in
gmane.comp.python.general:
> Is there any way to conditionally apply a decorator to a function?
> For example, in django, I want to be able to control, via a run-time
> config flag, if a view gets decorated with @login_required().
>
> @
Peter Steele wrote in
news:[email protected] in
comp.lang.python:
> I want to write a program in Python that sends a broadcast message
> using raw sockets. The system where this program will run has no IP or
> default route defined, hence the reason I need to u
Peter Steele wrote in
news:[email protected] in
comp.lang.python:
> On Monday, January 21, 2013 1:10:06 AM UTC-8, Rob Williscroft wrote:
>> Peter Steele wrote in
>>
>> news:[email protected] in
&g
Peter Steele wrote in
news:[email protected] in
comp.lang.python:
> I just tried running you code, and the "sendto" call fails with
> "Network is unreachable". That's what I expected, based on other tests
> I've done. That's why I was asking about how to do raw
Steven D'Aprano wrote in news:[email protected] in
gmane.comp.python.general:
> I can connect to an IMAP server using Python 2.6:
>
> steve@runes:~$ python2.6
> Python 2.6.6 (r266:84292, Dec 27 2010, 00:02:40)
server = imaplib.IMAP4_SSL('x')
> But when I tr
andrew cooke wrote in
news:33019705.1873.1333801405463.JavaMail.geo-discussion-forums@ynmm9 in
gmane.comp.python.general:
>
> hi,
>
> please, what am i doing wrong here? the docs say
> http://docs.python.org/release/3.1.3/library/stdtypes.html#comparisons
> "in general, __lt__() and __eq__() a
Steven D'Aprano wrote in news:4e1fd009$0$29986$c3e8da3
[email protected] in gmane.comp.python.general:
> I'm designing an API for some lightweight calculator-like statistics
> functions, such as mean, standard deviation, etc., and I want to support
> missing values. Missing values should
Nulpum wrote in news:0bf400a3-735c-487a-8d74-
[email protected] in gmane.comp.python.general:
> I want to make sure that folder exists.
> '2011-07-03' is really exists. but 'os.path.isdir' say false
> Does anyone know why?
>
os.path.isdir("C:\Users\Á¶Ã¢ÁØ\Desktop\logs"
Jack Trades wrote in
news:CAG5udOg=GtFGPmTB=1ojnvnrpdyucxdokn1wjqmomv9gx0+...@mail.gmail.com
in gmane.comp.python.general:
> ... I wanted to allow the user to manually return the
> function from the string, like this:
>
> a = exec("""
> def double(x):
> return x * 2
> double
> """)
>
> Howeve
Ven wrote in news:aa1212bb-35e5-4bf9-b8ad-7a3c083749c2
@x2g2000yql.googlegroups.com in gmane.comp.python.general:
> So, here is what I did/want:
>
> self.run_button=wx.Button(self.panel,ID_RUN_BUTTON,label='Install')
> self.Bind(wx.EVT_BUTTON, self.OnRun,id=ID_RUN_BUTTON)
>
> def OnRun(self,evt)
Jack Trades wrote in
news:CAG5udOh1+oE4g9Frjp3pucbHUtWcN34KK35a-Xs2YqkZH9X5=w...@mail.gmail.com
in gmane.comp.python.general:
>> def test():
>> src = (
>> "def double(x):"
>> " return x * 2"
>> )
>> globals = {}
>> exec( src, globals )
>> return globals[ "double" ]
>>
>> prin
Jack Trades wrote in news:CAG5udOiOAge3uHrGSDTZ412GAg+CC-
[email protected] in gmane.comp.python.general:
>> >>> class CapturingDict(dict):
>> ... def __setitem__(self, key, val):
>> ... self.key, self.val = key, val
>> ... dict.__setitem__(self, key, val)
>>
Ethan Furman wrote in news:[email protected] in
gmane.comp.python.general:
> Jack Trades wrote:
>> On Tue, Aug 30, 2011 at 2:37 AM, Rob Williscroft wrote:
>>> If an impementation (as you say up thread) can populate globals
>>> or locals with whatever they
Arnaud Delobelle wrote in
news:CAJ6cK1YVi3NQgdZOUdhAESf133pUkdazM1PkSP=p6xfayvo...@mail.gmail.com in
gmane.comp.python.general:
> On 30 August 2011 13:31, Jack Trades wrote:
>>
>>
>> On Tue, Aug 30, 2011 at 2:37 AM, Rob Williscroft wrote:
>>
>>>
>>
vm wrote in news:[email protected] in
gmane.comp.python.general:
> def fun1(params_used_below_except_lk_and_lk2):
> lk = 0.0
> lk2 = 0.0
> for raw_data, hist, freq in raw_data_hist_list:
> lk2 = lk2 + fun2(some_constants_and_params_from_this_scope)
> q =
Florian Lindner wrote in news:[EMAIL PROTECTED] in
comp.lang.python:
> Hello,
> I try to compute SHA hashes for different files:
>
>
> for root, dirs, files in os.walk(sys.argv[1]):
> for file in files:
> path = os.path.join(root, file)
> print path
> f = open(path)
Ralf W. Grosse-Kunstleve wrote in
news:[EMAIL PROTECTED] in
comp.lang.python:
> --- Robert Williscroft <[EMAIL PROTECTED]> wrote:
>
>> My apologies for having to resort to email but for some reason I
>> can't post this message to comp.lang.python. I've tried about 4 times
>> including starting a
Ralf W. Grosse-Kunstleve wrote in
news:[EMAIL PROTECTED] in
comp.lang.python:
> Does anyone know if there is a way to hide the _ or self_ from the
> user of the class, i.e. given:
>
> class foo(object):
> @attribute_decorator
> def __init__(self, x, _y, z):
> pass
>
> c
Robert Kern wrote in news:mailman.1954.1121875043.10512.python-
[EMAIL PROTECTED] in comp.lang.python:
> [EMAIL PROTECTED] wrote:
>> Hi Robert,
>> I didn't succeed in reversing a string with the "full form" you
>> proposed:
>> live[len(live)-1:-1:-1] # where live="live"
>> The result is an emp
deelan wrote in news:[EMAIL PROTECTED] in
comp.lang.python:
> Paolino wrote:
> (...)
>> What I'm needing as a global (in globals() or at the module level or
>> in the module namespace) is 'translate'.The rest of bindings
>> (all,badcars and table) is something which is 'polluting' the module
>> n
Paolino wrote in news:mailman.2453.1122812091.10512.python-
[EMAIL PROTECTED] in comp.lang.python:
> Rob Williscroft wrote:
>
> > After 3 or 4 iterations I refactored you code to this:
> >
> > def translate( text )
> > import string
> > all=str
Steven D'Aprano wrote in
news:[EMAIL PROTECTED] in
comp.lang.python:
> Quoting Rob Williscroft:
>
>> > def translate( text )
>> > import string all=string.maketrans('','')
>> > badcars=all.translate(all,string.letters+
cantabile wrote in news:[EMAIL PROTECTED] in
comp.lang.python:
> Hi,
>
> I have a class (a gui) with buttons and other controls. A button, for
> example, has a callback method, so that writing
>
> b = Button(label, OnClick)
>
> will call the global OnClick method.
>
> Now, if I want the
Riko Wichmann wrote in news:[EMAIL PROTECTED] in
comp.lang.python:
> Dear all,
>
> is there a way in Python to comment out blocks of code without putting a
> # in front of each line? Somethings like C's
>
> /*
> block of code here is commented out
> */
>
if False:
(indented) block of
Gustavo Córdova Avila wrote in news:mailman.6944.1101838678.5135.python-
[EMAIL PROTECTED] in comp.lang.python:
> Actually, it's infinitly [sp?] more defficient
> (contrary of efficient?) than triple-quoted strings
> or line-by-line comments, because those two never
> make it to execution stage, b
Daniel Bickett wrote in news:mailman.7076.1102081193.5135.python-
[EMAIL PROTECTED] in comp.lang.python:
>> I have no way to build it on Windows though, as I don't have Visual C++
>> 7.1, for that we must wait for Robin Dunn.
>
> Would it be too difficult of a task to try getting the build workin
Kartic wrote in news:[EMAIL PROTECTED]
in comp.lang.python:
> Hello,
>
> I downloaded the Win32 installer for Twisted 1.3.0, Python 2.3.
>
> The installer, when executed under my login, fails as it requires
> administrator rights to install (why they have it as a requirement, I
> don't understa
Tim Peters wrote in news:mailman.1223.1112417955.1799.python-
[EMAIL PROTECTED] in comp.lang.python:
> [Paul Rubin]
>> I'd like to have a function (or other callable object) that returns
>> 0, 1, 2, etc. on repeated calls. That is:
>>
>>print f() # prints 0
>>print f() # prints 1
>>
Lucas Machado wrote in news:1113606334.524947.54630
@l41g2000cwc.googlegroups.com in comp.lang.python:
> str1 = "[%s%s]\n\tpath = /mnt/samba/%s%s/\%U" % (list[0], list[1],
> list[0], list[1])
>
In a format string use '%%' for a single % char':
str1 = "[%s%s]\n\tpath = /mnt/samba/%s%s/%%U" % (li
Sorin Schwimmer wrote in news:mailman.8142.1152816058.27775.python-
[EMAIL PROTECTED] in comp.lang.python:
> The following code:
>
> from Tix import *
>
> r=Tk()
>
> tr=Tree(r)
> tr.subwidget('hlist').add('br1',text='branch 1')
> tr.subwidget('hlist').add('br1.b1',text='branch 1-1')
> tr.subwid
Iain King wrote in news:1153323649.171612.74510
@s13g2000cwa.googlegroups.com in comp.lang.python:
>
> [EMAIL PROTECTED] wrote:
>> [...] I need to reference (link) each object to the objects
>> upstream and downstream of it, i.e.
>>
>> supply = supply()
>> compressor = compressor(downs
Bruno Desthuilliers wrote in news:[EMAIL PROTECTED]
in comp.lang.python:
> John Salerno wrote:
>> Marc 'BlackJack' Rintsch wrote:
>>
>>> Can you flesh out your use case a little bit and tell why you can't
>>> solve the problem with inheritance or a meta class?
>>
>>
>> From my experience with
Jean_Francois Moulin wrote in
news:[EMAIL PROTECTED] in
comp.lang.python:
> Hi all,
>
> I tried this piece of code (FWIW, it was taken as is from a help
> section of mpfit, a mathematical routine for least square fitting):
>
> parinfo = [{'value':0., 'fixed':0, 'limited':[0,0],
> 'limits':[0.,
wrote in news:[EMAIL PROTECTED] in
comp.lang.python:
> #include
> using namespace std;
>
> // A base class that provides counting
> template class Counted {
> static int count;
> };
>
> template int Counted::count = 0;
>
> // Curious class definitions
> class CountedClass : public Counted
wrote in news:[EMAIL PROTECTED] in
comp.lang.python:
>
> I think what you say makes perfect sense
>
> I am using 2.4.2 python (I typed pthon -V on console to get)
>
> How can I find what my SPE editor is using ?
>
Wherever you can run python you can find the version by running
the following
Rochester wrote in news:[EMAIL PROTECTED] in
comp.lang.python:
> I just found out that the general open file mechanism doesn't work
> for named pipes (fifo). Say I wrote something like this and it
> simply hangs python:
>
> #!/usr/bin/python
>
> import os
>
> os.mkfifo('my_fifo
sj wrote in news:[EMAIL PROTECTED] in
comp.lang.python:
> I am just learning to use Tkinter and am having problems displaying
> image files. I am able to display an image using tutorials (such as
> http://www.daniweb.com/code/snippet296.html) But when I try my own
> code all I get is an empty wid
Tim Golden wrote in news:mailman.119.1160403292.11739.python-
[EMAIL PROTECTED] in comp.lang.python:
> [Rick]
>| Searching for a file by name. Scanning for viruses.
> Etc.
>| There are lots
>| of legitimate reason to walk all paths from a centra
> l
>| starting point, no???
>
> Well, to get y
wrote in news:[EMAIL PROTECTED] in
comp.lang.python:
> Hi folks, I've got a question for yas. I'm trying to write code that
> will open up a gzipped tar file using gnutar, and copy the list of
> files(including their directories) to a list variable in python. From
> there, I want to go through
Jonathan Bowlas wrote in
news:[EMAIL PROTECTED] in
comp.lang.python:
> Hi listers,
>
> I've written this little script to generate some html but I cannot get
> it to convert to a string so I can perform a replace() on the >,
> < characters that get returned.
>
> from StringIO import StringIO
>
abcd wrote in news:[EMAIL PROTECTED] in
comp.lang.python:
> class Foo:
> def __init__(self, name, data=[]):
http://docs.python.org/ref/function.html#l2h-619
Rob.
--
http://www.victim-prime.dsl.pipex.com/
--
http://mail.python.org/mailman/listinfo/python-list
Bruno Desthuilliers wrote in news:[EMAIL PROTECTED] in
comp.lang.python:
>> class cSphere() :
>
> OT : prefixing classes names with 'c' is totally unpythonic.
My understanding of "pythonic" is that its about how you use the
language not what style you code in.
Here's a variation of the usual
Frederic Rentsch wrote in news:mailman.1428.1162113628.11739.python-
[EMAIL PROTECTED] in comp.lang.python:
>def increment_time (interval_ms):
> outer weeks, days, hours, minutes, seconds, mseconds # 'outer'
> akin to 'global'
> (...)
> mseconds = new_ms - s * 1000
wrote in news:[EMAIL PROTECTED] in
comp.lang.python:
> Hi all,
>
> I have a script responsible for loading and executing scripts on a
> daily basis. Something like this:
>
> import time
> t = time.gmtime()
> filename = t[0] + '-' + t[1] + '-' + t[2] + '.py'
> import filename
>
> So, I have a
Efrat Regev wrote in news:[EMAIL PROTECTED] in comp.lang.python:
>Hello,
>
>I need to call GNU/make from within a Python script. This raised some
> problems:
> 1. The script is not in the directory of the makefile, and changing the
> locations of either is not an option. Consequently, t
Frederic Rentsch wrote in news:mailman.1536.1162292996.11739.python-
[EMAIL PROTECTED] in comp.lang.python:
> Rob Williscroft wrote:
>> Frederic Rentsch wrote in news:mailman.1428.1162113628.11739.python-
>> [EMAIL PROTECTED] in comp.lang.python:
>>
>>
>> d
Frederic Rentsch wrote in news:mailman.1556.1162316571.11739.python-
[EMAIL PROTECTED] in comp.lang.python:
> Rob Williscroft wrote:
>> Frederic Rentsch wrote in news:mailman.1536.1162292996.11739.python-
>>> Rob Williscroft wrote:
>>>> Frederic Rentsch wrote in news
Paul McGuire wrote in news:[EMAIL PROTECTED] in
comp.lang.python:
>
> class Constants(object)
> pass
>
> (I guess value immutability could probably be implemented using clever
> implementations of __setattr__ and such, but is it really worth the
> bother?).
>
> Then I defined the context
Paul McGuire wrote in news:[EMAIL PROTECTED] in
comp.lang.python:
>>> opAssoc = Constants(object)
>>> opAssoc.RIGHT = 0
>>> opAssoc.LEFT = 1
>> This is nice, but you can cut down on some of the cruft:
>> Constants.LEFT = 1
> One man's cruft is another man's clarity.
:-)
> The reason I used
Frederic Rentsch wrote in news:mailman.1613.1162403556.11739.python-
[EMAIL PROTECTED] in comp.lang.python:
> Since we have a class that goes out of scope
> when the function returns, and we don't need more than one instance, why
> bother to make an instance? Why not use the class object itself?
Tim Chase wrote in news:mailman.1617.1162412498.11739.python-
[EMAIL PROTECTED] in comp.lang.python:
>>> The reason I used instances instead of just the Constants
>>> class was so that I could define a little more descriptive
>>> context for the constants,
>>
>> Sorry I don't know what you mean h
Steve Holden wrote in
news:[EMAIL PROTECTED] in
comp.lang.python:
> Since we have a class that goes out of scope
>> when the function returns, and we don't need more than one instance,
>> why bother to make an instance? Why not use the class object itself?
>>
>> def whatever( new_ms ):
>>
>>
wrote in news:[EMAIL PROTECTED] in
comp.lang.python:
>
> steve> http://wiki.python.org/moin/Java_Scripting
>
> Renamed to "JavaScripting".
>
> Skip
So nobody around here has heared of that other language
called JavaScript then ?
Perhaps "Scripting_Java" might be better.
Pythoning-ly y
Praveen wrote in news:1162752076.121514.313750
@h48g2000cwc.googlegroups.com in comp.lang.python:
> I want to read individual disk label
>
> for Hard disk (C: drive, D: drive disk label)
> and
> CD-ROM disk label
>
> Please provide some pointer to the code or document.
>
You could use:
http:/
Terry Reedy wrote in
news:[EMAIL PROTECTED] in
comp.lang.python:
>> def main():
>>number = number()
>
> Within a function, a given name can be either global or local, but not
> both.
> Here you are expecting the compiler to interpret the first occurance
> of 'number' as local and the second
Grumman wrote in news:[EMAIL PROTECTED] in comp.lang.python:
[snip]
> Roughly, I have a script that fills in a field, sets a combobox, then
> clicks a button via clickButton. At this point, the python interpreter
> hangs. The only thing I've been able to identify as different about
> this form i
Bernard Lebel wrote in news:mailman.6413.1149178158.27775.python-
[EMAIL PROTECTED] in comp.lang.python:
> Hello,
>
> Is there an option or a way to allow the selection of multiple entries
> in the Listbox widget? I could not find any, and would like to allow
> the end user to select multiple ent
feel_energetic wrote in news:1149239221.045268.6170
@g10g2000cwb.googlegroups.com in comp.lang.python:
> Hi,
>
> I already knew how to define a static method of a class( using
> staticmethod() ),but I find there isn't a built-in func to build a
> static field ( something like staticfield() )
greenflame wrote in news:1149305472.893535.67770
@h76g2000cwa.googlegroups.com in comp.lang.python:
> Ok so I played with your script. Here is a script that more closely
> mimics what I would like to do except that the way I make the variable
> deckstr will be different. The only thing I am confus
wrote in news:[EMAIL PROTECTED] in
comp.lang.python:
>> As nikie pointed out, you can buy a 1-year MSDN Pro Subscription that
>> includes the VS2003 system. All that stopped is the free toolkit.
>
> The MSDN Pro Subscription is not really an option because we have no
> use for the 2005 compile
John Salerno wrote in news:[EMAIL PROTECTED] in
comp.lang.python:
> Quick question about the code below: I understand why the progress bar
> fills up at a steady pace when the mouse is idle over the frame; but
> why, when you move the mouse, does the progress bar speed up? Shouldn't
> it stop
Claudio Grondi wrote in news:[EMAIL PROTECTED] in
gmane.comp.python.general:
> Tim Roberts wrote:
>> "Tim Peters" <[EMAIL PROTECTED]> wrote:
>>
>> It is much simpler than that. With a multiprocessor HAL, including
>> on a dual-core or hyperthreaded system, QueryPerformanceCounter
>> returns th
Daniel Dittmar wrote in news:[EMAIL PROTECTED] in
comp.lang.python:
> - removing reference counting and relying on garbage collection alone
> will break many Python applications (because they rely on files being
> closed at end of scope etc.)
>
They are already broken on at least 2 python imp
[EMAIL PROTECTED] wrote in news:1157758817.446690.105620
@i42g2000cwa.googlegroups.com in comp.lang.python:
> Please help my poor brain :) Every time I try to do a list
> comprehension I find I just don't comprehend ...
>
> Anyway, I have the following bit of code:
>
> seq = [2, 3, 1, 9]
> tmp =
Andres Corrada-Emmanuel wrote in
news:[EMAIL PROTECTED] in
comp.lang.python:
> I have installed PIL 1.1.5 on Windows with Python 2.4. I'm unable to
> open .tiff images that I can open and view using Windows Explorer. In
> other words, this simple test fails:
>
> import Image
> im = Image.open('s
Tim Arnold wrote in news:[EMAIL PROTECTED] in
comp.lang.python:
> "Tim Arnold" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
>> I'm using ElementTree to access some xml configuration files, and
>> using the module's xinclude capability. I've got lines like this in
>> the parent x
Nirnimesh wrote in news:1158840271.942540.85640
@d34g2000cwd.googlegroups.com in comp.lang.python:
> I want to extract emails from an mbox-type file which contains a number
> of individual emails.
>
> I tried the python mailbox and email modules individually, but I'm
> unable to combine them to g
Martin v. Löwis wrote in news:[EMAIL PROTECTED] in
comp.lang.python:
> [EMAIL PROTECTED] schrieb:
>> I'm trying to install two different packages which wrap C or C++ code
>> and which make use of distutils.build_ext, which barfs because my only
>> compiler is too new. Trying this both on Python
=?ISO-8859-15?Q?=22Martin_v=2E_L=F6wis=22?= wrote in news:4514479B.5070808
@v.loewis.de in comp.lang.python:
> Rob Williscroft schrieb:
>> Download the 1.1 SDK:
>>
>> http://www.microsoft.com/downloads/details.aspx?familyid=9B3A2CA6-
>> 3647-4070-9F41-A333C6B9181D&am
Rob Williscroft wrote in news:Xns9846DDC7A18E0rtwfreenetREMOVEcouk@
216.196.109.145 in comp.lang.python:
>> That's yet another option. Somebody reported that the compiler in the
>> .NET SDK won't support generating optimized code, though. That's a
>> problem fo
Nigel wrote in news:[EMAIL PROTECTED]
in comp.lang.python:
> from Tkinter import *
> import pyTTS
> Hi i am trying to get a button so that when i click on it i hear a
> voice say "Hi Molly" this is my code so far.Can any one shed any light
> on this for please.
> Thanks Nige.
Your problem appear
wrote in news:[EMAIL PROTECTED] in
comp.lang.python:
> Hi all. How do I escape the "%" sign in a print statement so that it
> prints? Thanks.
>
print "%%"
Rob.
--
http://www.victim-prime.dsl.pipex.com/
--
http://mail.python.org/mailman/listinfo/python-list
Rob Williscroft wrote in news:Xns9849DC7DB4102rtwfreenetREMOVEcouk@
216.196.109.145 in comp.lang.python:
> wrote in news:[EMAIL PROTECTED] in
> comp.lang.python:
>
>> Hi all. How do I escape the "%" sign in a print statement so that it
>> prints? Thanks.
>>
Neal Becker wrote in
news:[EMAIL PROTECTED] in
comp.lang.python:
> Any suggestions for transforming the sequence:
>
> [1, 2, 3, 4...]
> Where 1,2,3.. are it the ith item in an arbitrary sequence
>
> into a succession of tuples:
>
> [(1, 2), (3, 4)...]
>
> In other words, given a seq and an in
Rob Williscroft wrote in news:Xns984ACDA635C9rtwfreenetREMOVEcouk@
216.196.109.145 in comp.lang.python:
>>>> seq = range(11)
>>>> zip(seq[::2], seq[1::2] + [None])
> [(0, 1), (2, 3), (4, 5), (6, 7), (8, 9), (10, None)]
>
>>>> seq = range(10)
>>&g
wrote in news:[EMAIL PROTECTED] in
comp.lang.python:
> Any insight?
>From the docs:
The yield statement is only used when defining a generator function, and is
only used in the body of the generator function. Using a yield statement in
a function definition is sufficient to cause that defin
Steven D'Aprano wrote in
news:[EMAIL PROTECTED] in
comp.lang.python:
> On Wed, 27 Sep 2006 20:16:52 +0200, Fredrik Lundh wrote:
>
>> Claes at work wrote:
>>
>>> Please tell me there is a simpler way than subtracting two datetimes
>>> to get a timedelta and then compute
>>>
>>> days * number of
Larry Hastings wrote in news:1159495643.213830.289620
@m7g2000cwm.googlegroups.com in comp.lang.python:
> _
> THE PATCH
>
> The core concept: adding two strings together no longer returns a pure
> "string" object. Instead, it returns a "string concatenation" object
> which holds referenc
Matthew Warren wrote in news:mailman.1152.1159872720.10491.python-
[EMAIL PROTECTED] in comp.lang.python:
> I would expect this to work,
>
> rawstring=r'some things\new things\some other things\'
It in the docs:
http://docs.python.org/ref/strings.html#l2h-14>
... Specifically, a raw string ca
Samuel wrote in news:[EMAIL PROTECTED]
in comp.lang.python:
> Hi,
>
> I am trying to replace the eval() in the following code:
>
> def myfunc(type, table):
> module = __import__(type)
> type = 'module' + '.' + type
> obj = eval(type)
> return obj(row[table.c.name], ro
many_years_after wrote in news:1164467660.760671.145440
@j44g2000cwa.googlegroups.com in comp.lang.python:
> class mythread(threading.Thread):
> def __init__(self, threadname):
> threading.Thread.__init__(self, name = threadname)
>
> def run(self):
> print 'i am running'
>
John Henry wrote in news:1164494606.514366.124810
@l39g2000cwd.googlegroups.com in comp.lang.python:
> I believe the standard dictionary should be amened to allow the use of
> case insensitive keys - as an option.
class idict( dict ):
class __istr( str ):
def __eq__( self, other ):
Chris Mellon wrote in
news:[EMAIL PROTECTED] in
comp.lang.python:
> I see super documented, and in use, as below (from the Python
> documentation)
>
> class C(B):
> def meth(self, arg):
> super(C, self).meth(arg)
>
> I'd like to not write C all the time, so is there any problem wit
wrote in news:[EMAIL PROTECTED] in
comp.lang.python:
> When rightclicking a, for example, pdf file on windows, one normally
> gets a screen with three or four tags. Clicking on one of the summary
> tag one can get some info like "title", "Author", "category", "keyword"
> etc..
>
> My question
Tom Plunket wrote in news:[EMAIL PROTECTED] in
comp.lang.python:
> ...at least, I think that I'm having a problem understanding the way
> closures work.
>
> I'm trying to define a function for an object which will take certain
> objects from the parent scope at the time that function is defined.
Podi wrote in news:[EMAIL PROTECTED]
in comp.lang.python:
> I am trying to set the system time on my Windows computer, but avoid
> using the DOS command (date, time).
>
> Does anyone know what parameter to pass to function SetLocalTime?
http://msdn.microsoft.com/library/default.asp?url=/library
Podi wrote in news:[EMAIL PROTECTED] in
comp.lang.python:
> Rob Williscroft wrote:
>>
>> Google will usually find the documentation of anything in the
>> Windows API however sometimes it also helps to add "msdn" to
>> your search as in:
> Yes, thank you
king kikapu wrote in news:1166181267.949316.197360@
16g2000cwy.googlegroups.com in comp.lang.python:
> I am sure it is something very obvious
Yes, property is *NOT* a decorator, it can only be used as a decorator in
the one case that is mentioned in the docs:
http://docs.python.org/lib/built-in
Evan wrote in news:[EMAIL PROTECTED] in
comp.lang.python:
> In matlab I can do the following:
>
>>> ind = [3,5,7,2,4,7,8,24]
> ind = 3 5 7 2 4 7 824
>>> ind(1) ans = 3
>>> ind(end) ans =24
>>> ind([1 end]) ans = 324
>
> but I can't get
John Machin wrote in news:1167008799.074885.250770@
73g2000cwn.googlegroups.com in comp.lang.python:
> Given a = Adder(),
> a.tally = 0
> gets AttributeError: 'Adder' object attribute 'tally' is read-only
> a.notinslots = 1
> gets AttributeError: 'Adder' object attribute 'notinslots' is re
John Machin wrote in
news:[EMAIL PROTECTED] in
comp.lang.python:
> Rob Williscroft wrote:
>> John Machin wrote in news:1167008799.074885.250770@
>> 73g2000cwn.googlegroups.com in comp.lang.python:
>>
>> > Given a = Adder(),
>> > a.tally = 0
>> &g
siggi wrote in news:[EMAIL PROTECTED] in
comp.lang.python:
> Hi all,
>
> a newbie question:
>
> I have a program gui03A.py using wxPython, importing it such:
> "from wxPython.wx import *"
>
> The program works, but I get the warning message:
>
> "gui03A.py:4: DeprecationWarning: The wxPython
On Fri, 15 Jun 2007 14:30:36 -0700, nano wrote:
> Using python 2.2 what is the simplest way to get the current date value?
> I have looked in so many places. The question is often asked and the
> usual response indicates how to get the current date and time like
>
> now = time.localtime()
>
> I
On Fri, 15 Jun 2007 14:46:20 -0700, nano wrote:
> In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED]
> says...
>> On Fri, 15 Jun 2007 14:30:36 -0700, nano wrote:
>>
>> > Using python 2.2 what is the simplest way to get the current date
>> > value? I have looked in so many places. The question is o
wrote in news:[EMAIL PROTECTED] in
comp.lang.python:
> Hi,
> I need a specific example. I have seen the docs, but I don't all the
> stuffs there.
>
> from ConfigParser import ConfigParser
> Now I want to know how to read a section, a section attribute's value,
> and to write thoses back aft
wrote in news:[EMAIL PROTECTED] in
comp.lang.python:
> Hi,
>
> I am hitting this error consistently and don't know why it's
> happening. I would like to define all exceptions for my project in one
> file and use them across the project. Here's a sample -
>
> exceptions.py -
> from exception
wrote in news:[EMAIL PROTECTED] in
comp.lang.python:
> If I have a button widget
>
> w = Button(root, text = "Button", state = 'disabled')
>
> How can I get the value of option 'state' from the widget 'w'.
> I want something like --
>
> print w.state >> to print out >> 'disabled'
>
print w
wrote in news:[EMAIL PROTECTED] in
comp.lang.python:
> >>> [] == []
> True
> >>> ['-o'] == []
> False
> >>> ['-o'] == False
> False
> >>>
To test wether something is true use if.
To test wether something is false use if not.
The python values "True" and "False" are
Ron Garret wrote in news:rNOSPAMon-B77D6B.12263417052007
@news.gha.chartermi.net in comp.lang.python:
>> PACKAGE CONTENTS
>> handlers
>> headers
>> simple_server
>> util
>> validate
>>
>> Reading the documentation can be useful sometimes. Recommending
>> http://docs.pyth
no`name` wrote in news:[EMAIL PROTECTED]
in comp.lang.python:
> maybe someone have some ideas how to block first stdin in main
> function and get stdin from the thread when here is a new connection?
>
No, but you could instead use a Queue:
http://docs.python.org/lib/module-Queue.html
1 - 100 of 175 matches
Mail list logo