Hello,
I am trying to create a tree structure for use with a PyQt QTreeView.
But first I need to get my head around how to create the tree
structure. I have a dictionary (for testing purposes) but I will
later use a table via sqlalchemy.
The use case is hydrology, so I would like to have a hydr
Hi Steven,
I too am just learning about metaclasses in Python and I found the
example you posted to be excellent.
I played around with it and noticed that the issue seems to be the
double-underscore in front of the fields (cls.__fields = {}). If you
change this parameter to use the single-u
In article , Robert
wrote:
> Is it possible to install the 2 and 3 series side by side?
Probably. On Mac OS X, t's certainly possible to install any python.org
versions side by side, even multiple versions of 2 and 3. That's one of
the advantages of the Python framework build layout on OS X
Is it possible to install the 2 and 3 series side by side?
--
Robert
--
http://mail.python.org/mailman/listinfo/python-list
On 26/07/11 00:05, Ethan Furman wrote:
> Ed Leafe wrote:
>> Religious fervor is one thing; freedom of religion is another! ;-)
>>
>> We strive for readability in our code, yet every printed material
>> designed to be read, such as books, newspapers, etc., uses a
>> proportional font.
>
> The book
Peter,
> I think it doesn't matter whether you type in text, or insert it with Ctrl+V
> or the middle mouse button. The validatecommand handler is always triggered.
> I suspect achieving the same effect with Button/KeyPress handlers would
> require significantly more work.
Thank you!
Malcolm
-
Brandon Harris wrote:
I don't really think lining things up makes them any easier to read.
I *totally* disagree. Often I'm scanning a dict looking for either a
key or a value, and having them lined up makes it much easier. Yes, I
have to reindent once in a while, but it's still a write few,
Ed Leafe wrote:
Religious fervor is one thing; freedom of religion is another! ;-)
We strive for readability in our code, yet every printed material
> designed to be read, such as books, newspapers, etc., uses a
> proportional font.
The books I purchase use monospaced fonts for code examples.
On Jul 25, 5:52 am, TonyO wrote:
> > Still I dont get how I am supposed to understand the pipe and its task/
> > idea/influece on control flow, of:
> > return |
>
> In the words of René Magritte,
>
> return |
> ^
> Ceci n'est pas une pipe.
We have a WINNER!!
--
http:/
Sometimes it's worth asking Why?
I assume there would be no need to rewrite if the existing code did most
of what was needed. It may be easier to ask the customer what he really
wants rather than to re-engineer a crappy solution to an obsolete
problem.
--
http://mail.python.org/mailman/listinfo
pyt...@bdurham.com wrote:
> How would your examples work with text being inserted or deleted via the
> clipboard?
>
> Is there anything special that would have to happen for changes to a
> widget's value as the result of one of these events?
I think it doesn't matter whether you type in text, or
Seems like pyssh (which is very old AFAIK) uses signal. Looks like you're
creating the SSHController instance (which uses pyssh) not in the main thread,
and Python won't allow you to place signal handlers outside the main thread.
You can probably move the SSHContorller creation to the main threa
On Mon, Jul 25, 2011 at 12:19 PM, RVince wrote:
> I am instantiating an SSH client class using this class:
>
> http://www.goldb.org/sshpython.html
You might consider using Paramiko instead:
http://www.lag.net/paramiko/
Cheers,
Chris
--
http://mail.python.org/mailman/listinfo/python-list
Peter,
How would your examples work with text being inserted or deleted via the
clipboard?
Is there anything special that would have to happen for changes to a
widget's value as the result of one of these events?
Thank you,
Malcolm (not the OP)
--
http://mail.python.org/mailman/listinfo/python-
On Jul 25, 2:08 pm, Peter Otten <__pete...@web.de> wrote:
> Terry Reedy wrote:
> > On 7/25/2011 8:31 AM, Peter Otten wrote:
> >> Saul Spatz wrote:
> > is it possible to set an onkey handler, that will pass on
> > valid keys?
>
> With validatecommand you can have tkinter provide the string that is b
Billy Mays wrote:
On 07/25/2011 10:16 AM, Archard Lias wrote:
On Jul 25, 2:03 pm, Ian Collins wrote:
On 07/26/11 12:00 AM, Archard Lias wrote:
Still I dont get how I am supposed to understand the pipe and its task/
idea/influece on control flow, of:
return|
??
It's simply a bitwise OR.
On 7/25/11 2:20 PM, Christopher Barrington-Leigh wrote:
The following code:
from pylab import arange
nSegments=5.0
print arange(0,1.0+1.0/nSegments,1.0/nSegments)
nSegments=6.0
print arange(0,1.0+1.0/nSegments,1.0/nSegments)
nSegments=8.0
print arange(0,1.0+1.0
On Jul 25, 3:20 pm, Christopher Barrington-Leigh
wrote:
> The following code:
>
> from pylab import arange
> nSegments=5.0
> print arange(0,1.0+1.0/nSegments,1.0/nSegments)
> nSegments=6.0
> print arange(0,1.0+1.0/nSegments,1.0/nSegments)
> nSegments=8.0
> print arange(
In article ,
Terry Reedy wrote:
> The windows distribution comes with the docs bundled in a windows help
> file, updated with each bug fix release. Is there really no *nix
> equivalent that could be used or is this one area where windows really wins?
Most *nix distributions provide an optional
You can use the 'Toolbutton' style in place of 'indicatoron'
button = Checkbutton(r,
text='Test',
style='Toolbutton')
button.pack()
> On Sunday, March 13, 2011 11:08 PM Peter wrote:
> Hi I am struggling to get a good understanding of styles as used in
> ttk. I have read the tutorial section o
The following code:
from pylab import arange
nSegments=5.0
print arange(0,1.0+1.0/nSegments,1.0/nSegments)
nSegments=6.0
print arange(0,1.0+1.0/nSegments,1.0/nSegments)
nSegments=8.0
print arange(0,1.0+1.0/nSegments,1.0/nSegments)
nSegments=10.0
print arange(0,1
I am instantiating an SSH client class using this class:
http://www.goldb.org/sshpython.html
With the following code:
sSHController = SSHController('xxx', 'root', 'password', '#')
sSHController.login()
Whereupon, at login(), it fails with a :
ValueError: signal only works in ma
Terry Reedy wrote:
> On 7/25/2011 8:31 AM, Peter Otten wrote:
>> Saul Spatz wrote:
>>
>>> That doesn't work, I'm being stupid, The user might type anywhere in
>>> the
>>> string, not just at the end. I need
>>>
>>> return all([c in '1234567890abcdefABCDEF ' for c in after])
>
> If one wants to
On Mon, Jul 25, 2011 at 8:36 AM, Steven W. Orr wrote:
> I have been doing a lot of reading. I'm starting to get it. I think it's
> really cool as well as dangerous, but I plan on being respectful of the
> construct. I found a web page that I found quite readable.
>
> http://cleverdevil.org/**comp
On 07/25/2011 11:45 AM, SigmundV wrote:
On Jul 24, 8:43 am, Laszlo Nagy wrote:
Can it be a problem on my side? I have tried from several different
computers. I cannot even ping it.
Whenever a page can't be accessed, although your connection is good,
http://www.downforeveryoneorjustme.com/ is
Very good.
Karim
On 07/25/2011 05:46 PM, jfine wrote:
Hi
I gave a tutorial at this year's EuroPython that covered metaclasses.
You can get the tutorial materials from a link on:
http://ep2011.europython.eu/conference/talks/objects-and-classes-in-python-and-javascript
Jonathan
--
http://ma
On 7/25/2011 8:31 AM, Peter Otten wrote:
Saul Spatz wrote:
That doesn't work, I'm being stupid, The user might type anywhere in the
string, not just at the end. I need
return all([c in '1234567890abcdefABCDEF ' for c in after])
If one wants to validate keystrokes, rather than the entire fi
On 7/25/2011 7:25 AM, hackingKK wrote:
Infact the first thing I ever did with documentation on Python was to
download it.
yes you are not uptodate but you can always do a download once in a
while rather than putting load on the server every time you want to
lookup a function reference.
Happy hack
Thanks, that a great link.
--
http://mail.python.org/mailman/listinfo/python-list
On 07/25/2011 05:48 AM, Steven D'Aprano wrote:
But if you're calling a function in both cases:
map(int, data)
[int(x) for x in data]
I am aware the premature optimization is a danger, but its also
incorrect to ignore potential performance pitfalls.
I would favor a generator expression here
Yes, the tuple is certainly easier to read.
Thanks again.
--
http://mail.python.org/mailman/listinfo/python-list
On Jul 24, 9:59 am, Benjamin Gregg
wrote:
> Hi
> python was my first language but I need to learn C++ and java for a
> project (No there isn't an alternative)
> and I want to know is there any good tutorials or tips for learning
> C++/java after using python?
I think it's always best to approach
On 25 Jul., 18:11, Christian Heimes wrote:
> Am 25.07.2011 17:28, schrieb Archard Lias:
>
> > It would be great if you could elaborate a little more on that. Am I
> > not supposed to access the parent here?
>
> You must spell out the parent explicitly, otherwise subclasses call
> super() with them
On Jul 24, 8:43 am, Laszlo Nagy wrote:
> Can it be a problem on my side? I have tried from several different
> computers. I cannot even ping it.
Whenever a page can't be accessed, although your connection is good,
http://www.downforeveryoneorjustme.com/ is a good site to check.
Sigmund
--
http
On Jul 25, 10:48 am, Steven D'Aprano wrote:
>
> One other important proviso: if your map function is a wrapper around a
> Python expression:
>
> map(lambda x: x+1, data)
> [x+1 for x in data]
>
> then the list comp will be much faster, due to the overhead of the function
> call. List comps and gen
Am 25.07.2011 17:28, schrieb Archard Lias:
> It would be great if you could elaborate a little more on that. Am I
> not supposed to access the parent here?
You must spell out the parent explicitly, otherwise subclasses call
super() with themselves rather than the correct parent class.
self.__class
Steven W. Orr wrote:
> I have been doing a lot of reading. I'm starting to get it. I think it's
> really cool as well as dangerous, but I plan on being respectful of the
> construct. I found a web page that I found quite readable.
>
> http://cleverdevil.org/computing/78/
>
> So, I tried to run t
Hi
I gave a tutorial at this year's EuroPython that covered metaclasses.
You can get the tutorial materials from a link on:
http://ep2011.europython.eu/conference/talks/objects-and-classes-in-python-and-javascript
Jonathan
--
http://mail.python.org/mailman/listinfo/python-list
Hi
I just want to use the Python part to catch this event as an error
try:
subprocess<>
except ERROR:
I just wanted to know if there is any special error that I can use to catch
this error?
THanks
-- Forwarded message --
From: Thomas Jollans
To: python-list@python.org
Date: M
I have been doing a lot of reading. I'm starting to get it. I think it's
really cool as well as dangerous, but I plan on being respectful of the
construct. I found a web page that I found quite readable.
http://cleverdevil.org/computing/78/
So, I tried to run the example code (below), and I ge
Need to get up-to-speed with Python as quickly and as in-depth as
possible? Already coding Python but still have areas of uncertainty
you need to fill? Then come join me, Wesley Chun, author of
Prentice-Hall's bestseller "Core Python" for a comprehensive
intro/intermediate course coming up this May
On Jul 25, 2:33 pm, Christian Heimes wrote:
> Am 25.07.2011 14:00, schrieb Archard Lias:
>
> > def flags(self, index):
> > if not index.isValid():
> > return Qt.ItemIsEnabled
>
> > return super(self.__class__, self).flags(index) |
>
> Your use of super() is incorrect and will not w
On Jul 25, 4:35 pm, Oliver Bestwalter wrote:
> Hello Archard,
>
> On 25.07.2011, at 16:16, Archard Lias wrote:
>
>
>
>
>
>
>
>
>
> > On Jul 25, 2:03 pm, Ian Collins wrote:
> >> On 07/26/11 12:00 AM, Archard Lias wrote:
>
> >>> Hi,
>
> >>> Still I dont get how I am supposed to understand the pipe
On 25/07/11 16:55, António Rocha wrote:
> Greetings
>
> I'm using subprocess module to run an external Windows binary. Due to
> some limitations, sometimes all memory is consumed in this process. How
> can I catch this error?
> Antonio
>
How is this relevant to the Python part?
Also, "no memory
On Jul 25, 4:39 pm, John Gordon wrote:
> In <1c175da2-79f4-40ed-803f-217dc935d...@m8g2000yqo.googlegroups.com> Archard
> Lias writes:
>
> > > > return |
>
> > > It's simply a bitwise OR.
> > Yes, but how does it get determined, which one actually gets returned?
>
> Neither value is returned on
Steven D'Aprano writes:
> On Sun, Jul 24, 2011 at 7:29 PM, Shashwat Anand
> wrote:
>
>> How do I start ?
>> The idea is to rewrite module by module.
>> But how to make sure code doesn't break ?
>
> By testing it.
>
> Read up on "test driven development".
>
> At this point, you have this:
>
> Per
Greetings
I'm using subprocess module to run an external Windows binary. Due to some
limitations, sometimes all memory is consumed in this process. How can I
catch this error?
Antonio
--
http://mail.python.org/mailman/listinfo/python-list
On Jul 25, 3:16 pm, Archard Lias wrote:
> Yes, but how does it get determined, which one actually gets returned?
It's a bit-wise or, not a logical or so what get returns is a
combination of the two results. The n-th bit of the return value is 1
if the n-th bit of either (or both) of the two st
In <1c175da2-79f4-40ed-803f-217dc935d...@m8g2000yqo.googlegroups.com> Archard
Lias writes:
> > > return |
> >
> > It's simply a bitwise OR.
> Yes, but how does it get determined, which one actually gets returned?
Neither value is returned on its own; the bitwise OR of both values is
computed
Hello Archard,
On 25.07.2011, at 16:16, Archard Lias wrote:
> On Jul 25, 2:03 pm, Ian Collins wrote:
>> On 07/26/11 12:00 AM, Archard Lias wrote:
>>
>>> Hi,
>>
>>> Still I dont get how I am supposed to understand the pipe and its task/
>>> idea/influece on control flow, of:
>>> return |
>>> ?
On 07/25/2011 10:16 AM, Archard Lias wrote:
On Jul 25, 2:03 pm, Ian Collins wrote:
On 07/26/11 12:00 AM, Archard Lias wrote:
Hi,
Still I dont get how I am supposed to understand the pipe and its task/
idea/influece on control flow, of:
return|
??
It's simply a bitwise OR.
--
Ian Col
On Jul 25, 2:03 pm, Ian Collins wrote:
> On 07/26/11 12:00 AM, Archard Lias wrote:
>
> > Hi,
>
> > Still I dont get how I am supposed to understand the pipe and its task/
> > idea/influece on control flow, of:
> > return |
> > ??
>
> It's simply a bitwise OR.
>
> --
> Ian Collins
Yes, but how do
On 2:59 PM, Kevin Walzer wrote:
> Can anyone point me in the direction of a Tkinter/Python app that has
> been wrapped with py2exe and is deployed on Windows as a standalone
> using one of the standard installer tools? (MSI, NSIS, Inno Setup,
> etc.) I'm working on a Tkinter app for Windows and hav
On 2:59 PM, Kevin Walzer wrote:
> Can anyone point me in the direction of a Tkinter/Python app that has
> been wrapped with py2exe and is deployed on Windows as a standalone
> using one of the standard installer tools? (MSI, NSIS, Inno Setup,
> etc.) I'm working on a Tkinter app for Windows and hav
On Jul 25, 1:52 pm, TonyO wrote:
>> return |
>
> In the words of René Magritte,
>
> return |
> ^
> Ceci n'est pas une pipe.
*golf clap*
--
http://mail.python.org/mailman/listinfo/python-list
> Still I dont get how I am supposed to understand the pipe and its task/
> idea/influece on control flow, of:
> return |
In the words of René Magritte,
return |
^
Ceci n'est pas une pipe.
--
http://mail.python.org/mailman/listinfo/python-list
Saul Spatz wrote:
> That doesn't work, I'm being stupid, The user might type anywhere in the
> string, not just at the end. I need
>
> return all([c in '1234567890abcdefABCDEF ' for c in after])
Ah, you found out already. Here's what I've come up with in the meantime.
I also changed the comman
Am 25.07.2011 14:00, schrieb Archard Lias:
> def flags(self, index):
> if not index.isValid():
> return Qt.ItemIsEnabled
>
> return super(self.__class__, self).flags(index) |
Your use of super() is incorrect and will not work as you might expect.
You *must* use the class here, nev
That doesn't work, I'm being stupid, The user might type anywhere in the
string, not just at the end. I need
return all([c in '1234567890abcdefABCDEF ' for c in after])
--
http://mail.python.org/mailman/listinfo/python-list
On 07/26/11 12:00 AM, Archard Lias wrote:
Hi,
Still I dont get how I am supposed to understand the pipe and its task/
idea/influece on control flow, of:
return |
??
It's simply a bitwise OR.
--
Ian Collins
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
I have come across something I don't really understand and would be
grateful if someone could shed some light into my understanding of it.
In the documentation of the Qt4 libs in the page regarding the
QAbstractTableModel you find, to make the table editable, the
following:
Qt::ItemFlags Str
Thanks so much, this is great. I want to validate that the user is entering a
string appropriate for bytes.fromhex. Here's how I modified your validate
funtion:
def validate(before, after):
print(before, "-->", after)
#return after.isdigit()
return after[-1] in '1234567890abcdefABC
On 2011-07-24, Ben Finney wrote:
> Code is also more densely expressive and provides less
> redundancy in expression, and the reader is required to make
> much finer scrutiny of it than of natural language text.
The best writing is less redundant than a line of code, not more.
But most people don
Infact the first thing I ever did with documentation on Python was to
download it.
yes you are not uptodate but you can always do a download once in a
while rather than putting load on the server every time you want to
lookup a function reference.
Happy hacking.
Krishnakant.
On 25/07/11 14:3
The UK's official Python conference returns. It is aimed at everyone
in the Python community, of all skill levels, from beginners to core
developers.
The conference will be held on the 24th to 25th September 2011, in the
TechnoCentre Coventry (CV1 2TT).
The conference is not-for-profit and commun
On 22/07/2011 03:55, SANKAR . wrote:
Hi all,
C:\Python26\dist>DELchek.exe
Traceback (most recent call last):
File "DELchek.py", line 12, in
File "reportlab\pdfgen\canvas.pyc", line 25, in<
File "reportlab\pdfbase\pdfdoc.pyc", line 22, in
File "reportlab\pdfbase\pdfmetrics.pyc", line
not sure if this is the right list for this, but it's a starting
point. i'm using a wind river linux development environment to build
a full system for a powerpc board, and that includes cross-compiling
python-2.5.1 for ppc. the compile fails thusly:
powerpc-wrs-linux-gnu-ppc_e500v2-glibc_std
On Mon, 25 Jul 2011 10:07 am Billy Mays wrote:
> On 7/24/2011 2:27 PM, SigmundV wrote:
>> list_of_integers = map(string_to_int, list_of_strings)
>>
>> Of course, this will be horribly slow if you have thousands of
>> strings. In such a case you should use an iterator (assuming you use
>> python 2
Carl Banks wrote:
> If you can't live without the docs, you should consider downloading them and
> accessing them locally. That'll let you work whenever python.org goes down,
> and will help keep the load off the server when it's up.
Thanks for the pointer, i did not realize that until now... T
Am 25.07.11 02:11, schrieb Saul Spatz:
> In tcl/tk an Entry widget can be set to validate its contents with the
> validate option. You have to give it a validatecommand (vcmd), which is a
> tcl script that runs when some action triggers validation. Usually, the
> script would use "percent subs
Chris Angelico wrote:
> On Sun, Jul 24, 2011 at 10:33 AM, goldtech wrote:
>>
>> I'm using using Idle on winXP, activestate 2.7. Is there a way to
>> suppress this and just show 174 in the shell ?
>> A script reading data and assigns 174 to n via some regex. Links on
>> this appreciated - I've tri
On Sunday, July 24, 2011 11:42:45 AM UTC-7, David Zerrenner wrote:
> *pew* I can't live without the docs, that really made my day now.
If you can't live without the docs, you should consider downloading them and
accessing them locally. That'll let you work whenever python.org goes down,
and wil
Saul Spatz wrote:
> In tcl/tk an Entry widget can be set to validate its contents with the
> validate option. You have to give it a validatecommand (vcmd), which is a
> tcl script that runs when some action triggers validation. Usually, the
> script would use "percent substitutions" so the scrip
73 matches
Mail list logo