In message , Steve
Holden wrote:
> I was somewhat surprised to discover that Python 3 no longer allows an
> exception to be raised in an except clause (or rather that it reports it
> as a separate exception that occurred during the handling of the first).
So what exactly is the problem? Exceptio
On 10/24/2010 1:26 AM, Chris Rebert wrote:
>> I was somewhat surprised to discover that Python 3 no longer allows an
>> > exception to be raised in an except clause (or rather that it reports it
>> > as a separate exception that occurred during the handling of the first).
>
[snip]
>> > What
>> > i
In article
,
Steve Howe wrote:
> The whole point is, is not supposed to be a set; a set literal would
> end with "})". As you can see, there is no such construct in the
> string.
> It's just a dict inside parentheses. Somehow, the parser seems to
> think it's a set.
>>> type({'', 1})
>>> type(
Geremy and the parser are correct - it *is* a set. It would only be a
dict if you changed the comma to a colon.
regards
Steve
On 10/24/2010 1:31 AM, Steve Howe wrote:
> Hello Geremy,
>
> The whole point is, is not supposed to be a set; a set literal would
> end with "})". As you can see, there
Ok, forget, I found the problem: bad sleeping.
Thanks.
--
Howe
howest...@gmail.com
On Sun, Oct 24, 2010 at 3:31 AM, Steve Howe wrote:
> Hello Geremy,
>
> The whole point is, is not supposed to be a set; a set literal would
> end with "})". As you can see, there is no such construct in the
> st
Hello Geremy,
The whole point is, is not supposed to be a set; a set literal would
end with "})". As you can see, there is no such construct in the
string.
It's just a dict inside parentheses. Somehow, the parser seems to
think it's a set.
--
Howe
howest...@gmail.com
On Sun, Oct 24, 2010 at 2:
On Sat, Oct 23, 2010 at 10:01 PM, Steve Holden wrote:
> I was somewhat surprised to discover that Python 3 no longer allows an
> exception to be raised in an except clause (or rather that it reports it
> as a separate exception that occurred during the handling of the first).
> Give the traceback
thanks, but this doesn't solve the problem, because I need to use the
numpad as a cursor, not to enter numbers.
cheers,
Alex
On 24 окт, 16:44, rantingrick wrote:
> On Oct 23, 7:41 pm, Jah_Alarm wrote:
>
> > here's my problem: I'm running IDLE in Ubuntu. For some reason numpad
> > buttons do no
I was somewhat surprised to discover that Python 3 no longer allows an
exception to be raised in an except clause (or rather that it reports it
as a separate exception that occurred during the handling of the first).
So the following code:
>>> d = {}
>>> try:
... val = d['nosuch']
... except:
On Sat, Oct 23, 2010 at 9:40 PM, Steve Howe wrote:
> Hello,
>
> This looks like a parser bug, but it's so basic I'm in doubt. Can
> anyone confirm ?
>
import sys
sys.version
> '2.7.0+ (r27:82500, Sep 15 2010, 18:14:55) \n[GCC 4.4.5]'
({'', 1}.items())
> Traceback (most recent call l
On Sun, Oct 24, 2010 at 12:40 AM, Steve Howe wrote:
> Hello,
>
> This looks like a parser bug, but it's so basic I'm in doubt. Can
> anyone confirm ?
>
import sys
sys.version
> '2.7.0+ (r27:82500, Sep 15 2010, 18:14:55) \n[GCC 4.4.5]'
({'', 1}.items())
> Traceback (most recent call
Hello,
This looks like a parser bug, but it's so basic I'm in doubt. Can
anyone confirm ?
>>> import sys
>>> sys.version
'2.7.0+ (r27:82500, Sep 15 2010, 18:14:55) \n[GCC 4.4.5]'
>>> ({'', 1}.items())
Traceback (most recent call last):
File "", line 1, in
AttributeError: 'set' object has no at
CLICK on the IMAGE below the SEARCH BOX for the FORMhttp://moneymaking.en.st
--
http://mail.python.org/mailman/listinfo/python-list
On 24 окт, 16:44, rantingrick wrote:
> On Oct 23, 7:41 pm, Jah_Alarm wrote:
>
> > here's my problem: I'm running IDLE in Ubuntu. For some reason numpad
> > buttons do not work. I'm kinda used to this layout. Doesn anyone have
> > an idea on how to switch it on?
>
> Sure, look directly above the n
Felipe Bastos Nunes wrote:
>
>Hi! I was looking for a good decorator library to study and make my
>own decorators. I've read the Bruce Eckel's blog at artima dot com.
>But I need some more examples. I'm building a WSN simulator like SHOX
>is in java, but programming it in python. I'd like to use d
Baba wrote:
>
>i need a hint regarding the following exercise question:
>
>"Write a program that generates all Pythagorean triples whose small
>sides are no larger than n.
>Try it with n <= 200."
>
>what is "n" ? i am guessing that it is a way to give a bound to the
>triples to be returned but i c
On Oct 23, 7:41 pm, Jah_Alarm wrote:
> here's my problem: I'm running IDLE in Ubuntu. For some reason numpad
> buttons do not work. I'm kinda used to this layout. Doesn anyone have
> an idea on how to switch it on?
Sure, look directly above the number pad and you will see a button
labeled "NumLoc
In message
<0af3e9b1-8d3d-4efd-99d6-ca033204e...@n26g2000yqh.googlegroups.com>, Devon
wrote:
> I have heard about Beautiful Soup but never used it.
BeautifulSoup is intended for HTML parsing. It is, or was, particularly good
at dealing with badly-formed HTML, as commonly found on lots of websit
In message
, Dave Angel wrote:
> Presumably the original pythonw.exe was called that because it's marked
> as a windows-app. In win-speak, that means it has a gui. Applications
> that are not so-marked are console-apps, and get a console created if
> they weren't already started from one. That's w
hi,
here's my problem: I'm running IDLE in Ubuntu. For some reason numpad
buttons do not work. I'm kinda used to this layout. Doesn anyone have
an idea on how to switch it on?
cheers,
Alex
--
http://mail.python.org/mailman/listinfo/python-list
Jonathan Hartley wrote:
One common way to store delayed actions is as a lambda (an anonymous
function.)
Although note that you don't have to use 'lambda' in
particular -- functions defined with 'def' can be used
the same way.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
On Sat, Oct 23, 2010 at 4:40 PM, Devon wrote:
> I must quickly and efficiently parse some data contained in multiple
> XML files in order to perform some learning algorithms on the data.
> Info:
>
> I have thousands of files, each file corresponds to a single song.
> Each XML file contains informa
I must quickly and efficiently parse some data contained in multiple
XML files in order to perform some learning algorithms on the data.
Info:
I have thousands of files, each file corresponds to a single song.
Each XML file contains information extracted from the song (called
features). Examples i
Hello All,
I know this is pretty easy to do, but I was not able to to do it because I
am new to GUI and Python. I am using grid to manager my layout and I would
like to add background image to one of my cells (say row=1 column=3), I
intend to have a label (text ) written on top of the image. For
On Thu, Oct 21, 2010 at 7:25 PM, Joe Shoulak wrote:
> I'm trying to make a sports simulation program and so far everything has
> worked until I try entering:
>
> Score1 = (Team1Off + Team2Def)/2
>
> I get the error:
>
> TypeError: unsupported operand type(s) for /: 'str' and 'int'
>
> Can someone
2010/10/22 Joe Shoulak :
> I'm trying to make a sports simulation program and so far everything has
> worked until I try entering:
>
> Score1 = (Team1Off + Team2Def)/2
>
> I get the error:
>
> TypeError: unsupported operand type(s) for /: 'str' and 'int'
>
> Can someone please explain to me what th
On Thu, Oct 21, 2010 at 7:25 PM, Joe Shoulak wrote:
> I'm trying to make a sports simulation program and so far everything has
> worked until I try entering:
>
> Score1 = (Team1Off + Team2Def)/2
>
> I get the error:
>
> TypeError: unsupported operand type(s) for /: 'str' and 'int'
>
> Can someone
On Wed, Oct 20, 2010 at 3:27 PM, Sebastian
wrote:
> Hi,
> Is there a simpler way to yield all elements of a sequence than this?
> for x in xs:
> yield x
Not presently. There's a related PEP under discussion though:
PEP 380: Syntax for Delegating to a Subgenerator
http://www.python.org/dev/peps
On Wed, Oct 20, 2010 at 11:28 AM, Guy Doune wrote:
> Hello,
> I would get :
> db.table.field1, db.table.field2, etc.
> Inside a python instruction :
> db().select(HERE)
> It is web2py query actually.
>
> But I can't do this :
> db().select(
> for f in db['table'].fields:
> if f not in fieldsBl
I'm trying to make a sports simulation program and so far everything has worked
until I try entering:
Score1 = (Team1Off + Team2Def)/2
I get the error:
TypeError: unsupported operand type(s) for /: 'str' and 'int'
Can someone please explain to me what this means, why it doesn't work and what
Does anyone have any example with perforce integrate command? Please
help
—Code Snippet—
import P4
##set p4.port, p4.client
p4c = P4.P4()
p4c.connect()
view = “//depot/meta/project/frombranch/...//depot/meta/project/
tobranch/..."
p4c.run(“integ –n”,view)
—Getting—
return P4API.P4Adapter.run(
Hi,
Is there a simpler way to yield all elements of a sequence than this?
for x in xs:
yield x
I tried googling but fond only the other direction (turning a generator
into a list with "list(my_generator())".
Sebastian
--
http://mail.python.org/mailman/listinfo/python-list
Hello,
I would get :
db.table.field1, db.table.field2, etc.
Inside a python instruction :
db().select(HERE)
It is web2py query actually.
But I can't do this :
db().select(for f in db['table'].fields: if f not in fieldsBlackList:
db['table'][f],)
Any idea?
--
http://mail.python.
Emile van Sebille writes:
> On 10/23/2010 11:51 AM Arnaud Delobelle said...
>>
>> Can you change the value of a.x?
>>
>> (Hint: my shortest solution is of the form A.*.*[*].*[*].x = 3)
>
> A.x,a.x = a.x,3
I knew that was going to come next! That'll teach me not to specify the
problem precisely
On 10/23/2010 11:51 AM Arnaud Delobelle said...
Can you change the value of a.x?
(Hint: my shortest solution is of the form A.*.*[*].*[*].x = 3)
A.x,a.x = a.x,3
--
http://mail.python.org/mailman/listinfo/python-list
On 10/23/2010 3:34 AM, Lawrence D'Oliveiro wrote:
In message<8idui6f21...@mid.individual.net>, Peter Pearson wrote:
Is it important to let "a" range all the way up to b, instead of
stopping at b-1? (tongue in cheek)
Makes no difference. :)
The difference is that before one writes the restri
Emile van Sebille writes:
> On 10/23/2010 11:51 AM Arnaud Delobelle said...
>>
>> Just to challenge you a bit, here is another (doomed) attempt at having
>> private attributes for object instances:
[...]
> I'm obviously missing something:
>
> ActivePython 2.6.1.1 (ActiveState Software Inc.) based
On 10/23/2010 11:51 AM Arnaud Delobelle said...
Just to challenge you a bit, here is another (doomed) attempt at having
private attributes for object instances:
def private_maker():
class Private: pass
privmap = {}
def private(f):
def wrapper(self, *args, **kwargs):
The FORM is in the IMAGE below the SEARCH BOX...CLICK on the
IMAGE for the FORM of TRANSFERhttp://moneymaking.en.st
--
http://mail.python.org/mailman/listinfo/python-list
dmytro starosud writes:
>
> I think I'm being realized that Python allows to do everything.
> Maybe I will not try to find "really hidden encapsulation". :)
I think it's a wise decision :)
Just to challenge you a bit, here is another (doomed) attempt at having
private attributes for object inst
On 2010-10-23 01:50:53 -0700, Peter Otten said:
TomF wrote:
I have a program that manipulates lots of very large indices, which I
implement as bit vectors (via the bitarray module). These are too
large to keep all of them in memory so I have to come up with a way to
cache and load them from
Am 07.10.2010 23:20, schrieb MRAB:
> On 07/10/2010 20:12, jay thompson wrote:
>> I'm not sure if it is limited to 32 bit addresses or if it's only
>> re.start() that is limited to 'em.
>>
>> jt
>>
> From what I can tell, Microsoft compilers (I'm assuming you're using
> Windows) have a 32-bit 'int'
This is first PYBAG announce on comp.lang.python.
PYBAG implements a portable bag and is intended for fast
synchronization and backup. It lets you use a portable digital storage
device to carry your electronic documents similar to the way you can
use a bag to carry paper documents. You can synchro
On Oct 23, 8:01 am, Peter Otten <__pete...@web.de> wrote:
> You may be better off with __getattr__().
Ayup, thanks. (Maybe I should have googled for "python equivalent of
ruby method_missing", hmm?;)
--
http://mail.python.org/mailman/listinfo/python-list
Thanks Felipe , sure i will search for that..
Bests,
n.a.s
On Sat, Oct 23, 2010 at 7:11 PM, Felipe Bastos Nunes <
felipe.bast...@gmail.com> wrote:
> Theres the time module and the timeit() function to evaluate time to
> execute. For memory usage and cpu usage i can't remember exactly. I
> read t
Is there anything that does for Mathematica what matplotlib does
for MATLAB?
matplotlib, even in its underlying so-called "OO mode", follows
MATLAB's graphics model, which, in my very subjective opinion, is
vastly inferior to Mathematica's.
The latter allows for a clean separation between the t
Okay found the instruction to build the project on the site
http://www.gnu.org/software/pythonwebkit/
Not sure how to apply the patch. I already have an installation of
pythonwebkit. Should I uninstall it, download the source from
http://code.google.com/p/pywebkitgtk and then apply the patch.
I'v
Theres the time module and the timeit() function to evaluate time to
execute. For memory usage and cpu usage i can't remember exactly. I
read the profile and cprofile documentation, and, in my opinion, help
in somethings you wanna do.
2010/10/23, n.a.s :
> Hi all,
> I use to program in many langua
On Oct 22, 10:48 pm, Steven D'Aprano wrote:
> On Fri, 22 Oct 2010 22:03:38 -0700, Sean DiZazzo wrote:
> > How can I assure him (and the client) that the transfer completed
> > successfully like my log shows?
>
> "It has worked well for many years, there are no reported bugs in the ftp
> code
> [..
Steven D'Aprano writes:
> Well, what is the definition of pi? Is it:
>
> the ratio of the circumference of a circle to twice its radius;
> the ratio of the area of a circle to the square of its radius;
> 4*arctan(1);
> the complex logarithm of -1 divided by the negative of the complex square
> r
Thanks for that info, Ned, I can now get the sys.argv[] list I need,
that's a big help! However, is there any other way to set a breakpoint
in idle that will work on Mac OS X, maybe entering a manual command
somewhere with a specified line number? Inability to set a breakpoint
is an absolute showst
Hi all,
I use to program in many languages ,currently i 'm working in python ,i
wonder if their is any way-program to measure my code , for example memory
usage , cpu speed - because of the ability to write one program in many ways
, how i can evaluate my code?
Many thanks,
n.a.s
--
http://mail.p
Hrvoje Niksic wrote:
> The documentation of the mro() method on the class object says:
>
> class.mro()
> This method can be overridden by a metaclass to customize the method
> resolution order for its instances. It is called at class
> instantiation, and its result is stored in __mro_
==Get an Internship in the United States ==
Internships are practical experiences that bridge the gap between the
educational world and the real world allowing students to understand
what is really like to work in the industry of their choice.
International internships offer much more than the usu
Phlip wrote:
> Pythonistas:
>
> Here's the property decorator:
>
>@property
>def foo(self): return 'bar'
>
> If I generate foo dynamically, how to I make it a property?
>
> setattr(self, 'foo', property(lambda: 'bar'))
>
> Variations of that are apparently not working.
You have to
Pythonistas:
Here's the property decorator:
@property
def foo(self): return 'bar'
If I generate foo dynamically, how to I make it a property?
setattr(self, 'foo', property(lambda: 'bar'))
Variations of that are apparently not working.
(I'm heading for a proxy pattern, where if you ne
On Oct 22, 10:42 pm, Felipe Bastos Nunes
wrote:
> Hi! I was looking for a good decorator library to study and make my
> own decorators. I've read the Bruce Eckel's blog at artima dot com.
> But I need some more examples. I'm building a WSN simulator like SHOX
> is in java, but programming it in py
On 2:59 PM, Lawrence D'Oliveiro wrote:
In message, Tim Golden
wrote:
If you were to rename the .py to a .pyw it would run without a console
window showing up.
Presumably the “w” stands for “window”. Wouldn’t it be less confusing if it
was the other way round?
Presumably the original pythonw
Hi all,
I have just released Shed Skin 0.6, an optimizing (restricted-)Python-to-C++
compiler. Most importantly, this release comes with a substantial
scalability improvement. It should now be possible to compile programs into
several thousands of lines, as shown by the new Commodore 64 emulator
e
The documentation of the mro() method on the class object says:
class.mro()
This method can be overridden by a metaclass to customize the method
resolution order for its instances. It is called at class instantiation,
and its result is stored in __mro__.
Am I interpreting it correctly
In message , Chris
Rebert wrote:
> On Sat, Oct 23, 2010 at 12:32 AM, Lawrence D'Oliveiro
> wrote:
>
>> In message , Tim
>> Golden wrote:
>>
>>> If you were to rename the .py to a .pyw it would run without a console
>>> window showing up.
>>
>> Presumably the “w” stands for “window”.
>
> Why not
Hello,
On Thu, Oct 21, 2010 at 12:26:50PM +, Steven
D'Aprano wrote:
> I know what you're thinking: "it's easy to cache
> the next result, and return it on the next
> call". But iterators can also be dependent on
> the time that they are called, like in this
> example:
>
> def evening_time():
:-0
very interesting!
I've tried to run something like this:
.
class en_property(property):
ptr_pget = None
ptr_pset = None
def pset(self, _class, value):
if (self.ptr_pset is None or type(value) == tuple):
TomF wrote:
> I have a program that manipulates lots of very large indices, which I
> implement as bit vectors (via the bitarray module). These are too
> large to keep all of them in memory so I have to come up with a way to
> cache and load them from disk as necessary. I've been reading about
On Sat, Oct 23, 2010 at 12:32 AM, Lawrence D'Oliveiro
wrote:
> In message , Tim Golden
> wrote:
>
>> If you were to rename the .py to a .pyw it would run without a console
>> window showing up.
>
> Presumably the “w” stands for “window”.
Why not "windowless"?
- Chris
--
http://mail.python.org/m
In message <8idui6f21...@mid.individual.net>, Peter Pearson wrote:
> Is it important to let "a" range all the way up to b, instead of
> stopping at b-1? (tongue in cheek)
Makes no difference. :)
--
http://mail.python.org/mailman/listinfo/python-list
In message , Tim Golden
wrote:
> If you were to rename the .py to a .pyw it would run without a console
> window showing up.
Presumably the “w” stands for “window”. Wouldn’t it be less confusing if it
was the other way round?
--
http://mail.python.org/mailman/listinfo/python-list
67 matches
Mail list logo