Re: Favorite non-python language trick?

2005-06-24 Thread Sergei Organov
Steven D'Aprano <[EMAIL PROTECTED]> writes: > On Fri, 24 Jun 2005 00:55:38 -0600, Joseph Garvin wrote: > > > I'm curious -- what is everyone's favorite trick from a non-python > > language? And -- why isn't it in Python? > > Long ago, I used to dabble in Forth. You could say, the entire Forth >

Re: easy float question just eludes me

2005-07-28 Thread Sergei Organov
[EMAIL PROTECTED] writes: > Hullo all ! > > i have a real easy one here that isn't in my book. > i have a int number that i want to divide by 100 and display to two > decimal places. > > like this float(int(Var)/100) > but i need it to display the .00 even if it does not have a .00 value > like

Re: ANN: Kamaelia 0.2.0 released!

2005-08-03 Thread Sergei Organov
[EMAIL PROTECTED] (phil hunt) writes: [...] > Unix pipelines act on ascii files; No, they don't. -- Sergei. -- http://mail.python.org/mailman/listinfo/python-list

Re: py-serial + CSV

2005-08-23 Thread Sergei Organov
Steve Holden <[EMAIL PROTECTED]> writes: > McBooCzech wrote: [...] > > $GPRMC,174525.617,A,5026.1080,N,01521.6724,E,0.0,005.8,230805,,*0A > > etc > > > [...] > > s = serial.Serial(port=0,baudrate=4800, timeout=20) > > while 1: > > line = s.readline() > > words = line.split(',') > >

Re: Python and version control

2005-02-09 Thread Sergei Organov
Carl <[EMAIL PROTECTED]> writes: [...] > I am a keen user of Emacs, but version control, which is very simple > when you are in a Linux environment, for example, is not a > straightforward in Windows. Emacs + CVS (or CVSNT) should work just fine in Windows either. -- Sergei. -- http://mail.pyt

Re: Semaphore or what should I use?

2004-12-02 Thread Sergei Organov
Pierre Barbier de Reuille <[EMAIL PROTECTED]> writes: > Ville Vainio a Иcrit : > >>"Bastian" == Bastian Hammer <[EMAIL PROTECTED]> writes: > > Bastian> Now I have to make sure, that both threads are > > > Bastian> synchronal, 1 thread edits something and the other is > > Bastian>

Re: Semaphore or what should I use?

2004-12-02 Thread Sergei Organov
Ville Vainio <[EMAIL PROTECTED]> writes: > >>>>> "Sergei" == Sergei Organov <[EMAIL PROTECTED]> writes: > > Sergei> My answer to OP's question is: use either lock (mutex) or > Sergei> semaphore. I'd probably use semaphore

Re: goto statement

2005-04-21 Thread Sergei Organov
Maxim Kasimov <[EMAIL PROTECTED]> writes: > 1. comment for debug > > It can be used in the same way, as the comments for debugging are > used, but it will be easier than to use """ or ''', or using > features of text-editors, when it is necessary to comment piece of > code which a

Re: goto statement

2005-04-21 Thread Sergei Organov
Tim Daneliuk <[EMAIL PROTECTED]> writes: [...] > Some HLLs almost have to have it by definition. I cut my teeth as programmer > writing for embedded realtime systems in a HLL (PL/M). While you could, > in theory, completely avoid 'goto' in a realtime environment, it would > make all manner of p

Re: goto statement

2005-04-21 Thread Sergei Organov
Maxim Kasimov <[EMAIL PROTECTED]> writes: > Sergei Organov wrote: > > Maxim Kasimov <[EMAIL PROTECTED]> writes: > > > > >>1. comment for debug > >> > >>It can be used in the same way, as the comments for debugging are used, > >&

Re: goto statement

2005-04-21 Thread Sergei Organov
Grant Edwards <[EMAIL PROTECTED]> writes: > On 2005-04-21, Sergei Organov <[EMAIL PROTECTED]> wrote: > > > Well, I'm writing for embedded realtime systems in C/C++ and > > have never encountered a single need to use goto. > > I have encountered situation

Re: goto statement

2005-04-21 Thread Sergei Organov
Grant Edwards <[EMAIL PROTECTED]> writes: > On 2005-04-21, Sergei Organov <[EMAIL PROTECTED]> wrote: > > Grant Edwards <[EMAIL PROTECTED]> writes: > > > >> On 2005-04-21, Sergei Organov <[EMAIL PROTECTED]> wrote: > >> > >&

Re: goto statement

2005-04-21 Thread Sergei Organov
Grant Edwards <[EMAIL PROTECTED]> writes: > On 2005-04-21, Peter Maas <[EMAIL PROTECTED]> wrote: > > Maxim Kasimov schrieb: > >> but what if i just can't to do this becouse i'm working thrue ssh, and > >> have to use only installed editors (such as vi) > > > > - at first line of block enter: ma (

Re: [Linux] Detect a key press

2006-10-06 Thread Sergei Organov
"Jia,Lu" <[EMAIL PROTECTED]> writes: > Hi all > I write a program to detect key press,but , why there is a *space* > before the character I typed.?? There is none. The output I see when I type 1 2 q is: ->1 ->2 ->q If that is what you see, the problem is in your print "->%s"%ch

Re: Visibility against an unknown background

2006-10-24 Thread Sergei Organov
"Odalrick" <[EMAIL PROTECTED]> writes: > I need to draw visible lines on pictures with wxPython. That means I > can't simply use, for instance, a black line since it wont be visible > on a black or dark picture. > > Painting applications like the GIMP accomplish this by altering the > colour of th

Re: Visibility against an unknown background

2006-10-24 Thread Sergei Organov
Fredrik Lundh <[EMAIL PROTECTED]> writes: > Sergei Organov wrote: > >> There is a better way to do it. Check if the toolkit has line drawing >> mode that XORs the line color with the background, then draw using this >> mode and white color of the line. > > which

Re: Visibility against an unknown background

2006-10-25 Thread Sergei Organov
"Filip Salomonsson" <[EMAIL PROTECTED]> writes: > On 10/24/06, Sergei Organov <[EMAIL PROTECTED]> wrote: >> I'd be very upset to see, say, 5-6 highly intersecting >> scientific plots on the same picture drawn using the >> "marching ants" ap

Re: Visibility against an unknown background

2006-10-25 Thread Sergei Organov
Fredrik Lundh <[EMAIL PROTECTED]> writes: > Sergei Organov wrote: > [...] >> Where "most cases" depends on application. I'd be very upset to see, >> say, 5-6 highly intersecting scientific plots on the same picture drawn >> using the "marching an

Re: Watching serial port activity.

2006-05-30 Thread Sergei Organov
Grant Edwards <[EMAIL PROTECTED]> writes: > On 2006-05-30, TheSeeker <[EMAIL PROTECTED]> wrote: > >> Have you looked into slsnif >> (http://www.dakotacom.net/~ymg/software.html) > > FYI, slsnif won't work for any serial program that needs to use > parity, 7 data bits, or any of the modem control/s

Re: Watching serial port activity.

2006-06-01 Thread Sergei Organov
Grant Edwards <[EMAIL PROTECTED]> writes: > On 2006-05-31, Sergei Organov <[EMAIL PROTECTED]> wrote: > >> It seems that sniff on a real tty device could be implemented using the >> same technique strace uses to intercept and show syscalls, though I'm >>

Re: a good programming text editor (not IDE)

2006-06-16 Thread Sergei Organov
John Salerno <[EMAIL PROTECTED]> writes: > I know there's a request for a good IDE at least once a week on the ng, > but hopefully this question is a little different. I'm looking for > suggestions for a good cross-platform text editor (which the features > for coding, such as syntax highlightin

Re: Outbound port on sockets

2006-09-14 Thread Sergei Organov
"bmearns" <[EMAIL PROTECTED]> writes: > Quick follow up, I'm able to connect to other external FTP sites behind > my firewall and router, no problem. You've been told already to implement PASV command in your server (then client will be able to use so called passive mode). -- Sergei. -- http:/

Re: Outbound port on sockets

2006-09-15 Thread Sergei Organov
Grant Edwards <[EMAIL PROTECTED]> writes: > On 2006-09-15, Diez B. Roggisch <[EMAIL PROTECTED]> wrote: > > Is it possible to specify which port to use as the outbound port on a > connection? >>> [...] > Specifically, I'm trying to write an FTP host, and I'm trying to > implement t

Re: how do you pronounce 'tuple'?

2006-02-13 Thread Sergei Organov
John Salerno <[EMAIL PROTECTED]> writes: > Yes, silly question, but it keeps me up at night. :) > > I know it comes from the suffix -tuple, which makes me think it's > pronounced as 'toople', but I've seen (at m-w.com) that the first > pronunciation option is 'tuhple', so I wasn't sure. Maybe i

Re: Incorrect Decimal-Float behaviour in comparison tests

2006-03-03 Thread Sergei Organov
"Fredrik Lundh" <[EMAIL PROTECTED]> writes: > "Cassiano, Marco" wrote: > >> I have difficulties with a weird Python 2.4.2 behaviour in comparing >> Decimal to Floats. >> >> For Example : >> >> >> >>> from decimal import Decimal >> >>> a=Decimal('3.7') >> >>> b=6.3 >> >> >>> if a > b :print a,b,'a

Re: Encryption with Python?

2005-05-07 Thread Sergei Organov
"Anthra Norell" <[EMAIL PROTECTED]> writes: > Thanks a lot for the feedback. This is certainly a great learning > experience. It's a fascinating topic too. Without wishing to annoy, I'd be > interested in knowing more. I insert questions below. There is a lot of information about the issues on th

Re: Strings for a newbie

2005-05-27 Thread Sergei Organov
"Malcolm Wooden" <[EMAIL PROTECTED]> writes: > I'm trying to get my head around Python but seem to be failing miserably. I > use RealBasic on a Mac and find it an absolute dream! But PythonUGH! > > I want to put a sentence of words into an array, eg "This is a sentence of > words" > > In R

Re: Is PEP-8 a Code or More of a Guideline?

2007-05-28 Thread Sergei Organov
Roy Smith <[EMAIL PROTECTED]> writes: [...] > On the other hand, I'm convinced that words_with_underscores, is easier to > read. This is especially true when abbreviations creep into variable > names. It's certainly easier to parse ip_address as compared to IPAddress. > Same with snmp_manager

Re: Parallel Python

2007-01-10 Thread Sergei Organov
[EMAIL PROTECTED] (Nick Maclaren) writes: > In article <[EMAIL PROTECTED]>, > "sturlamolden" <[EMAIL PROTECTED]> writes: [...] > |> I wonder if too much emphasis is put on thread programming these days. > |> Threads may be nice for programming web servers and the like, but not > |> for numerical co

Re: Parallel Python

2007-01-11 Thread Sergei Organov
[EMAIL PROTECTED] (Nick Maclaren) writes: > In article <[EMAIL PROTECTED]>, > Sergei Organov <[EMAIL PROTECTED]> writes: > |> > |> Do you mean that POSIX threads are inherently designed and implemented > |> to stay idle most of the time?! If so, I'm a

Re: Parallel Python

2007-01-11 Thread Sergei Organov
[EMAIL PROTECTED] (Nick Maclaren) writes: [...] > I mean precisely the first. > > The C99 standard uses a bizarre consistency model, which requires serial > execution, and its consistency is defined in terms of only volatile > objects and external I/O. Any form of memory access, signalling or > wh

Re: multithreading concept

2007-02-07 Thread Sergei Organov
"sturlamolden" <[EMAIL PROTECTED]> writes: > On Feb 7, 6:17 pm, John Nagle <[EMAIL PROTECTED]> wrote: [...] > MPI does not use threads on SMPs because it performs worse than using > multiple processes. I fail to see how threads in general could perform worse than processes. I do understand that pr

Re: Conditions vs Events

2006-04-20 Thread Sergei Organov
"Carl J. Van Arsdall" <[EMAIL PROTECTED]> writes: > Le Monde De Python, > > I've been working a lot with python threads from the threading module. > Specifically, when is it better to use a condition object vs an event > object? Condition is the universal primitive for waiting for some conditio

Re: threading, how to?

2006-04-21 Thread Sergei Organov
"akrapus" <[EMAIL PROTECTED]> writes: > Hi, > > I am trying to understand how to use threading in Python. I get > threading as a concept, but not the implementation. > > In order to start threading, do you call it as a separate function, > which will then be applied to the rest of the code (functi

Re: threading, how to?

2006-04-21 Thread Sergei Organov
"akrapus" <[EMAIL PROTECTED]> writes: > Thanks for reply. > > So would it be implemented as follows: > > Func 1 > Func 2 > Func 3 > > Thread for Func 1 > Thread for Func 2 > Thread for Func 3 Yes, if you wish to run every of your 3 functions in a separate thread. -- Sergei. -- http://mail.pyth

Re: Because of multithreading semantics, this is not reliable.

2006-05-04 Thread Sergei Organov
"Olaf Meding" <[EMAIL PROTECTED]> writes: >> return result before that line, some other thread added a value ! > > Sure, but that is the nature of using threads and a mutex. I hope you are > you not saying that every function that uses a mutex should have a comment > saying this is not "reliabl

Re: Python 3.0 or Python 3000?

2006-04-10 Thread Sergei Organov
Dennis Lee Bieber <[EMAIL PROTECTED]> writes: > On Mon, 10 Apr 2006 12:12:58 +0200, Benjamin Niemann <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: >> >> That's actually the versioning scheme of TeX, currently being at 3.141592 > >My last exposure to TeX was some 15 od

Re: Python 3.0 or Python 3000?

2006-04-10 Thread Sergei Organov
Robert Kern <[EMAIL PROTECTED]> writes: > Sergei Organov wrote: >> Dennis Lee Bieber <[EMAIL PROTECTED]> writes: >> >>>On Mon, 10 Apr 2006 12:12:58 +0200, Benjamin Niemann <[EMAIL PROTECTED]> >>>declaimed the following in comp.lang.python: [...]

Re: Python 3.0 or Python 3000?

2006-04-11 Thread Sergei Organov
Dennis Lee Bieber <[EMAIL PROTECTED]> writes: > On Tue, 11 Apr 2006 09:40:50 +0400, Sergei Organov <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > >> >> Anyway, it's unfair to speak of one of the most wonderful pieces of >> softwa

Re: Python editing with emacs/wordstar key bindings.

2006-04-13 Thread Sergei Organov
"BartlebyScrivener" <[EMAIL PROTECTED]> writes: >>> When all I started looking for was a more robust editor for Python ;-) > > Both WingIDE and Komodo Dragon allow for customization of keyboard > bindings. They aren't free, but they cost only $30.00 or so. Cheap for > what you get, especially in th

Re: list.clear() missing?!?

2006-04-13 Thread Sergei Organov
Peter Hansen <[EMAIL PROTECTED]> writes: [...] > Then it's a good reason we had this thread, so you could learn something > *crucial* to understanding Python and writing non-buggy code: name > binding versus variables which occupy fixed memory locations like in > some other languages. This has

Re: list.clear() missing?!?

2006-04-14 Thread Sergei Organov
Dennis Lee Bieber <[EMAIL PROTECTED]> writes: > On Fri, 14 Apr 2006 09:17:05 +0400, Sergei Organov <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > >> >> I, as a newcomer, don't have much trouble understanding the binding vs >> the

Re: Python editing with emacs/wordstar key bindings.

2006-04-14 Thread Sergei Organov
"BartlebyScrivener" <[EMAIL PROTECTED]> writes: > Yes, but for some reason, I get more and better help here with Python > than on xemacs. Or maybe I've just had bad luck. Something like the > following just leaves me scratching my head. I'm on Windows XP and > never compiled anything that I know