Re: [OT] What can Nuitka do?

2014-06-30 Thread Michael Torrie
I highly recommend the talk by Daniel Stone who used to be a core X.org developer. He explains it quite well how X is used currently, and why it has problems and why they are considered so hard to fix that Wayland (and Mir) was created. https://www.youtube.com/watch?v=RIctzAQOe44 One interesting

Re: [OT] What can Nuitka do?

2014-06-30 Thread Michael Torrie
On 06/30/2014 07:36 AM, Chris Angelico wrote: > Hmm. I'm not sure that it's necessarily that bad; I've done 3G-based > X11 forwarding fairly successfully on occasion. Yes, it's potentially > quite slow, but it certainly works - I've used SciTE, for instance, > and I've used some GTK2 apps without p

Re: Translation of Python!

2014-06-30 Thread Steven D'Aprano
On Mon, 30 Jun 2014 14:24:46 -0600, Michael Torrie wrote: > On 06/30/2014 12:37 PM, Doriven Basha wrote: >> I want to translate it into my language like the chinese python >> https://code.google.com/p/zhpy/w/list?q=label:Chinese can you help me? > > I don't understand chinese, so I am not sure wh

Re:Writing files at run time

2014-06-30 Thread Dave Angel
subhabangal...@gmail.com Wrote in message: > Dear Group, > > In my previous > post["https://groups.google.com/forum/#!topic/comp.lang.python/ZYjsskV5MgE";] > I was trying to discuss some issue on file writing. > > I got an associated issue. > > I am trying to crawl a link, through urllib and

Re: Python While loop Takes too much time.

2014-06-30 Thread Gregory Ewing
marco.naw...@colosso.nl wrote: In the past I even dumped an EXCEL sheet as a CSV file That's probably the only way you'll speed things up significantly. In my experience, accessing Excel via COM is abysmally slow no matter how you go about it. -- Greg -- https://mail.python.org/mailman/listinf

Validating Data Extracted from Files

2014-06-30 Thread Ari King
Hi, I'm sourcing data from multiple excel files (workbooks) each with multiple worksheets. Prior to persisting the aggregated data, I want to validate it. I was thinking of creating classes to hold the data and validate type and content via methods. I'd appreciate feedback on this approach, sug

Re: Writing Multiple files at a times

2014-06-30 Thread Denis McMahon
On Mon, 30 Jun 2014 12:23:08 -0700, subhabangalore wrote: > Thank you for your kind suggestion. But I am not being able to sort out, > "fp = open( "scraped/body{:0>5d}.htm".format( n ), "w" ) " > please suggest. look up the python manual for string.format() and open() functions. The line indicat

Re: Creating a dict-like class that counts successful and failed key matches

2014-06-30 Thread Chris Angelico
On Tue, Jul 1, 2014 at 2:47 AM, wrote: > I'm not sure I understand. Are you saying that Chris's __getitem__ will > not be called by other dict methods that would normally call this magic > method and instead call the parent's __getitem__ directly (via super() > or something similar?)? He's point

Re: unorderable error: less ok, equal ok, less-or-equal gives unorderable error!

2014-06-30 Thread Ethan Furman
On 06/30/2014 12:34 PM, Peter Otten wrote: RainyDay wrote: def __eq__(self, other): return self._loc == getattr(other, "_loc", None) Note that None is not a good default when _loc is expected to be a tuple: In this case None is not being returned, but will be comparid with sel

Re: unorderable error: less ok, equal ok, less-or-equal gives unorderable error!

2014-06-30 Thread RainyDay
On Monday, June 30, 2014 3:34:25 PM UTC-4, Peter Otten wrote: > RainyDay wrote: > > > > > Hi, in python 3.4.1, I get this surpising behaviour: > > > > > l=Loc(0,0) > > l2=Loc(1,1) > > l>l2 > > > False > > l > > True > > l<=l2 > > > Traceback (most recent call l

Re: Translation of Python!

2014-06-30 Thread Michael Torrie
On 06/30/2014 12:37 PM, Doriven Basha wrote: > I want to translate it into my language like the chinese python > https://code.google.com/p/zhpy/w/list?q=label:Chinese can you help > me? I don't understand chinese, so I am not sure what this web page is about. Do you want to translate Python's mess

Writing files at run time

2014-06-30 Thread subhabangalore
Dear Group, In my previous post["https://groups.google.com/forum/#!topic/comp.lang.python/ZYjsskV5MgE";] I was trying to discuss some issue on file writing. I got an associated issue. I am trying to crawl a link, through urllib and trying to store its results in different files. As discusse

Re: Creating a dict-like class that counts successful and failed key matches

2014-06-30 Thread python
Ethan, >> Is this specific to the native Dict class (because its implemented in C vs. >> Python?) or is this behavior more general. > I /think/ it's only dict, but I haven't played with subclassing lists, > tuples, etc. It's not a C vs Python issue, but a 'implemented with __private methods'

Re: unorderable error: less ok, equal ok, less-or-equal gives unorderable error!

2014-06-30 Thread Peter Otten
RainyDay wrote: > Hi, in python 3.4.1, I get this surpising behaviour: > l=Loc(0,0) l2=Loc(1,1) l>l2 > False l True l<=l2 > Traceback (most recent call last): > File "", line 1, in > TypeError: unorderable types: Loc() <= Loc() l==l2 > False l True > > Loc i

Re: Writing Multiple files at a times

2014-06-30 Thread subhabangalore
On Sunday, June 29, 2014 4:19:27 PM UTC+5:30, subhaba...@gmail.com wrote: > Dear Group, > > > > I am trying to crawl multiple URLs. As they are coming I want to write them > as string, as they are coming, preferably in a queue. > > > > If any one of the esteemed members of the group may kin

unorderable error: less ok, equal ok, less-or-equal gives unorderable error!

2014-06-30 Thread RainyDay
Hi, in python 3.4.1, I get this surpising behaviour: >>> l=Loc(0,0) >>> l2=Loc(1,1) >>> l>l2 False >>> l>> l<=l2 Traceback (most recent call last): File "", line 1, in TypeError: unorderable types: Loc() <= Loc() >>> l==l2 False >>> lhttps://mail.python.org/mailman/listinfo/python-list

Re: Translation of Python!

2014-06-30 Thread Doriven Basha
On Monday, June 30, 2014 8:37:43 PM UTC+2, Doriven Basha wrote: > I want to translate it into my language like the chinese python > https://code.google.com/p/zhpy/w/list?q=label:Chinese > > can you help me? -- https://mail.python.org/mailman/listinfo/python-list

Re: Translation of Python!

2014-06-30 Thread Doriven Basha
I want to translate it into my language like the chinese python https://code.google.com/p/zhpy/w/list?q=label:Chinese can you help me? -- https://mail.python.org/mailman/listinfo/python-list

Re: Python While loop Takes too much time.

2014-06-30 Thread marco . nawijn
On Monday, June 30, 2014 1:32:23 PM UTC+2, Jaydeep Patil wrote: > I have did excel automation using python. > > In my code I am creating python dictionaries for different three columns data > at a time.There are are many rows above 4000. Lets have look in below > function. Why it is taking too m

Re: Creating a dict-like class that counts successful and failed key matches

2014-06-30 Thread Ethan Furman
On 06/30/2014 09:47 AM, pyt...@bdurham.com wrote: Keep in mind that dict /will not/ call your overridden methods, so if, for example, you provide your own __getitem__ you will also need to provide your own copies of any dict method that calls __getitem__. I'm not sure I understand. Are you say

Re: Creating a dict-like class that counts successful and failed key matches

2014-06-30 Thread python
Ethan, > Keep in mind that dict /will not/ call your overridden methods, so if, for > example, you provide your own __getitem__ you will also need to provide your own copies of any dict method that calls __getitem__. I'm not sure I understand. Are you saying that Chris's __getitem__ will not be

Re: Creating a dict-like class that counts successful and failed key matches

2014-06-30 Thread Ethan Furman
On 06/30/2014 07:44 AM, pyt...@bdurham.com wrote: Nice!!! I need to study your solution, but at first blush it looks exactly like what I wanted to implement. Keep in mind that dict /will not/ call your overridden methods, so if, for example, you provide your own __getitem__ you will also nee

Re: Creating a dict-like class that counts successful and failed key matches

2014-06-30 Thread python
Hi Chris, > Sounds like you want to subclass dict, then. Something like this: Nice!!! I need to study your solution, but at first blush it looks exactly like what I wanted to implement. Thank you! Malcolm -- https://mail.python.org/mailman/listinfo/python-list

Re: Creating a dict-like class that counts successful and failed key matches

2014-06-30 Thread Chris Angelico
On Mon, Jun 30, 2014 at 11:43 PM, wrote: > As a diagnostic tool, I would like to create a dict-like class that counts > successful and failed key matches by key. By failed I mean in the sense that > a default value was returned vs. an exception raised. By count, I mean by > tracking counts for in

Re: Creating a dict-like class that counts successful and failed key matches

2014-06-30 Thread python
After some additional research, it looks like I may have even more options to consider including using a UserDict mixin. I think I've identified another magic method to subclass ... __missing__. - Original message - From: [1]pyt...@bdurham.com To: [2]python-list@python.org Subjec

Creating a dict-like class that counts successful and failed key matches

2014-06-30 Thread python
As a diagnostic tool, I would like to create a dict-like class that counts successful and failed key matches by key. By failed I mean in the sense that a default value was returned vs. an exception raised. By count, I mean by tracking counts for individual keys vs. just total success/failure counts

Re: [OT] What can Nuitka do?

2014-06-30 Thread Chris Angelico
On Mon, Jun 30, 2014 at 11:10 PM, Michael Torrie wrote: > Only the most primitive X11 apps are at all fast over network > forwarding. If the app uses any modern toolkit, then it's basically > just sending a bunch of bitmaps over the wire (changes), which would be > fine, but X11 involves a lot of

Re: [OT] What can Nuitka do?

2014-06-30 Thread Michael Torrie
On 06/28/2014 09:16 AM, Chris Angelico wrote: >> I remember approx. 10 years ago a neighboring dept. at my work effectively >> killed our 10 MB/s Ethernet segment with such traffic (due to a >> misconfigured switch/router?). Running an ethernet analyzer showed a single >> X11 host-server session oc

Re: Python While loop Takes too much time.

2014-06-30 Thread Peter Otten
Jaydeep Patil wrote: > I have did excel automation using python. > In my code I am creating python dictionaries for different three columns > data at a time.There are are many rows above 4000. Lets have look in below > function. Why it is taking too much time? > > Code: > > def transientTestDict

Python While loop Takes too much time.

2014-06-30 Thread Jaydeep Patil
I have did excel automation using python. In my code I am creating python dictionaries for different three columns data at a time.There are are many rows above 4000. Lets have look in below function. Why it is taking too much time? Code: def transientTestDict(self,ws,startrow,startcol):

Re: [Q] override __init__() method of classes implemented in C

2014-06-30 Thread Makoto Kuwata
On Mon, Jun 30, 2014 at 4:52 PM, Chris Angelico wrote: > > Actually, __init__ isn't the problem here, __new__ is. > > class Foo(datetime): > def __new__(self): > return super().__new__(self,2014,1,1) > > >>> Foo() > Foo(2014, 1, 1, 0, 0) > > Maybe that helps, maybe it doesn't, but the

Re: [Q] override __init__() method of classes implemented in C

2014-06-30 Thread Chris Angelico
On Mon, Jun 30, 2014 at 5:45 PM, Makoto Kuwata wrote: > Result (Python 2.7.7 and 3.4.1): > > Traceback (most recent call last): > File "hoge.py", line 7, in >obj = Foo() > TypeError: Required argument 'year' (pos 1) not found > > > It seems to be failed to override datetime.__init__() in sub

[Q] override __init__() method of classes implemented in C

2014-06-30 Thread Makoto Kuwata
Is it impossible to override __init__() method of classes implemented in C (such as datetime.datetime) ? example.py: from datetime import datetime class Foo(datetime): def __init__(self): pass obj = Foo() Result (Python 2.7.7 and 3.4.1): Traceback (most recent call last): File

Re: Translation of Python!

2014-06-30 Thread INADA Naoki
Do you mean translating official document? We are translating docs into Japanese using Transifex. https://www.transifex.com/projects/p/python-33-ja/ But I hope PSF have official project on Transifex. On Mon, Jun 30, 2014 at 4:24 PM, Doriven Basha wrote: > Hello everybody! > I want to translate

Translation of Python!

2014-06-30 Thread Doriven Basha
Hello everybody! I want to translate python into albanian language because it's very flexible and similar to english words used in programming.Can anybody help me to start translation of the python the programm used or anything else to get started with programming translation???I can do it by my