Re: Decrypting GPG/PGP email messages

2005-09-02 Thread Piet van Oostrum
ts someone from tampering with >FP> the sequence number without being detected. Of course. But with the originators manually sending the requests by email (at least that's how I understood it), this may be a nuisance. -- Piet van Oostrum <[EMAIL PROTECTED]> URL: http://www.cs.

Re: threads/sockets quick question.

2005-09-19 Thread Piet van Oostrum
threads was done properly, it would swallow up all available threads for one port_number, rather than starting one thread per port_number. And it doesn't handle the case when the threads are exhausted: it should wait until a thread becomes available before continuing. -- Piet van Oostrum <

Re: threads/sockets quick question.

2005-09-19 Thread Piet van Oostrum
bers. The latter approach would be simpler IMO. You may also have to take into account if your OS allows a maximum number of open sockets for a process. -- 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 and Unix Commands

2005-09-19 Thread Piet van Oostrum
uot;command", execution blocks until I kill the called script. Is >T> there a way around this?? Use the subprocess module. If you have an older python, you could use os.system(command + "&") or install the subprocess module yourself. -- Piet van Oostrum <[EMAIL PRO

Re: multithread exception handling

2005-09-20 Thread Piet van Oostrum
ght. You can post a signal to the main thread, however, to catch the exception: def TimeoutHandler(): print '!' os.kill(0, signal.SIGUSR1) def handler(): raise Exception class Active: def __init__(self): signal.signal(signal.SIGUSR1, handler) timer = Ti

Re: Exception raised in wrong thread?

2005-09-20 Thread Piet van Oostrum
Please don't post the same question twice with different subjects. -- 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: Question about smtplib, and mail servers in general.

2005-09-20 Thread Piet van Oostrum
me ISP's smtp server and my work's smtp server (but only if I am at the proper location). -- 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: OS X and Tkinter

2005-03-14 Thread Piet van Oostrum
inter.py", line 38, in ? >MT> import _tkinter # If this fails your Python may not be configured for >MT> Tk >MT> ImportError: No module named _tkinter >MT> I have looked everywhere on the net, and can't figure out how to configure >MT> python so

Re: mysteriously nonfunctioning script - very simple

2005-03-26 Thread Piet van Oostrum
>>>>> [EMAIL PROTECTED] (Sean McIlroy) (SM) wrote: >SM> Can anybody help me make sense of the fact that the following script >SM> doesn't work? It's so simple I can't imagine what I'm missing. Any >SM> help will be much appreciated. Wha

Re: PDF Printing support from Python

2005-04-27 Thread Piet van Oostrum
dnowism. >DBR> It could be that he means that creating PDFs on windows is done using >DBR> a fake printer that will produce the pdf when being printed to - and >DBR> that fake printer is implemented as a driver. But that is about creating a PDF file, whereas the OP was speaking abou

Re: Oh look, another language (ceylon)

2013-11-18 Thread Piet van Oostrum
ge reference manual rather than reading in detail.) So, yes, > they're O(n) operations. Thanks for hunting that down. > > ChrisA It would be so much better to use the Flexible String Representation. -- Piet van Oostrum WWW: http://pietvanoostrum.com/ PGP key: [8DAE142BE17999C4] -- https://mail.python.org/mailman/listinfo/python-list

Re: If you continue being rude i will continue doing this

2013-11-18 Thread Piet van Oostrum
t helped a bit these would have been done in a couple of hours. How could anyone have known that this was the problem? AFIAK you didn't even tell about the VPS. And moreover this wasn't a Python problem, so off topic here. -- Piet van Oostrum WWW: http://pietvanoostrum.com/ PGP key: [8DAE142BE17999C4] -- https://mail.python.org/mailman/listinfo/python-list

Re: python socket query

2013-12-23 Thread Piet van Oostrum
of 1 sec s.settimeout() call after the send call but it > doesnot help. > > I tried by commenting s.close() still it did not work. > > Any idea what is the problem? Length(reply) == 0 means that the other side closed the socket without sending anything back. -- Piet van Oostr

Re: Python mange with liste

2013-12-29 Thread Piet van Oostrum
";"+r1 > > f=open("test.txt","r") > conten = f.read() > print conten > f.close() > > #f=open("test.txt","a") > #f.write(infos) > #f.write('\n') > #f.close() > > > thank you =) -- Piet van Oostrum WWW: http://pietvanoostrum.com/ PGP key: [8DAE142BE17999C4] -- https://mail.python.org/mailman/listinfo/python-list

Re: Python/Django Extract and append only new links

2014-01-01 Thread Piet van Oostrum
r information with it also (and then it would be partly a Django problem because you would get the user id from Django). -- Piet van Oostrum WWW: http://pietvanoostrum.com/ PGP key: [8DAE142BE17999C4] -- https://mail.python.org/mailman/listinfo/python-list

Re: the Gravity of Python 2

2014-01-09 Thread Piet van Oostrum
utc from the doc and use that: from datetime import tzinfo, timedelta, datetime ZERO = timedelta(0) class UTC(tzinfo): """UTC""" def utcoffset(self, dt): return ZERO def tzname(self, dt): return "UTC" def dst(self, dt):

Re: the Gravity of Python 2

2014-01-09 Thread Piet van Oostrum
; elegant solution (for text: Unicode; for time zones: twelve simple, >> static zones that never change) > > Twelve or twenty-four? Or are you thinking we should all be an even > number of hours away from UTC, which would also work? Even 24 doesn't take into account DST. -- Pie

Re: the Gravity of Python 2

2014-01-09 Thread Piet van Oostrum
Chris Angelico writes: > On Fri, Jan 10, 2014 at 1:06 AM, Piet van Oostrum wrote: >> Chris Angelico writes: >> >>> On Thu, Jan 9, 2014 at 2:34 PM, Ben Finney >>> wrote: >>>> With time zones, as with text encodings, there is a single technically

Re: Bytes indexing returns an int

2014-01-09 Thread Piet van Oostrum
narrow-minded and Unicode > illiterate. They are neither of these things. > > Continuing to post these comments with no interest in learning is rude. > Other recent threads have contained details rebuttals of your views, > which you have ignored. This is rude. Please stop. Please ign

Re: Monkeypatching a staticmethod?

2014-01-10 Thread Piet van Oostrum
Ian Kelly writes: > I suggest defining x as a normal function and writing the assignment > as "Foo.x = staticmethod(x)" to keep x callable from the global > namespace. Or just del it after doing the monkey patch. You can use Foo.x = staticmethod(lambda: 2) -- Piet van

Re: setup.py issue - some files are included as intended, but one is not

2014-01-15 Thread Piet van Oostrum
t. m4_treap.m4 contains this instruction twice: ifdef(/*pyx*/,cp)if current is None: ifdef(/*pyx*/,cp)raise KeyError Which when generating pyx_treap.pyx (with *pyx* defined) expands to the syntactically incorrect cpif current is None: cpraise KeyError -- P

Re: Python 3.x adoption

2014-01-16 Thread Piet van Oostrum
Travis Griggs writes: > Personally, I wish they’d start python4, sure would take the heat out of > the 3 vs 2 debates. And maybe there’d be a program called twentyfour as > a result. twelve would be sufficient, I would think. -- Piet van Oostrum WWW: http://pietvanoostrum.com

How to write this as a list comprehension?

2014-01-17 Thread Piet van Oostrum
_, mn, dy, _, _, _, wd, _, _ in [localtime(then)]] Python misses a 'where' or 'let'-like construction as in Haskell. Anybody has a more elegant solution? -- Piet van Oostrum WWW: http://pietvanoostrum.com/ PGP key: [8DAE142BE17999C4] -- https://mail.python.org/mailman/listinfo/python-list

Re: How to write this as a list comprehension?

2014-01-18 Thread Piet van Oostrum
Rustom Mody writes: > On Saturday, January 18, 2014 4:49:55 AM UTC+5:30, Piet van Oostrum wrote: [...] > >> Python misses a 'where' or 'let'-like construction as in Haskell. > > +1 > Yes Ive often been bitten by the lack of a 'comprehension-let

Re: How to write this as a list comprehension?

2014-01-18 Thread Piet van Oostrum
Alain Ketterlin writes: > Piet van Oostrum writes: > [...] >> Python misses a 'where' or 'let'-like construction as in Haskell. > > "let x = v in e" really is (lambda x:e)(v) > You are right, but it is a lot less readable IMHO. -- Piet v

Re: How to write this as a list comprehension?

2014-01-19 Thread Piet van Oostrum
where (sic!) the last part means as much as where _, mn, dy, _, _, _, wd, _, _ = localtime(then) I find the list comprehension preferable because it makes it more clear that a new list is constructed from an existing list, something that is not as immediately clear with the append construction.

Re: How to write this as a list comprehension?

2014-01-20 Thread Piet van Oostrum
of a sequence/iterator. There is no way to bind the name(s) to a single object other than putting that object in a one element sequence. I was just looking for a way to avoid that. Functional programming languages have a way to do this with the 'let' or 'where' construction

Re: Early retirement project?

2014-01-22 Thread Piet van Oostrum
wxjmfa...@gmail.com writes: > In fact, Python just becomes the last tool I (would) > recommend, especially for non-ascii users. > > jmf In fact, Python 3 is one of the best programming tools for non-ASCII users. -- Piet van Oostrum WWW: http://pietvanoostrum.com/ PGP key: [8DAE

Re: Can post a code but afraid of plagiarism

2014-01-24 Thread Piet van Oostrum
xtract an element of a list use indexing, like mylist[0]. If you don't know these things or can't find this out yourself, you have a serious lack of knowledge about Python, or maybe about programming, and it is time to learn that first. -- Piet van Oostrum WWW: http://pietvanoostrum.com/ PGP key: [8DAE142BE17999C4] -- https://mail.python.org/mailman/listinfo/python-list

Re: Highlighting program variables instead of keywords?

2014-01-29 Thread Piet van Oostrum
der.com > I seriously think jmf has a mental disorder. So these reactions won't do anything useful. Just ignore. -- Piet van Oostrum WWW: http://pietvanoostrum.com/ PGP key: [8DAE142BE17999C4] -- https://mail.python.org/mailman/listinfo/python-list

Re: ANN: A new version (0.3.6) of python-gnupg has been released.

2014-02-06 Thread Piet van Oostrum
Vinay Sajip writes: > A new version of the Python module which wraps GnuPG has been > released. > There seem to be 2 gnupg modules for Python. The other one has version number 1.2.5. Very confusing! -- Piet van Oostrum WWW: http://pietvanoostrum.com/ PGP key: [8DAE142BE17999C4]

Re: singleton ... again

2014-02-13 Thread Piet van Oostrum
t of it; but > we already have it built in :-) There is a use case for a singleton class: when creating the singleton object takes considerable resources and you don't need it always in your program. -- Piet van Oostrum WWW: http://pietvanoostrum.com/ PGP key: [8DAE142BE17999C4] -- https://mail.python.org/mailman/listinfo/python-list

Re: http post goes into $_REQUEST instead into $_FILES

2013-08-16 Thread Piet van Oostrum
me, mimetype, body)) return and then use it like: form.add_fake_file('file', 'test1.txt', 'This is a test.') -- Piet van Oostrum WWW: http://pietvanoostrum.com/ PGP key: [8DAE142BE17999C4] -- http://mail.python.org/mailman/listinfo/python-list

Re: refresing the edited python function

2013-08-21 Thread Piet van Oostrum
text. I use Komodo IDE when i want an IDE functionality, > and never restart Komodo, over hours of work. > IPython's IDE just works the way alex23 described. -- Piet van Oostrum WWW: http://pietvanoostrum.com/ PGP key: [8DAE142BE17999C4] -- http://mail.python.org/mailman/listinfo/python-list

Re: I wonder if I would be able to collect data from such page using Python

2013-08-21 Thread Piet van Oostrum
srcnode.find_previous_sibling('div').string print("Date: {0}".format(date)) print("Source: {0}".format(source)) cont = srcnode.find_next_siblings('p', class_='articleParagraph enarticleParagraph') contents = '\n'.join([c.get_text() for c in cont]) print("Contents: {0}".format(contents)) -- Piet van Oostrum WWW: http://pietvanoostrum.com/ PGP key: [8DAE142BE17999C4] -- http://mail.python.org/mailman/listinfo/python-list

Re: Python script help

2013-08-23 Thread Piet van Oostrum
;]) print url html = urlopen(url).read() fn = generate_filename(url) with open(fn, 'wb') as outfile: outfile.write(html) #### You should add a more intelligent filename generator, filter out mail: urls and possibly others and add

Re: Lambda function Turing completeness

2013-08-24 Thread Piet van Oostrum
expressions, so this helps. We don't have to emulate booleans and conditions with weird lambda expressions. In Python's lambda expressions you can not use statements, only expressions, so without conditional expressiosn Python's booleans wouldn't be very useful. The rema

Re: Lambda function Turing completeness

2013-08-24 Thread Piet van Oostrum
nside a lambda expression, so this makes all this even nicer. -- [1] http://en.wikipedia.org/wiki/Fixed-point_combinator#Y_combinator -- Piet van Oostrum WWW: http://pietvanoostrum.com/ PGP key: [8DAE142BE17999C4] -- http://mail.python.org/mailman/listinfo/python-list

Re: Cannot form correctly the FORM part of the header when sending mail

2013-09-03 Thread Piet van Oostrum
address) and certain Microsoft programs use that to display as the From address instead of the real From address. It's against the rules, but then, Microsoft makes its own rules and who is going to stop them? And maybe there are other mail programs that do the same. AFAIK there is no way to get rid of that Sender line. -- Piet van Oostrum WWW: http://pietvanoostrum.com/ PGP key: [8DAE142BE17999C4] -- https://mail.python.org/mailman/listinfo/python-list

Re: Cannot form correctly the FORM part of the header when sending mail

2013-09-04 Thread Piet van Oostrum
s an error in the transmission, error messages should go to Charles. At least that is what the RFC's say. And I think that is the logical way to do it. Now some Microsoft mail programs will send replies to Charles, which is incorrect. -- Piet van Oostrum WWW: http://pietvanoostrum.com/ PGP

Re: Cannot form correctly the FORM part of the header when sending mail

2013-09-04 Thread Piet van Oostrum
, SUBJECT ) + MESSAGE + "\r\n" You could even change that to: MESSAGE = "From: %s\r\n" + "To: %s\r\n" + "Subject: %s\r\n\r\n%s\r\n" % (FROM, TO, SUBJECT, MESSAGE) which I think is nicer. -- Piet van Oostrum WWW: http://pietvanoostrum.com/ PGP key: [8DAE142BE17999C4] -- https://mail.python.org/mailman/listinfo/python-list

Re: Cannot form correctly the FORM part of the header when sending mail

2013-09-04 Thread Piet van Oostrum
he sent email, as this is something Gmail automatically provides. Maybe as some kind of spam detector, which is reasonable. Actually providing the Sender in situations like this is what the RFC requires, so Gmail is totally, completely correct in doing this. The problem is completely on the rec

Re: Cannot form correctly the FORM part of the header when sending mail

2013-09-04 Thread Piet van Oostrum
, let it show all headers. Or if you don't trust that, just let the mail be sent to me. I can see exactly how it is. -- Piet van Oostrum WWW: http://pietvanoostrum.com/ PGP key: [8DAE142BE17999C4] -- https://mail.python.org/mailman/listinfo/python-list

Re: Cannot form correctly the FORM part of the header when sending mail

2013-09-04 Thread Piet van Oostrum
Piet van Oostrum writes: > Ferrous Cranus writes: > >> I this hoq you mean? > [...] >> >> SUBJECT = u"Mail από τον επισκέπτη: ( %s )" % FROM >> >> MESSAGE = &qu

Re: how to detect comment in source code file ?

2013-09-05 Thread Piet van Oostrum
. Comments begin at any # > character that is not inside a string (something inside ' or " pairs). You could consider this a kind of nested comment :) # if condition: # # calculate the amount # amount = sum(parts) -- Piet van Oostrum WWW: http://pietvanoostrum.com/ PGP key: [8DA

Re: Cannot form correctly the FORM part of the header when sending mail

2013-09-05 Thread Piet van Oostrum
# send the mail > server.sendmail( MESSAGE ) > > both fail. The first thing you should do then is to look up the documentation of sendmail. http://docs.python.org/ has a good index where you can look for sendmail. -- Piet van Oostrum WWW: http://pietvanoostrum.com/ PGP key: [8DAE14

Re: Multiprocessing / threading confusion

2013-09-05 Thread Piet van Oostrum
t all ticks are deliverd. In my system, only one tick per thread, and then it disappears. I have no idea if this is a bug. I certainly couldn't find it documented. The solution to this is to put a join statement in gogo: def gogo(qu): w = Worker(qu) w.start() w.join() -- Piet van Oostrum WWW: http://pietvanoostrum.com/ PGP key: [8DAE142BE17999C4] -- https://mail.python.org/mailman/listinfo/python-list

Re: Multiprocessing / threading confusion

2013-09-05 Thread Piet van Oostrum
Piet van Oostrum writes: > def run(self): > for n in range(5): > self.que.put('%s tick %d' % (self._pid, n)) > # do some work > time.sleep(1) > self.que.put('%s has exited' % self._pid) To preven

Re: Cannot form correctly the FORM part of the header when sending mail

2013-09-05 Thread Piet van Oostrum
olution would be to filter your mesaage through procmail or similar on your receiving computer. For example put the from address in an X-From header and let the filter replace the From header with the address from the X-From. -- Piet van Oostrum WWW: http://pietvanoostrum.com/ PGP key: [8DAE142BE17999C4] -- https://mail.python.org/mailman/listinfo/python-list

Re: file handling issues

2013-09-06 Thread Piet van Oostrum
d value to be lost and the file probably to be closed. Just messy. print("writing %s" % str(keys[0])+pasw) f.write(str(keys[0])+pasw) f.close() else: hesin=0 And how are people supposed to guess an 8 character password? Are they supposed to do that weird calculation on their calculators or some such? -- Piet van Oostrum WWW: http://pietvanoostrum.com/ PGP key: [8DAE142BE17999C4] -- https://mail.python.org/mailman/listinfo/python-list

Re: Chardet, file, ... and the Flexible String Representation

2013-09-06 Thread Piet van Oostrum
there are none. And you would have a lot more peace of mind if you stopped doing this. [*] array in the C sense. -- Piet van Oostrum WWW: http://pietvanoostrum.com/ PGP key: [8DAE142BE17999C4] -- https://mail.python.org/mailman/listinfo/python-list

Re: Multiprocessing / threading confusion

2013-09-06 Thread Piet van Oostrum
) msg = self.q.get() print(msg) if 'END' in msg: break ..main.. processes = [] for i in range(5): d = Process(target=Worker, args=(debug_q,)) d.start() processes.append(d) for p in processes:

Re: file handling issues

2013-09-07 Thread Piet van Oostrum
user. If you use an internet connection then of course you can keep the relevant data outside of the reach of the user. -- Piet van Oostrum WWW: http://pietvanoostrum.com/ PGP key: [8DAE142BE17999C4] -- https://mail.python.org/mailman/listinfo/python-list

Re: Tryign to send mail via a python script by using the local MTA

2013-09-17 Thread Piet van Oostrum
isking that temporarily your email cannot be delivered. I think you should give up this unholy idea, and just stick with the standard. -- Piet van Oostrum WWW: http://pietvanoostrum.com/ PGP key: [8DAE142BE17999C4] -- https://mail.python.org/mailman/listinfo/python-list

Re: Making it a MultiThread!

2013-09-21 Thread Piet van Oostrum
ultiprocessing.current_process().name My advice would be to just do the GUI in the main module, and if the Action needs more time, the create a new Thread or Process in the Action class. -- Piet van Oostrum WWW: http://pietvanoostrum.com/ PGP key: [8DAE142BE17999C4] -- https://mail.python.org/mailman/listinfo/python-list

Re: Making it a MultiThread!

2013-09-24 Thread Piet van Oostrum
. Very, very long files usually are not a good idea. Also you imported multiprocessing through anothe module. This obscures the structure of the application, and is unnecesary. You should only access a module through another module if you add a layer of abstraction that makes it easier or more

Re: python, pythontex and plots

2013-09-24 Thread Piet van Oostrum
ater. But if I am correct then the following might work: \newcommand{\filename}{} \edef\filename{\py{outputfile}} \includegraphics[scale=0.75]{\filename} -- Piet van Oostrum WWW: http://pietvanoostrum.com/ PGP key: [8DAE142BE17999C4] -- https://mail.python.org/mailman/listinfo/python-list

Re: removing BOM prepended by codecs?

2013-09-24 Thread Piet van Oostrum
ion. The only difference is Fedora 18 v > Fedora 17. > > The BOMs are certainly there: > > <86> %R 10C0203z-621 > %A François-Xavier Le_Bourdonnec > > 000 206 255 373 % R 1 0 C 0 2 0 3 z - > That is not a BOM or SIG. It isn't

Re: Referrer key missing form os.environ dictionary?

2013-09-25 Thread Piet van Oostrum
ADDR'] )[0] or > UnKnown Host' >^ > SyntaxError: invalid syntax > > > i dont see anything wrong with that line, and the carret is actually > pointing to the "host". There is an apostrophe (') missing before UnKnown. host = socket.gethostbyaddr(

Re: Newline interpretation issue with MIMEApplication with binary data, Python 3.3.2

2013-09-26 Thread Piet van Oostrum
python-requests.org/en/latest/) or the Uploading Files part from Doug Hellmann's page (http://doughellmann.com/2009/07/pymotw-urllib2-library-for-opening-urls.html). This is for Python2; I can send you a Python3 version if you want. -- Piet van Oostrum WWW: http://pietvanoostrum.com/ PGP k

Re: Weird bahaviour from shlex - line no

2013-09-28 Thread Piet van Oostrum
hars are > returned as single characters, so there is no need to peek ahead and the > lineno is not altered. > > In short: this looks like an implementation accident. I think shlex should be changed to give the line number of the start of the token in self.lineno. It isn't

Re: Handling 3 operands in an expression without raising an exception

2013-09-29 Thread Piet van Oostrum
> point you react that you want to get to Londen without boat > or plane but just by bicycle. And in further exchange make it > clear that using a bike is more important than arriving in London. And then the easiests would be to put your bicycle in the train. -- Piet v

Re: class implementation

2013-09-30 Thread Piet van Oostrum
les? -- Piet van Oostrum WWW: http://pietvanoostrum.com/ PGP key: [8DAE142BE17999C4] -- https://mail.python.org/mailman/listinfo/python-list

Re: what is wrong in my code?? (python 3.3)

2013-09-30 Thread Piet van Oostrum
ding: import codecs sys.stdout = codecs.getwriter("utf-8")(sys.stdout.detach()) [Note: I haven't tested this] -- Piet van Oostrum WWW: http://pietvanoostrum.com/ PGP key: [8DAE142BE17999C4] -- https://mail.python.org/mailman/listinfo/python-list

Re: Functional Programming and python

2013-09-30 Thread Piet van Oostrum
is > bullshit. Tail recursion optimization throws away valuable stack trace information in case of an error. > 2. Lambda-expression body is limited to one expression. Why ? Allowing general statements in a lambda body makes indentation more difficult, I think. -- Piet van Oostrum W

Re: Functional Programming and python

2013-10-01 Thread Piet van Oostrum
Antoon Pardon writes: > Op 30-09-13 20:55, Piet van Oostrum schreef: >> Franck Ditter writes: >> >>> Good approach of FP in Python, but two points make me crazy : >>> 1. Tail recursion is not optimized. We are in 2013, why ? This is known >>> technolo

Re: I haev fixed it

2013-10-01 Thread Piet van Oostrum
FILE ON MY > ACCOUNT? > > PLEASE ANSWER ME, I WONT GET MAD, BUT THIS IS AN IMPORTANT SECURITY RISK. > > SOMEONES MUST HAVE ACCESS TO MY ACCOUNT, DOES THE SOURCE CODE OF MY MAIN > PYTHON SCRIPT APPEARS SOMEPLACE AGAIN?!?! These questions show that the one who put that

Re: JUST GOT HACKED

2013-10-01 Thread Piet van Oostrum
FILE ON MY > ACCOUNT? > > PLEASE ANSWER ME, I WONT GET MAD, BUT THIS IS AN IMPORTANT SECURITY RISK. > > SOMEONES MUST HAVE ACCESS TO MY ACCOUNT, DOES THE SOURCE CODE OF MY MAIN > PYTHON SCRIPT APPEARS SOMEPLACE AGAIN?!?! This shows that the warning was correct. -- Piet van Oos

Re: JUST GOT HACKED

2013-10-04 Thread Piet van Oostrum
also find it interesting to solve Python problems. I did not like Nikos' arrogance, ignorance and his refusal to use perfectly good solutions. -- Piet van Oostrum WWW: http://pietvanoostrum.com/ PGP key: [8DAE142BE17999C4] -- https://mail.python.org/mailman/listinfo/python-list

Re: Why didn't my threads exit correctly ?

2013-10-05 Thread Piet van Oostrum
ist now, thanks again. Also make sure that l_ip and l_result are Queues instead of lists, as MRAB suggested. -- Piet van Oostrum WWW: http://pietvanoostrum.com/ PGP key: [8DAE142BE17999C4] -- https://mail.python.org/mailman/listinfo/python-list

Re: Database statements via python but database left intact

2013-10-06 Thread Piet van Oostrum
sing, and also to study the underlying computer science concepts. -- Piet van Oostrum WWW: http://pietvanoostrum.com/ PGP key: [8DAE142BE17999C4] -- https://mail.python.org/mailman/listinfo/python-list

Re: Odd-length string

2013-10-06 Thread Piet van Oostrum
7;'.join(tulemus2), and then to convert it to a string you have to specify the encoding, which should be 'ascii', as you say it is ASCII. str(b''.join(tulemus2), 'ascii') or b''.join(tulemus2).decode('ascii') But note: If your

Re: HEX to ASCII

2013-10-06 Thread Piet van Oostrum
\\', b'r', b'3', > b'\x1f', b'V', b's', b'9', b'\x1d'] > > the Key-0000 is the key im using to decrypt the code. everything else is > generated by the decrytion process and the unhexlify command. So my guess is, > the join command cant handle the b"u" type of format. how can i get rid of > the b. > > Or does anyone have a better idea how to translate HEX into ASCII and sort > out the lines that make sense Why do you post the same question twice under different subjects? -- Piet van Oostrum WWW: http://pietvanoostrum.com/ PGP key: [8DAE142BE17999C4] -- https://mail.python.org/mailman/listinfo/python-list

Re: Select fails when cookie tried to get a numeric value

2013-10-06 Thread Piet van Oostrum
nd convert them one after one if you think it is necessary. For example a script that is seldom used can stay as CGI script. And last but not least: not every Apache installation has mod-wsgi enabled. I think most hosting providers don't. -- Piet van Oostrum WWW: http://pietva

Re: HEX to ASCII

2013-10-07 Thread Piet van Oostrum
oint with xxx = b''.join(tulemus2), and then you have another byte string. If you are sure this is ASCII (which means all bytes are < 128), the you can convert it to a string with str(xxx, 'ascii') or xxx.decode('ascii'). If there are bytes > 127 then you ha

Re: Tail recursion to while iteration in 2 easy steps

2013-10-07 Thread Piet van Oostrum
Alain Ketterlin writes: > BTW, does the original callable object have a ref counter? Is it garbage > collected in that case? If not, would it be considered a bug? In CPython ALL objects have ref counters. -- Piet van Oostrum WWW: http://pietvanoostrum.com/ PGP key: [8DAE142BE1

Re: Tail recursion to while iteration in 2 easy steps

2013-10-07 Thread Piet van Oostrum
mputation are you talking about? And what magica; effects? AFAIK there is no magic in computer science, although every sufficiently advanced ... -- Piet van Oostrum WWW: http://pietvanoostrum.com/ PGP key: [8DAE142BE17999C4] -- https://mail.python.org/mailman/listinfo/python-list

Re: Tail recursion to while iteration in 2 easy steps

2013-10-07 Thread Piet van Oostrum
ll optimization there is no need to do tail recursion optimization. -- Piet van Oostrum WWW: http://pietvanoostrum.com/ PGP key: [8DAE142BE17999C4] -- https://mail.python.org/mailman/listinfo/python-list

Re: Re for Apache log file format

2013-10-09 Thread Piet van Oostrum
(7)() > -> pattern = re.compile(r'(?P\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})\s+' > (Pdb) n >> /Users/user/Documents/Python/apache.py(17)() > -> match = re.search(pattern, string) > (Pdb) Also as Andreas has noted the r'(?P\"\")\s+' part is wrong. It should probably be r'(?P\".*?\")\s+' And the r'(?P\((.*?)\))') will also not match as there is text outside the (). Should probably also be r'(?P\".*?\")') or something like it. -- Piet van Oostrum WWW: http://pietvanoostrum.com/ PGP key: [8DAE142BE17999C4] -- https://mail.python.org/mailman/listinfo/python-list

Re: Cookie gets changed when hit comes from a referrer

2013-10-09 Thread Piet van Oostrum
65 # this cookie will > expire in a year > As Ian already has told you (but apparently you didn't pay attention to), your expires is wrong. So if your cookies disappear you should get this right first. from datetime import datetime, timedelta expiretime = datetime.u

Re: closure = decorator?

2013-10-10 Thread Piet van Oostrum
in this area). In Python, however, you can define the __call__ method and with this they become almost identical in behaviour. -- Piet van Oostrum WWW: http://pietvanoostrum.com/ PGP key: [8DAE142BE17999C4] -- https://mail.python.org/mailman/listinfo/python-list

Re: Python 3.2 | WIndows 7 -- Multiprocessing and files not closing

2013-10-10 Thread Piet van Oostrum
27;c:/testfile.h5' filename = 'c:\\testfile.h5' filename = r'c:\testfile.h5' -- Piet van Oostrum WWW: http://pietvanoostrum.com/ PGP key: [8DAE142BE17999C4] -- https://mail.python.org/mailman/listinfo/python-list

Re: Python 3.2 | WIndows 7 -- Multiprocessing and files not closing

2013-10-10 Thread Piet van Oostrum
h the same problem posted a smaller, more complete example here: > Then you should give us real code (a minimal example) that we can try. You use myFunction in your example that isn't defined in your code. And by the way, why don't you close f just after reading? Or even better, use

Re: class implementation

2013-10-10 Thread Piet van Oostrum
therefore _WorldProper is not defined. from import * is considered bad practice anyway. It is better just to import the things you need. from pykkar import World, Pykkar, _WorldProper I have looked a bit in this pykkar.py and I think it is badly structured for extension. The three classes

Re: Multi-threading in Python vs Java

2013-10-11 Thread Piet van Oostrum
e Python will serve you just fine! Check out the threading > module, knock together a quick test, and spin it up! But it only works if the external C library has been written to release the GIL around the long computations. If not, then the OP could try to write a wrapper around them that does th

Re: Unicode Objects in Tuples

2013-10-11 Thread Piet van Oostrum
more help. But you can do everything you want with 2.x, I think. -- Piet van Oostrum WWW: http://pietvanoostrum.com/ PGP key: [8DAE142BE17999C4] -- https://mail.python.org/mailman/listinfo/python-list

Re: Inter-process locking

2013-10-11 Thread Piet van Oostrum
ditions. File locking is generally the best solution for this kind of problems, unless you can make use of OS level semaphores. -- Piet van Oostrum WWW: http://pietvanoostrum.com/ PGP key: [8DAE142BE17999C4] -- https://mail.python.org/mailman/listinfo/python-list

Re: Inter-process locking

2013-10-13 Thread Piet van Oostrum
can be done in a platform independent way without the risk of race conditions. Maybe I have to find out. -- Piet van Oostrum WWW: http://pietvanoostrum.com/ PGP key: [8DAE142BE17999C4] -- https://mail.python.org/mailman/listinfo/python-list

Re: Would you l like to take over lockfile?

2013-10-13 Thread Piet van Oostrum
Skip Montanaro writes: > I don't have the time or inclination to continue supporting lockfile ( > https://pypi.python.org/ > pypi/lockfile/). If you'd like to take it over, let me know. > > Skip Hi Skip, I am interested. -- Piet van Oostrum WWW: http://pi

Re: Python was designed

2013-10-15 Thread Piet van Oostrum
cc, that I did not know) and used it to generate a parser for Algol 68. -- Piet van Oostrum WWW: http://pietvanoostrum.com/ PGP key: [8DAE142BE17999C4] -- https://mail.python.org/mailman/listinfo/python-list

Re: urllib2 timeout issue

2013-10-16 Thread Piet van Oostrum
socket.setdefaulttimeout(5) > > and it didn't make any difference. > > In both cases, Python version is "Python 2.7.3". > > Am I missing something ? > I would guess the difference to be caused by DNS. Maybe the DNS configuration on the RPi is not optimal. -- Piet van Oostrum WWW: http://pietvanoostrum.com/ PGP key: [8DAE142BE17999C4] -- https://mail.python.org/mailman/listinfo/python-list

Re: converting letters to numbers

2013-10-16 Thread Piet van Oostrum
IRC Lisp uses % for comments, but it may need to be doubled. (It's > been doubled in the examples I've seen, and I don't remember the > syntax.) > Perhaps Scheme has the same convention, but Scheme could be considered a > part of the Lisp clade. Lisp and scheme use

Re: Python was designed

2013-10-16 Thread Piet van Oostrum
ll due respect, Mark, your remarks are rubbish. Nobody talked about parsing input with binary switches except you. I answered that 40 years ago I wrote a parser generator that generated a parser for Algol 68 (and another one for Algol 60 I should have added). And all this was using punched cards.

Re: Python was designed (was Re: Multi-threading in Python vs Java)

2013-10-17 Thread Piet van Oostrum
ors that translated into pure C code, which was then compiled with a C compiler. The resulting intermediate C code would be an object-oriented program in C. IIRC, the C code was reasonably clear, not really convoluted, so you would have been able to write it yourself. -- Piet van Oostrum WWW: http://piet

Re: Markers on a matplotlib plot

2013-10-17 Thread Piet van Oostrum
t.show() > > I would like to place markers on the 4 curves when the price is equal to $20 > label it A, and when the price is equal to $40 and label it B. Does anyone > know how I can accomplish this. Something like: plt.plot(20,40, 'bo') plt.annotate('B', (20,40), xytex

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:/

<    1   2   3   4   5   6   7   8   >