On 6/10/2011 11:34 PM, Steven D'Aprano wrote:
I have a metaclass in Python 3.1:
class MC1(type):
@staticmethod
def get_mro(bases):
print('get_mro called')
return type('K', bases, {}).__mro__[1:]
The call to type figures out the proper metaclass from bases and
forwa
2011/6/10 可乐 :
> On 6月11日, 下午12时03分, Javier wrote:
>> ?? wrote:
>> > i want to learn pyqt ,but i have no c++ knowlage. is it ok
>>
>> It should be ok. I would recoomend this book:
>>
>> "Rapid GUI Programming with Python and Qt" (Prentice Hall Open Source
>> Software
>> Development)
>>
Hello,
I'm seldomly writng python code, nothing but a beginner code.
I wrote these lines >>
=
_log_in= mhandler.ConnectHandler(lmbox, _logger, accs)
multhr= sttng['multithread']
if multhr:
_log_in= mhandler.mThreadSession(lmbox, _log
On 6月11日, 下午12时03分, Javier wrote:
> ?? wrote:
> > i want to learn pyqt ,but i have no c++ knowlage. is it ok
>
> It should be ok. I would recoomend this book:
>
> "Rapid GUI Programming with Python and Qt" (Prentice Hall Open Source Software
> Development)
> Mark Summerfield (Author)
tha
?? wrote:
> i want to learn pyqt ,but i have no c++ knowlage. is it ok
It should be ok. I would recoomend this book:
"Rapid GUI Programming with Python and Qt" (Prentice Hall Open Source Software
Development)
Mark Summerfield (Author)
--
http://mail.python.org/mailman/listinfo/pyth
Íàì, ãîâîðèò, î÷åíü ïðèÿòíî, è íàì íóæíû îáðàçîâàííûå Îíè íå ïðîñ÷èòàþò Âû, ãîâîðèò, òîæå, êàæåòñÿ, ïî êîììåð÷åñêîé ÷àñòè? http://rayjonz8231.de.tl/esp1006nimfia.htm --
http://mail.python.org/mailman/listinfo/python-list
I have a metaclass in Python 3.1:
class MC1(type):
@staticmethod
def get_mro(bases):
print('get_mro called')
return type('K', bases, {}).__mro__[1:]
def __new__(cls, name, bases, dict):
mro = None
docstring = dict.get('__doc__')
if docstring == '
i want to learn pyqt ,but i have no c++ knowlage. is it ok
--
http://mail.python.org/mailman/listinfo/python-list
On Fri, 10 Jun 2011 14:46:06 -0700, Carl Banks wrote:
> On Friday, June 10, 2011 2:51:20 AM UTC-7, Steven D'Aprano wrote:
>> On Thu, 09 Jun 2011 20:36:53 -0700, Carl Banks wrote:
>> > Put it this way: if Python doesn't automatically inherit docstrings,
>> > the worst that can happen is missing inf
On 6/10/2011 6:30 AM, Francesc Segura wrote:
Hello all, I'm new to this and I'm having problems on summing two
values at python.
I get the following error:
Traceback (most recent call last):
File "C:\edge-bc (2).py", line 168, in
if (costGG<= cost + T0):
TypeError: unsupported operand t
On 6/10/2011 3:15 PM, KK wrote:
Thanks for the reply!!
i ve installed the binary
but when i import anything of PyQt in my prog it says error??
i think there is some problem with folders
If you install in python32/Lib/site-packages, it should work.
But see Andrew's message. Show both
I found that Head First Python gives a really good introduction to Django. It's
definitely a beginners book, as are all of the Head First books, but it still
teaches the basics in a very good manner.
If you're very knowledgeable with Python, you can skip the first few chapters
(or read through
On 6/10/2011 3:31 AM, Gregory Ewing wrote:
Eric Snow wrote:
But for "method" objects (really a wrapper for
bound functions) would it change the __doc__ of the wrapper or of the
bound function?
You probably wouldn't want to change the __doc__ of a method
wrapper; instead you'd make sure you got
En Fri, 10 Jun 2011 07:30:28 -0300, Francesc Segura
escribió:
Hello all, I'm new to this and I'm having problems on summing two
values at python.
I get the following error:
Traceback (most recent call last):
File "C:\edge-bc (2).py", line 168, in
if (costGG <= cost + T0):
TypeError: un
En Fri, 10 Jun 2011 07:30:28 -0300, Francesc Segura
escribió:
Hello all, I'm new to this and I'm having problems on summing two
values at python.
I get the following error:
Traceback (most recent call last):
File "C:\edge-bc (2).py", line 168, in
if (costGG <= cost + T0):
TypeError: un
Xah Lee writes:
> Dear lisp comrades, it's Friday!
>
The answers to your question give poor coverage of the possible
responses to your writing. I myself enjoy reading what you write, most
of the time, but become bored and fed up with the way you sometimes seem
unaccountably angry with the rest of
Hi Thomas,
APologies for not being clear enough in my question.
On 06/09/2011 04:40 PM, Thomas Guettler wrote:
> On 08.06.2011 12:29, News123 wrote:
>> Hi,
>>
>>
>> Do you have any recommendations for a good book about Web design with
>> Django?
>
> You can do web design with HTML, CSS and Jav
On Thu, Jun 9, 2011 at 12:22 AM, Eric Snow wrote:
> Sometimes when using class inheritance, I want the overriding methods
> of the subclass to get the docstring of the matching method in the
> base class. You can do this with decorators (after the class
> definition), with class decorators, and w
On Fri, Jun 10, 2011 at 4:57 PM, Ian Kelly wrote:
> So as far as I can tell, generator-based context managers simply can't
> be used as ContextDecorators. Furthermore, the documentation's claim
> that they can is actually harmful, since they *appear* to work at
> first. Or am I simply missing so
Python 3.2 has this lovely new contextlib.ContextDecorator mixin [1]
for context manager classes that allows you to apply the context
manager as a decorator. The docs for this feature include the note:
ContextDecorator is used by contextmanager(), so you get this
functionality automatically.
Andre Majorel wrote:
> Is there a way to keep the definitions of the high-level
> functions at the top of the source ? I don't see a way to
> declare a function in Python.
I am not a Python developer, but Pythonic way of definition not
declaration is definitely interesting. Languages with variabl
En Fri, 10 Jun 2011 04:13:05 -0300, prakash jp
escribió:
I am using quickfix, would like to start with that
..\quickfix-1.13.3\quickfix\examples\executor\python\executor.py asks
for a
configuration file how should it look like.
This one? http://www.quickfixengine.org/
I see a forum and
On Jun 10, 5:56 pm, Hans Mulder wrote:
> On 10/06/11 22:56:06, virdo wrote:
>
>
>
>
>
>
>
>
>
> > On Jun 10, 4:48 pm, John Gordon wrote:
> >> In<6e035898-8938-4a61-91de-7a0ea7ead...@y30g2000yqb.googlegroups.com>
> >> virdo writes:
>
> >>> My python file is simple print "test". I run it, it wor
Hello,
I am trying to create a movie in chimera UCSF using the python scripts.
I want to take an input of certain images, rotate, translate, etc and make a
movie out of them all through the command line.
So if I were give a series of images from a matlab code, my script would
generate a video o
2011/6/11 Sérgio Monteiro Basto :
> ok after thinking about this, this problem exist because Python want be
> smart with ttys
The *anomaly* (not problem) exists because Python has a way of being
told a target encoding. If two parties agree on an encoding, they can
send characters to each other. I
On 10/06/11 20:03:44, Kurt Smith wrote:
On Fri, Jun 10, 2011 at 12:58 PM, Mark Phillips
wrote:
How do I write my script so it picks up argument from the output of commands
that pipe input into my script?
def main():
import sys
print sys.stdin.read()
if __name__ == '__main__':
On 10/06/11 22:56:06, virdo wrote:
On Jun 10, 4:48 pm, John Gordon wrote:
In<6e035898-8938-4a61-91de-7a0ea7ead...@y30g2000yqb.googlegroups.com>
virdo writes:
My python file is simple print "test". I run it, it works no problem.
I pipe the output to a file "run> logfile" and that's the err
On Friday, June 10, 2011 2:51:20 AM UTC-7, Steven D'Aprano wrote:
> On Thu, 09 Jun 2011 20:36:53 -0700, Carl Banks wrote:
> > Put it this way: if Python doesn't automatically inherit docstrings, the
> > worst that can happen is missing information. If Python does inherit
> > docstrings, it can lea
On Thursday, June 9, 2011 10:18:34 PM UTC-7, Ben Finney wrote:
[snip example where programmer is expected to consult class docstring to infer
what a method does]
> There's nothing wrong with the docstring for a method referring to the
> context within which the method is defined.
>
> > Whenever
On 06/10/2011 04:00 PM, Benjamin Kaplan wrote:
On Fri, Jun 10, 2011 at 11:31 AM, Tim Chase
if os.isatty(sys.stdin): #<-- this check
Any reason for that over sys.stdin.isatty()?
my knowledge of os.isatty() existing and my previous lack of
knowledge about sys.stdin.isatty()
:)
-tkc
-
On Fri, Jun 10, 2011 at 12:15 PM, KK wrote:
> Thanks for the reply!!
> i ve installed the binary
> but when i import anything of PyQt in my prog it says error??
> i think there is some problem with folders
What is the exact text of the error message? We can't help you unless
we know
On Fri, Jun 10, 2011 at 11:31 AM, Tim Chase
wrote:
> On 06/10/2011 12:58 PM, Mark Phillips wrote:
>>
>> How do I write my script so it picks up argument from the
>> output of commands that pipe input into my script?
>
> You can check
>
> if os.isatty(sys.stdin): # <-- this check
Any reason for
On Jun 10, 4:48 pm, John Gordon wrote:
> In <6e035898-8938-4a61-91de-7a0ea7ead...@y30g2000yqb.googlegroups.com> virdo
> writes:
>
> > My python file is simple print "test". I run it, it works no problem.
> > I pipe the output to a file "run > logfile" and that's the error I
> > get. This is with
In <6e035898-8938-4a61-91de-7a0ea7ead...@y30g2000yqb.googlegroups.com> virdo
writes:
> My python file is simple print "test". I run it, it works no problem.
> I pipe the output to a file "run > logfile" and that's the error I
> get. This is with Windows Server 2008 (64 bit) using ActivePython
>
Hi,
I'm getting the following error and I can't Google my way out of it:
close failed in file object destructor:
sys.excepthook is missing
lost sys.stderr
My python file is simple print "test". I run it, it works no problem.
I pipe the output to a file "run > logfile" and that's the error I
get.
On Fri, Jun 10, 2011 at 1:33 PM, Dennis wrote:
> On Fri, Jun 10, 2011 at 11:58 AM, Mark Phillips
> fred
>
> ['alice']
> fred
Just realized the if/else will have to be changed slightly if we want
to output both argv and stdin.
--
http://mail.python.org/mailman/listinfo/python-list
On Fri, Jun 10, 2011 at 11:58 AM, Mark Phillips
wrote:
\
>
> Kurt,
>
> How does one write a main method to handle both command line args and stdin
> args?
Here is what I came up with:
The one weird thing, the line from above didn't seem to work so I changed it
if os.isatty(sys.stdin):
to this:
Hi,
I am having an issue when making a shell call from within a
multiprocessing.Process(). Here is the story: i tried to parallelize
the computations in 800-ish Matlab scripts and then save the results
to MySQL. The non-parallel/serial version has been running fine for
about 2 years. However, i
On Jun 10, 2011 10:26 AM, "Mark Phillips"
wrote:
>
> I have a script that processes command line arguments
>
> def main(argv=None):
> syslog.syslog("Sparkler stared processing")
> if argv is None:
> argv = sys.argv
> if len(argv) != 2:
> syslog.syslog(usage())
> els
On 6/10/11 12:58 PM, Mark Phillips wrote:
On Fri, Jun 10, 2011 at 10:41 AM, MRAB mailto:pyt...@mrabarnett.plus.com>> wrote:
On 10/06/2011 18:21, Mark Phillips wrote:
I have a script that processes command line arguments
def main(argv=None):
syslog.syslog("Spark
Thanks for the reply!!
i ve installed the binary
but when i import anything of PyQt in my prog it says error??
i think there is some problem with folders
--
http://mail.python.org/mailman/listinfo/python-list
On Jun 10, 5:15 am, Brian Martin
wrote:
> Then again you could use a high level language like Perl, Python, APL ...
>
> On 10/06/2011 8:17 AM, Paul Rubin wrote:
>
> > Mentifex writes:
> >> At one point, I had to create 8jun11T.F as a "Test" version of
> >> MindForth, so that I could fix the JavaS
On Fri, Jun 10, 2011 at 11:03 AM, Kurt Smith wrote:
> On Fri, Jun 10, 2011 at 12:58 PM, Mark Phillips
> wrote:
> > How do I write my script so it picks up argument from the output of
> commands
> > that pipe input into my script?
>
> def main():
>import sys
>print sys.stdin.read()
>
> if
On Fri, Jun 10, 2011 at 11:26 AM, Ian Kelly wrote:
> Everybody always focuses so much on properties and forgets that you
> can also just write your own descriptors.
>
I'm so glad that you pointed this out. I totally forgot that
properties simply returned themselves if not called on the instance.
FYI, I started this topic up on python-ideas, as it seemed valid
enough from the responses I've gotten here [1].
-eric
[1] http://mail.python.org/pipermail/python-ideas/2011-June/010473.html
--
http://mail.python.org/mailman/listinfo/python-list
On 06/10/2011 12:58 PM, Mark Phillips wrote:
How do I write my script so it picks up argument from the
output of commands that pipe input into my script?
You can check
if os.isatty(sys.stdin): # <-- this check
do_stuff_with_the_terminal()
else:
read_options_from_stdin()
-tkc
-
On Fri, Jun 10, 2011 at 11:03 AM, Dennis wrote:
> On Fri, Jun 10, 2011 at 10:58 AM, Mark Phillips
> wrote:
>> On Fri, Jun 10, 2011 at 10:41 AM, MRAB wrote:
>>
>> On 10/06/2011 18:21, Mark Phillips wrote:
>
>>
> How do I write my script so it picks up argument from the output of commands
> that p
On Fri, Jun 10, 2011 at 12:58 PM, Mark Phillips
wrote:
> How do I write my script so it picks up argument from the output of commands
> that pipe input into my script?
def main():
import sys
print sys.stdin.read()
if __name__ == '__main__':
main()
$ echo "fred" | python script.py
fr
Dear lisp comrades, it's Friday!
Dear Xah, your writing is:
• Full of bad grammar. River of Hiccups.
• Stilted. Chocked under useless structure and logic.
• WRONG — Filled with uncouth advices.
• Needlessly insulting. You have problems.
• Simply stinks. Worthless.
• M
On Fri, Jun 10, 2011 at 10:41 AM, MRAB wrote:
> On 10/06/2011 18:21, Mark Phillips wrote:
>
>> I have a script that processes command line arguments
>>
>> def main(argv=None):
>> syslog.syslog("Sparkler stared processing")
>> if argv is None:
>> argv = sys.argv
>> if len(argv)
On 10/06/2011 18:21, Mark Phillips wrote:
I have a script that processes command line arguments
def main(argv=None):
syslog.syslog("Sparkler stared processing")
if argv is None:
argv = sys.argv
if len(argv) != 2:
syslog.syslog(usage())
else:
r = par
On Fri, 10 Jun 2011 11:01:41 -0600, Eric Snow wrote:
> On Fri, Jun 10, 2011 at 10:47 AM, Steven D'Aprano
> wrote:
>> Here's some Python 3 code that uses a factory function as a metaclass
>> to inherit docstrings. Give the class a docstring of an empty string,
>> and it will be inherited from the
On Fri, Jun 10, 2011 at 10:55 AM, Eric Snow wrote:
> The only problem, as seen in the last line, is that the __doc__ on
> instances is not inherited on instances of the class. Object
> attribute lookup only looks to the type's __dict__ for inheritance,
> and not the types's type. However, that s
I have a script that processes command line arguments
def main(argv=None):
syslog.syslog("Sparkler stared processing")
if argv is None:
argv = sys.argv
if len(argv) != 2:
syslog.syslog(usage())
else:
r = parseMsg(sys.argv[1])
syslog.syslog(r)
ret
On Fri, 10 Jun 2011 16:47:03 +, Steven D'Aprano wrote:
> On Thu, 09 Jun 2011 00:22:54 -0600, Eric Snow wrote:
>
>> Sometimes when using class inheritance, I want the overriding methods
>> of the subclass to get the docstring of the matching method in the base
>> class. You can do this with d
On Fri, Jun 10, 2011 at 10:47 AM, Steven D'Aprano
wrote:
> Here's some Python 3 code that uses a factory function as a metaclass to
> inherit docstrings. Give the class a docstring of an empty string, and it
> will be inherited from the first superclass found with a non-empty
> docstring.
>
>
Yea
2011/6/10 Sérgio Monteiro Basto :
> ok after thinking about this, this problem exist because Python want be
> smart with ttys, which is in my point of view is wrong, should not encode to
> utf-8, because tty is in utf-8. Python should always encode to the same
> thing. If the default is ascii, shou
On Fri, Jun 10, 2011 at 5:05 AM, Tim Chase
wrote:
> On 06/09/2011 01:22 AM, Eric Snow wrote:
>>
>> Sometimes when using class inheritance, I want the overriding methods
>> of the subclass to get the docstring of the matching method in the
>> base class. You can do this with decorators (after the
On Thu, 09 Jun 2011 00:22:54 -0600, Eric Snow wrote:
> Sometimes when using class inheritance, I want the overriding methods of
> the subclass to get the docstring of the matching method in the base
> class. You can do this with decorators (after the class definition),
> with class decorators, an
Ben Finney wrote:
>> > What should it decode to, then?
>>
>> UTF-8, as in tty
>
> But when you explicitly redirect to a file, it's not going to a TTY.
> It's going to a file whose encoding isn't known unless you specify it.
ok after thinking about this, this problem exist because Python want be
On 2011.06.10 08:09 AM, KK wrote:
> I have python 3.2 installed m not able to install PyQt.
> i have downloaded and configured sip but how to build it???
The pages are misleading. You only need the SIP source if you want to
build everything from source. Since you don't seem to be familiar with
I have python 3.2 installed m not able to install PyQt.
i have downloaded and configured sip but how to build it???
whats the make and make install given on the installation
Plzzz help m a newbie to python
--
http://mail.python.org/mailman/listinfo/python-list
On 10 jun, 13:38, Tim Chase wrote:
> On 06/10/2011 05:30 AM, Francesc Segura wrote:
>
> > Hello all, I'm new to this and I'm having problems on summing two
> > values at python.
>
> > I get the following error:
>
> > Traceback (most recent call last):
> > File "C:\edge-bc (2).py", line 168, in
Sure did
http://www.manta.com/c/mmlq5dm/w-gary-sokolich
W Gary Sokolich
801 Kings Road
Newport Beach, CA 92663-5715
(949) 650-5379
http://www.tbpe.state.tx.us/da/da022808.htm
TEXAS BOARD OF PROFESSIONAL ENGINEERS
February 28, 2008 Board Meeting Disciplinary Actions
W. Gary Sokolich , Newpor
On 06/10/2011 05:30 AM, Francesc Segura wrote:
Hello all, I'm new to this and I'm having problems on summing two
values at python.
I get the following error:
Traceback (most recent call last):
File "C:\edge-bc (2).py", line 168, in
if (costGG<= cost + T0):
TypeError: unsupported operand
On 06/09/2011 01:22 AM, Eric Snow wrote:
Sometimes when using class inheritance, I want the overriding methods
of the subclass to get the docstring of the matching method in the
base class. You can do this with decorators (after the class
definition), with class decorators, and with metaclasses
Hello all, I'm new to this and I'm having problems on summing two
values at python.
I get the following error:
Traceback (most recent call last):
File "C:\edge-bc (2).py", line 168, in
if (costGG <= cost + T0):
TypeError: unsupported operand type(s) for +: 'float' and 'tuple'
I'm working
Hello all, I'm new to this and I'm having problems on summing two
values at python.
I get the following error:
Traceback (most recent call last):
File "C:\edge-bc (2).py", line 168, in
if (costGG <= cost + T0):
TypeError: unsupported operand type(s) for +: 'float' and 'tuple'
I'm working
Hi Im new to this and I am having a problem converting my .py to a .exe
I get the following:
Traceback (most recent call last):
File "casemng.py", line 163, in
File "casemng.py", line 38, in __init__
File "wx\_core.pyc", line 3369, in ConvertToBitmap
wx._core.PyAssertionError: C++ assert
On Thu, 09 Jun 2011 20:36:53 -0700, Carl Banks wrote:
> x = random.choice([Triange(),Square()]) print x.draw.__doc__ # prints
> "Draws a shape"
>
>
> Quick, what shape is x.draw() going to draw?
That's easy... it will draw a type(x).__name__.
I think this not a terribly convincing argument. I
On Thu, 09 Jun 2011 23:59:08 -0400, Terry Reedy wrote:
> On 6/9/2011 9:12 PM, Carl Banks wrote:
>
>> Presumably, the reason you are overriding a method in a subclass is to
>> change its behavior; I'd expect an inherited docstring to be inaccurate
>> more often than not. So I'd be -1 on automatic
On Fri, 10 Jun 2011 01:00:35 -0500, harrismh777 wrote:
> So, be careful. I have had to separate *all* of my python installs on
> *every* one of my systems for this similar reason. The bottom line is if
> the distro ships with 2.6 (minus the idle) chances are that the
> interpreter is there *not*
On Fri, 10 Jun 2011 07:33:34 +1000, Ben Finney wrote:
> Steven D'Aprano writes:
>> It's an unnecessary restriction, as far as I'm concerned, but an old
>> one.
>
> Well, it's incompatible with the Python compiler I keep in my head. Have
> these developers no consideration for backward-thinking-
On Thu, Jun 9, 2011 at 6:10 PM, Dan Stromberg wrote:
>
> On Thu, Jun 9, 2011 at 10:55 AM, geremy condra wrote:
>>
>> On Thu, Jun 9, 2011 at 4:38 AM, Dave Angel wrote:
>> > On 01/-10/-28163 02:59 PM, Chris Rebert wrote:
>> >>
>> >> On Thu, Jun 9, 2011 at 1:31 AM, Ganapathy Subramanium
>> >> wro
Eric Snow wrote:
But for "method" objects (really a wrapper for
bound functions) would it change the __doc__ of the wrapper or of the
bound function?
You probably wouldn't want to change the __doc__ of a method
wrapper; instead you'd make sure you got hold of the underlying
function first. So
Carl Banks wrote:
x = random.choice([Triange(),Square()])
print x.draw.__doc__ # prints "Draws a shape"
Quick, what shape is x.draw() going to draw?
Your debugging code is insufficient. It should include
print type(x)
and then it will be obvious what shape is going to get
drawn.
--
Gre
Carl Banks wrote:
Presumably, the reason you are overriding a method in a subclass
is to change its behavior;
Not always true by any means, and maybe not even usually true.
Consider overriding for the purpose of implementing an abstract
method, or because something about the internal operation
On Thu, Jun 9, 2011 at 11:00 PM, harrismh777 wrote:
> Andrew Berg wrote:
>>
>> AFAICT, there are three reasons to learn Python 2:
>
> ... there is a fourth reason.
>
> The linux distro you are using currently was customized with python 2.x
>
> I ran into this problem this week in fact... on my H
Hi,
I am using quickfix, would like to start with that
..\quickfix-1.13.3\quickfix\examples\executor\python\executor.py asks for a
configuration file how should it look like.
Thanks
--
http://mail.python.org/mailman/listinfo/python-list
79 matches
Mail list logo