On Mon, May 23, 2011 at 4:33 PM, Steven D'Aprano
wrote:
> And presumably anyone who has played around with GUI programming in
> Python will have run into message oriented coding.
>
GUI code almost always involves a main loop somewhere that consists of:
while not time_to_terminate:
get_message()
On Mon, May 23, 2011 at 4:46 PM, Carl Banks wrote:
> On Sunday, May 22, 2011 12:44:18 AM UTC-7, Octavian Rasnita wrote:
>> If Python would be so great, you wouldn't talk so much about how bad are
>> other languages,
>
> Sure we would. Sometimes it's fun to sit on your lofty throne and scoff at
>
On May 23, 4:29 am, Deeyana wrote:
>
> You might be interested in Clojure, then. Lists are more abstracted, like
> in Scheme, and vectors and also dictionaries/maps and sets are first
> class citizens along side lists. And unlike Scheme, Clojure has good
> library/host interop support. You can wri
On Mon, May 23, 2011 at 5:06 PM, Octavian Rasnita wrote:
> There are more, but a single eloquent feature is the possibility of
> interpreting variables in strings which cannot be done so nice in Python.
I've should probably mentioned it earlier, but I'm not Perl expert,
not following its developm
On 21/05/2011 16:56, vijay swaminathan wrote:
I'm having some problem in using the communicate() along with the
subprocess.I would like to invoke a command prompt and pass on a .bat
file to execute. I went through the subprocess module and understood
that using communicate, we can send the send
Hi,
I'm going to skip the Perl vs. Python flame-bait and correct your one statement.
On Sun, May 22, 2011 at 7:44 AM, Octavian Rasnita wrote:
> Somebody told that C# and Objective C are good languages. They might be good,
> but they are proprietary, and not only that they are proprietary, but t
ANNOUNCING
eGenix.com mx Base Distribution
Version 3.2.0 for Python 2.4 - 2.7
Open Source Python extensions providing
important and useful services
From: "Terry Reedy"
On 5/23/2011 1:31 AM, Octavian Rasnita wrote:
I am talking about a simple way of creating a hash/dict from an array,
which is so simple that there should be really a single way to do it, or
very few.
Again, Python has such:
>>> dict([['one',1],['two', 2]])
{'two': 2, 'o
From: "Chris Angelico"
On Mon, May 23, 2011 at 3:31 PM, Octavian Rasnita
wrote:
From: "Dennis Lee Bieber"
Since indentation seems so crucial to easy comprehension of the logical
structure of a program,
making it a mandatory syntactical structure becomes a desirable feature
for code that mus
From: "Daniel Kluev"
On Mon, May 23, 2011 at 5:06 PM, Octavian Rasnita
wrote:
There are more, but a single eloquent feature is the possibility of
interpreting variables in strings which cannot be done so nice in Python.
I've should probably mentioned it earlier, but I'm not Perl expert,
not
On Mon, May 23, 2011 at 7:49 PM, Octavian Rasnita wrote:
> That is not an array, but a list. An array has a name and we can't do
> something like the following simple statement in Python:
>
> l = (1, 2)
> d = dict(l)
> An array has a name
What?
In python there is no difference whether your object
On Mon, 2011-05-23 at 10:32 +1000, Chris Angelico wrote:
> On Mon, May 23, 2011 at 7:06 AM, John Ladasky wrote:
> > If I spawn N worker sub-processes, my application in fact has N+1
> > processes in all, because there's also the master process itself.
> > I'd still appreciate hearing from anyone e
On Mon, May 23, 2011 at 8:41 PM, Octavian Rasnita wrote:
> From: "Daniel Kluev"
> As I said, that ORM is not able to do those SQL constructs without using
> literal SQL code, but only Python variables and data structures...
> An ORM is usually prefered exactly because it doesn't force the program
Does python have an equivalent of the java Timezone object?
I need to be able to get offsets for timezones (only U.S. time zones
at the moment)
--
http://mail.python.org/mailman/listinfo/python-list
On 2011-05-22 23:23, Terry Reedy wrote:
On 5/22/2011 2:34 PM, Patrick Sabin wrote:
I wanted to register my project (epdb) in pypi. Unfortunately there
already exists a project with the same name. It is not possible for me
to change the name of the project, because I used it in multiple
writings.
On 21/05/2011 16:49, John J Lee wrote:
I still like Python after using it for over a decade, but there are
things I don't like.
..
a relatively new one that's going about is cobra, http://cobra-language.com/, it
appears to have some of the features you indicate eg speed, some kind of
int
On Mon, May 23, 2011 at 9:32 PM, loial wrote:
> Does python have an equivalent of the java Timezone object?
>
> I need to be able to get offsets for timezones (only U.S. time zones
> at the moment)
Depends on what exactly do you want. If you need to convert timezone
name into current offset, you
Hi all
I'm a little confused about the corner cases of Condition.wait() with a timeout
parameter in the threading module.
When looking at the code the first thing that I don't quite get is that the
timeout should never work as far as I understand it. .wait() always needs to
return while holdi
GMail Felipe wrote:
> For the "ps" command, have you seen the psuti module?
>
> The link to it is: http://code.google.com/p/psutil/
You gave a brand new start :)
I bit of additional program to include into the package ;)
--
goto /dev/null
--
http://mail.python.org/mailman/listinfo/python-lis
From: "Daniel Kluev"
...
Can it also set the current locale, for example romanian, and print the
name of the current month?
...something like t1.date.set_locale('ro').month_name?
There is separate module for date localization. You can pass datetime
object to it and it will give you needed val
Octavian Rasnita wrote:
> Somebody told that C# and Objective C are good languages. They might be
> good, but they are proprietary, and not only that they are proprietary,
> but they need to be ran under platforms that cannot be used freely, so
> from the freedom point of view, Perl, Ruby, Python a
Ulrich Eckhardt wrote:
> Ahem, is this Java the language that a certain, well-known service
> provider is getting screwed over hard currently, because they forgot
> to read the fineprint in the declaration of freedom?
That would be the case where the plaintiff has been ordered to drop all but
3
On Mon, May 23, 2011 at 10:17 PM, Octavian Rasnita wrote:
> From: "Daniel Kluev"
> Aha, so with other words that ORM doesn't have that feature.
> DBIX::Class also use the DateTime module, but it can use it directly,
> without needing to write more code for that, and it can also return
> localized
Thanks...but being a python newbie I am struggling to understand how
to do this.
How can I use tzinfo to do the equivalent of what I do in Java, which
is :
TimeZone tz1 = TimeZone.getDefault();
long localOffset = tz1.getOffset(date.getTime());
TimeZone tz2 = TimeZone.getTimeZone("E
On 22-May-11 15:23 PM, Stef Mientki wrote:
hello,
must of us will not use single bits these days,
but at first sight, this looks funny :
a=2
b=6
a and b
6
a& b
2
a or b
2
a | b
6
cheers,
Stef
5.2. Boolean Operations — and, or, not
These are the Boolean operations, ordered by ascendi
On Mon, May 23, 2011 at 10:56 PM, loial wrote:
> Thanks...but being a python newbie I am struggling to understand how
> to do this.
>
> How can I use tzinfo to do the equivalent of what I do in Java, which
> is :
>
>TimeZone tz1 = TimeZone.getDefault();
>
>long localOffset = tz1.getOffset
I switched from Mark Hammonds pywin32 extensions for file choosers as the
multiselect there seems to crash on me when selecting more than a few dozen.
Using Tk now. Works well but the resulting string passed back seems to
'decorated' when the files are on local disk and not decorated when
retri
> [1] http://pypi.python.org/pypi/PosixTimeZone/0.9.4
> [2] http://pypi.python.org/pypi/pytz/2011g
> [3] http://docs.python.org/library/datetime.html#tzinfo-objects
Also
http://labix.org/python-dateutil#head-587bd3efc48f897f55c179abc520a34330ee0a62
HTH
--
Miki Tebeka
http://pythonwise.blogspot.c
torb...@diku.dk (Torben Ægidius Mogensen) writes:
> Xah Lee writes:
>
>
>> Functional Programing: stop using recursion, cons. Use map & vectors.
>>
>> 〈Guy Steele on Parallel Programing〉
>> http://xahlee.org/comp/Guy_Steele_parallel_computing.html
>
> This is more or less what Backus said in his
[cc-ing back to the list; please keep the conversation over there...]
On 23/05/2011 13:11, vijay swaminathan wrote:
What I want to achieve is, I want to run a batch file on a command prompt.
The reason for using thread is not for running multiple scripts
simultaneously. It is just to monitor my
Chris Angelico writes:
> That said, though, I still do not believe in Python's philosophy of
> significant whitespace. I like to be able, if I choose, to put one
> entire "logical unit" on one line, such that it can be commented out
> with a single comment marker,
Use an editor that can with a
> > Hi I'm tryin to create a game but I have a question in how to save
> > (saveasfile) the value of a global variable.. and then load the same value
> > with openfile.
> > Also for example you have a main label and a botton on the left so when
> > you click the left bottom the label will chan
On May 23, 5:30 am, Steven D'Aprano wrote:
> On Sun, 22 May 2011 15:39:33 -0700, Tim Roberts wrote:
> > Stef Mientki wrote:
>
> >>must of us will not use single bits these days, but at first sight, this
> >>looks funny :
>
> > a=2
> > b=6
> > a and b
> >>6
> > a & b
> >>2
> >
If I start turtle from idle, and issue commands from there, there are
all kinds of strange behaviors.
I cant pin down any properly but they all look like IO issues.
-- If the turtle window is hidden by the tkinter interpreter window,
none of what is drawn appears
-- If the turtle window is killed
On 23.5.2011 16:39, Pascal J. Bourguignon wrote:
torb...@diku.dk (Torben Ægidius Mogensen) writes:
Xah Lee writes:
Functional Programing: stop using recursion, cons. Use map& vectors.
〈Guy Steele on Parallel Programing〉
http://xahlee.org/comp/Guy_Steele_parallel_computing.html
This is m
In article
<5790ee23-37d1-4cdd-b88b-a63c2b627...@k15g2000pri.googlegroups.com>,
rusi wrote:
> If I start turtle from idle, and issue commands from there, there are
> all kinds of strange behaviors.
Have you tried starting IDLE with the "-n" switch?
http://docs.python.org/library/turtle.html
On 5/23/2011 4:49 AM, Octavian Rasnita wrote:
But let's remember from what this discussion started. This is not a
Python critique, because each language has its own ways.
I just wanted to show that the fact that "there is more than one way to
do it" in Perl and that "there is a single way" in Py
On Sun, May 22, 2011 at 8:48 PM, Shunichi Wakabayashi
wrote:
> One idea is using contextlib.nested(),
>
> from contextlib import nested
>
> with nested(*[open('list_%d.txt' % i, 'w') for i in range(LIST_LEN)]) as
> fobjlist:
> for i in range(1000):
> fobjlist[random.randrange(LIST_LEN)].write
In article
<94d1d127-b423-4bd4-853c-d92da9ac7...@glegroupsg2000goo.googlegroups.com>
Floris Bruynooghe wrote:
>I'm a little confused about the corner cases of Condition.wait() with a
>timeout parameter in the threading module.
>
>When looking at the code the first thing that I don't quite get is
I installed Python 3 By Downloading python3.2 bziped source tarball
and install it according to the README, Now How shall I uninstalled
python 3.2?
The README instructions are as below
Build Instructions
--
On Unix, Linux, BSD, OSX, and Cygwin:
./configure
make
make
You can use sizeof function,
>>> a=12234
>>> b=23456.8
>>> a.__sizeof__()
12
>>> b.__sizeof__()
16
So sizeof int is 12 bytes and float is 16 bytes
--
http://mail.python.org/mailman/listinfo/python-list
On 2011-05-20, Hans Georg Schaathun wrote:
>: It starts with the misconception (or should I say confusion?) between
>: performing a recursive job and using a recursive tool to do it. And then it
>: blazes off in these huge discusions about semantics to define a definition
>: of an abstraction
On 2011-05-20, Steven D'Aprano wrote:
> On Thu, 19 May 2011 22:13:14 -0700, rusi wrote:
>
>> [I agree with you Xah that recursion is a technical word that should not
>> be foisted onto lay users.]
>
> I think that is a patronizing remark that under-estimates the
> intelligence of lay people and o
From: "Terry Reedy"
> On 5/23/2011 4:49 AM, Octavian Rasnita wrote:
>
>> But let's remember from what this discussion started. This is not a
>> Python critique, because each language has its own ways.
>> I just wanted to show that the fact that "there is more than one way to
>> do it" in Perl and
On May 23, 2:50 am, Adam Tauno Williams
wrote:
> I develop an app that uses multiprocessing heavily. Remember that all
> these processes are processes - so you can use all the OS facilities
> regarding processes on them. This includes setting nice values,
> schedular options, CPU pinning, etc..
Hello,
I have checked another computer (WinXP, 32b) with Komodo Edit 6.1 and
ActiveState Python 3.2 - problem still occurs.
Have you received my email?
s.
--
http://mail.python.org/mailman/listinfo/python-list
On Mon, May 23, 2011 at 2:55 PM, kracekumar ramaraju
wrote:
> You can use sizeof function,
a=12234
b=23456.8
a.__sizeof__()
> 12
b.__sizeof__()
> 16
> So sizeof int is 12 bytes and float is 16 bytes
I'm not sure what you're trying to show here, but try the following in
Python
On Mon, 2011-05-23 at 12:51 -0700, John Ladasky wrote:
> On May 23, 2:50 am, Adam Tauno Williams
> wrote:
> > I develop an app that uses multiprocessing heavily. Remember that all
> > these processes are processes - so you can use all the OS facilities
> > regarding processes on them. This inclu
On Monday, 23 May 2011 17:32:19 UTC, Chris Torek wrote:
> In article
> <94d1d127-b423-4bd4...@glegroupsg2000goo.googlegroups.com>
> Floris Bruynooghe wrote:
> >I'm a little confused about the corner cases of Condition.wait() with a
> >timeout parameter in the threading module.
> >
> >When lookin
On 5/23/2011 2:55 PM, kracekumar ramaraju wrote:
You can use sizeof function,
Appears not to be in manuals, that I could find. As a special method, it
is intended to be called through sys.getsizeof.
a=12234
b=23456.8
a.__sizeof__()
12
b.__sizeof__()
16
So sizeof int is 12 bytes and float
On Mon, 23 May 2011 00:52:07 -0700, asandroq wrote:
> On May 23, 4:29 am, Deeyana wrote:
>>
>> You might be interested in Clojure, then. Lists are more abstracted,
>> like in Scheme, and vectors and also dictionaries/maps and sets are
>> first class citizens along side lists. And unlike Scheme, C
Hello,
would be gratefull for the explonation.
I did a simple test case:
def setUp(self):
self.testListNone = None
def testListSlicing(self):
self.assertRaises(TypeError, self.testListNone[:1])
and I am expecting test to pass, but I am getting exception:
Traceback (most recent call last):
On Tue, May 24, 2011 at 1:44 AM, Aleksander Pietkiewicz
wrote:
> Hello,
> I have googled your email address, I hope it is not a problem.
> Thank you for your help!
I figured you would get it from my post, but either way works! My
email address is fairly well known. Sorry for the delay in response
That was quick! Thanks Ian
On 23 May 2011 23:46, Ian Kelly wrote:
> On Mon, May 23, 2011 at 4:30 PM, Andrius wrote:
> > and I am expecting test to pass, but I am getting exception:
> > Traceback (most recent call last):
> >self.assertRaises(TypeError, self.testListNone[:1])
> > TypeError:
On Mon, May 23, 2011 at 4:30 PM, Andrius wrote:
> and I am expecting test to pass, but I am getting exception:
> Traceback (most recent call last):
> self.assertRaises(TypeError, self.testListNone[:1])
> TypeError: 'NoneType' object is unsubscriptable
>
> I thought that assertRaises will pass s
On Mon, 23 May 2011 11:55:08 -0700, kracekumar ramaraju wrote:
> You can use sizeof function,
Who are you talking to, and what question did they ask?
Please always quote enough of the post that you are replying to to
establish context.
a=12234
b=23456.8
a.__sizeof__()
> 12
Steven D'Aprano wrote:
On Mon, 23 May 2011 13:11:40 +1200, Gregory Ewing wrote:
...until you want to read someone *else's* code, that is.
The same might be said about Python, which supports procedural, OO and
functional styles out of the box.
But it only uses *one* syntax and core set of c
On Mon, 23 May 2011 20:56:03 +0200, Rikishi42 wrote:
> On 2011-05-20, Steven D'Aprano
> wrote:
>> On Thu, 19 May 2011 22:13:14 -0700, rusi wrote:
>>
>>> [I agree with you Xah that recursion is a technical word that should
>>> not be foisted onto lay users.]
>>
>> I think that is a patronizing rem
In article ,
Ian Kelly wrote:
> This would work:
>
> self.assertRaises(TypeError, lambda: self.testListNone[:1])
If you're using the version of unittest from python 2.7, there's an even
nicer way to write this:
with self.assertRaises(TypeError):
self.testListNone[:1]
--
http://mail.pyth
On May 23, 7:04 pm, Gregory Ewing wrote:
> Falcon seems to collect programming paradigms the way Perl
> collects language features, i.e. by just munging them all
> together and bending parts until they fit.
Not that i am picking on anyone here...
but...
Why is okay to rip apart Perl with jagged
En Mon, 23 May 2011 10:00:53 -0300, Alex van der Spek
escribió:
I switched from Mark Hammonds pywin32 extensions for file choosers as
the multiselect there seems to crash on me when selecting more than a
few dozen. Using Tk now. Works well but the resulting string passed back
seems to 'dec
From: "Daniel Kluev"
a = [1,2]
dict([a])
Yes, but
d = dict([a])
is not so nice as
$d = @a;
because it has exactly those numerous number of params and brackets which is
used as a reason for bashing Perl and an aditional "dict" word.
Octavian
--
http://mail.python.org/mailman/listinfo/pyth
On Mon, May 23, 2011 at 10:10 PM, Octavian Rasnita wrote:
> is not so nice as
>
> $d = @a;
It is 'not so nice' only in your perception. Python clearly defines
dict as container of (key, value) pairs, and therefore its constructor
expects such pairs. Adding unjustified arbitrary ways to guess such
On May 22, 4:32 pm, Chris Angelico wrote:
> On Mon, May 23, 2011 at 9:17 AM, Xah Lee wrote:
> > the context is this: In emacs directory manager (aka dired), when you
> > call dired-do-delete on a directory, emacs prompts, this way:
> > “Recursive delete of xx? (y or n)”
>
> But in order to make y
On Tue, May 24, 2011 at 2:20 PM, Xah Lee wrote:
> why don't you file a bug report? In GNU Emacs 23.2, it's under the
> Help menu. I suppose it's the same in other emacs distro.
>
Because I do not consider its behaviour to be errant. And I suspect
its main developers won't either. That's why I sug
"Octavian Rasnita" writes:
> From: "Daniel Kluev"
> a = [1,2]
> dict([a])
>
> Yes, but
>
> d = dict([a])
>
> is not so nice as
>
> $d = @a;
That will give you the number of elements in @a. What you (probably)
mean is %hash = @array;
--
John Bokma
On Apr 17, 7:13 pm, Wolfgang Keller wrote:
> > You can't run Python programs without a Python interpreter installed.
>
> Wrong.
>
> See e.g.http://www.portablepython.com/
In this case Python is still installed on the machine.
It may not be installled on the PC's hard disk but it is certainly
is
From: "Ulrich Eckhardt"
Ahem, is this Java the language that a certain, well-known service
provider
is getting screwed over hard currently, because they forgot to read the
fineprint in the declaration of freedom? And this Objective C, isn't this
the language that GCC had support for since befor
From: "Daniel Kluev"
On Mon, May 23, 2011 at 10:17 PM, Octavian Rasnita
wrote:
From: "Daniel Kluev"
Aha, so with other words that ORM doesn't have that feature.
DBIX::Class also use the DateTime module, but it can use it directly,
without needing to write more code for that, and it can also r
From: "Daniel Kluev"
Moreover, you are comparing apples to oranges here, and then
complaining that apples somehow turned out to be not oranges.
If we take python way of defining dicts and check it in perl, we find
that it is not supported, so obviously perl is non-intuitive and does
not support
Beliavsky, 20.05.2011 18:39:
I thought this essay on why one startup chose Python was interesting.
Since everyone seems to be hot flaming at their pet languages in this
thread, let me quickly say this:
Thanks for sharing the link.
Stefan
--
http://mail.python.org/mailman/listinfo/python-li
71 matches
Mail list logo