On Wed, Jan 14, 2009 at 11:02 AM, Catherine Moroney
wrote:
> I would like to spawn off multiple instances of a function
> and run them simultaneously and then wait until they all complete.
> Currently I'm doing this by calling them as sub-processes
> executable from the command-line. Is there a w
I'm trying to implement a basic user controlled sliding box with
pygame. I have everything worked out, except for two things.
The acceleration is changed once a second (for meters/second) this
leads to very jumpy movement. I need to add a way to check how long it
takes the program to loop and mult
On Jan 14, 10:45 am, "Russ P." wrote:
> The Wikipedia entry for "object-oriented programming" also lists
> encapsulation as a "fundamental concept."
The Wikipedia entry for "encapsulation" defines it as "the grouping
together of data and functionality".
That sounds like Python classes & modules
On Wed, Jan 14, 2009 at 11:29 AM, killsto wrote:
> I'm trying to implement a basic user controlled sliding box with
> pygame. I have everything worked out, except for two things.
Try the pygame mailing list :)
cheers
James
--
http://mail.python.org/mailman/listinfo/python-list
James Mills wrote:
On Wed, Jan 14, 2009 at 11:02 AM, Catherine Moroney
wrote:
I would like to spawn off multiple instances of a function and run
them simultaneously and then wait until they all complete.
Currently I'm doing this by calling them as sub-processes
executable from the command-lin
On Wed, Jan 14, 2009 at 11:35 AM, MRAB wrote:
> The disadvantage of threads in Python (CPython, actually) is that
> there's the GIL (Global Interpreter Lock), so you won't get any speed
> advantage if the threads are mostly processor-bound.
The OP didn't really say what this function
does :) *sig
For R, and others who haven't read the PEP or worked a lot with the
web, here are some really strong advantages of the new string
formatting over the old.
Note: I'm not saying that you have to use one or the other. I'm just
pointing out some of the things that the new format gives us - things
whic
On 2009-01-12, John Machin wrote:
> I didn't think your question was stupid. Stupid was (a) CP/M recording
> file size as number of 128-byte sectors, forcing the use of an in-band
> EOF marker for text files (b) MS continuing to regard Ctrl-Z as an EOF
> decades after people stopped writing Ctrl-
On Jan 13, 5:29 pm, alex23 wrote:
> On Jan 14, 10:45 am, "Russ P." wrote:
>
> > The Wikipedia entry for "object-oriented programming" also lists
> > encapsulation as a "fundamental concept."
>
> The Wikipedia entry for "encapsulation" defines it as "the grouping
> together of data and functionali
Ben Sizer wrote:
> What am I doing wrong?
What are you trying to achieve?
If you want to modify sys.path I suggest using Python/C API directly:
(boilerplate removed)
PyImport_ImportModule("sys")
PyObject_GetAttrString(sysmod_pointer, "path")
PyList_Insert(pathobj_pointer, 0, path_python_str)
--
I'm trying to call a method within my wx frame, but that doesn't seem to work.
What am I doing wrong?
class MyFrame(wx.Frame):
def __init__(self, *args, **kwds):
self.Bind(wx.EVT_BUTTON, self.test, self.testbutton)
...
def sendmail(self):
...
def test(self, even
On Wed, Jan 14, 2009 at 11:50 AM, Russ P. wrote:
> Here's the definition on the Wikipedia page for object oriented
> programming (and it does *not* sound like Python classes):
>
> Encapsulation conceals the functional details of a class from objects
> that send messages to it. ... Encapsulation is
"Aaron Brady" wrote in message
news:6197f37d-0ea0-4430-a466-2f36b2011...@v42g2000yqj.googlegroups.com...
On Jan 13, 10:22 am, Grimson wrote:
hello out there,
I have a problem with c-types.
I made a c-library, which expects a pointer to a self defined structure.
let the funtion call myfuncti
Ivan Illarionov schrieb:
> Ben Sizer wrote:
>> What am I doing wrong?
>
> What are you trying to achieve?
> If you want to modify sys.path I suggest using Python/C API directly:
> (boilerplate removed)
> PyImport_ImportModule("sys")
> PyObject_GetAttrString(sysmod_pointer, "path")
> PyList_Insert
On Jan 13, 5:06 pm, Mark Wooding wrote:
snip
> I'm going to move away from the formal semantics stuff and try a
> different tack. Here's what I think is the defining property of
> pass-by-value (distilled from the formal approach I described earlier,
> but shorn of the symbolism):
>
> The calle
On Wed, Jan 14, 2009 at 12:29 PM, killsto wrote:
>
> force. So lets say I am slowing down at a rate of -2m/s^2, if I hit 1,
> the next number will be -1 and I shoot off in the other direction. How
> do I fix this an still have backwards movement?
> --
> http://mail.python.org/mailman/listinfo/pyt
"James Mills" writes:
> You do realize this is a model and not strictly a requirement. Quite
> a few things in Python are done merely by convention.
> Don't get caught up.
But, if something is done by convention, then departing from the
convention is by definition unconventional. If you do somet
On Wed, Jan 14, 2009 at 11:28 AM, wrote:
> class MyFrame(wx.Frame):
>def __init__(self, *args, **kwds):
It might be helpful here if you called
the parent __init__. Like so:
class MyFrame(wx.Frame):
def __init__(self, *args, **kwds):
super(MyFrame, self).__init__(*args, **kwargs)
.
On Wed, Jan 14, 2009 at 12:27 PM, Paul Rubin
<"http://phr.cx"@nospam.invalid> wrote:
> "James Mills" writes:
>> You do realize this is a model and not strictly a requirement. Quite
>> a few things in Python are done merely by convention.
>> Don't get caught up.
>
> But, if something is done by con
On Jan 13, 1:33 am, Philip Semanchuk wrote:
> I don't think I understand you clearly. Whether or not Google et al
> whitelist the Python UA isn't a Python issue, is it?
Hi, sorry for taking so long to reply :)
I imagine it's something akin to Firefox's 'Report broken website':
evangelism.
IMH
On Jan 13, 2009, at 6:41 PM, Mel wrote:
Philip Semanchuk wrote:
I'm working on message queue support, but the Sys V IPC API is a
headache and takes longer to code against than the POSIX API.
I hadn't found it that bad. I have a C extension I should perhaps
clean up
and make public.
Ha
Russ P. wrote:
On Jan 13, 5:29 pm, alex23 wrote:
On Jan 14, 10:45 am, "Russ P." wrote:
The Wikipedia entry for "object-oriented programming" also lists
encapsulation as a "fundamental concept."
The Wikipedia entry for "encapsulation" defines it as "the grouping
together of data and function
On Wed, Jan 14, 2009 at 12:57 PM, Terry Reedy wrote:
> public = no leading underscore
> private = one leading underscore
> protected = two leading underscores
>
> Python uses encapsulation by convention rather than by enforcement.
As mentioned previously this is not encapsulation, but
access cont
On Jan 13, 6:04 pm, "James Mills"
wrote:
> On Wed, Jan 14, 2009 at 11:50 AM, Russ P. wrote:
> > Here's the definition on the Wikipedia page for object oriented
> > programming (and it does *not* sound like Python classes):
>
> > Encapsulation conceals the functional details of a class from object
On Wed, 14 Jan 2009 02:27:09 -, Paul Rubin
<"http://phr.cx"@nospam.invalid> wrote:
But, if something is done by convention, then departing from the
convention is by definition unconventional. If you do something
unconventional in a program, it could be on purpose for a reason, or
it could
On Wed, Jan 14, 2009 at 1:18 PM, Russ P. wrote:
> Yes, but the fact that you can approximate OO programming in a
> particular language does not make that language object oriented. You
> can approximate OO programming in C, but that does not mean that C is
> an OO language.
Wrong. Not having stric
> public = no leading underscore
> private = one leading underscore
> protected = two leading underscores
>
> Python uses encapsulation by convention rather than by enforcement.
Very well said Terry!
I like that python does not force me to do "everything" but does force
things like parenthesis in
On Wed, Jan 14, 2009 at 1:25 PM, Rhodri James
wrote:
> I wouldn't violently object to having some means of policing class
> or module privacy, but it does have consequences. When it's a
> convention, you can break it; when it isn't, you can't, even if
> you do have good reason. Add that to the o
On Wed, Jan 14, 2009 at 1:31 PM, r wrote:
>> public = no leading underscore
>> private = one leading underscore
>> protected = two leading underscores
>>
>> Python uses encapsulation by convention rather than by enforcement.
>
> Very well said Terry!
>
> I like that python does not force me to do
On Jan 13, 6:45 pm, "Russ P." wrote:
> On Jan 13, 3:07 pm, Carl Banks wrote:
>
> > I've seen no evidence that any Python project is moving even remotely
> > toward data encapsulation. That would be a drastic change. Even if
> > it were only a minor change in the implementation (and it would not
On Jan 13, 2009, at 9:42 PM, ajaksu wrote:
On Jan 13, 1:33 am, Philip Semanchuk wrote:
I don't think I understand you clearly. Whether or not Google et al
whitelist the Python UA isn't a Python issue, is it?
Hi, sorry for taking so long to reply :)
I imagine it's something akin to Firefox'
On Jan 13, 9:50 pm, Carl Banks wrote:
> The cultural impact that would have on the
> community is far worse, IMHO, than any short-sighted benefits like
> being able to catch an accidental usage of an internal variable.
> Trust would be replaced by mistrust, and programming in Python would
> go fro
On Wed, Jan 14, 2009 at 1:50 PM, Carl Banks wrote:
> 1. Wise people don't believe everything that is written on Wikipedia.
> 2. The person who wrote that line in Python.org is a wise person.
Agreed.
> You know what? Computer science buzzwords mean jack squat to me. I
> don't give a horse's tai
On Jan 13, 9:50 pm, Carl Banks wrote:
[snip]
it gives
> the library implementor the power to dictate to the user how they can
> and can't use the library. The cultural impact that would have on the
> community is far worse, IMHO, than any short-sighted benefits like
> being able to catch an accid
On Jan 13, 5:08 pm, Philip Semanchuk wrote:
> On Jan 13, 2009, at 4:31 PM, drobi...@gmail.com wrote:
>
> > On Jan 13, 2:37 pm, Philip Semanchuk wrote:
> >> I was suggesting getting posix_ipc or sysv_ipc to compile against a
> >> compatibility library (Cygwin?) under Windows. It sounds like you're
On Tue, Jan 13, 2009 at 5:29 PM, Kevin Jing Qiu
wrote:
> I've been experiencing weird behavior of Python's os module on Windows:
>
> Here's the environment:
> Box1: Running Windows 2003 Server with Apache+mod_python
> Box2: Running Windows 2003 Server with Zope/Plone and Z:\ mapped to D:\
> on Box
In article
,
"Russ P." wrote:
> I can claim that Python is not strictly object oriented until it
> gets encapsulation (in the sense of data hiding). That is simply a
> fact, and no amount of pleading or obfuscation will change it.
I have no idea if Python is strictly anything. What I do know
On Jan 13, 7:50 pm, Carl Banks wrote:
> On Jan 13, 6:45 pm, "Russ P." wrote:
>
>
>
> > On Jan 13, 3:07 pm, Carl Banks wrote:
>
> > > I've seen no evidence that any Python project is moving even remotely
> > > toward data encapsulation. That would be a drastic change. Even if
> > > it were only
Here is a piece of C code this same guy showed me saying Pythonic
indention would make this hard to read -- Well lets see then!
I swear, before god, this is the exact code he showed me. If you don't
believe me i will post a link to the thread.
// Warning ugly C code ahead!
if( is_opt_data() < si
On Jan 13, 2009, at 11:26 PM, drobi...@gmail.com wrote:
On Jan 13, 5:08 pm, Philip Semanchuk wrote:
On Jan 13, 2009, at 4:31 PM, drobi...@gmail.com wrote:
On Jan 13, 2:37 pm, Philip Semanchuk wrote:
I was suggesting getting posix_ipc or sysv_ipc to compile against a
compatibility library
On Jan 13, 7:32 pm, "James Mills"
wrote:
> On Wed, Jan 14, 2009 at 1:18 PM, Russ P. wrote:
> > Yes, but the fact that you can approximate OO programming in a
> > particular language does not make that language object oriented. You
> > can approximate OO programming in C, but that does not mean th
On Wed, Jan 14, 2009 at 3:11 PM, Russ P. wrote:
(...)
>> Give me one use-case where you strictly require
>> that members of an object be private and their
>> access enforced as such ?
>
> You're kidding, right? Think about a ten-million line program being
> developed by 100 developers.
No I"m so
On Jan 14, 2:02 am, Catherine Moroney
wrote:
> Hello everybody,
>
> I know how to spawn a sub-process and then wait until it
> completes. I'm wondering if I can do the same thing with
> a Python function.
>
> I would like to spawn off multiple instances of a function
> and run them simultaneously
On Jan 13, 7:50 pm, Carl Banks wrote:
> You know what? Computer science buzzwords mean jack squat to me. I
> don't give a horse's tail whether some people label it a fundamental
> concept of object-oriented programming or not. I think it's a bad
> thing. And it's a bad thing for exactly the r
hello all,
I have a strange situation where I have to load initiate an instance of
a class at run-time with the name given by the user from a dropdown
list.
Is this possible in python and how?
To make things clear, let me give the real example.
there is an inventory management system and products b
On Tue, Jan 13, 2009 at 9:46 PM, Krishnakant wrote:
> hello all,
> I have a strange situation where I have to load initiate an instance of
> a class at run-time with the name given by the user from a dropdown
> list.
> Is this possible in python and how?
> To make things clear, let me give the rea
On Wed, Jan 14, 2009 at 3:11 PM, Russ P. wrote:
> I think you are the one who is confused. Part of the problem here is
> that the term "encapsulation" has at least two widely used meanings
> (in the context of programming). In one sense, it just means grouping
> data and methods together. In anoth
On Wed, Jan 14, 2009 at 3:35 PM, Russ P. wrote:
> You know what? The more I think about the kind of nonsense you and
> others are spouting here, the more annoyed I get. I will gladly agree
> that encapsulation may be more trouble than it's worth for small
> applications, maybe even some medium siz
"James Mills" writes:
> Bare in mind also, that enfocing access control / policing as you
> called it has a performance hit as the machine (the Python vm)
> has to perform checks each time members of an object are accessed.
It's the other way around. If the compiler knows that you aren't
creatin
PEP 8 doesn't mention anything about using all caps to indicate a constant.
Is all caps meaning "don't reassign this var" a strong enough
convention to not be considered violating good python style? I see a
lot of people using it, but I also see a lot of people writing
non-pythonic code... so I th
On Wed, Jan 14, 2009 at 4:35 PM, Paul Rubin
<"http://phr.cx"@nospam.invalid> wrote:
> "James Mills" writes:
>> Bare in mind also, that enfocing access control / policing as you
>> called it has a performance hit as the machine (the Python vm)
>> has to perform checks each time members of an object
On Wed, Jan 14, 2009 at 4:49 PM, Brendan Miller wrote:
> PEP 8 doesn't mention anything about using all caps to indicate a constant.
>
> Is all caps meaning "don't reassign this var" a strong enough
> convention to not be considered violating good python style? I see a
> lot of people using it, bu
ajaksu wrote:
> On Jan 13, 1:33 am, Philip Semanchuk wrote:
>> I don't think I understand you clearly. Whether or not Google et al
>> whitelist the Python UA isn't a Python issue, is it?
>
> Hi, sorry for taking so long to reply :)
>
> I imagine it's something akin to Firefox's 'Report broken
On Wed, 14 Jan 2009 15:25:38 +1000, James Mills wrote:
> On Wed, Jan 14, 2009 at 3:11 PM, Russ P. wrote:
> (...)
>
>>> Give me one use-case where you strictly require that members of an
>>> object be private and their access enforced as such ?
>>
>> You're kidding, right? Think about a ten-milli
hi, is there a way to read a character/string into bits in python?
i understand that character is read in bytes. Do i have to write a
function to convert it myself into 1010101 or there is a library in
python that enable me to do that?
--
http://mail.python.org/mailman/listinfo/python-list
"James Mills" writes:
> Python is a dynamic object oriented language ... (almost verbatim
> from the website). It is compiled to bytecode and run on a virtual
> machine.
1. There is nothing inherent about dynamic languages that prevents
them from being compiled. There are compiled implementatio
> FOO = 1
>
> def f(x=FOO):
> ...
>
>
> Use this instead:
>
> def f(x=1):
> ...
I tend to use constants as a means of avoiding the proliferation of
magic literals for maintenance reasons... Like say if your example of
FOO would have been used in 10 places. Maybe it is more pythonic to
simply
On Tue, Jan 13, 2009 at 11:21 PM, ts wrote:
> hi, is there a way to read a character/string into bits in python?
>
> i understand that character is read in bytes. Do i have to write a
> function to convert it myself into 1010101 or there is a library in
> python that enable me to do that?
It's no
On Jan 13, 11:35 pm, "Russ P." wrote:
> I suggest you call Boeing and tell them that encapsulation is more
> trouble than it's worth for their 787 flight software. But please
> don't do it if you ever wish to work for them, because you will be
> proving conclusively that you don't have a clue abou
Unknown wrote:
> On 2009-01-12, John Machin wrote:
>
>> I didn't think your question was stupid. Stupid was (a) CP/M recording
>> file size as number of 128-byte sectors, forcing the use of an in-band
>> EOF marker for text files (b) MS continuing to regard Ctrl-Z as an EOF
>> decades after peopl
Um.. and I can't seem to find any sample code of it around.
Can anybody share a simple snippet of how to use it? I don't understand
what's URI in PutFile method is suppose to be.
TIA.
On Tue, Jan 13, 2009 at 8:03 PM, Vincent Gulinao
wrote:
> Kindly point me to a good WebDAV client module for Py
On Tue, 13 Jan 2009 20:17:08 -0800, Carl Banks wrote:
> On Jan 13, 9:50 pm, Carl Banks wrote:
>> The cultural impact that would have on the community is far worse,
>> IMHO, than any short-sighted benefits like being able to catch an
>> accidental usage of an internal variable. Trust would be repl
On Jan 14, 3:32 pm, Chris Rebert wrote:
> On Tue, Jan 13, 2009 at 11:21 PM, ts wrote:
> > hi, is there a way to read a character/string into bits in python?
>
> > i understand that character is read in bytes. Do i have to write a
> > function to convert it myself into 1010101 or there is a librar
On Tue, 2009-01-13 at 21:51 -0800, Chris Rebert wrote:
> Assuming all the classes are in the same module as the main program:
>
> instance = vars()[class_name](args, to, init)
>
The classes are not in the same module.
Every glade window is coupled with one py file (module) containing one
class th
On Wed, 14 Jan 2009 11:16:58 +0530, Krishnakant wrote:
> hello all,
> I have a strange situation where I have to load initiate an instance of
> a class at run-time with the name given by the user from a dropdown
> list.
Not strange at all.
> Is this possible in python and how?
Of course. Just u
Carl Banks writes:
> At GE there was no encapsulation in sight on any system I worked on.
> In fact, our engine simulation was a special-purpose object-oriented
> language with--get this--no private variables. Some other systems I
> worked on didn't even use scoping, let alone encapsulation.
Whe
On Tue, Jan 13, 2009 at 11:49 PM, Krishnakant wrote:
> On Tue, 2009-01-13 at 21:51 -0800, Chris Rebert wrote:
>> Assuming all the classes are in the same module as the main program:
>>
>> instance = vars()[class_name](args, to, init)
>>
> The classes are not in the same module.
> Every glade windo
101 - 167 of 167 matches
Mail list logo