On Wed, Apr 22, 2009 at 9:33 PM, David Lyon wrote:
> Hi Steve,
>>> Why should the package developer dictacte which python version the
>>> package will run on ?
>>
>> Because they're the developer. Who else should decide what Python
>> versions to support?
> The developer shouldn't be making such d
2009/4/18 Filip Gruszczyński :
> Yep, I have heard a lot about test driven development. I am now
> programming a lot using DJango and I would like to use its test
> framework to try it. However, I have little experience with this (as
> most people I know). I also have no idea, how to apply this, wh
2009/4/3 Jeremiah Dodds :
>
>
> On Thu, Apr 2, 2009 at 9:02 PM, andrew cooke wrote:
>>
>> Echo wrote:
>> > 2009/4/2 Jeremiah Dodds
>> >
>> >> The one thing that makes me want to use git more than any other dvcs is
>> >> that you don't have to create a new directory for branches. This may be
>> >>
On Mon, Mar 2, 2009 at 6:56 PM, Maxim Khitrov wrote:
> - Show quoted text -
> On Mon, Mar 2, 2009 at 9:18 PM, William Heath wrote:
>> Hi All,
>> I am using py2exe to create a windows executable. I am curious if anyone
>> knows a way to automatically upgrade a py2exe windows executable while it i
On Sun, Mar 1, 2009 at 8:35 AM, The Dude wrote:
> Hello,
>
> Each invocation of py2exe creates an executable along with a number of
> other files which need to be distributed with it, including library.zip. I
> noticed that compiling different scripts creates different, and incompatible
> libr
On Mon, Dec 29, 2008 at 6:13 PM, R. Bernstein wrote:
> How do I DRY the following code?
>
> class C():
>
> def f1(self, arg1, arg2=None, globals=None, locals=None):
> ... unique stuff #1 ...
> ... some common stuff #1 ...
> ret = eval(args, globals, locals)
> ... more stuff #2
On Sun, Dec 21, 2008 at 11:41 AM, Gilles Ganault wrote:
> Hi
>
> I'd like to rewrite a Web 2.0 PHP application in Python with AJAX, and
> it seems like Django and Turbogears are the frameworks that have the
> most momentum.
>
> I'd like to use this opportunity to lower the load on servers, as the
On Sun, Dec 21, 2008 at 11:26 AM, r wrote:
> I noticed when i mentioned "self" nobody wants to touch that subject.
> There could be many reasons why...
>
> 0.) nobody but the 10 regulars i see here exists
> 1.) nobody cares(doubt it)
> 2.) nobody is brave enough to question it(maybe)
> 3.) most pe
On Sat, Dec 20, 2008 at 10:15 PM, r wrote:
> On Dec 20, 11:11 pm, walterbyrd wrote:
>> On Dec 20, 5:05 pm, Roy Smith
>>
>> > He got really hung up on the % syntax.
>>
>> I guess it's good to know that there is, at least, one person in the
>> world doesn't like the % formatting. As least the move
On Wed, Dec 10, 2008 at 11:57 AM, Benjamin Kaplan
<[EMAIL PROTECTED]> wrote:
>
>
> On Wed, Dec 10, 2008 at 12:22 PM, Patrick Mullen <[EMAIL PROTECTED]>
> wrote:
>>
>> I don't have a huge stake in this, but I wouldn't mind a change to
>> allow any
On Wed, Dec 10, 2008 at 6:57 AM, MRAB <[EMAIL PROTECTED]> wrote:
> Aaron Brady wrote:
>>
>> On Dec 9, 12:40 pm, MRAB <[EMAIL PROTECTED]> wrote:
>>>
>>> Aaron Brady wrote:
On Dec 9, 8:28 am, MRAB <[EMAIL PROTECTED]> wrote:
snip
>
> In some languages (I think Delphi is one of t
On Mon, Dec 8, 2008 at 12:55 PM, Arnaud Delobelle
<[EMAIL PROTECTED]> wrote:
> [EMAIL PROTECTED] writes:
>
>> class C:
>> def createfunc(self):
>> def self.func(arg):
>> return arg + 1
>>
>> Or, after the class definition is done, to extend it dynamically:
>>
>> def C.method
On Sun, Dec 7, 2008 at 4:43 PM, <[EMAIL PROTECTED]> wrote:
> Trying to decide which to get started with. Can anyone suggest some
> pros and cons to each of them?
>
> Would PyOpenGL be in the same camp as Pygame and pyglet? Do either of
> Pygame or pyglet make use of PyOpenGL behind the scenes?
> -
>> Daniel Fetchinson wrote:
>>> http://neopythonic.blogspot.com/2008/10/why-explicit-self-has-to-
> stay.html
>>>
>>> The proposal is to allow this:
>>>
>>> class C:
>>> def self.method( arg ):
>>> self.value = arg
>>> return self.value
>>>
>>> instead of this:
>>>
>>> class C:
On Fri, Nov 7, 2008 at 2:23 PM, RyanN <[EMAIL PROTECTED]> wrote:
>
> to do this I tried:
>
>def addCountry(self,country_name):
># create an instance of country
>exec(country_name + "= country('" + country_name + "')")
># Add this new instance of a country to a list
>
On Fri, Sep 26, 2008 at 1:11 PM, Bruno Desthuilliers
<[EMAIL PROTECTED]> wrote:
> Steven D'Aprano a écrit :
>>
>> On Fri, 26 Sep 2008 17:00:59 +0200, Bruno Desthuilliers wrote:
>>
>>> Patrick Mullen a écrit :
>>>>
>>>> Depending on
Depending on the scale of the website I am making, how much I care
about editing it in the future, and how much I just want to get
something up, I will occasionally use php. And I am a self confessed
php hater :) But it's generally the fastest way I know to get
something up. So even terrible lan
How about:
class A:
def add(self,x,y):
return x+y
class B(A):
pass
print B().add(1, 2)
This also works:
class A:
def add(self, x, y):
return x+y
class B:
pass
B.add = A.add.im_func
print B().add(1, 2)
--
http://mail.python.org/mailman/listinfo/python-list
On Wed, Jul 30, 2008 at 12:27 PM, Robert Dailey <[EMAIL PROTECTED]> wrote:
>
> Given the code samples above, is there any technical reason why this cannot
> be done? Thanks for the input guys, and thanks more over for keeping this
> easy-going.
>
> --
> http://mail.python.org/mailman/listinfo/pyth
On Wed, Jun 11, 2008 at 12:28 PM, Russ P. <[EMAIL PROTECTED]> wrote:
>
> If Desthuilliers doesn't like my suggestion, then fine. If no other
> Python programmer in the world likes it, then so be it. But do we
> really need to get personal about it? Python will not be ruined if it
> gets such a key
Hi Russ,
Here are just some pragmatic considerations. Personally I am against data
hiding, but I obviously won't convince you in that regard. There are some
pros and cons as with anything, and I feel the cons outweight the pros
(namely that users of code should be able to use how they want, even
"Well, "common" in Prolog, Smalltalk, Haskell, ML, and Erlang is hardly
common in general. I'll bet that Java and C/C++ are used more in North
Dakota than all those languages combined are used in the entire world."
I would say python has more in common with the mentioned family than with
the C or
Can we plez not try and ruin my fave language with a useless concept?
Strict data hiding is only necessary because textbooks say it is. Use
method attributes or some other hack if you really must (people won't know
it's there unless they look, and if they are looking, maybe they have a
reason?)
I
Yeah I would agree that a decent (a few steps below good in my book)
programmer should be able to have a decent handle on a new language, given
some acclimatization time of course. The amount of time this period lasts
varies on the language said programmer is learning, as well as the languages
he
I don't know if this will go through (my posts seem to have become blocked
lately), but I'll give it a shot anyhow.
You seem to be under a misconception that a python list is similar to a list
in say, Java or other languages that have a rigid idea of variables and
types. In python, a list is a li
Here is a quick, ugly way you can easily hide data, although persistent
clients can still bypass it. x.__dict__ is ugly, though not any uglier than
x.__Ugly__Internal__Variable__Do__Not__Set
Another option would be to use another structure, such as a dictionary or
list, and store variables in the
There are certainly situations where data hiding is useful and perhaps a
wanted feature, but there has to be at least one place where I can use what
I want when I want to with some high and mighty designer telling me what I
should and shouldn't access. One of the reasons they have data hiding in
s
Hi Erik,
As far as I know the only full web framework that works with a primarily
inline style is spyce, which is not currently under active development. I
used it for a while and it was the first python framework I used. I think
it's pretty good, if a little bit of an underdog.
That said, usin
I can see both sides of this argument, and I think TDD is great in some
cases and not so great in others. I have used it before, but don't use it
often, as the programs I write are very difficult to automatically test.
(Games, which many of the bugs have to do with whether an optimization
produces
Judging python's speed by how fast websites go is not going to work very
well. There are many things that can bog down the "speed" of loading a web
site, especially if you are judging speed by how long a page takes to load.
torontolife.com is loading extremely slow for me also. So is wikipedia.
M
In my experience, python is very pattern agnostic. You can do functional or
object oriented or procedural fairly easily, have deep or light object
trees, or even mix procedural style with some object oriented code if you
like. "There should be one way to do it" tends to not apply as much as some
Here's a quick dumb example, hope it helps:
def function1(a,b,c):
print a,b,c
def function2(x):
print x
def function3(y):
print y+3
def executeall(list):
print "setting up"
for function,args in list:
function(*args) #Calls the function passing in the arguments
mylist = [[f
Yeah I don't know much about locals or globals. I've never used them
before, just know they are there. But anyway, to illustrate what I meant by
the interesting behavior, here is the output (and sorry for it being so
long):
IDLE 2.6a2
>>> globals()
{'__builtins__': , '__name__': '__main__',
'__d
On Sat, May 10, 2008 at 3:57 PM, Grant Edwards <[EMAIL PROTECTED]> wrote:
> On a Linux system (and I presume on other Unixes), the kernel
> itself (if built with the proper options) knows know how start
> a "script" file that starts with the characters "#!". When the
> kernel is told to execute a
I had some very interesting results with this code to do what is asked:
for key in globals().keys():
del globals()[key]
for key in locals().keys():
del locals()[key]
It might be better to reverse the two steps, I didn't give it much thought.
Anyway, when this is done, all of the builtins
There is also the python tutor list:
http://mail.python.org/mailman/listinfo/tutor
Which is more geared toward beginners. Although I am subscribed to both
lists, and they are both matched by the same filter for me so I wont know
the difference... But there may be people who are not subscribed t
The K_a is a constant integer, but you don't need to worry about it's
value. It tells you the index in get_pressed() to check for. So:
print pygame.key.get_pressed()[pygame.K_a]
Says, look at the 97th index in the get_pressed() list and see if that is a
1 or a 0.
Or if you use the pygame event
YAML is a joke if you expect a windows user to be able to hand edit the
data. Windows users typically expect a .ini file in the application's
directory. (Usually not the users home directory, even if that may be a
better location). XML is ok, but .ini is much preferred.
If you have a configurat
On Mon, Apr 21, 2008 at 1:49 PM, Jorgen Grahn <[EMAIL PROTECTED]> wrote:
> OP: keep in mind that your users do not see any gain from you using
> 2.5. All they see is something that makes your software harder to
> install. At some point you can dismiss them as living in the Stone Age,
> but the
On Fri, Apr 18, 2008 at 4:29 PM, globalrev <[EMAIL PROTECTED]> wrote:
> type "python setup.py install"
>
> that is used in most "addons" for python.
>
> well using windows vista, where the h*** am i supposed to type this?
>
> if it is not doable in windows, what do i have to do instead? just
>
It's dangerously close to april fools for this kind of posting!
Congrats on the release, it looks mighty impressive.
--
http://mail.python.org/mailman/listinfo/python-list
It seems like this is mostly a non-issue. The original code actually
works correctly (of course the updated versions that solve the
exception problem are probably better). The only thing that is going
haywire is the interpreter shutdown process. I think it is going a
bit overboard to "consider _
(sorry michael, didn't mean to personal post
On Wed, Mar 19, 2008 at 9:24 AM, Michael Wieher wrote:
> I think py2exe does this, but it might be a bit bloated
No, py2exe basically bundles the main script and the interpreter
together so it's easy to run and requires no python installation.
Loo
On Wed, Mar 12, 2008 at 9:23 AM, Carl Banks <[EMAIL PROTECTED]> wrote:
> Even though it's typically used for graphical games, PyGame would be a
> good way to make a cross-platform "text-mode" game. It should be
> pretty straightforward to simulate a text mode terminal using a grid
> of sprites
On Jan 22, 2008 10:59 PM, <[EMAIL PROTECTED]> wrote:
> I am writing a game, and it must keep a list of objects. I've been
> representing this as a list, but I need an object to be able to remove
> itself. It doesn't know it's own index. If I tried to make each object
> keep track of it's own index
On Dec 17, 2007 1:10 PM, Bruno Desthuilliers
<[EMAIL PROTECTED]> wrote:
> Hem... May I remind you that Python doesn't have block comments ?-)
I suppose we could argue semantics, since """ strings are actually
processed, but they are basically block comments.
So, there we are, multiline strings A
> > > > Kay Schluehr wrote:
> > > > Python 2.6 and 3.0 have a more Pythonic way for the problem:
> > > > class A(object):
> > > > @property
> > > > def foo(self):
> > > > return self._foo
> > > > @foo.setter
> > > > def foo(self, value)
> > > > self._foo = value
> >
Monty Python pioneered (or at least pioneered the organized televising
of) a form of humor where there is no punchline or reason something is
funny, it just is (or isn't). I find about half of it very funny, and
the rest very unfunny. I used to find it more hilarious than I do
now. It's an extre
On 24 Nov 2007 13:56:37 GMT, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote:
> So::
>
> def meth(self):
> using self:
> tmp = raw_input('Enter age: ')
> age = int(tmp)
>
> becomes::
>
> def meth(self):
> using self:
> self.tmp = self.
Ton Van Vliet:
> [... using/with ...]
This looks like a really nice little construct, and solves my small
quirk issue (which has popped up maybe twice in my python experience).
It could also be a solution to the OP's problem. The issue of course
is disambiguation. Is EVERY name looked up in the
On 24 Nov 2007 08:41:24 GMT, Ayaz Ahmed Khan <[EMAIL PROTECTED]> wrote:
> Donn Ingle wrote:
> > Already done, the code within PIL is causing the crash. It gets ugly and
> > out of my remit. It's a freetype/Pil thing and I simply want to a way to
> > catch it when it happens.
> > Since a segfault e
Most of the time self doesn't bother me in the slightest. The one
time it does bother me however, is when I am turning a function into a
method. In this case, often I have many local variables which I
actually want to be instance variables, so I have to add self to all
of them. Of course, this i
On Nov 22, 2007 1:04 PM, Brian <[EMAIL PROTECTED]> wrote:
> / Chime Mode
> I have, in fact, sent this thread to my friend.
> His limiting factors are
>
> - money-control people favor MS platforms
> - C# and VS have minimal cost impact for academia
> - sys admins have everything locked down (probab
(Oops, sent as private, reposting to list)
On Nov 20, 2007 12:36 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> FWIW it's trivial to run pyflakes on your code (automatically behind
> the scenes) to get syntax checking; in vim, my syntax errors get
> underlined immediately for python code. It
You would use setattr to bind a name that you don't know:
for pin in self.pin:
setattr(self,pin.Name,pin.Value)
However, I'm not sure why you're using a dictionary in this way. I don't
totally understand the context, so I may be wrong, but I would code it more
like this:
class Power_Supply(d
55 matches
Mail list logo