Re: python call golang

2013-05-10 Thread Fábio Santos
On 10 May 2013 03:37, "Thanatos xiao" wrote: > > Hey ! > > Now! I have written a python script . I want to call a golang script in python script. > Who can give me some advices? > > thanks! Check out the subprocess module. You can use it to call other programs from python and get their error code

Re: Message passing syntax for objects | OOPv2

2013-05-10 Thread Chris Angelico
On Fri, May 10, 2013 at 2:55 PM, Roy Smith wrote: > In article , > Chris Angelico wrote: > >> The first hard disk I ever worked with stored 20MB in the space of a >> 5.25" slot (plus its associated ISA controller card). > > Heh. The first hard disk I ever worked with stored 2.4 MB in 6U of rack

Re: in need of some help...

2013-05-10 Thread Alex Norton
On Wednesday, 1 May 2013 13:15:28 UTC+1, Jens Thoms Toerring wrote: > Alex Norton wrote: > > > thanks... ill take a look at the Qt event handling > > > > It's rather simple: instead of the program running through a > > sequence of steps, the program normally is basically doing > > nothing.

Re: object.enable() anti-pattern

2013-05-10 Thread Steven D'Aprano
On Fri, 10 May 2013 01:50:09 -0400, Roy Smith wrote: > In article <518c7f05$0$29997$c3e8da3$54964...@news.astraweb.com>, > Steven D'Aprano wrote: > >> there is no way to create a C file descriptor in a closed state. Such a >> thing does not exist. If you have a file descriptor, the file is open

Re: Append to python List

2013-05-10 Thread 88888 Dihedral
Jussi Piitulainen於 2013年5月9日星期四UTC+8下午7時30分05秒寫道: > 8 Dihedral writes: > > > > > This is just the handy style for a non-critical loop. > > > In a critical loop, the number of the total operation counts > > > does matter in the execution speed. > > > > Do you use speed often? There i

Re: object.enable() anti-pattern

2013-05-10 Thread Steven D'Aprano
On Fri, 10 May 2013 06:22:31 +, Dan Sommers wrote: > On Fri, 10 May 2013 05:03:10 +, Steven D'Aprano wrote: > > There is no sensible use-case for creating a file OBJECT unless it > initially wraps an open file pointer. > >> So far the only counter-examples given aren't counter-ex

Re: object.enable() anti-pattern

2013-05-10 Thread Robert Kern
On 2013-05-10 12:00, Steven D'Aprano wrote: But either way, that's fine. You've found an object where it does make sense to have an explicit "make it go" method: first one entity has permission to construct the object, but not to open the underlying file. Another entity has permission to open th

Re: Message passing syntax for objects | OOPv2

2013-05-10 Thread William Ray Wing
On May 10, 2013, at 12:55 AM, Roy Smith wrote: > In article , > Chris Angelico wrote: > >> The first hard disk I ever worked with stored 20MB in the space of a >> 5.25" slot (plus its associated ISA controller card). > > Heh. The first hard disk I ever worked with stored 2.4 MB in 6U of rack

Re: help on Implementing a list of dicts with no data pattern

2013-05-10 Thread Neil Cerutti
On 2013-05-09, Dave Angel wrote: > On 05/09/2013 05:22 PM, rlelis wrote: >> On Thursday, May 9, 2013 7:19:38 PM UTC+1, Dave Angel wrote: >> >> Yes it's a list of string. I don't get the NameError: name 'file_content' is >> not defined in my code. > > That's because you have the 3 lines below whic

Re: Message passing syntax for objects | OOPv2

2013-05-10 Thread Roy Smith
On May 10, 2013, at 7:49 AM, William Ray Wing wrote: > On May 10, 2013, at 12:55 AM, Roy Smith wrote: > >> In article , >> Chris Angelico wrote: >> >>> The first hard disk I ever worked with stored 20MB in the space of a >>> 5.25" slot (plus its associated ISA controller card). >> >> Heh. T

Re: object.enable() anti-pattern

2013-05-10 Thread Roy Smith
In article <518cc239$0$29997$c3e8da3$54964...@news.astraweb.com>, Steven D'Aprano wrote: > > int fd = 37; > > > > I've just created a file descriptor. There is not enough information > > given to know if it corresponds to an open file or not. > > No, you haven't created a file descriptor. You

Re: object.enable() anti-pattern

2013-05-10 Thread Roy Smith
In article , Robert Kern wrote: > I'd be curious to see in-the-wild instances of the anti-pattern that > you are talking about, then. I think everyone agrees that entirely > unmotivated "enable" methods should be avoided, but I have my doubts > that they come up very often. As I mentioned e

Re: object.enable() anti-pattern

2013-05-10 Thread Oscar Benjamin
On 10 May 2013 15:01, Roy Smith wrote: > In article , > Robert Kern wrote: > >> I'd be curious to see in-the-wild instances of the anti-pattern that >> you are talking about, then. I think everyone agrees that entirely >> unmotivated "enable" methods should be avoided, but I have my doubts >> th

Re: object.enable() anti-pattern

2013-05-10 Thread Roy Smith
In article , Oscar Benjamin wrote: > It's not just because of exceptions. In C++ virtual method calls in a > constructor for a class A will always call the methods of class A even > if the object being constructed is actually of a subclass B because > the B part of the object isn't initialised w

Re: object.enable() anti-pattern

2013-05-10 Thread Chris Angelico
On Sat, May 11, 2013 at 12:37 AM, Roy Smith wrote: > I suppose, if I had a class like this, I would write a factory function > which called the constructor and post-construction initializer. And > then I would make the constructor protected. That sounds like a reasonable plan, with the possible

Re: object.enable() anti-pattern

2013-05-10 Thread Roy Smith
In article , Chris Angelico wrote: > On Sat, May 11, 2013 at 12:37 AM, Roy Smith wrote: > > I suppose, if I had a class like this, I would write a factory function > > which called the constructor and post-construction initializer. And > > then I would make the constructor protected. > > That

Re: object.enable() anti-pattern

2013-05-10 Thread Chris Angelico
On Sat, May 11, 2013 at 12:54 AM, Roy Smith wrote: > In article , > Chris Angelico wrote: > >> On Sat, May 11, 2013 at 12:37 AM, Roy Smith wrote: >> > I suppose, if I had a class like this, I would write a factory function >> > which called the constructor and post-construction initializer. An

Re: Unicode humor

2013-05-10 Thread jmfauth
On 8 mai, 15:19, Roy Smith wrote: > Apropos to any of the myriad unicode threads that have been going on > recently: > > http://xkcd.com/1209/ -- This reflects a lack of understanding of Unicode. jmf -- http://mail.python.org/mailman/listinfo/python-list

Re: Unicode humor

2013-05-10 Thread Chris Angelico
On Sat, May 11, 2013 at 1:06 AM, jmfauth wrote: > On 8 mai, 15:19, Roy Smith wrote: >> Apropos to any of the myriad unicode threads that have been going on >> recently: >> >> http://xkcd.com/1209/ > > -- > > > This reflects a lack of understanding of Unicode. By the skywriter, or by the two

Re: Anybody familiar with pygments ?

2013-05-10 Thread Chris “Kwpolska” Warrick
On Thu, May 9, 2013 at 10:40 AM, Fábio Santos wrote: > > On 9 May 2013 05:19, "dabaichi" wrote: >> >> And hereis the output file: > > That's not the output file. That is just an HTML fragment to put on your > page. A full HTML file will need more things, which is the reason why you > don't see co

Re: Unicode humor

2013-05-10 Thread Ned Batchelder
On 5/10/2013 11:06 AM, jmfauth wrote: On 8 mai, 15:19, Roy Smith wrote: Apropos to any of the myriad unicode threads that have been going on recently: http://xkcd.com/1209/ -- This reflects a lack of understanding of Unicode. jmf And this reflects a lack of a sense of humor. :) --N

Re: object.enable() anti-pattern

2013-05-10 Thread Roy Smith
In article , Chris Angelico wrote: > > Each language has its own set of best practices. Trying to write C++ > > code using Python patterns is as bad as trying to write Python code > > using C++ patterns. > > Agreed, in generality. But what is actually gained by hiding data from > yourself? Y

Re: Unicode humor

2013-05-10 Thread Chris Angelico
On Sat, May 11, 2013 at 1:24 AM, Ned Batchelder wrote: > On 5/10/2013 11:06 AM, jmfauth wrote: >> >> On 8 mai, 15:19, Roy Smith wrote: >>> >>> Apropos to any of the myriad unicode threads that have been going on >>> recently: >>> >>> http://xkcd.com/1209/ >> >> -- >> >> >> This reflects a lac

Re: object.enable() anti-pattern

2013-05-10 Thread Robert Kern
On 2013-05-10 15:01, Roy Smith wrote: In article , Robert Kern wrote: I'd be curious to see in-the-wild instances of the anti-pattern that you are talking about, then. I think everyone agrees that entirely unmotivated "enable" methods should be avoided, but I have my doubts that they come up

Re: object.enable() anti-pattern

2013-05-10 Thread Chris Angelico
On Sat, May 11, 2013 at 1:21 AM, Roy Smith wrote: > In article , > Chris Angelico wrote: >> >> Agreed, in generality. But what is actually gained by hiding data from >> yourself? > > You're not hiding it from yourself. You're hiding it from the other > people who are using your code and may not

Re: Unicode humor

2013-05-10 Thread rusi
On May 10, 8:32 pm, Chris Angelico wrote: > On Sat, May 11, 2013 at 1:24 AM, Ned Batchelder > wrote: > > On 5/10/2013 11:06 AM, jmfauth wrote: > > >> On 8 mai, 15:19, Roy Smith wrote: > > >>> Apropos to any of the myriad unicode threads that have been going on > >>> recently: > > >>>http://xkcd

Re: Unicode humor

2013-05-10 Thread MRAB
On 10/05/2013 17:07, rusi wrote: On May 10, 8:32 pm, Chris Angelico wrote: On Sat, May 11, 2013 at 1:24 AM, Ned Batchelder wrote: > On 5/10/2013 11:06 AM, jmfauth wrote: >> On 8 mai, 15:19, Roy Smith wrote: >>> Apropos to any of the myriad unicode threads that have been going on >>> recentl

Re: Unicode humor

2013-05-10 Thread Ethan Furman
On 05/10/2013 09:07 AM, rusi wrote: On May 10, 8:32 pm, Chris Angelico wrote: On Sat, May 11, 2013 at 1:24 AM, Ned Batchelder wrote: On 5/10/2013 11:06 AM, jmfauth wrote: On 8 mai, 15:19, Roy Smith wrote: Apropos to any of the myriad unicode threads that have been going on recently:

Re: object.enable() anti-pattern

2013-05-10 Thread Nobody
On Thu, 09 May 2013 05:23:59 +, Steven D'Aprano wrote: > There is no sensible use-case for creating a file without opening it. > What would be the point? Any subsequent calls to just about any method > will fail. Since you have to open the file after creating the file object > anyway, why m

Re: object.enable() anti-pattern

2013-05-10 Thread Serhiy Storchaka
10.05.13 15:19, Robert Kern написав(ла): I'd be curious to see in-the-wild instances of the anti-pattern that you are talking about, then. Many (if not most) GUI frameworks use this pattern. button = Button("text") button.setForegroundColor(...) button.setBackgoundColor(...) bu

Re: object.enable() anti-pattern

2013-05-10 Thread Robert Kern
On 2013-05-10 16:44, Serhiy Storchaka wrote: 10.05.13 15:19, Robert Kern написав(ла): I'd be curious to see in-the-wild instances of the anti-pattern that you are talking about, then. Many (if not most) GUI frameworks use this pattern. button = Button("text") button.setForegroundCol

Re: object.enable() anti-pattern

2013-05-10 Thread Chris Angelico
On Sat, May 11, 2013 at 1:44 AM, Serhiy Storchaka wrote: > 10.05.13 15:19, Robert Kern написав(ла): > >> I'd be curious to see in-the-wild instances of the anti-pattern that you >> are talking about, then. > > > Many (if not most) GUI frameworks use this pattern. > > button = Button("text") >

Re: object.enable() anti-pattern

2013-05-10 Thread Roy Smith
In article , Nobody wrote: > However: there are situations where it is useful to be able to separate > the simple task of creating an object from more invasive actions such as > system calls. Particularly in multi-threaded or real-time code (although > the latter is a non-starter in Python for m

?????????? WHY DID PROPHET MUHAMMAD MARRY AISHA THE YOUNG GIRL

2013-05-10 Thread BV BV
WHY DID PROPHET MUHAMMAD MARRY AISHA THE YOUNG GIRL? This is an important book talks about a common issue misunderstood but misused by lots of thinkers and orientalists. It is “Why did Prophet Muhammad marry Aisha the young girl?” The author shows the reason behind their discussion. They want to d

Re: python call golang

2013-05-10 Thread Miki Tebeka
> Now! I have written a python script . I want to call a golang script in > python script. > Who can give me some advices? See http://gopy.qur.me/extensions/examples.html and http://www.artima.com/weblogs/viewpost.jsp?thread=333589 -- http://mail.python.org/mailman/listinfo/python-list

Re: object.enable() anti-pattern

2013-05-10 Thread Cameron Simpson
On 10May2013 09:22, Roy Smith wrote: | In article <518cc239$0$29997$c3e8da3$54964...@news.astraweb.com>, | Steven D'Aprano wrote: | > > int fd = 37; | > > | > > I've just created a file descriptor. There is not enough information | > > given to know if it corresponds to an open file or not. |

Re: object.enable() anti-pattern

2013-05-10 Thread Mark Janssen
>> There is no sensible use-case for creating a file OBJECT unless it >> initially wraps an open file pointer. >> >>> So far the only counter-examples given aren't counter-examples ... >> >> Well, sure, if you discount operations like "create this file" and >> queries like "could I delete t

Re: object.enable() anti-pattern

2013-05-10 Thread Mark Janssen
> | No, I've created a file descriptor, which is, by definition, an integer. > | It has nothing to do with C. This is all defined by the POSIX > | interface. For example, the getdtablesize(2) man page says: > | > | "The entries in the descriptor table are numbered with small integers > | starting

Re: object.enable() anti-pattern

2013-05-10 Thread Thomas Rachel
Am 10.05.2013 15:22 schrieb Roy Smith: That's correct. But, as described above, the system makes certain guarantees which allow me to reason about the existence or non-existence os such entries. Nevertheless, your 37 is not a FD yet. Let's take your program: #include #include #include #