Re: New to Python - block grouping (spaces)

2015-04-19 Thread CHIN Dihedral
On Thursday, April 16, 2015 at 11:06:28 PM UTC+8, Mark Lawrence wrote: > On 16/04/2015 15:52, Blake McBride wrote: > > > So, Python may be a cute language for you to use as an individual, but it > > is unwieldy in a real development environment. > > > > Thanks for this, one of the funniest comme

Re: generator/coroutine terminology

2015-04-18 Thread CHIN Dihedral
On Friday, March 13, 2015 at 5:36:35 PM UTC+8, Marko Rauhamaa wrote: > Rustom Mody : > > > Nice demo of the same confusing terminology we are talking about. > > Why don't you just stick with the terminology of the language > specification? I think your students are going to be more confused if >

Re: What is elegant way to do configuration on server app

2015-03-27 Thread CHIN Dihedral
On Thursday, March 26, 2015 at 4:19:33 PM UTC+8, Jerry OELoo wrote: > Hi. > I have used python to provide a web service app, it will running 7*24, > and it will return some data to client by API. http://jonpy.sourceforge.net/modpy.html Check the page of modpy and django. -- https://mail.python.o

Re: Basic Python V3 Search Tool using RE module

2015-03-26 Thread CHIN Dihedral
> Gregg Dotoli Are you reminding everyone who had a PC running DOS2.X-3X in 1990. It was really a pain at that time that a hard disk of an intel-MS based PC was sold hundreds of dollars, and another pain was that the buyer had to use the disabled dir in DOS after buying a HD. -- https://ma

Re: fibonacci series what Iam is missing ?

2015-03-24 Thread CHIN Dihedral
On Tuesday, March 24, 2015 at 10:24:59 PM UTC+8, Ian wrote: > On Tue, Mar 24, 2015 at 12:20 AM, Rustom Mody wrote: > > On Tuesday, March 24, 2015 at 10:51:11 AM UTC+5:30, Ian wrote: > >> Iteration in log space. On my desktop, this calculates fib(1000) in > >> about 9 us, fib(10) in about 5 ms,

Re: fibonacci series what Iam is missing ?

2015-03-24 Thread CHIN Dihedral
On Tuesday, March 24, 2015 at 6:54:20 AM UTC+8, Terry Reedy wrote: > On 3/23/2015 2:44 PM, Dave Angel wrote: > > > ## Example 2: Using recursion with caching > > cache = [0, 1] > > def fib4(n): > > if len(cache) <= n: > > value = fib4(n-2) + fib4(n-1) > > cache.append(value)

Re: fibonacci series what Iam is missing ?

2015-03-23 Thread CHIN Dihedral
On Tuesday, March 24, 2015 at 1:00:11 AM UTC+8, Chris Angelico wrote: > On Tue, Mar 24, 2015 at 3:16 AM, Dave Angel wrote: > > An entirely separate question is whether you can gain performance by caching > > intermediate values. For example, if you capture values in a list, you > > could potentia

Re: Windows service in production?

2015-03-19 Thread CHIN Dihedral
Please check wxpython and there was an example. -- https://mail.python.org/mailman/listinfo/python-list

Re: Example of python service running under systemd?

2014-09-12 Thread CHIN Dihedral
On Friday, September 12, 2014 1:48:37 AM UTC+8, Travis Griggs wrote: > I've been reading lots of systemd docs. And blogs. Etc. At this point, I > think I would benefit from learning by example... > > > > Does anyone have an example .service file that they use to launch a long > running service

Re: Why can not initialize the class?

2014-08-23 Thread CHIN Dihedral
On Saturday, August 23, 2014 7:29:44 AM UTC+8, luofeiyu wrote: > One final version: > > > > class Contact(object): > > def __init__(self, email="haha@haha"): > > self.email = email > > def _get_email(self): > > return self._the_secret_private_email > > def _

Re: the output in reference of descriptor.

2014-08-22 Thread CHIN Dihedral
On Friday, August 22, 2014 9:25:02 AM UTC+8, luofeiyu wrote: > class C(object): > Well, in python class is treated as onte of the first class built in operations. class "new_class_ame" ( parentclasses) Please check this syntax first in Python. > a = 'abc' > > def __getattri

Re: Python vs C++

2014-08-22 Thread CHIN Dihedral
On Friday, August 22, 2014 8:26:00 AM UTC+8, Chris Angelico wrote: > On Fri, Aug 22, 2014 at 4:05 AM, Joseph Martinot-Lagarde > > wrote: > > > For information, Cython works with C++ now: > > > http://docs.cython.org/src/userguide/wrapping_CPlusPlus.html. > > > > Now isn't that cool! > > >

Re: try/exception - error block

2014-08-03 Thread CHIN Dihedral
On Sunday, August 3, 2014 10:39:19 PM UTC+8, Roy Smith wrote: > In article , > > bruce wrote: > > > > > I'm posting the test code I'm using. Pointers/comments would be > > > helpful/useful. > > > > It would be really helpful if you could post a minimal code example > > which demonstrat

Re: one to many (passing variables)

2014-07-28 Thread CHIN Dihedral
On Tuesday, July 29, 2014 3:29:04 AM UTC+8, Terry Reedy wrote: > On 7/25/2014 9:47 PM, C.D. Reimer wrote: > > > > > > On 7/24/2014 2:58 AM, Ben Finney wrote: > > >> Here is an article on good API design; the principles apply to Python > > >> http://blog.isnotworking.com/2007/05/api-design-guide

Re: Anything better than asyncio.as_completed() and asyncio.wait() to manage execution of large amount of tasks?

2014-07-22 Thread CHIN Dihedral
On Thursday, July 17, 2014 7:09:02 AM UTC+8, Maxime Steisel wrote: > 2014-07-15 14:20 GMT+02:00 Valery Khamenya : > > > Hi, > > > > > > both asyncio.as_completed() and asyncio.wait() work with lists only. No > > > generators are accepted. Are there anything similar to those functions that > >

Re: Network/multi-user program

2014-07-21 Thread CHIN Dihedral
> > almost nothing about JS. I worked thru a short generic tutorial a couple > Please check Pyjs and Python with flash in http://pyjs.org/examples/Space.html for the front end part of GUI under a browser. -- https://mail.python.org/mailman/listinfo/python-list

Re: Python and IDEs [was Re: Python 3 is killing Python]

2014-07-21 Thread CHIN Dihedral
On Sunday, July 20, 2014 9:53:02 AM UTC+8, C.D. Reimer wrote: > On 7/19/2014 6:23 PM, Steven D'Aprano wrote: > > > I haven't used Python on Windows much, but when I did use it, I found > > > the standard Python interactive interpreter running under cmd.exe to > > > be bare- bones but usable fo

Re: Confused with Functions and decorators

2014-07-21 Thread CHIN Dihedral
On Saturday, July 19, 2014 8:44:25 PM UTC+8, Wojciech Giel wrote: > On 19/07/14 12:40, Jerry lu wrote: > > > oh yeah i forgot about the decorators. Um say that you wanted to decorate a > > function with the outer() func you would just put @outer on top of it? And > > this is the same as passing

Re: OT: This Swift thing

2014-06-15 Thread CHIN Dihedral
On Wednesday, June 4, 2014 10:53:13 PM UTC+8, Mark H. Harris wrote: > On 6/4/14 9:24 AM, Skip Montanaro wrote: > > > Surely your local colleagues realize that Python has been around for > > > 20-odd years now, that indentation-based block structure has been > > > there since Day One, and that it

Re: Windows automatic rebooting due to faulty code

2014-05-23 Thread CHIN Dihedral
On Saturday, May 24, 2014 12:08:24 AM UTC+8, Ronak Dhakan wrote: > It is a small file to draw an approximate circle using Turtle. The reboot > does not happen consistently. Here is the code: http://pastebin.com/8T3aRCEd > > > > I was thinking whether there is a way to run python in a virtual en

Re: How to implement key of key in python?

2014-05-09 Thread CHIN Dihedral
On Saturday, May 10, 2014 9:22:43 AM UTC+8, eckh...@gmail.com wrote: > I'm migrating from Perl to Python and unable to identify the equivalent of > key of key concept. The following codes run well, > > > > import csv > > >

Re: Tutorials for Reorganizing Spreadsheet Data

2014-05-05 Thread CHIN Dihedral
On Wednesday, April 16, 2014 9:50:25 PM UTC+8, joseph...@gmail.com wrote: > Hello, I'm a high school physics teacher and while I've played with Python > enough to make a rock paper scissors program or animation of a bouncing ball > (with air resistance!), I've never used it to work with data from

Re: socket client and server in one application?

2014-05-05 Thread CHIN Dihedral
On Monday, May 5, 2014 11:33:38 PM UTC+8, ch...@freeranger.com wrote: > I have a python script that uses a serial port to read data from an xbee > radio and it delivers the data to a socket server. > > > > Now I need to retrieve the data from a socket client so I can send data out > on the com

Re: object().__dict__

2014-04-23 Thread CHIN Dihedral
On Wednesday, April 23, 2014 10:21:26 PM UTC+8, Amirouche Boubekki wrote: > 2014-04-23 15:59 GMT+02:00 Phil Connell : > > > > On Wed, Apr 23, 2014 at 03:48:32PM +0200, Amirouche Boubekki wrote: > > > 2014-04-23 8:11 GMT+02:00 Cameron Simpson : > > > > > Look up the "__slots__" dunder var in t

Re: Why Python 3?

2014-04-20 Thread CHIN Dihedral
On Saturday, April 19, 2014 12:50:09 PM UTC+8, Ethan Furman wrote: > On 04/18/2014 08:28 PM, Anthony Papillion wrote: > > > > > > What is the general feel of /this/ community? I'm about to start a > > > large scale Python project. Should it be done in 2 or 3? What are the > > > benefits, aside