Re: [Python-Dev] Dinamically set __call__ method

2014-11-06 Thread dieter
John Ladasky writes: > On Tuesday, November 4, 2014 11:12:31 AM UTC-8, Ethan Furman wrote: > >> If you really absolutely positively have to have the signature be correct >> for each instance, you may to either look at a >> function creating factory, a class creating factory, or a meta-class. >

Re: Understanding "help" command description syntax - explanation needed

2014-11-06 Thread Darren Chen
在 2014年11月5日星期三UTC+8下午8时17分11秒,larry@gmail.com写道: > On Wed, Nov 5, 2014 at 7:13 AM, Ivan Evstegneev > wrote: > > Firtst of all thanks for reply. > > > >>>brackets [] means that the argument is optional. > > > > That's what I'm talking about (asking actually), where do you know it from? > > I

Re: Understanding "help" command description syntax - explanation needed

2014-11-06 Thread Chris Angelico
On Fri, Nov 7, 2014 at 4:47 PM, Steven D'Aprano wrote: > But a *great* mathematician will say, "Hmmm, actually, we don't *know* that > 2+2 equals 4, because we cannot prove that arithmetic is absolutely > consistent. If arithmetic is not consistent, then we might simultaneously > prove that 2+2 =

Re: Understanding "help" command description syntax - explanation needed

2014-11-06 Thread Steven D'Aprano
Chris Angelico wrote: > On Wed, Nov 5, 2014 at 11:31 PM, Ivan Evstegneev > wrote: That's what I'm talking about (asking actually), where do you know it from? >> I know it because I've been a programmer for 39 years. >> >> I didn't intend to offence anyone here. Just asked a question

Re: Real-world use of Counter

2014-11-06 Thread Ian Kelly
On Nov 6, 2014 10:51 AM, "Ian Kelly" wrote: > > On Nov 6, 2014 1:06 AM, "Rustom Mody" wrote: > > Calling a bag as counter is inappropriate for an analogous reason > > to why calling a dictionary as a 'hash' is inappropriate -- > > it confuses an implementation detail for fundamental semantics. >

Re: Python has arrived!

2014-11-06 Thread Ian Kelly
On Nov 6, 2014 10:47 PM, "Sturla Molden" wrote: > > Grant Edwards wrote: > > According to > > http://www.theregister.co.uk/2014/11/06/hackers_use_gmail_drafts_as_dead_drops_to_control_malware_bots : > > > > "Attacks occur in two phases. Hackers first infect a targeted > >machine via simple

Re: [Python-Dev] Dinamically set __call__ method

2014-11-06 Thread Steven D'Aprano
Roberto Martínez wrote: > Yikes, I didn't realize the difference in inheritance. > > The thing with this is tricky. I need the change in the instance, not in > the class, because I have multiple instances and all of them must have > different implementations of __call__. > > The workaround of ca

Re: Python has arrived!

2014-11-06 Thread Sturla Molden
Grant Edwards wrote: > According to > http://www.theregister.co.uk/2014/11/06/hackers_use_gmail_drafts_as_dead_drops_to_control_malware_bots: > > "Attacks occur in two phases. Hackers first infect a targeted >machine via simple malware that installs Python onto the device, >[...]" >

Re: I need algorithm for my task

2014-11-06 Thread Darren Chen
Probably homework, you are a good man ! -- https://mail.python.org/mailman/listinfo/python-list

Re: help with creating dict from string

2014-11-06 Thread versalytics
On Thursday, November 6, 2014 12:41:10 PM UTC-5, Peter Otten wrote: > Tim wrote: > > > hi, I have strings coming in with this format: > > > > '[one=two, three=four five, six, seven=eight]' > > > > and I want to create from that string, this dictionary: > > {'one':'two', 'three':'four fiv

Re: [Python-Dev] Dinamically set __call__ method

2014-11-06 Thread John Ladasky
On Tuesday, November 4, 2014 11:12:31 AM UTC-8, Ethan Furman wrote: > If you really absolutely positively have to have the signature be correct for > each instance, you may to either look at a > function creating factory, a class creating factory, or a meta-class. +1. Overriding __call__() wit

Re: help with creating dict from string

2014-11-06 Thread Tim
On Thursday, November 6, 2014 12:41:10 PM UTC-5, Peter Otten wrote: > Tim wrote: > > > hi, I have strings coming in with this format: > > > > '[one=two, three=four five, six, seven=eight]' > > > > and I want to create from that string, this dictionary: > > {'one':'two', 'three':'four fiv

Re: help with creating dict from string

2014-11-06 Thread Peter Otten
Tim wrote: > hi, I have strings coming in with this format: > > '[one=two, three=four five, six, seven=eight]' > > and I want to create from that string, this dictionary: > {'one':'two', 'three':'four five', 'six':True, 'seven':'eight'} > > These are option strings, with each key-value

Re: [OFF-TOPIC] It is true that is impossible write in binary code, the lowest level of programming that you can write is in hex code?

2014-11-06 Thread mbg1708
On Tuesday, 4 November 2014 16:49:36 UTC, françai s wrote: > I intend to write in lowest level of computer programming as a hobby. > > It is true that is impossible write in binary code, the lowest level > of programming that you can write is in hex code? > > What is the lowest level of programm

help with creating dict from string

2014-11-06 Thread Tim
hi, I have strings coming in with this format: '[one=two, three=four five, six, seven=eight]' and I want to create from that string, this dictionary: {'one':'two', 'three':'four five', 'six':True, 'seven':'eight'} These are option strings, with each key-value pair separated by commas. Wh

Re: Real-world use of Counter

2014-11-06 Thread Ian Kelly
On Nov 6, 2014 1:06 AM, "Rustom Mody" wrote: > In studying (somewhat theoretically) the general world of > collection data structures we see > - sets -- neither order nor repetition > - bags -- no order, repetition significant > - lists -- both order and repetition > > Sometimes 'bag' is called

Python has arrived!

2014-11-06 Thread Grant Edwards
According to http://www.theregister.co.uk/2014/11/06/hackers_use_gmail_drafts_as_dead_drops_to_control_malware_bots: "Attacks occur in two phases. Hackers first infect a targeted machine via simple malware that installs Python onto the device, [...]" -- Grant Edwards gr

Re: [OFF-TOPIC] It is true that is impossible write in binary code, the lowest level of programming that you can write is in hex code?

2014-11-06 Thread William Ray Wing
> On Nov 5, 2014, at 6:14 PM, Clayton Kirkwood wrote: > > Yeah, the 11 was mesmerizing. You didn't need no stinkin' program to see how > busy the system was, you just checked the lights. You could really tell when > somebody was compiling or link/loading. As I've done many times since those > da

Re: Python 3.4.2 + PyQt4 + PyCharm 3.4.1

2014-11-06 Thread Juan Christian
Resolved, kinda. Just use PySide instead of PyQt. Remove everything PyQt related from PyCharm and install PySide using the PyCharm plugins window. PySide has access to all modules and packages that PyQt has, but now you need to import like "from PySide.<**> import *". On Thu, Nov 6, 2014 at 12:50

Re: Python 3.4.2 + PyQt4 + PyCharm 3.4.1

2014-11-06 Thread farshad akbari
On Saturday, November 1, 2014 3:11:54 PM UTC+3:30, Juan Christian wrote: > No one here uses PyCharm and Qt? =/ > > > On Wed, Oct 29, 2014 at 8:45 PM, Juan Christian wrote: > > It only occurs whule using PyCharm I tried it via pure terminal and > everything works... =/ > > > > > On Tue, Oct

Re: wxPython Boxsizers

2014-11-06 Thread Joy Deep
I am using Python 2.7.6 Here is the code I am trying: import wx class MyFrame(wx.Frame): def __init__(self, *args, **kid's): wx.Frame.__init__(self, *args, **kwds) self.button_1 = wx.Button(self, wx.ID_ANY, "button_1") self.button_2 = wx.Button(self, wx.ID_ANY, "button

Re: Understanding "help" command description syntax - explanation needed

2014-11-06 Thread MRAB
On 2014-11-06 04:05, Gene Heskett wrote: On Wednesday 05 November 2014 21:52:42 Mark Lawrence did opine And Gene did reply: On 06/11/2014 02:37, Dave Angel wrote: > Chris Angelico Wrote in message: >> On Thu, Nov 6, 2014 at 2:56 AM, Larry Martell wrote: And I don't think Larry was

Re: wxPython Boxsizers

2014-11-06 Thread Mark Lawrence
On 06/11/2014 10:13, Jaydip Chakrabarty wrote: Hello, I am new to Python. I am learning boxsizer. I want to put two buttons on my panel. One at top right corner and one at bottom right corner. How do I achieve this? Thanks Probably best asked here https://groups.google.com/forum/#!forum/wxp

Re: wxPython Boxsizers

2014-11-06 Thread Joel Goldstick
On Thu, Nov 6, 2014 at 5:13 AM, Jaydip Chakrabarty wrote: > Hello, > > I am new to Python. I am learning boxsizer. I want to put two buttons on > my panel. One at top right corner and one at bottom right corner. How do > I achieve this? > > Thanks First, what version of python. What is boxsizer?

ANN: eGenix ThreadLock Distribution 2.13.0.1

2014-11-06 Thread eGenix Team: M.-A. Lemburg
ANNOUNCING eGenix.com ThreadLock Distribution Version 2.13.0.1 eGenix is making a ThreadLock binary distribution available to simplify the setup for u

wxPython Boxsizers

2014-11-06 Thread Jaydip Chakrabarty
Hello, I am new to Python. I am learning boxsizer. I want to put two buttons on my panel. One at top right corner and one at bottom right corner. How do I achieve this? Thanks -- https://mail.python.org/mailman/listinfo/python-list

Re: Moving a window on the screen

2014-11-06 Thread Terry Reedy
On 11/6/2014 3:57 AM, Chris Angelico wrote: On Thu, Nov 6, 2014 at 7:32 PM, ast wrote: The fen window goes from it's initial location to the last one but we dont see all the intermediate steps You usually don't want to use time.sleep() in a GUI program. Try doing the same thing, but with an e

Re: Moving a window on the screen

2014-11-06 Thread ast
"Chris Angelico" a écrit dans le message de news:mailman.15536.1415264262.18130.python-l...@python.org... You usually don't want to use time.sleep() in a GUI program. Try doing the same thing, but with an event loop delay call instead; often, the display won't update until you go back to the

Re: Moving a window on the screen

2014-11-06 Thread Peter Otten
ast wrote: > Why the following program doesn't work ? > > for x in range(0, 100, 10): > fen.geometry("200x200+%d+10" % x) > time.sleep(0.5) > > > where fen is a window (fen = Tk()) > > The fen window goes from it's initial location to the last one > but we dont see all the intermed

Re: Moving a window on the screen

2014-11-06 Thread Chris Angelico
On Thu, Nov 6, 2014 at 7:32 PM, ast wrote: > The fen window goes from it's initial location to the last one > but we dont see all the intermediate steps You usually don't want to use time.sleep() in a GUI program. Try doing the same thing, but with an event loop delay call instead; often, the dis

Moving a window on the screen

2014-11-06 Thread ast
Hi Why the following program doesn't work ? for x in range(0, 100, 10): fen.geometry("200x200+%d+10" % x) time.sleep(0.5) where fen is a window (fen = Tk()) The fen window goes from it's initial location to the last one but we dont see all the intermediate steps thx -- https://m

RE: [OFF-TOPIC] It is true that is impossible write in binary code, the lowest level of programming that you can write is in hex code?

2014-11-06 Thread Clayton Kirkwood
Yeah, the 11 was mesmerizing. You didn't need no stinkin' program to see how busy the system was, you just checked the lights. You could really tell when somebody was compiling or link/loading. As I've done many times since those days, I am amazed how many users could be using the system simultaneo

Re: I need algorithm for my task

2014-11-06 Thread Jussi Piitulainen
Denis McMahon writes: > On Thu, 06 Nov 2014 15:14:05 +1100, Chris Angelico wrote: > > On Thu, Nov 6, 2014 at 3:00 PM, Denis McMahon wrote: > >> def baseword(s): > >> """find shortest sequence which repeats to generate s""" > >> return s[0:["".join([s[0:x]for k in range(int(len(s)/x)+1)])[0: