Re: Php vs Python gui (tkinter...) for small remote database app

2021-06-15 Thread Tomasz Rola
on, choose your framework and do the gui. If you go with tkinter, then you will have to do the job already done by authors of web server and web framework, you will have to rethink various problems they gave their thoughts to, but in much shorter time and on your own. -- Regards, Tomasz Rola -- *

Re: convert script awk in python

2021-03-23 Thread Tomasz Rola
then with rewrite one also has to make sure new code is drop in replacement for the old. There is very nice documentation to gawk (Gnu AWK). -- Regards, Tomasz Rola -- ** A C programmer asked whether computer had Buddha's nature. ** ** As the answer, master did "rm -rif"

Re: How to record the console's content in the interpreter?

2019-08-23 Thread Tomasz Rola
EPL for Emacs and with an interface similar to command shells such as bash, zsh, rc, or 4dos. [ https://www.gnu.org/software/emacs/manual/html_mono/eshell.html ] -- Regards, Tomasz Rola -- ** A C programmer asked whether computer had Buddha's nature. ** ** As the answer, master did &quo

Re: ESR "Waning of Python" post

2018-10-11 Thread Tomasz Rola
i.e. nodes, I assume? How many edges (arcs, lines) for a node, on average? on max? I am curious, as always. Because it is nice of him to rant, but technical/mathematical side of decision making is still a bit too foggy for me and I cannot assess it. -- Regards, Tomasz Rola -- ** A C programmer

Re: don't quite understand mailing list

2018-09-10 Thread Tomasz Rola
r long enough, you will finally learn enough to solve your problem(s). Maybe you will even be able to unsubscribe on your very own? HTH -- Regards, Tomasz Rola -- ** A C programmer asked whether computer had Buddha's nature. ** ** As the answer, master did "rm -rif" on t

Re: How to install matplotlib in Debian 9

2018-06-11 Thread Tomasz Rola
so, you may want to make sure it does not mess with the stable part before you run it. The stable part - i.e. the part of the Debian that is maintained with aptitude/apt* commands. Like /usr, /bin, good part of /var etc. HTH -- Regards, Tomasz Rola -- ** A C programmer asked whethe

Re: [Glitch?] Python has just stopped working

2017-02-23 Thread tomasz . wisniewski . gm
W dniu wtorek, 16 lutego 2016 21:09:50 UTC+1 użytkownik Theo Hamilton napisał: > I woke up two days ago to find out that python literally won't work any > more. I have looked everywhere, asked multiple Stack Overflow questions, > and am ready to give up. Whenever I run python (3.5), I get the follo

Re: Quick way to calculate lines of code/comments in a collection of Python scripts?

2016-10-24 Thread Tomasz Rola
On Mon, Oct 24, 2016 at 10:03:29AM +0100, Stephen Tucker wrote: > Tomasz, > > How about using the command prompt command FIND /C on each of your source > files as follows: > > FIND/C "#" >NumbersOfLinesContainingPythonComments.dat > FIND/C /V "#" &g

Re: Quick way to calculate lines of code/comments in a collection of Python scripts?

2016-10-23 Thread Tomasz Rola
: http://www.dwheeler.com/sloccount/ -- Regards, Tomasz Rola -- ** A C programmer asked whether computer had Buddha's nature. ** ** As the answer, master did "rm -rif" on the programmer's home** **

Re: Fortran

2014-05-11 Thread Tomasz Rola
On Mon, May 12, 2014 at 02:42:13AM +1000, Chris Angelico wrote: > On Mon, May 12, 2014 at 2:09 AM, Tomasz Rola wrote: > > Given that Fortran is here for almost 60 years and lot of effort has > > been spent to keep it backwards compatible (AFAIK), I wouldn't hold my > >

Re: Fortran (Was: The "does Python have variables?" debate)

2014-05-11 Thread Tomasz Rola
thers will not be influenced by such attitude :-). Neglecting someone's effort to make working flawless code, forcing people into periodic rewrites of things that used to work, such events always blink red in my head. -- Re

Re: unicode to human readable format

2013-12-27 Thread tomasz . kaczorek
hello, can I ask you for help? when I try to print s[0] i vane the message: UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-1: ordinal not in range(128). how to solve my problem, please? regards, t. -- https://mail.python.org/mailman/listinfo/python-list

unicode to human readable format

2013-12-22 Thread tomasz . kaczorek
Hi, i'm looking for solution the unicode string translation to the more readable format. I've got string like s=s=[u'\u0105\u017c\u0119\u0142\u0144'] and have no idea how to change to the human readable format. please help! regards, tomasz -- https://mail.python.org/mai

Re: My son wants me to teach him Python

2013-06-13 Thread Tomasz Rola
I've reposted on another list and got this reply. At first I was sceptic a bit, but for the sake of completeness, here goes. Processing language seems to be interesting in its own right. Examples are Java-flavoured, images are ok. Regards, Tomasz Rola -- ** A C programmer asked wh

Re: My son wants me to teach him Python

2013-06-13 Thread Tomasz Rola
functional-programming-philosophical.html > Nevertheless it seems to be the best there is at the moment. Mee too! For this reason I am exploring Ocaml and SML. Regards, Tomasz Rola -- ** A C programmer asked whether computer had Buddha's nature. ** ** As t

Re: Calculate Big Number

2013-01-07 Thread Tomasz Rola
P folks are doing: http://en.wikipedia.org/wiki/GNU_Multi-Precision_Library Regards, Tomasz Rola -- ** A C programmer asked whether computer had Buddha's nature. ** ** As the answer, master did "rm -rif" on the programmer's home** ** directory.

Re: which one do you prefer? python with C# or java?

2012-06-15 Thread Tomasz Rola
On Fri, 15 Jun 2012, Terry Reedy wrote: > On 6/15/2012 1:03 PM, Tomasz Rola wrote: > > > Last time I checked, Python didn't have linked lists - arrayed lists are > > nice, but their elements can't be automatically GC-ed (or, this requires > > very nontrivial GC

Re: which one do you prefer? python with C# or java?

2012-06-15 Thread Tomasz Rola
uch) even if you'd like to. Myself, I love more choice, but of course everybody can have his own preferences. Regards, Tomasz Rola -- ** A C programmer asked whether computer had Buddha's nature. ** ** As the answer, master did "rm -rif" on the programmer's h

Re: which one do you prefer? python with C# or java?

2012-06-13 Thread Tomasz Rola
to Lisp what Ansi C is to > C. > > IOWS, there does remain incompatibilities between different > Common Lisp implementations. Interesting. I play with CL for some time but haven't rammed this particular wall yet. Do you remember more about it? If you can't be specific, perhap

Re: which one do you prefer? python with C# or java?

2012-06-11 Thread Tomasz Rola
On Mon, 11 Jun 2012, Tomasz Rola wrote: > If you want to delve into Java world, well, I consider Java an unbearably > ugly hog. When I was younger and fearless I programmed a bit in Java, but > nowadays, the only way I myself could swallow this would be to use some > other langua

Re: which one do you prefer? python with C# or java?

2012-06-11 Thread Tomasz Rola
malltalk (in a form of SqueakVM) could do the job. Every time I read about Smalltalk and think how Java took over, I mentally weep. Regards, Tomasz Rola -- ** A C programmer asked whether computer had Buddha's nature.

Re: Smallest/cheapest possible Python platform?

2012-05-26 Thread Tomasz Rola
sembly. Or Forth. If you land among embedded systems, it's better to speak embeddish or you will feel uncomfortable. Regards, Tomasz Rola -- ** A C programmer asked whether computer had Buddha's nature. ** ** As the answer, master did &quo

Re: John Carmack glorifying functional programing in 3k words

2012-05-02 Thread Tomasz Rola
On Wed, 2 May 2012, Michael Torrie wrote: > On 05/02/2012 09:31 AM, Tomasz Rola wrote: > > On Wed, 2 May 2012, jaialai.technol...@gmail.com wrote: > >> OP lives out of his car and his main source of income seems to be ad > >> revenue from his website. > > I&#x

Re: John Carmack glorifying functional programing in 3k words

2012-05-02 Thread Tomasz Rola
On Wed, 2 May 2012, Tim Wintle wrote: > On Wed, 2012-05-02 at 17:31 +0200, Tomasz Rola wrote: > > positive aura drives more people and more permamently towards you. Perhaps > > he should > > develop an alter ego that could stand side by side with Dalai Lama and see &g

Re: John Carmack glorifying functional programing in 3k words

2012-05-02 Thread Tomasz Rola
On Thu, 3 May 2012, Chris Angelico wrote: > On Thu, May 3, 2012 at 1:31 AM, Tomasz Rola wrote: > > He may be smart but obviously hasn't figured out this yet: positive aura > > drives more people and more permamently towards you. > > You catch more flies with honey

Re: John Carmack glorifying functional programing in 3k words

2012-05-02 Thread Tomasz Rola
ings and leave him be. He may be smart but obviously hasn't figured out this yet: positive aura drives more people and more permamently towards you. Perhaps he should develop an alter ego that could stand side by side with Dalai Lama and see which one gets more attention. Regards, Tomasz Ro

Re: Common LISP-style closures with Python

2012-02-04 Thread Tomasz Rola
rn those other language(s). If you'd like to try "unlimited" lambda, you might want to play with Racket, a Scheme superset. Or any other Scheme - it's simple enough to start coding after a day or two of learning (I mean Fibonaccis and Erastotenes sieves, not implementing database or

Re: slightly OT -- LaTeX

2011-09-01 Thread Tomasz Rola
://www.ctan.org/ Regards, Tomasz Rola -- ** A C programmer asked whether computer had Buddha's nature. ** ** As the answer, master did "rm -rif" on the programmer's home** ** directory.

Re: Trying to decide between PHP and Python

2011-01-05 Thread Tomasz Rola
On Tue, 4 Jan 2011, Roy Smith wrote: > There. Now that I've tossed some gasoline on the language wars fire, > I'll duck and run in the other direction :-) May I suggest a better strategy? Run first, duck next :-). Regards, Tomasz Rola -- ** A C programmer asked whether compu

Re: Trying to decide between PHP and Python

2011-01-05 Thread Tomasz Rola
On Wed, 5 Jan 2011, Grant Edwards wrote: > On 2011-01-05, Tomasz Rola wrote: > > On Tue, 4 Jan 2011, Roy Smith wrote: > >> Alan Meyer wrote: > >>> On 1/4/2011 4:22 PM, Google Poster wrote: > >>> > >>>> The syntax reminds me of Lots

Re: Trying to decide between PHP and Python

2011-01-05 Thread Tomasz Rola
ling list for a while. Or every programmer regardless of his/her current language. HTDP is interesting book, pity I couldn't read it when it might have made a bigger difference to my development. Regards, Tomasz Rola -- ** A C programmer asked whether computer had Buddha's nature.

Re: Trying to decide between PHP and Python

2011-01-04 Thread Tomasz Rola
On Wed, 5 Jan 2011, Ben Finney wrote: > > Tomasz Rola writes: > > Heh. One day, guys, when you have nothing better to do, try writing a > > parser for Lisp-like language (Common Lisp, Scheme, whatever). After > > that, do the same with some other language of your pref

Re: Trying to decide between PHP and Python

2011-01-04 Thread Tomasz Rola
better to do, try writing a parser for Lisp-like language (Common Lisp, Scheme, whatever). After that, do the same with some other language of your preference (Python, Java, whatever). Compare time and code spent... Regards :-) Tomasz Rola -- ** A C programmer asked whether computer had Buddha

Re: Trying to decide between PHP and Python

2011-01-04 Thread Tomasz Rola
rs (or maybe ten, or maybe only two) - after that, you can learn PHP and Perl if you really want to :-). I guess stackoverflow can give some pointers about it. Myself, I see neither of the two as promising for me, so I deflect them. Regards, Tomasz Rola -- ** A C programmer asked whether computer ha

Re: Python comparison matrix

2011-01-03 Thread Tomasz Rola
CPython supported which > operating systems (e.g. the first and last Python release that works on > Windows 98 or Mac OS 9)? The best I've found so far is PEP 11 Nothing comes to my head ATM. Regards, Tomasz Rola -- ** A C programmer asked whether computer had Buddha's nature.

Re: What was your strategy?

2010-11-18 Thread Tomasz Rola
is their best option IMHO. But in case of "serious"/"serial" ;-) programing, I would save Python for second or third language. I mean, I perceive it as rather "one way to do it" language and forcing this "one way" on unformed programer doesn't look good.

naming the main module in embedded Python

2010-09-21 Thread Tomasz Koziara
Hi I am embedding Python as an interpret in my code. Now, whenever my code or Python itself issues an error/warning message I am getting something like: File "", line 1, in or __main__:46: RuntimeWarning: My warning message I am using PyRun_SimpleString to load part of the code and the

Re: Why is python not written in C++ ?

2010-08-01 Thread Tomasz Rola
int of interpreting or JIT, yet they stand in a way. While this could be solved (with some headache, I suspect), C is far simpler and function calls or manipulating structs are actually trivial... Regards, Tomasz Rola -- ** A C programmer asked whether computer had Buddha's nature. ** ** As

Re: Why is python not written in C++ ?

2010-08-01 Thread Tomasz Rola
iga were based around the same concept. It seems, that Comeau C++ compiler (which I never tried) still requires C compiler as a backend (and is highly regarded by some). Regards, Tomasz Rola -- ** A C programmer asked whether computer had Buddha's nature. ** ** As the answer, master d

Re: Opinions please -- how big should a single module grow?

2010-07-09 Thread Tomasz Rola
not screw something, a typical Python code size is far below 1KLOC (wc counts all lines, so my result includes all comments and blanks too). Regards, Tomasz Rola -- ** A C programmer asked whether computer had Buddha's nature. ** ** As the answer, master did "rm -rif" on the p

Re: Opinions please -- how big should a single module grow?

2010-07-09 Thread Tomasz Rola
On Fri, 9 Jul 2010, Tomasz Rola wrote: > On Fri, 9 Jul 2010, Steven D'Aprano wrote: > > > This is a style question rather than a programming question. > > > > How large (how many KB, lines, classes, whatever unit of code you like to > > measure in) should a m

Re: Opinions please -- how big should a single module grow?

2010-07-09 Thread Tomasz Rola
needs (CGI? desktop? etc). So I would take this under consideration, too - how many times per second (minute, day) this code will be executed? Regards, Tomasz Rola -- ** A C programmer asked whether computer had Buddha's nature. ** ** As the answer, master did "rm -rif" on the

setprocname

2010-06-14 Thread Tomasz Pajor
Hello, Why there is no setprocname function in standard library, or am I missing something? -- http://mail.python.org/mailman/listinfo/python-list

Re: Bored.

2009-11-30 Thread Tomasz Rola
ne to turn them into code. Look out the window. Read a book. Repeat. Regards, Tomasz Rola -- ** A C programmer asked whether computer had Buddha's nature. ** ** As the answer, master did "rm -rif" on the programmer's home** ** directory. And then

Re: What python can NOT do?

2009-08-29 Thread Tomasz Rola
On Sat, 29 Aug 2009, Steven D'Aprano wrote: > On Sat, 29 Aug 2009 05:37:34 +0200, Tomasz Rola wrote: > > > My private list of > > things that when implemented in Python would be ugly to the point of > > calling it difficult: > > > > 1. AMB operator - m

Re: What python can NOT do?

2009-08-29 Thread Tomasz Rola
; > > > -tkc > > > > if you don't know the answer please don't reply > > If you want to ask a silly question don't ask it. The question the OP asked was not silly. Regards, Tomasz Rola -- ** A C programmer asked whether computer had Bu

Re: What python can NOT do?

2009-08-28 Thread Tomasz Rola
fragile code, so I decided it could be easier to learn another language... Regards, Tomasz Rola -- ** A C programmer asked whether computer had Buddha's nature. ** ** As the answer, master did "rm

Re: Is Python what I need?

2009-08-23 Thread Tomasz Rola
s, if this is going to be "let's show them how interesting it is", you should stay away from languages more complicated, like Java. Those who are going to learn Java, will learn it anyway. Knowing something different and cool first should not kill them. Quite the contrary, i

Re: #elements of seq A in seq B

2009-08-19 Thread Tomasz Rola
tree from elements of A and use it to count elements of B. I.e., tree nodes would be counters. Building trees in Python, however, I guess it is a little bit tricky. Of course it is possible. But maybe you would rather have this tree maintained in C. Regards Tomasz Rola -- ** A C programmer aske

Re: fork, threads and proper closing

2009-06-28 Thread Tomasz Pajor
On 28 juin, 23:26, Tomasz Pajor wrote: Hello, Configuration is as follows. I have a starter process which creates 3 sub processes (forks) and each of this processes creates a number of threads. Threads in that processes have semaphore so on KeyboardInterrupt without sending a sigterm to

fork, threads and proper closing

2009-06-28 Thread Tomasz Pajor
reads. Is there any work around? Can I somehow run join for the thread on keyboard interrupt? -- Best regards Tomasz Pajor -- http://mail.python.org/mailman/listinfo/python-list

Re: 3.2*2 is 9.6 ... or maybe it isn't?

2009-06-25 Thread Tomasz Zieliński
On 25 Cze, 20:04, Bojan Sudarevic wrote: > > I wasn't particularly good in math in school and university, but I'm > pretty sure that 3.2*3 is 9.6. > It's not math, it's floating point representation of numbers - and its limited accuracy. Type 9.6 and you'

Re: How to get local copy of docs?

2009-06-07 Thread Tomasz Zieliński
s Windows installer). -- Tomasz Zieliński http://pyconsultant.eu -- http://mail.python.org/mailman/listinfo/python-list

Re: Keeping console window open

2009-06-07 Thread Tomasz Zieliński
ons, so you can try:...except: them. -- Tomasz Zieliński http://pyconsultant.eu -- http://mail.python.org/mailman/listinfo/python-list

Re: Nimrod programming language

2009-05-16 Thread Tomasz Rola
On Mon, 11 May 2009, k...@fiber-space.de wrote: > On 12 Mai, 02:10, Tomasz Rola wrote: > > On Mon, 11 May 2009, rump...@web.de wrote: > > > > One question I ask myself upon seeing a new language is if it is > > > > possible > > > > to program amb (a

Re: Nimrod programming language

2009-05-11 Thread Tomasz Rola
s kind of stuff plays more and more important role in my programing. > It seems to require continuations. AFAIK > continuations are extremely hard to implement efficiently, so probably > it won't be done in Nimrod. Pity, a little. But not really big problem for me. Nimrod may be inte

Re: Nimrod programming language

2009-05-10 Thread Tomasz Rola
//planet.plt-scheme.org/package-source/murphy/amb.plt/1/0/planet-docs/amb/index.html Anyway, I think amb is quite a test of a language. If you can do it, please show the code. Regards, Tomasz Rola -- ** A C programmer asked whether computer had Buddha's nature. ** ** As the answer, ma

Re: Is python worth learning as a second language?

2009-03-21 Thread Tomasz Rola
that you > can load on the page into a div with ajax, preferrably jquery but you can > use any framework for that too I see. Thanks for answering. Regards, Tomasz Rola -- ** A C programmer asked whether computer had Buddha's nature. ** ** As the answer, master did "rm -rif&qu

Re: Is python worth learning as a second language?

2009-03-21 Thread Tomasz Rola
an Perl. But this is just my personal choice. Since we are already a little offtopic :-), did you see any speed difference between PHP and Python? I understand, that you are doing web devel in those two? > -Alex Goretoy > http://www.goretoy.com Regards, Tomasz Rola -- ** A C programmer asked wh

Re: Is python worth learning as a second language?

2009-03-21 Thread Tomasz Rola
On Sat, 21 Mar 2009, Aahz wrote: > In article , > Tomasz Rola wrote: > >On Sat, 20 Mar 2009, Aahz wrote: > >> > >> Taking C++ and turning it into a VM model does not exactly strike me > >> as particularly good use of resources. > > > >It doesn

Re: Is python worth learning as a second language?

2009-03-20 Thread Tomasz Rola
ut few other Java implementations, some of them not so resource hungry. Not that it makes Java much better, but your choice could be better informed. Eh, English - not sure if it is really what I've wanted to say :-). Regards Tomasz Rola -- ** A C programmer asked whether computer had Buddh

Re: cross compile Python to Linux-ARM

2009-03-20 Thread Tomasz Rola
rial spec Intel Atom boards to avoid > the cross compilation altogether ? Depends. If you know for sure when they are going to be here and if they will be price-performance-competitive. Regards Tomasz Rola -- ** A C programmer asked whether computer had Buddha's nature. ** *

Re: Is python worth learning as a second language?

2009-03-20 Thread Tomasz Rola
On Thu, 19 Mar 2009, Aahz wrote: > --===0027953262== > > In article <49b58b35$0$3548$426a7...@news.free.fr>, > Bruno Desthuilliers wrote: > >Tomasz Rola a écrit : > >> > >> I may not be objective (tried Java, hated it after 6 years). > &

Re: Is python worth learning as a second language?

2009-03-09 Thread Tomasz Rola
On Mon, 9 Mar 2009, Bruno Desthuilliers wrote: > Tomasz Rola a écrit : > (snip) > > > I may not be objective (tried Java, hated it after 6 years). > > Arf - only took me 6 months !-) I guess sometimes I need to be knocked really hard ;-/. But it works both ways - I canno

Re: Is python worth learning as a second language?

2009-03-09 Thread Tomasz Rola
his, for a start: http://docs.python.org/tutorial/index.html and later: http://docs.python.org/ http://diveintopython.org/ > Thanks pl.comp.lang.python ;-) Regards/Pozdrawiam, Tomasz Rola -- ** A C programmer asked whether computer had Buddha's nature. ** ** As the answ

Re: Why not Ruby?

2009-01-01 Thread Tomasz Rola
he writes is informative, too. A bit redundant but still, I would give him a small "plus", rather than "zero" or "minus". But I do not remember him being blunt or agressive. Regards, Tomasz Rola -- ** A C programmer asked whether computer had Buddha's nature.

Re: Python is slow

2008-12-15 Thread Tomasz Rola
robably will be some descendant of Erlang and/or Haskell. As evolutionary step, they look very promising to me, they just are "not quite there" yet. As of C++, I cannot tell before I read their new standard. Regards, Tomasz Rola -- ** A C programmer asked whether computer had Buddha&

Re: Programming exercises/challenges

2008-11-18 Thread Tomasz Rola
th bigger ones. Writing real life programs will give you an opportunity to learn some python libraries, which is a good thing too. Nice attitude :-). Regards, Tomasz Rola -- ** A C programmer asked whether computer had Buddha's nature. ** ** As the answer, master did "rm -rif&qu

Re: Is there a faster way to do this?

2008-08-05 Thread Tomasz Rola
r. Or seems to ;-/. For 20 mln products, on my Athlon XP @1800 / 1.5G ram, Debian Linux box, it takes about 13 minutes to go through list generation, about 3 minutes to sort the list, and few more seconds to skim it (writing should not be much longer). All summed up, about 18 minutes of real

Re: Limits of Metaprogramming

2008-08-04 Thread Tomasz Rola
akes me feel better. Or rather, knowing I can easily merge the two (or more) ways. Regards, Tomasz Rola -- ** A C programmer asked whether computer had Buddha's nature. ** ** As the answer, master did "rm -rif" on the

Re: Limits of Metaprogramming

2008-08-04 Thread Tomasz Rola
erstood. And, last but not least, it has metaprogramming included with nice bunch of additional stuff. For a start, PLT's DrScheme looks nice (IMHO - yes, there are other nice looking Scheme implementations but this one is probably best fitted for a beginner): http://www.plt-scheme.or

checking a string against multiple patterns

2007-12-18 Thread tomasz
it? Am I missing something? Python doesn't have special variables $1, $2 (right?) so you must assign the result of a match to a variable, to be able to access the groups. I'd appreciate any hints. Tomasz -- http://mail.python.org/mailman/listinfo/python-list

Re: pipeline encoding

2007-12-07 Thread Tomasz Toczyski
"Martin v. Löwis": > Not a command line option. However, you can wrap sys.stdout with a > stream that automatically performs an encoding. If all your print > statements output Unicode strings, you can do > > sys.stdout = codecs.getwriter("utf-8")(sys.stdout) It is the best solution for me. Thanks.

pipeline encoding

2007-12-06 Thread Tomasz Toczyski
My locale is set to UTF-8. The command: python -c "print u'\u03A9'" gives me the desired result and doesn't produce any error. But when I want to redirect the output to a file I invoke: python -c "print u'\u03A9'" > file.txt I get an error: File "", line 1, in UnicodeEncodeError: 'ascii' codec c

Re: case insensitive dictionary

2006-11-25 Thread tomasz . kulawik . groups . 1
John Henry napisal(a): > I believe the standard dictionary should be amened to allow the use of > case insensitive keys - as an option. I found some work done by others > to do that at: > > http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/283455 > > but the problem with that approach is tha

Re: A critic of Guido's blog on Python's lambda

2006-05-07 Thread Tomasz Zielonka
nctions doesn't take your common sense away, so you still "have a chance". Best regards Tomasz -- http://mail.python.org/mailman/listinfo/python-list

Re: A critic of Guido's blog on Python's lambda

2006-05-07 Thread Tomasz Zielonka
be interpreted is > a piece of code to be executed later. Haskell has one such "macro" - this is the do-notation syntax. But it's translation to ordinary lambdas is very straightforward, and the choice between using the do-notation or lambdas with >>= is a matter of style. Best regards Tomasz -- http://mail.python.org/mailman/listinfo/python-list

Re: A critic of Guido's blog on Python's lambda

2006-05-06 Thread Tomasz Zielonka
Alex Martelli wrote: > Tomasz Zielonka <[EMAIL PROTECTED]> wrote: > >> Alex Martelli wrote: >> > Having to give functions a name places no "ceiling on expressiveness", >> > any more than, say, having to give _macros_ a name. >> >> And wha

Re: A critic of Guido's blog on Python's lambda

2006-05-06 Thread Tomasz Zielonka
e based on how well it scales on the "teams" and "features" axes. You seem to claim that there is something in Python that lets it scale well on "data" and "load", and is not related to "teams" and "features", and also not related to Google's data processing model. Can you tell me what it is? Best regards Tomasz -- http://mail.python.org/mailman/listinfo/python-list

Re: A critic of Guido's blog on Python's lambda

2006-05-06 Thread Tomasz Zielonka
good thing, but the way it is designed in Python it has some costs. Can't you simply acknowledge that? Best regards Tomasz -- http://mail.python.org/mailman/listinfo/python-list

Re: A critic of Guido's blog on Python's lambda

2006-05-06 Thread Tomasz Zielonka
ance not so big an issue, so it doesn't prevent the application from scaling on the "load" and "amount of data" axes. I also guess that python is often used to control simple, fast C/C++ programs, or even to generate such programs. Best regards Tomasz -- http://mail.python.org/mailman/listinfo/python-list

Re: Programming challenge: wildcard exclusion in cartesian products

2006-03-17 Thread Tomasz Zielonka
27;. It's a lot easier to specify > a list of simpler wc's than create a long logical expression. I missed "any logical combination" :-( It would be quite easy to fix my first program, but I don't have the time to do it right now. Best regards Tomasz -- I am searching

Re: Programming challenge: wildcard exclusion in cartesian products

2006-03-17 Thread Tomasz Zielonka
t ['a','b'] 3 [[Lit 'a', All, Lit 'b'], [Lit 'b', All, Lit 'a']] t [1,2] 3 [[Lit 1, All, Lit 2], [Lit 2, All, Lit 1]] where t a b c = do putStrLn (concat (intersperse " " ["generateNotMatching",

Re: Programming challenge: wildcard exclusion in cartesian products

2006-03-16 Thread Tomasz Zielonka
Major correction (missing case): Tomasz Zielonka wrote: > generateMatching :: (Ord a) => Int -> Set a -> [Pat a] -> [[a]] > generateMatching 0 _[]= [[]] generateMatching 0 alphabet (All:ps) = generateMatching 0 alphabet ps > generateMatching 0 _(_:

Re: Programming challenge: wildcard exclusion in cartesian products

2006-03-16 Thread Tomasz Zielonka
Tomasz Zielonka wrote: > putStrLn (concat (intersperse " " ["generateMatching", show a, show > b, show c])) Minor correction: it should be "generateNotMatching". Best regards Tomasz -- I am searching for programmers who are good at least in (Haskell

Re: Programming challenge: wildcard exclusion in cartesian products

2006-03-16 Thread Tomasz Zielonka
'b'], [Lit 'b', All, Lit 'a']] t [1,2] 3 [[Lit 1, All, Lit 2], [Lit 2, All, Lit 1]] where t a b c = do putStrLn (concat (intersperse " " ["generateMatching", show a, show b, show c])) mapM_ (putStrLn . (" "++)

Re: Problem with running external process

2006-01-24 Thread ToMasz
No, no, that wasn't my intention (I'm just not conscious enough what's going on with these fork, exec, spawn.. functions). My parent process should start the child process and go back to it's tasks. Before executing it for the next time the parent should check if the previous child process is done

Re: Problem with running external process

2006-01-23 Thread ToMasz
Yes, each time the process is created, it remains. os.waitpid(-1, os.WNOHANG) doesn't work before starting the process for the first time. I tried this: pid = os.fork() if pid == 0: os.execl('ext_script.py','ext_script.py') else: (pid,status) = os.waitpid(pid, 0) It seems to work w

Re: Problem with running external process

2006-01-23 Thread ToMasz
This is the result of ulimit command on my machine: core file size(blocks, -c) 0 data seg size (kbytes, -d) unlimited file size (blocks, -f) unlimited max locked memory (kbytes, -l) unlimited max memory size (kbytes, -m) unlimited open files

Problem with running external process

2006-01-20 Thread ToMasz
There is a script running continuously which executes an external script in a loop using os.spawnlp(os.P_WAIT, 'extscript.py') function. After several hundred executions (cycles of the loop), the main script gets an exception while trying to start the process. This situation is repeated until the m

Re: py vs pyc

2006-01-09 Thread Tomasz Lisowski
nd > "python test.pyc" > > > thanks > When running "python test.py" the interpreter will first precompile the test.py source file, and then execute it. When running "python test.pyc", the interpreter will go straight to the execution of the script. Tomasz -- http://mail.python.org/mailman/listinfo/python-list

Re: Why it doesn't work?

2006-01-09 Thread Tomasz Lisowski
L['a'] first, before referencing L['a']['b'] So, you need to call first: L['a'] = {} Then you can write: L['a']['b'] = 2 Tomasz Lisowski -- http://mail.python.org/mailman/listinfo/python-list

Re: problem adding list values

2005-12-22 Thread Tomasz Lisowski
Dave Hansen wrote: > I think what you want is > >for cr in credlist: > credits += cr > > Which could also be implemented as > >credits = reduce(lambda x,y: x+y, credlist) or even: credits = sum(credlist) Tomasz Lisowski -- http://mail.python.org/mailman/listinfo/python-list

Re: newbie: concatenate literals (using jython)

2005-12-22 Thread Tomasz Lisowski
a string, use > str(obj). see this tutorial section for more info: > > http://docs.python.org/tut/node9.html#SECTION00910 > > > > > You are right, Fredrik, but David is using Jython, so perhaps he tried to mimic the Java language behaviour, where adding in

Re: A simple list question.

2005-12-22 Thread Tomasz Lisowski
e sure, though, what you mean by accessing the elements in random order. What's the idea behind having mylist[1] = [c,f,g], when the elements c, f, and g are apread across all three internal lists, and at various position within these lists (not necessarily 1, as the mylist index suggests). Toma

Re: non descriptive error

2005-10-07 Thread Tomasz Lisowski
"error". anyidea where i need to start looking? It seems to me, like a result of a "print" statement, exexcuted somewhere (maybe in the except: clause). You may look for lines similar to: print "error" Tomasz Lisowski -- http://mail.python.org/mailman/listinfo/python-list

Re: bug or feature?

2005-10-05 Thread Tomasz Lisowski
n error, or a feature? I would say - a feature. Everyone should be aware, that the argument default values are evaluated once, and the same value (memory object) is reused at each instance creation. Best regards, Tomasz Lisowski -- http://mail.python.org/mailman/listinfo/python-list

Re: Help w/ easy python problem

2005-09-22 Thread Tomasz Lisowski
.g. <0, 71>, representing the 72 characters wide lines being printed. Tomasz Lisowski -- http://mail.python.org/mailman/listinfo/python-list

Re: up to date books?

2005-08-18 Thread Tomasz Rola
ny *.py file made any sense to me. This would give me some hints about how much I need to learn and on what level. Regards, Tomasz Rola - -- ** A C programmer asked whether computer had Buddha's nature. ** ** As the answer, master did "rm -rif" on the programmer's ho

Re: catching all exceptions

2005-08-13 Thread Tomasz Lisowski
> Hello, > > I'd like to catch all exeptions and be able to inspect them. > > The simple case: I know which exceptions I'll get: > > # standard textbook example: > try: > something() > except ThisException, e: > print "some error occurred: ", str(e) > > > The not-so-simple case: Handli

  1   2   >