Re: ANN: matplotlib 1.3.1

2013-10-18 Thread Piet van Oostrum
with tcl.h from Tcl 8.5 lipo: can't figure out the architecture type of: /var/folders/5r/5r4ywY4e2ReN7U+8ZPQSJTI/-Tmp-//ccXN6p4b.out error: command 'gcc-4.2' failed with exit status 1 You have new mail in /var/mail/piet bash-3.2$ hg ftp -su -- Piet van Oostrum WWW: http://pietvanoostrum.com/ PGP key: [8DAE142BE17999C4] -- https://mail.python.org/mailman/listinfo/python-list

Re: ANN: matplotlib 1.3.1

2013-10-19 Thread Piet van Oostrum
Ned Deily writes: > In article , > Piet van Oostrum wrote: >> I tried to install it from source, on Mac OS X 10.6.8, with Python >> 3.3.2, and Tck/Tk 8.5 installed as Frameworks, but I get an error during >> compilation. It seems it doesn't find the Tcl/TK f

Re: Python Front-end to GCC

2013-10-21 Thread Piet van Oostrum
could make it easy. A language specification in BNF is just syntax. It doesn't say anything about semantics. So how could this be used to produce executable C code for a program? BNF is used to produce parsers. But a parser isn't sufficient. -- Piet van Oostrum WWW: http://pietvanoos

Re: Python Front-end to GCC

2013-10-22 Thread Piet van Oostrum
kens relate to each other. Syntax is grammar. Tokens are part of the grammar (but often specified separately with a different grammar, usually regular expressions, which is a subset of BNF). So are you just confused or are you trollong? -- Piet van Oostrum WWW: http://pietvanoostrum.com/ PGP key: [8DAE142BE17999C4] -- https://mail.python.org/mailman/listinfo/python-list

Re: Python Front-end to GCC

2013-10-22 Thread Piet van Oostrum
Neil Cerutti writes: > > Context-sensitive grammars can be parse, too. > That's not English. Do you mean "parsed"? But context-sentitive grammars cannot be specified by BNF. -- Piet van Oostrum WWW: http://pietvanoostrum.com/ PGP key: [8DAE142BE17999C4] -- https:/

Re: Python Front-end to GCC

2013-10-22 Thread Piet van Oostrum
mplete, it is not clear that > you will be able to compile it at all. That's the difference between > a calculator and a computer. You think a language that is not Turing-complete cannot be compiled? What nonsense is that. Please Mark, spare us your nonsense. -- Piet van Oostrum

Re: functools and objective usage

2013-10-22 Thread Piet van Oostrum
> functionality differ, Do you have experience with objective usage ? > http://docs.python.org/2/library/functools.html#partial-objects > What do you mean with "objective usage"? -- Piet van Oostrum WWW: http://pietvanoostrum.com/ PGP key: [8DAE142BE17999C4] -- https://mail.python.org/mailman/listinfo/python-list

Re: Cookie aint retrieving when visiting happens from a backlink.

2013-10-26 Thread Piet van Oostrum
my internet connection and then trying both the back button and entering the URL in the address bar. So it has nothing to do with referrer, I think. -- Piet van Oostrum WWW: http://pietvanoostrum.com/ PGP key: [8DAE142BE17999C4] -- https://mail.python.org/mailman/listinfo/python-list

Re: Cookie aint retrieving when visiting happens from a backlink.

2013-10-26 Thread Piet van Oostrum
Piet van Oostrum writes: > Νίκος Αλεξόπουλος writes: > >> There is no set of cookie returned back when visitor comes from a referer. >> >> Isn't this strange? >> No matter if you visit a webpage as a direct hit or via a referer the >> cookie on the v

Re: how to avoid checking the same condition repeatedly ?

2013-10-28 Thread Piet van Oostrum
he condition every time through the for loop, even though there > is no chance for needs_processing to change inside the loop, which does not > look very efficient. I bet in most cases you won't notice the time used to check the condition. Beware of premature optimization! -- Piet van Oost

Re: trying to strip out non ascii.. or rather convert non ascii

2013-10-29 Thread Piet van Oostrum
sking for evidence you know you will never get. -- Piet van Oostrum WWW: http://pietvanoostrum.com/ PGP key: [8DAE142BE17999C4] -- https://mail.python.org/mailman/listinfo/python-list

Problem installing matplotlib 1.3.1 with Python 2.7.6 and 3.3.3 (release candidate 1)

2013-11-03 Thread Piet van Oostrum
ython should also include the Tcl/Tk header files. -- Piet van Oostrum WWW: http://pietvanoostrum.com/ PGP key: [8DAE142BE17999C4] -- https://mail.python.org/mailman/listinfo/python-list

Re: Help me with this code PLEASE

2013-11-05 Thread Piet van Oostrum
CONVERT FROM LISTS TO LONG STRINGS SO I CAN STORE SUCCESSFULLY LIST > PYTHON DATATYPE TO MYSQL SCALAR STRING. > > EVERYHTIGN I TRIED FAILED. Then why don't you use the simple solution: use a relational database to store the data? -- Piet van Oostrum WWW: http://pietvanoostrum.c

Re: Help me with this code

2013-11-07 Thread Piet van Oostrum
returns None. So the print sequence_b(10) dosn't make sense. If the print is only for debugging the use the following: def sequence_b(N): result = 0 for k in range (1,N): step = ((-1)**(k+1))/(2*k-1) print(step) ## debug output result += step return result

Re: Adding 'download' column to existing 'visitors' table (as requested)

2013-11-07 Thread Piet van Oostrum
use an extra table of downlaods that i asoociate with table > visitors with a foreing key but decided to add an additional 'download' > column into the existant visitors table: Nikos, you are an excellent member of the Greek society. Listening to you makes it so much easier to under

Re: Adding 'download' column to existing 'visitors' table (as requested)

2013-11-08 Thread Piet van Oostrum
Sibylle Koczian writes: > Am 07.11.2013 14:14, schrieb Piet van Oostrum: >> Nick the Gr33k writes: >> >>> I have decided to take your advice. >>> I wasn't able to fit those 'lists' of mine into MySQL's varchar() >>> datatype afte

Re: splitting file/content into lines based on regex termination

2013-11-09 Thread Piet van Oostrum
', '#9 /\n58#0#', '10178#000#C S#S#124##001##DAY#Computer Systems#Roper,\nPaul#3#MWF#11:00am#11:50am#1170 TMCB ', '#41 /\n145#0#', '10178#000#C S#S#124##002##DAY#Computer Systems#Roper,\nPaul#3#MWF#2:00pm#2:50pm#1170 TMCB ', '#40 /\n120#0#

Re: Calling a function is faster than not calling it?

2015-06-22 Thread Piet van Oostrum
e("0", 'string', "eval") t1 = Timer("eval(dummy); func()", setup="from __main__ import dummy, func") t2 = Timer("0; eval(code)", setup="from __main__ import code") And then you'll see that t1 is slightly slower than t2. -- Piet van Oostrum WWW: http://pietvanoostrum.com/ PGP key: [8DAE142BE17999C4] -- https://mail.python.org/mailman/listinfo/python-list

Re: Need help with simple OOP Python question

2011-09-08 Thread Piet van Oostrum
Terry Reedy writes: > Indexing objects by their internal id is usually useless. obj.id is not the internal id. -- Piet van Oostrum WWW: http://pietvanoostrum.com/ PGP key: [8DAE142BE17999C4] -- http://mail.python.org/mailman/listinfo/python-list

Re: Installing WebDAV server

2011-09-08 Thread Piet van Oostrum
"Fokke Nauta" writes: > "Piet van Oostrum" wrote in message > news:m2zkigartn@cochabamba.vanoostrum.org... >> "Fokke Nauta" writes: >> >> >>> INFO:DAVServer.fshandler:get_data: d:\webdav not found >>> XXX --- [

Re: autoflush on/off

2013-02-05 Thread Piet van Oostrum
or the original sys.stdout. That can be solved with a dup. import os, sys class Unbuff(object): def __enter__(self): sys.stdout.flush() self.stdout_bak = sys.stdout sys.stdout = os.fdopen(os.dup(sys.stdout.fileno()), 'w', 0) def __exit__(self, exc_type, e

Re: How to improve writing code in python?

2013-02-06 Thread Piet van Oostrum
ge and I am studying about manipulating the images using > Python. If you also know any websites relating to manipulate the images, can > you guys tell me? Thank you! For learning programming you could do the Udacity course Introduction to Computer Science: https://www.udacity.com/course/cs101

Re: Monitoring updating directory for image for GUI

2013-02-07 Thread Piet van Oostrum
ge in fn. In this way you always display the most recent one. You can make it more sophisticated by removing files that have been displayed and files that you skip. -- Piet van Oostrum WWW: http://pietvanoostrum.com/ PGP key: [8DAE142BE17999C4] -- http://mail.python.org/mailman/listinfo/python-list

Re: pxssh sendline() cmd

2013-02-08 Thread Piet van Oostrum
> > Could any one help quickly. > > Note : If I use sendline(X Y 00:00:00:00:00:00:00 F2) was working fine. > sendline("X Y %s %s" % (var, name)) -- Piet van Oostrum WWW: http://pietvanoostrum.com/ PGP key: [8DAE142BE17999C4] -- http://mail.python.org/mailman/listinfo/python-list

Re: Monitoring updating directory for image for GUI

2013-02-13 Thread Piet van Oostrum
re we got a newer one except Empty: break # stop the inner loop display the image in fn. In this way you always display the most recent one. You can make it more sophisticated by removing files that have been displayed and files that you skip. -- Piet van Oostrum WWW: http://pietvanoostrum.com/ PGP key: [8DAE142BE17999C4] -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 3.3 vs. MSDOS Basic

2013-02-19 Thread Piet van Oostrum
ed to Python. > > I find this surprising too. I am also surprised that it even works, > given that the highest intermediate value is about 57 billion and I do > not remember that Basic had infinite precision ints. That may explain why the Basic version is faster: it gets overflow and the

Re: why can not parse the web in almost same xpath expression?

2013-03-06 Thread Piet van Oostrum
;down s-fc3 > f-fl"]//a') > > why i can't get nothing? There is only one in the document and that div contains only a single but the latter does not contain any . The URLs that you get in the first code are not contained in a . They are contained in a , however. So xpath('//div[@class="m-tdli"]//div[@class="down s-fc3 f-fl"]//a') works. -- Piet van Oostrum WWW: http://pietvanoostrum.com/ PGP key: [8DAE142BE17999C4] -- http://mail.python.org/mailman/listinfo/python-list

Re: Spiritual Programming (OT, but Python-inspired)

2006-01-04 Thread Piet van Oostrum
r and the thing is too old to survive then you could dump its state to another computer and continue running there. Or you could archive the state for some time and resume it when it is convenient. I imagine that something similar would be possible with my state of mind. -- Piet van Oostrum

Re: Filename case-insensitivity on OS X

2006-01-04 Thread Piet van Oostrum
XT files >>> lying around). >DS> Strictly speaking, it's not OS X, but the HFS file system that is case >DS> insensitive. You can use other file systems, such as "UNIX File >DS> System". Use Disk Utility to create a disk image and then erase it >DS

Re: hash() yields different results for different platforms

2006-07-12 Thread Piet van Oostrum
>>>>> Grant Edwards <[EMAIL PROTECTED]> (GE) wrote: >GE> The low 32 bits match, so perhaps you should just use that >GE> portion of the returned hash? If the hashed should be unique, 32 bits is much too low if you have millions of entries. -- Piet van Oost

Re: hash() yields different results for different platforms

2006-07-13 Thread Piet van Oostrum
ains a definition of a hash function. I know what a hash function is. But the OP wanted to use the hash as a unique key. -- Piet van Oostrum <[EMAIL PROTECTED]> URL: http://www.cs.uu.nl/~piet [PGP 8DAE142BE17999C4] Private email: [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Python strings outside the 128 range

2006-07-13 Thread Piet van Oostrum
nterpreter. It is done in the editor in which you prepare your python source. -- Piet van Oostrum <[EMAIL PROTECTED]> URL: http://www.cs.uu.nl/~piet [PGP 8DAE142BE17999C4] Private email: [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: don't need dictionary's keys - hash table?

2006-07-13 Thread Piet van Oostrum
e a tradition hash table. If I >k> do it this way am I going to get the memory savings I am after? Will >k> the hash function always generate unique keys? Also, would the same >k> technique work for a set? Maybe a Berkeley DB hash file would be a good alternative. It can cont

Re: Augument assignment versus regular assignment

2006-07-14 Thread Piet van Oostrum
only evaluated once' is quite clear I would say. Your problem is that you thought __setitem__ is part of evaluation, but it isn't. It is part of assignment, while __getitem__ is part of evaluation. See the definitions of __getitem__ and __setitem__ in the language reference manual. -- Piet v

Re: How to start more than one process at the same time?

2006-07-14 Thread Piet van Oostrum
ished. These jobs should run parallel to save time. Use the subprocess module. -- Piet van Oostrum <[EMAIL PROTECTED]> URL: http://www.cs.uu.nl/~piet [PGP 8DAE142BE17999C4] Private email: [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Augument assignment versus regular assignment

2006-07-15 Thread Piet van Oostrum
>>>>> Gerhard Fiedler <[EMAIL PROTECTED]> (GF) wrote: >GF> On 2006-07-14 16:07:28, Piet van Oostrum wrote: >AP> 2a) In case you answer yes to question (1). Can you explain me how >AP> I have to read the language reference in order to deduce this >AP>

Re: reading specific lines of a file

2006-07-15 Thread Piet van Oostrum
ot fast. You have to read all preceding lines. If you have to do this many times while the file does not change, you could build an index into the file. -- Piet van Oostrum <[EMAIL PROTECTED]> URL: http://www.cs.uu.nl/~piet [PGP 8DAE142BE17999C4] Private email: [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Python strings outside the 128 range

2006-07-17 Thread Piet van Oostrum
use the functions from the locale module, e.g.: >MP> import locale >MP> locale.setlocale(locale.LC_ALL, '') # use the current locale settings >MP> encoding = locale.nl_langinfo(locale.CODESET) But if LANG isn't set (like on Mac OS X) this doesn't give you the proper encoding. On my system I have added LANG to .profile. -- Piet van Oostrum <[EMAIL PROTECTED]> URL: http://www.cs.uu.nl/~piet [PGP 8DAE142BE17999C4] Private email: [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Augument assignment versus regular assignment

2006-07-17 Thread Piet van Oostrum
>>>>> Antoon Pardon <[EMAIL PROTECTED]> (AP) wrote: >AP> On 2006-07-14, Piet van Oostrum <[EMAIL PROTECTED]> wrote: >>> Just read what it says. `It is only evaluated once' is quite clear I would >>> say. >AP> If it is so clear,

Re: Augument assignment versus regular assignment

2006-07-18 Thread Piet van Oostrum
>>>>> Antoon Pardon <[EMAIL PROTECTED]> (AP) wrote: >AP> On 2006-07-17, Piet van Oostrum <[EMAIL PROTECTED]> wrote: >>>>>>>> Antoon Pardon <[EMAIL PROTECTED]> (AP) wrote: >>> >AP> On 2006-07-14, Piet van Oostrum <[E

Re: How to execute a file outside module's namespace?

2006-08-15 Thread Piet van Oostrum
> print x # doesn't work, x is not defined in main script namespace >SN> What is the best way to make "print x" work? Using the following: emacs.py: def eexecfile(file, glob): # do other stuff execfile(file,glob) main: import emacs emacs.eexecfile("te

Re: Small Troll on notation of variables over time

2006-08-21 Thread Piet van Oostrum
You are about 7 months early. -- Piet van Oostrum <[EMAIL PROTECTED]> URL: http://www.cs.uu.nl/~piet [PGP 8DAE142BE17999C4] Private email: [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Recursive descent algorithm able to parse Python?

2006-10-06 Thread Piet van Oostrum
nential time. >DBR> """ This is the first time I see this called `backup'. I have always used and seen the term `backtracking'. -- Piet van Oostrum <[EMAIL PROTECTED]> URL: http://www.cs.uu.nl/~piet [PGP 8DAE142BE17999C4] Private email: [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: operator overloading + - / * = etc...

2006-10-10 Thread Piet van Oostrum
no difference in behavior between the *names* >SD> this_is_an_integer and this_is_a_string. (The *objects* they point to are >SD> a different story, naturally.) The official Python documentation (language reference manual) talks a lot about variables. So it seems silly to say that Python d

Re: People's names

2006-10-10 Thread Piet van Oostrum
blem. I prefer having Van Straeten and Van Stralen >RS> next to each other than having them mixed up with names without Van like >RS> this: >RS> Straeten, Van >RS> Straetmans >RS> Stralen, Van In Holland it is sorted without the 'van' 'de' etc. --

Re: operator overloading + - / * = etc...

2006-10-13 Thread Piet van Oostrum
>>>>> Fredrik Lundh <[EMAIL PROTECTED]> (FL) wrote: >FL> Piet van Oostrum wrote: >>> The official Python documentation (language reference manual) talks a lot >>> about variables. So it seems silly to say that Python doesn't have >>> v

Re: why does this unpacking work

2006-11-07 Thread Piet van Oostrum
;> #then it does it correctly >CH> No, it's actually behaving like >CH> for x in t: >CH> y,z = t y,z = x >CH> # do something with y and z -- Piet van Oostrum <[EMAIL PROTECTED]> URL: http://www.cs.uu.nl/~piet [PGP 8DAE142BE17999C4] Private email: [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: New to Python: Do we have the concept of Hash in Python?

2006-06-02 Thread Piet van Oostrum
>>>>> "A.M" <[EMAIL PROTECTED]> (AM) wrote: >AM> This is my 1st day that I am seriously diving into Python and I have >AM> to finish this application by the end of today. Are you serious? -- Piet van Oostrum <[EMAIL PROTECTED]> URL: http://www.cs

Re: after del list , when I use it again, prompt 'not defined'.how could i delete its element, but not itself?

2006-06-02 Thread Piet van Oostrum
t; >>> This is a way: >>>>>> a = range(10) >>>>>> del a[:] >S> or simply >S> a = [] >>>>>> a >>> [] Then you *have* deleted the list and created a new one, which is different from keeping the list and deleting the ele

Re: Open Source Charting Tool

2006-06-02 Thread Piet van Oostrum
that what you referring to? >FAL> ReportLab (the commercial bussiness thing on .com) is where the main >FAL> developers of ReportLab (a library freely available on www.reporlab.org) >FAL> work. So what you want really is .org, but apparently it's having >FAL> problems righ

Re: What is Expressiveness in a Computer Language

2006-06-23 Thread Piet van Oostrum
pet peeve of >M> mine: "immutable variable." >M> immutable = can't change >M> vary-able = can change >M> Clearly a contradiction in terms. I would say that immutable = 'can't *be* changed' rather than 'can't change'. But I am not a na

Re: Dictionary .keys() and .values() should return a set [with Python 3000 in mind]

2006-07-03 Thread Piet van Oostrum
set of a dictionary be represented as a set instead of a list? >P> I think the order of the items returned by keys() and values() are >P> related. I decided on a short empirical test: yes, it is documented that their order is related. In fact d.items() == zip(d.keys(), d.valu

Re: Nested scopes, and augmented assignment

2006-07-05 Thread Piet van Oostrum
clared explicitly, like 'local A'. But that would break existing code. Or maybe the composite assignment operators should have been exempted. Too late now! You have the same problem with: A = [10] def inner(): A.append(2) works but A = [10] def inner(): A += [

Re: Nested scopes, and augmented assignment

2006-07-06 Thread Piet van Oostrum
ave the impression that the defenders try to defend >AP> those results as a design decision. With your remark above I have >AP> to wonder if someone really thought this through at design time >AP> and came to the conclusion that nested variables are harmfull >AP> and thus may not be rebound but not that harmfull so mutation >AP> is allowed and if so how he came to that conclusion. I don't think that was the reasoning. On the other hand I think nested scopes were mainly added for read-only access (to the namespace that is, not to the values) . But then Python doesn't forbid you to change mutable objects once you have access to them. -- Piet van Oostrum <[EMAIL PROTECTED]> URL: http://www.cs.uu.nl/~piet [PGP 8DAE142BE17999C4] Private email: [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Nested scopes, and augmented assignment

2006-07-07 Thread Piet van Oostrum
CM SIGPLAN Notices, 1973, 8 (2) pp. 28--34). I think nested variables have the same troubles as global variables, so they should be used with care. -- Piet van Oostrum <[EMAIL PROTECTED]> URL: http://www.cs.uu.nl/~piet [PGP 8DAE142BE17999C4] Private email: [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Nested scopes, and augmented assignment

2006-07-07 Thread Piet van Oostrum
be one of them. You didn't understand it in your OP. Maybe your understanding has gained in the meantime? -- Piet van Oostrum <[EMAIL PROTECTED]> URL: http://www.cs.uu.nl/~piet [PGP 8DAE142BE17999C4] Private email: [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Finding Return Code From GPG

2006-07-07 Thread Piet van Oostrum
urther suggestions? That output is passed to stderr. So you can get it in a string: output = Popen(["gpg", "--output", "outfile", "--verify", "sigtest"], stderr=PIPE).communicate()[1] -- Piet van Oostrum <[EMAIL PROTECTED]> URL: http://www.cs.uu.nl/~piet [PGP 8DAE142BE17999C4] Private email: [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Nested scopes, and augmented assignment

2006-07-07 Thread Piet van Oostrum
>>>>> Antoon Pardon <[EMAIL PROTECTED]> (AP) wrote: >AP> On 2006-07-07, Piet van Oostrum <[EMAIL PROTECTED]> wrote: >>>>>>>> Antoon Pardon <[EMAIL PROTECTED]> (AP) wrote: >>> >AP> Could you maybe clarify what problem

Re: Nested scopes, and augmented assignment

2006-07-09 Thread Piet van Oostrum
decided whether the search was >AP> to stop at the local level or not. No, it doesn't. There could be another binding in the same scope. The complicatedness of this particular assignment doesn't decide anything about how to search for 'a', but rather the presence or absence of a binding anywhere in the scope. -- Piet van Oostrum <[EMAIL PROTECTED]> URL: http://www.cs.uu.nl/~piet [PGP 8DAE142BE17999C4] Private email: [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Nested scopes, and augmented assignment

2006-07-09 Thread Piet van Oostrum
nally, the lefthandside can also be a [nested] tuple or list, in which case it is a collection of parallel assignments. And oh yes, there are also other binding operations e.g. a function or class definition.) -- Piet van Oostrum <[EMAIL PROTECTED]> URL: http://www.cs.uu.nl/~piet [PGP 8DAE142BE17999C4] Private email: [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: language design question

2006-07-10 Thread Piet van Oostrum
>>>>> Bruno Desthuilliers <[EMAIL PROTECTED]> (BD) wrote: >BD> Actually, and AFAIK, len(obj) = lambda obj : obj.__len__(). You mean: len = lambda obj : obj.__len__(). -- Piet van Oostrum <[EMAIL PROTECTED]> URL: http://www.cs.uu.nl/~piet [PGP 8DAE142BE17999C4

Re: Nested scopes, and augmented assignment

2006-07-10 Thread Piet van Oostrum
UnboundLocalError. OK. That could have been chosen. But that would mean that instead of c.a = b, where c is bound in a non-local scope, you have to write something like: cc = c cc.a = b I don't find that useful. -- Piet van Oostrum <[EMAIL PROTECTED]> URL: http://www.cs.uu.nl/~piet

Re: threading troubles

2006-07-11 Thread Piet van Oostrum
library itself. I tried your example with cmd='ls -l' and it works. If I put a print 'started' after the xc.start(), it prints that before the output of ls -l, indicating that ls -l is running in the background. (Of course the actual order is up to the scheduler.) Maybe running it i

Re: Augument assignment versus regular assignment

2006-07-11 Thread Piet van Oostrum
gt; from BINARY_SUBSCR or STORE_SUBSCR) You need both the __setitem__ and the __getitem__ otherwise it won't work. I think the "evaluated once" clause is for cases like: f(a)[g(b)] += 1 where f and/or g have side effects. These side effects should then take place only once. Side effe

Re: threading troubles

2006-07-11 Thread Piet van Oostrum
e child process, not in the parent process, I think. Or do you have a solution for that? -- Piet van Oostrum <[EMAIL PROTECTED]> URL: http://www.cs.uu.nl/~piet [PGP 8DAE142BE17999C4] Private email: [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Need compile python code

2006-09-25 Thread Piet van Oostrum
sing $0 (which is the shell script itself) to python is sure to >M> break. Try this: I guess this is a trick to use a python script as a shell script that executes itself. In other words it is both a shell script and a python script and when executed as a shell script then it passes itself to the p

Re: ruby %w equivalent

2006-09-27 Thread Piet van Oostrum
ot;c" in ruby... >>> >>> Thanks a lot >>> Regards, >>> antoine >A> Why would they want to make such an obscure API ? ... didn't they have >A> Python to learn from (I am truly amazed - nothing cynical ...just ... >A> why ?) I think

Re: How good is CORBA?

2006-11-24 Thread Piet van Oostrum
to Qt. >CM> I like Ice a lot, it's got hardly any of the ramp up time and learning >CM> curve that CORBA does, and it's extremely efficent. If GPL or cash are >CM> acceptable licensing options to you, then I encourage you to use it >CM> before you head to CORBA. O

Re: Tarfile .bz2

2006-12-13 Thread Piet van Oostrum
pression library. The underlying compression algorithm >MvL> is LZW. No, it uses a compression algorithm based on LZ77 (called DEFLATE). Therefore gzip was not encumbered by the the LZW patent. -- Piet van Oostrum <[EMAIL PROTECTED]> URL: http://www.cs.uu.nl/~piet [PGP 8DAE142BE1

Re: namespace question

2006-12-13 Thread Piet van Oostrum
gc><>: >jssgc># Objects created here are local to this scope >jssgc>a = 1 >jssgc>b = 2 >jssgc>global c >jssgc>c = a + b As you want c to be an *instance* variable, the normal idiom would be: class Test: def __in

Re: Elliptic Curve Library

2006-12-25 Thread Piet van Oostrum
urve stuff (donated by SUN). M2Crypto is a Python interface to SSL. -- Piet van Oostrum <[EMAIL PROTECTED]> URL: http://www.cs.uu.nl/~piet [PGP 8DAE142BE17999C4] Private email: [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: persistant gloabl vars (very newbie) ?

2006-12-27 Thread Piet van Oostrum
m init import X,Y explicitely is probably safer. And, by the way, from init import * can only be used at module level, not in inner namespaces. -- Piet van Oostrum <[EMAIL PROTECTED]> URL: http://www.cs.uu.nl/~piet [PGP 8DAE142BE17999C4] Private email: [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: How do I add users using Python scripts on a Linux machine

2007-01-02 Thread Piet van Oostrum
>>>>> Sebastian 'lunar' Wiesner <[EMAIL PROTECTED]> (SW) wrote: >SW> Linux seems to ignore SUID bit on scripts: The reason is that obeying SUID bits on scripts would be a security risk. -- Piet van Oostrum <[EMAIL PROTECTED]> URL: http://www.cs.uu.nl

Re: How do I add users using Python scripts on a Linux machine

2007-01-04 Thread Piet van Oostrum
It can only be made safe if interpreters can be passed inodes or opened files by the kernel, but that is not how most interpreters work. At least not python. -- Piet van Oostrum <[EMAIL PROTECTED]> URL: http://www.cs.uu.nl/~piet [PGP 8DAE142BE17999C4] Private email: [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: How do I add users using Python scripts on a Linux machine

2007-01-06 Thread Piet van Oostrum
>>>>> Lawrence D'Oliveiro <[EMAIL PROTECTED]> (LD) wrote: >LD> No it wouldn't. This security hole was fixed years ago. How? -- Piet van Oostrum <[EMAIL PROTECTED]> URL: http://www.cs.uu.nl/~piet [PGP 8DAE142BE17999C4] Private email: [EMAIL PROTECTED]

Re: Python on a public library computer

2005-05-23 Thread Piet van Oostrum
There are several ssh and telnet applets on the web. Of course it depends on the Java support in your IE. -- Piet van Oostrum <[EMAIL PROTECTED]> URL: http://www.cs.uu.nl/~piet [PGP] Private email: [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: What are OOP's Jargons and Complexities?

2005-05-26 Thread Piet van Oostrum
u mean with: 'Haskell has a dynamic typing system'? -- Piet van Oostrum <[EMAIL PROTECTED]> URL: http://www.cs.uu.nl/~piet [PGP] Private email: [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: What are OOP's Jargons and Complexities?

2005-05-27 Thread Piet van Oostrum
there is also `daily typed' or `monthly typed'? >XL> http://xahlee.org/UnixResource_dir/writ/jargons.html -- Piet van Oostrum <[EMAIL PROTECTED]> URL: http://www.cs.uu.nl/~piet [PGP] Private email: [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: write to the same file from multiple processes at the same time?

2005-05-31 Thread Piet van Oostrum
wise os.write can be used. As this depends on the OS support for append, it is not portable. But neither is locking. And I am not sure if it works for NFS-mounted files. -- Piet van Oostrum <[EMAIL PROTECTED]> URL: http://www.cs.uu.nl/~piet [PGP] Private email: [EMAIL PROTECTED] -- htt

Re: The need to put "self" in every method

2005-05-31 Thread Piet van Oostrum
like 'this' in Java or C++. It could even have chosen to use a keyword 'local' to indicate local ones and let instance ones be the default. But if instance variable would be implicit, local ones should have been explicit. -- Piet van Oostrum <[EMAIL PROTECTED]> URL: http://www.cs.uu.nl/~piet [PGP] Private email: [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: The need to put "self" in every method

2005-06-01 Thread Piet van Oostrum
>>>>> [EMAIL PROTECTED] (Aahz) (A) wrote: >A> [posted & e-mailed] >A> In article <[EMAIL PROTECTED]>, >A> Piet van Oostrum <[EMAIL PROTECTED]> wrote: >>> >>> There is. >>> Inside a method there are 3 kinds of identif

Re: Any way to not create .pyc files?

2005-06-11 Thread Piet van Oostrum
ible? If the directory is writable, you can delete a file and write a new one with the same name. The permissions of the file itself are of no importance in this case. -- Piet van Oostrum <[EMAIL PROTECTED]> URL: http://www.cs.uu.nl/~piet [PGP] Private email: [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Access Database Using Python

2005-06-14 Thread Piet van Oostrum
tivestate.com/ASPN/Cookbook/Python/Recipe/302930 -- Piet van Oostrum <[EMAIL PROTECTED]> URL: http://www.cs.uu.nl/~piet [PGP] Private email: [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Set of Dictionary

2005-06-16 Thread Piet van Oostrum
somedict): self.data = somedict.copy() def __hash__(self): result = 0 for elt in self.data: result ^= hash(elt) ^ hash(self.data[elt]) return result def __repr__(self): return repr(self.data) __str__ = __repr__ d = immdic

Re: whos -- a function listing objects

2005-06-17 Thread Piet van Oostrum
s iType1 = string.split(str(iType), "'")[1] NameError: global name 'string' is not defined Using execfile is a bad way to get the function definition. Import is the way to go. Just add a line: import string to the beginning of whos.py, and the the usage should be: from w

Re: How to right align IPaddress?

2005-06-17 Thread Piet van Oostrum
e Ipaddress? >pk> I expects below format output >pk> eg 203.199.200.0 >pk> 203.33.20.0 "%15s" % ip -- Piet van Oostrum <[EMAIL PROTECTED]> URL: http://www.cs.uu.nl/~piet [PGP] Private email: [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: encoding latin1 to utf-8

2007-09-10 Thread Piet van Oostrum
decs.open(filename,"wb", encoding="utf-8") >HM> file.write(data) >HM> file_name=sys.argv[1] >HM> encode(file_name) I tried this program and for me it works correctly. So you probably used a wrong input file or you misinterpreted the output. To be sure make h

Re: Checking if elements are empty

2007-09-11 Thread Piet van Oostrum
should use u"" if you're going to take that route, as this >CM> will fail spuriously if y[0] contains a unicode string that can't be >CM> implicitly converted to ascii. Personally, I prefer the boolean check >CM> and I'll let operations fail elsewhere if th

Re: Python 3K or Python 2.9?

2007-09-13 Thread Piet van Oostrum
*is* passed when you call it, but it is written before the method name instead of after it. Some people have called this an "infix" call similar to infix operators. -- Piet van Oostrum <[EMAIL PROTECTED]> URL: http://www.cs.uu.nl/~piet [PGP 8DAE142BE17999C4] Private email: [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 3K or Python 2.9?

2007-09-13 Thread Piet van Oostrum
>>>>> Ben Finney <[EMAIL PROTECTED]> (BF) wrote: >BF> The latter two statements are equivalent. The 'instance.method(args)' >BF> syntax is just sugar for 'Class.method(instance, args)'. It is more than just syntactic sugar because the Class i

Re: How to Read Bytes from a file

2007-03-05 Thread Piet van Oostrum
d with non-8-byte machines (CDC) until the beginning of the 80's. :=( In fact in that time the institution where Guido worked also had such a machine, but Python came later. -- Piet van Oostrum <[EMAIL PROTECTED]> URL: http://www.cs.uu.nl/~piet [PGP 8DAE142BE17999C4] Private email: [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Displaying EPS in a GUI

2007-03-20 Thread Piet van Oostrum
hackish. You need e Postscript interpreter, e.g. Ghostscript. If you have Ghostscript installed PIL can read EPS images. Then they can be converted to wx images: http://wiki.wxpython.org/index.cgi/WorkingWithImages -- Piet van Oostrum <[EMAIL PROTECTED]> URL: http://www.cs.uu.nl/~piet [PGP

Re: why brackets & commas in func calls can't be ommited? (maybe it could be PEP?)

2007-03-21 Thread Piet van Oostrum
; ... = word1 word2 word3 ... >d> then only word "word1" should be call to func "word1" with parameters >d> word2, word3 etc That depends whether you want function application to be left-associative or right-associative. For example, in haskell it is left associati

Re: Sets in Python

2007-09-20 Thread Piet van Oostrum
unequal Huh? Unequal things may hash to the same value. That one of the essential properties of a hash function. -- Piet van Oostrum <[EMAIL PROTECTED]> URL: http://www.cs.uu.nl/~piet [PGP 8DAE142BE17999C4] Private email: [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Tapping into the access of an int instance

2007-10-02 Thread Piet van Oostrum
def __init__(self, *a, **k): >>> super(Int, self).__init__(self, *a, **k) >>> >>> >>> i = Int(1) >>> >>> i >>> >>> 1 >>> >>> Regards, >>> Tor Erik >CM> While I'm not *totally* sure what

Re: Owner of spawned process in threads

2007-10-04 Thread Piet van Oostrum
and create a new new child In >VS> this case who becomes the owner of this child process. >VS> Is it the thread that spawned becomes the owner or is the main program >VS> becomes the owner of that child process. Owner (parent) is the process, not a thread. -- Piet

Problem installing cElementTree on Python 2.5

2007-01-10 Thread Piet van Oostrum
didn't help. I also removed the -c, but then the install failed in the next step. Has anybody succesfully installed cElementTree on this combination? -- Piet van Oostrum <[EMAIL PROTECTED]> URL: http://www.cs.uu.nl/~piet [PGP 8DAE142BE17999C4] Private email: [EMAIL PROTECTED] -- http

Re: Django, one more newbie question

2007-02-20 Thread Piet van Oostrum
{% endfor %} >BO> >BO> {% else %} >BO> No polls are available. >BO> {% endif %} >BO> Whole tutorial is on this page: >BO> http://www.djangoproject.com/documentation/tutorial3/ >BO> endfor, endif, {{? :) It is the Django template language. --

Re: Local class variables? (mod_python problem)

2007-02-22 Thread Piet van Oostrum
a spurious comma. And a and b already print out the same, so it is not clear what you want. Do you mean that the x and y of the a and b object should be independent? In that case you should not use static variables but instance variables. If they have to survive across different HTTP requests

Re: Local class variables? (mod_python problem)

2007-02-22 Thread Piet van Oostrum
_python it will not do that because different requests can run in different Apache processes (on Linux, Unix, Mac OS X etc.). So it this desired behaviour or not? Your post isn't clear about that. And if it isn't what is the desired behaviour? And you certainly should do something about

<    1   2   3   4   5   6   7   8   >