Uninstall tool not working.
Hi, I was trying to uninstall version 3.10.7 of python but I've encountered problems with the uninstall tool. I open the python setup program, click on the uninstall button but it doesn't even start deleting python even though it says that the process has finished. Feel free to ask for more details in case I didn't explain it correctly. Thanks in advance for your help. -- https://mail.python.org/mailman/listinfo/python-list
[issue41606] multiprocessing.Event.wait hangs when interrupted by signal that sets the event
New submission from Salvatore Ingala : According to the docs, multiprocessing.Event is a clone of threading.Event. Yet, there is a strange behavior that is observed only on multiprocessing.Event. If an event.wait() is interrupted by a SIGINT and the signal handler sets the event, then the call to event.set() hangs if event is an instance of multiprocessing.Event, in what looks like a deadlock; instead, it works as expected if it's an instance of threading.Event. See the file attached for a reproduction. It seems to have been so for a long time, see: https://stackoverflow.com/questions/24422154/multiprocessing-event-wait-hangs-when-interrupted-by-a-signal/30831867 -- files: event-test.py messages: 375745 nosy: salvatore.ingala priority: normal severity: normal status: open title: multiprocessing.Event.wait hangs when interrupted by signal that sets the event type: behavior versions: Python 3.8 Added file: https://bugs.python.org/file49419/event-test.py ___ Python tracker <https://bugs.python.org/issue41606> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
Transcrypt - Games for Kids
Hello, I am using Transcrypt (Python to Javascript translator) to create games for kids, and introduce them to programming. You can give an eye here : https://github.com/artyprog/GFK Regards -- https://mail.python.org/mailman/listinfo/python-list
ArtWork in PyPyBox - Pure Python
In pure Python, here is a nice image (for me at least) http://salvatore.diodev.fr/pypybox/ Regards -- https://mail.python.org/mailman/listinfo/python-list
Re: Experimenting with PyPyJS
Le samedi 19 mars 2016 19:52:45 UTC+1, Terry Reedy a écrit : > On 3/19/2016 1:06 PM, Salvatore DI DIO wrote: > > Le samedi 19 mars 2016 18:00:05 UTC+1, Vincent Vande Vyvre a écrit : > >> Le 19/03/2016 16:32, Salvatore DI DIO a écrit : > >>> Le samedi 19 mars 2016 16:28:36 UTC+1, Salvatore DI DIO a écrit : > >>>> Hy all, > >>>> > >>>> I am experimenting PyPyJS and found it not so bad at all. > >>>> The virtual machine loads on a few seconds (using firefox). > >>>> > >>>> It s really nice for learning Python, you have all the standard > >>>> libraries, > >>>> and traceback on errors. I don't have to choose anymore with all > >>>> transpilers around > >>>> > >>>> You can try it here, but please don't tell it s too long to load the VM. > >>>> After all, don't you wait when you start a desktop application, or an > >>>> heavy game online ? > >>>> > >>>> Just try it and tell your feeling > >>>> > >>>> Regards > >>>> > >>>> http://salvatore.diodev.fr/pypybox/ > >>> Use Firefox... > >> > >> That's look fine but: > >> > >> PID USER PR NI VIRT RES SHR S %CPU %MEMTIME+ COMMAND > >>4917 vincent 20 0 1081m 305m 52m R *50.3* 15.4 5:23.75 firefox > >>1094 root 20 0 48152 15m 7180 S *35.0* 0.8 4:43.28 Xorg > >>5421 vincent 20 0 162m 14m 10m R 2.0 0.7 0:02.49 > >> mate-terminal > >> 1 root 20 0 3660 1984 ... > >> > >> 85.3 % (50.3 + 35) CPU usage just for a rotating square it's too much cost. > >> > >> Vincent > > > > Thank you for testing :-) > > Strange on Windows I have an average 6% CPU with Firefox 45.0.1 > > Win10, same FF, 6 core pentium, 1% +- CPU, 110 MB memory increase. > > > -- > Terry Jan Reedy Thanks Terry -- https://mail.python.org/mailman/listinfo/python-list
Re: Experimenting with PyPyJS
Le samedi 19 mars 2016 18:00:05 UTC+1, Vincent Vande Vyvre a écrit : > Le 19/03/2016 16:32, Salvatore DI DIO a écrit : > > Le samedi 19 mars 2016 16:28:36 UTC+1, Salvatore DI DIO a écrit : > >> Hy all, > >> > >> I am experimenting PyPyJS and found it not so bad at all. > >> The virtual machine loads on a few seconds (using firefox). > >> > >> It s really nice for learning Python, you have all the standard libraries, > >> and traceback on errors. I don't have to choose anymore with all > >> transpilers around > >> > >> You can try it here, but please don't tell it s too long to load the VM. > >> After all, don't you wait when you start a desktop application, or an > >> heavy game online ? > >> > >> Just try it and tell your feeling > >> > >> Regards > >> > >> http://salvatore.diodev.fr/pypybox/ > > Use Firefox... > > That's look fine but: > >PID USER PR NI VIRT RES SHR S %CPU %MEMTIME+ COMMAND > 4917 vincent 20 0 1081m 305m 52m R *50.3* 15.4 5:23.75 firefox > 1094 root 20 0 48152 15m 7180 S *35.0* 0.8 4:43.28 Xorg > 5421 vincent 20 0 162m 14m 10m R 2.0 0.7 0:02.49 mate-terminal > 1 root 20 0 3660 1984 ... > > 85.3 % (50.3 + 35) CPU usage just for a rotating square it's too much cost. > > Vincent Here is a screenshot http://salvatore.diodev.fr/pypybox/static/images/pypyjs.png -- https://mail.python.org/mailman/listinfo/python-list
Re: Experimenting with PyPyJS
Le samedi 19 mars 2016 18:00:05 UTC+1, Vincent Vande Vyvre a écrit : > Le 19/03/2016 16:32, Salvatore DI DIO a écrit : > > Le samedi 19 mars 2016 16:28:36 UTC+1, Salvatore DI DIO a écrit : > >> Hy all, > >> > >> I am experimenting PyPyJS and found it not so bad at all. > >> The virtual machine loads on a few seconds (using firefox). > >> > >> It s really nice for learning Python, you have all the standard libraries, > >> and traceback on errors. I don't have to choose anymore with all > >> transpilers around > >> > >> You can try it here, but please don't tell it s too long to load the VM. > >> After all, don't you wait when you start a desktop application, or an > >> heavy game online ? > >> > >> Just try it and tell your feeling > >> > >> Regards > >> > >> http://salvatore.diodev.fr/pypybox/ > > Use Firefox... > > That's look fine but: > >PID USER PR NI VIRT RES SHR S %CPU %MEMTIME+ COMMAND > 4917 vincent 20 0 1081m 305m 52m R *50.3* 15.4 5:23.75 firefox > 1094 root 20 0 48152 15m 7180 S *35.0* 0.8 4:43.28 Xorg > 5421 vincent 20 0 162m 14m 10m R 2.0 0.7 0:02.49 mate-terminal > 1 root 20 0 3660 1984 ... > > 85.3 % (50.3 + 35) CPU usage just for a rotating square it's too much cost. > > Vincent Thank you for testing :-) Strange on Windows I have an average 6% CPU with Firefox 45.0.1 -- https://mail.python.org/mailman/listinfo/python-list
Re: Experimenting with PyPyJS
Le samedi 19 mars 2016 16:28:36 UTC+1, Salvatore DI DIO a écrit : > Hy all, > > I am experimenting PyPyJS and found it not so bad at all. > The virtual machine loads on a few seconds (using firefox). > > It s really nice for learning Python, you have all the standard libraries, > and traceback on errors. I don't have to choose anymore with all transpilers > around > > You can try it here, but please don't tell it s too long to load the VM. > After all, don't you wait when you start a desktop application, or an heavy > game online ? > > Just try it and tell your feeling > > Regards > > http://salvatore.diodev.fr/pypybox/ Use Firefox... -- https://mail.python.org/mailman/listinfo/python-list
Experimenting with PyPyJS
Hy all, I am experimenting PyPyJS and found it not so bad at all. The virtual machine loads on a few seconds (using firefox). It s really nice for learning Python, you have all the standard libraries, and traceback on errors. I don't have to choose anymore with all transpilers around You can try it here, but please don't tell it s too long to load the VM. After all, don't you wait when you start a desktop application, or an heavy game online ? Just try it and tell your feeling Regards http://salvatore.diodev.fr/pypybox/ -- https://mail.python.org/mailman/listinfo/python-list
Re: Explaining names vs variables in Python
Thank you very much ast and all of you. I better understant now Regards -- https://mail.python.org/mailman/listinfo/python-list
Explaining names vs variables in Python (follow)
Thank you very much all of you. I better understand now Regards -- https://mail.python.org/mailman/listinfo/python-list
Explaining names vs variables in Python
Hello, I know Python does not have variables, but names. Multiple names cant then be bound to the same objects. So this behavior >>> b = 234 >>> v = 234 >>> b is v True according to the above that is ok But where is the consistency ? if I try : >>> v = 890 >>> w = 890 >>> v is w False It is a little difficult to explain this behavior to a newcommer in Python Can someone give me the right argument to expose ? Regards -- https://mail.python.org/mailman/listinfo/python-list
Re: Calulation in lim (1 + 1 /n) ^n when n -> infinite
Thank you very much Peter -- https://mail.python.org/mailman/listinfo/python-list
Calulation in lim (1 + 1 /n) ^n when n -> infinite
Hello, I was trying to show that this limit was 'e' But when I try large numbers I get errors def lim(p): return math.pow(1 + 1.0 / p , p) >>> lim(5) 2.718281748862504 >>> lim(9) 2.7182820518605446 What am i doing wrong ? Regards -- https://mail.python.org/mailman/listinfo/python-list
Re: Calulation in lim (1 + 1 /n) ^n when n -> infinite
Thank you very much Oscar,I was considerind using Mapple :-) -- https://mail.python.org/mailman/listinfo/python-list
Re: Calulation in lim (1 + 1 /n) ^n when n -> infinite
Thank you very much Chris -- https://mail.python.org/mailman/listinfo/python-list
Re: Calulation in lim (1 + 1 /n) ^n when n -> infinite
Thank you very much Oscar, I was considering using Mapple :-) -- https://mail.python.org/mailman/listinfo/python-list
RapydBox
Hello, For those of you who are interested by tools like NodeBox or Processing. you can give a try to RapydScript here : https://github.com/artyprog/RapydBox Regards -- https://mail.python.org/mailman/listinfo/python-list
Re: RapydScript : Python to Javascript translator
I don't know about other people here, but I'm a bit leery of just downloading Windows binaries from people and running them. Is your source code available? Is this an open source / free project? ChrisA You are completly right :-) Here is the source code : https://github.com/charleslaw/rapydscript_online You can see other demos here : http://salvatore.pythonanywhere.com/RapydScript The official site of RapydScript : http://rapydscript.pyjeon.com/ e assumptions before testing : Here is the official site: http://rapydscript.pyjeon.com/ Regards Salvatore -- https://mail.python.org/mailman/listinfo/python-list
Source code of Python to Javascsript translator
I don't know about other people here, but I'm a bit leery of just downloading Windows binaries from people and running them. Is your source code available? Is this an open source / free project? ChrisA You are completly right :-) Here is the source code : https://github.com/charleslaw/rapydscript_online You can see other demos here : http://salvatore.pythonanywhere.com/RapydScript The official site of RapydScript : http://rapydscript.pyjeon.com/ e assumptions before testing : Here is the official site: http://rapydscript.pyjeon.com/ Regards Salvatore -- https://mail.python.org/mailman/listinfo/python-list
RapydScript : Python to Javascript translator
Hello, If someone is interested about a fast Python to Javascript translator (not a compiler like Brython which is another beast) Here is a link of a RapydScript Tester. For now it's only for windows. Regards http://salvatore.pythonanywhere.com/static/Projects/RapydScriptDemo.exe (I can if there is needs publish it for mac and linux) -- https://mail.python.org/mailman/listinfo/python-list
Re: [ANN] Pythonium Core 0.2.5
Thanks Amirouche, I am now balanced between RapydScript and Pythonium :-) Le dimanche 17 novembre 2013 20:17:44 UTC+1, Amirouche Boubekki a écrit : Héllo Pythonistas from all over the world, I'm very proud to announce the immediate availability of Pythonium Core 0.2.5, a Python 3 to Javascript translator (the best) that generates *fast* *portable* code written in Python. It use Python 3 parser and translates the code to JavaScript code. I did not say “it's fully compliant” because it's not. That's not the point of this flavor. Its point is to make possible to write Python code and use it in the browsers. All the objects stay vanilla Javascript objects. There is no builtins, no stdlib, except what is available in the wild, because Pythonium can access Javascript objects directly, you can use *whatever* JavaScript library you want. There is port of the mrdoob webgl cloud demo available watch: http://pythonium.github.io/ read: https://github.com/pythonium/pythonium.github.io/blob/master/js/app.py The project is hosted at github: https://github.com/pythonium/pythonium Don't hesitate to watch/star/fork/create/pr ! Like said earlier, it's the best translator I know of, and it's written in Python. How do you get started ? == If you know JavaScript it's easy you don't need guidance. Don't forget to read the cookook https://github.com/pythonium/pythonium/wiki/Pythonium-Core-Cookbook If you only know backend or desktop Python development, it will be a bit more work. What you can do is take a jQuery or Javascript course, and translate the code on the fly to Python, compile it using the pythonium_core and and run it in nodejs or a browser. Good luck! What's next? == Now, basicly, I don't know what to do! Except bugs in requirejs integration, I don't except to commit more on this flavor of Pythonium, so I could work on more compliant flavors until reaching full compliance with Python 3. BUT, this is not very interesting, having full compliance is nice, but you loose native javascript speed (meh!) I'd rather be working on the next killer todo list or some Kivy-like library for the browser using Pythonium Core. What do you think? Amirouche -- https://mail.python.org/mailman/listinfo/python-list
Re: [ANN] Pythonium Core 0.2.5
Porting Kivy would be really great. Le dimanche 17 novembre 2013 20:17:44 UTC+1, Amirouche Boubekki a écrit : Héllo Pythonistas from all over the world, I'm very proud to announce the immediate availability of Pythonium Core 0.2.5, a Python 3 to Javascript translator (the best) that generates *fast* *portable* code written in Python. It use Python 3 parser and translates the code to JavaScript code. I did not say “it's fully compliant” because it's not. That's not the point of this flavor. Its point is to make possible to write Python code and use it in the browsers. All the objects stay vanilla Javascript objects. There is no builtins, no stdlib, except what is available in the wild, because Pythonium can access Javascript objects directly, you can use *whatever* JavaScript library you want. There is port of the mrdoob webgl cloud demo available watch: http://pythonium.github.io/ read: https://github.com/pythonium/pythonium.github.io/blob/master/js/app.py The project is hosted at github: https://github.com/pythonium/pythonium Don't hesitate to watch/star/fork/create/pr ! Like said earlier, it's the best translator I know of, and it's written in Python. How do you get started ? == If you know JavaScript it's easy you don't need guidance. Don't forget to read the cookook https://github.com/pythonium/pythonium/wiki/Pythonium-Core-Cookbook If you only know backend or desktop Python development, it will be a bit more work. What you can do is take a jQuery or Javascript course, and translate the code on the fly to Python, compile it using the pythonium_core and and run it in nodejs or a browser. Good luck! What's next? == Now, basicly, I don't know what to do! Except bugs in requirejs integration, I don't except to commit more on this flavor of Pythonium, so I could work on more compliant flavors until reaching full compliance with Python 3. BUT, this is not very interesting, having full compliance is nice, but you loose native javascript speed (meh!) I'd rather be working on the next killer todo list or some Kivy-like library for the browser using Pythonium Core. What do you think? Amirouche -- https://mail.python.org/mailman/listinfo/python-list
Re: [ANN] Pythonium Core 0.2.5
Are lists comprehensions are featured in Veloce ? -- https://mail.python.org/mailman/listinfo/python-list
Nodebox(v1) on the web via RapydScript
Hello, Nodebox is a program in the spirit of Processing but for Python. The first version runs only on MAC. Tom, the creator has partly ported it to Javascript. But many of you dislike Javascript. The solution was to use a translator, Python - Javascript Of the both two greats solutions Brython / RapydScript, I've choosen RapydScript (Brython and RapydScript does not achieve the same goal) You can see a preview of 'Nodebox on the Web' namely 'RapydBox' here : http://salvatore.pythonanywhere.com/RapydBox Regards -- https://mail.python.org/mailman/listinfo/python-list
Re: Processing in Python
He meant it has been re-implemented in Javascript: Indeed :-) There is a jython based NodeBox that runs on windows that can be found here: http://research.nodebox.net/index.php/NodeBoxDev Thank you -- http://mail.python.org/mailman/listinfo/python-list
Re: Processing in Python
Thanks all of you Regards Salvatore -- http://mail.python.org/mailman/listinfo/python-list
Processing in Python
Hello, The Processing Graphics language has been implemented in Javascript. Does anybody tried to make this in Python ? Regards Salvatore http://processing.org/ -- http://mail.python.org/mailman/listinfo/python-list
Re: Compress a string
Try this t = set(bbc) list(t) Regards Salvatore Matt Porter [EMAIL PROTECTED] a écrit dans le message de news: [EMAIL PROTECTED] Hi guys, I'm trying to compress a string. E.g: BBBC - ABC The code I have so far feels like it could be made clearer and more succinct, but a solution is currently escaping me. def compress_str(str): new_str = for i, c in enumerate(str): try: if c != str[i+1]: new_str += c except IndexError: new_str += c return new_str Cheers Matt -- -- -- http://mail.python.org/mailman/listinfo/python-list
Ikaroo Tools CSV files
Hello Is there a way e to use joker characters in queries ? Regards Salvatore -- http://mail.python.org/mailman/listinfo/python-announce-list Support the Python Software Foundation: http://www.python.org/psf/donations.html
Re: Client side GUI-like web framework ?
[EMAIL PROTECTED] a écrit : You just described what XUL aims to be http://developer.mozilla.org/en/docs/The_Joy_of_XUL http://developer.mozilla.org/en/docs/XULRunner XUL is great but it does not allow yet to use Python. There use to be such a beast, it was named 'Nufox'... Give a try to http://www.appcelerator.org/index.html Regards Salvatore A.K.A ArtyProg -- http://mail.python.org/mailman/listinfo/python-list
Re: Python FTP server library 0.3.0 released
Giampaolo Rodola' a écrit : Hi, I'm pleased to announce release 0.3.0 of Python FTP Server library (pyftpdlib). http://code.google.com/p/pyftpdlib/ - Giampaolo Rodola' g.rodola [at] gmail [dot] com Greatissimo :-) It would be nice if this could be integrate in Python Libs Regards Salvatore -- http://mail.python.org/mailman/listinfo/python-list
Valgrind and pexpect
Hi, I'm using the pexpect module to spawn some processes in a testing environment. pexpect uses, internally, os.execv. What I need to do is valgrind python and get memory leaks from the spawned children (assuming that python doesn't leak :)). Here's a simple testcase: === leak.c: === #include stdlib.h #include stdio.h int main() { int *i = (int *) malloc(sizeof(int)); *i = 7; printf(*i=%d\n, *i); return 0; } === leak.py: === import pexpect import sys child = pexpect.spawn('./leak') child.expect('\*i='); print 'Done' === Valgrind command: === valgrind --leak-check=full --trace-children=yes --tool=memcheck --suppressions=valgrind-python.supp python ./leak.py ==30239== Memcheck, a memory error detector. ==30239== Copyright (C) 2002-2006, and GNU GPL'd, by Julian Seward et al. ==30239== Using LibVEX rev 1658, a library for dynamic binary translation. ==30239== Copyright (C) 2004-2006, and GNU GPL'd, by OpenWorks LLP. ==30239== Using valgrind-3.2.1-Debian, a dynamic binary instrumentation framework. ==30239== Copyright (C) 2000-2006, and GNU GPL'd, by Julian Seward et al. ==30239== For more details, rerun with: -v ==30239== Done ==30239== ==30239== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 1092 from 8) ==30239== malloc/free: in use at exit: 702,546 bytes in 140 blocks. ==30239== malloc/free: 2,314 allocs, 2,174 frees, 1,929,320 bytes allocated. ==30239== For counts of detected errors, rerun with: -v ==30239== searching for pointers to 140 not-freed blocks. ==30239== checked 1,069,436 bytes. ==30239== ==30239== LEAK SUMMARY: ==30239==definitely lost: 0 bytes in 0 blocks. ==30239== possibly lost: 0 bytes in 0 blocks. ==30239==still reachable: 699,710 bytes in 138 blocks. ==30239== suppressed: 2,836 bytes in 2 blocks. ==30239== Reachable blocks (those to which a pointer was found) are not shown. ==30239== To see them, rerun with: --show-reachable=yes As you can see, the 4 bytes leaked by leak.c are not reported. The suppression file I've used is taken from: http://svn.python.org/projects/python/trunk/Misc/valgrind-python.supp and I have uncommented the parts related to PyObject_Free and PyObject_Realloc, as explained there. So, does anyone know what the correct way to do this is? Thanks in advance, Salvarore. -- Salvatore Iovene http://www.iovene.com/ Key Fingerprint: 5647 944D D5AD 2E87 00B4 7D54 2864 359D FF20 16D8 -- http://mail.python.org/mailman/listinfo/python-list
Python in HTML Application (HTA)
Hello, I encounter a display problem in one of my script ... ... def setValue(divid,data): elt = document.getElementById(divid) elt.innerHTML = data def infoSystem(): setValue(info,Please Wait) #update div info c = os.popen(cmdDisk%Server).read() setValue('tabcentre',c) ... ... When I call 'infoSystem', the 'info' div is only updated at the end of the 'infoSystem' call. Did someone have an explication of that behavior ? Regards Salvatore -- http://mail.python.org/mailman/listinfo/python-list
Re: Python in HTML Application (HTA)
In fact, whatever I do in infoSystem (modifiying style attributes of an object, change cursor appearance...), changes are only reflected at the end of the function call ... Salvatore a écrit : Hello, I encounter a display problem in one of my script ... ... def setValue(divid,data): elt = document.getElementById(divid) elt.innerHTML = data def infoSystem(): setValue(info,Please Wait) #update div info c = os.popen(cmdDisk%Server).read() setValue('tabcentre',c) ... ... When I call 'infoSystem', the 'info' div is only updated at the end of the 'infoSystem' call. Did someone have an explication of that behavior ? Regards Salvatore -- http://mail.python.org/mailman/listinfo/python-list
Re: Watch log
Thinker ha scritto: What you want is something like 'tail -f' in linux. If you look into it's source code, you will find it check file periodically. When a read() reach the end of the file, read() will return a empty string. You can try to read data from the file periodically after a EOF. I think it is what you want. So every 2 sec: - open the file - read the file from the oldPosition to the EOF - save the last position in file - first point mmm ok -- http://mail.python.org/mailman/listinfo/python-list
Re: Watch log
Michele Simionato ha scritto: You may begin from this: Tnx Michele -- http://mail.python.org/mailman/listinfo/python-list
Watch log
Hi guys, I've an application that writes a log file. I need to write an application with python that will read this file. I would like wait until a new line will be write in the file. Something like the watch cat Log command on Linux os. How can I check the eof and restart the reading? -- http://mail.python.org/mailman/listinfo/python-list
Re: Watch log
Bjoern Schliessmann ha scritto: Why not read the file continuously and only do something if a new line is complete (i. e. a newline char is detected)? How can I read the file continuously? -- http://mail.python.org/mailman/listinfo/python-list
Re: Thread error
Dennis Lee Bieber ha scritto: Ah, sorry... Warned you that I didn't test... Duplicate the block of lines with the .join() calls. Put this block just before them, but after the threading.Thread calls, and change the .join() to .start() Tnx Dennis I resolved yesterday after the post. I tried to delete the post :) Anyway tnx -- http://mail.python.org/mailman/listinfo/python-list
Re: Thread error
Tnx Dennis, this is my first python program, so I don't know every modules :( Anyway thank you so much for the suggestions, corrections and for the whole program :) Thank you -- http://mail.python.org/mailman/listinfo/python-list
Re: Thread error
Hi Dennis, I have another little problem with your source: Traceback (most recent call last): File main.py, line 86, in module kdi.join() # wait for kdi thread to exit NO CPU HOG BUSY LOOPS File d:\programmi\python25\lib\threading.py, line 549, in join assert self.__started, cannot join thread before it is started AssertionError: cannot join thread before it is started I don't know what this means. Now I try some experiment. Tnx -- http://mail.python.org/mailman/listinfo/python-list
Thread error
Hi guys, when I close the application I get the following error: - Traceback (most recent call last): File main.py, line 88, in module while exit : pass KeyboardInterrupt Unhandled exception in thread started by Error in sys.excepthook: Original exception was: - This is the code: - # Echo client program import socket import sys import thread import mtalk HOST = '192.168.0.115'# The remote host PORT = 3580 # The same port as used by the server buff = buffStatus = 0 s = None exit = 1 ### keywordDataIn ### def keywordDataIn(): global buff, buffStatus, exit talkmsg = mtalk.TalkMessage() while exit: line = sys.stdin.readline() if line == 'quit\n': exit = 0 break elif line != '\n': lock.acquire() buff = talkmsg.Make(line) buffStatus = 1 lock.release() elif line == '\n': pass ### dataToServer ### def dataToServer(): global buff, buffStatus, exit while exit: if buffStatus == 1: try: lock.acquire() s.sendall(buff) buff = buffStatus = 0 lock.release() except: socket.error pass # errore da controllare ## dataFromServer ## def dataFromServer(): global exit while exit: data = s.recv(1024) print 'Received', repr(data) ### Main ### if __name__ == __main__ : for res in socket.getaddrinfo(HOST, PORT, socket.AF_UNSPEC, socket.SOCK_STREAM): af, socktype, proto, canonname, sa = res buffStatus = 0 try: s = socket.socket(af, socktype, proto) except socket.error, msg: print(Unexpected error) s = None sys.exit(1) try: s.connect(sa) print 'Connection ...' except socket.error, msg: print(The server was not reachable) s.close() s = None sys.exit(1) print 'Connected' # mutex lock = thread.allocate_lock() thread.start_new_thread(keywordDataIn, ()) thread.start_new_thread(dataToServer, ()) thread.start_new_thread(dataFromServer, ()) while exit : pass s.close() - Tnx -- http://mail.python.org/mailman/listinfo/python-list
I/O Multiplexing and non blocking socket
Hi guys, I'm looking for a tutorial to make a client with a i/o multiplexing and non blocking socket. Anybody knows where is a tutorial? Tnx -- http://mail.python.org/mailman/listinfo/python-list
Re: I/O Multiplexing and non blocking socket
Jean-Paul Calderone ha scritto: On 1 Dec 2006 06:07:28 -0800, Salvatore Di Fazio [EMAIL PROTECTED] wrote: Hi guys, I'm looking for a tutorial to make a client with a i/o multiplexing and non blocking socket. Anybody knows where is a tutorial? http://twistedmatrix.com/projects/core/documentation/howto/clients.html Jean-Paul Thank you guys, but I would like to use the standard libraries -- http://mail.python.org/mailman/listinfo/python-list
Thread help
Hi guys, I would make 3 threads for a client application. Tnx -- http://mail.python.org/mailman/listinfo/python-list
Re: Thread help
Grant Edwards ha scritto: You should use 4. Yes, but I don't know how can I make a thread :) -- http://mail.python.org/mailman/listinfo/python-list
Re: Thread help
Grant Edwards ha scritto: http://docs.python.org/lib/module-threading.html http://linuxgazette.net/107/pai.html http://www.wellho.net/solutions/python-python-threads-a-first-example.html http://heather.cs.ucdavis.edu/~matloff/Python/PyThreads.pdf Thank Edward, I didn't find the linuxgazette tutorial. Tnx -- http://mail.python.org/mailman/listinfo/python-list
Re: Thread help
Grant Edwards ha scritto: http://docs.python.org/lib/module-threading.html http://linuxgazette.net/107/pai.html http://www.wellho.net/solutions/python-python-threads-a-first-example.html http://heather.cs.ucdavis.edu/~matloff/Python/PyThreads.pdf Thank Edward, I didn't find the linuxgazette tutorial before the post. Tnx -- http://mail.python.org/mailman/listinfo/python-list
Re: Forum written in Python?
Hello, Look at Karrigell, it includes the base of a forum and a blog in is demo Karrigell is a wonderfull pythonic framework. It's simple and efficient. Thanks his author Regards slav0nic a écrit : Karlo Lozovina ÐÉÛÅÔ: Are there any forum or bulletin board systems written entirely in Python? I got sick of PhpBB, mostly because I can't tweak and fiddle with the code, since I really don't like PHP and don't know it that well. I thought of writting my own simple forum software, but if there are existing projects out there, I wouldn't mind contributing. So far I found out about Pocoo, but it seems to immature right now, I was looking for something comparable to PhpBB or IPB? Django-based: http://wiki.woodpecker.org.cn/moin/UliPad http://zyons.com --- http://python.com.ua -- http://mail.python.org/mailman/listinfo/python-list
Re: urllib.urlopen: Errno socket error
Hello, Try to increase the time out : socket.settimeout(n) and catch the timeout error when it occurs Regards [EMAIL PROTECTED] a écrit : Hi, I'm just trying to read from a webpage with urllib but I'm getting IOErrors. This is my code: import urllib sock = urllib.urlopen(http://www.google.com/;) and this is the error: Traceback (most recent call last): File pyshell#5, line 1, in module sock = urllib.urlopen(http://www.google.com/;) File C:\Python25\lib\urllib.py, line 82, in urlopen return opener.open(url) File C:\Python25\lib\urllib.py, line 190, in open return getattr(self, name)(url) File C:\Python25\lib\urllib.py, line 325, in open_http h.endheaders() File C:\Python25\lib\httplib.py, line 856, in endheaders self._send_output() File C:\Python25\lib\httplib.py, line 728, in _send_output self.send(msg) File C:\Python25\lib\httplib.py, line 695, in send self.connect() File C:\Python25\lib\httplib.py, line 679, in connect raise socket.error, msg IOError: [Errno socket error] (10060, 'Operation timed out') I'm behind my company's firewall. Would that cause a problem? If it does, How do I get around it? -- http://mail.python.org/mailman/listinfo/python-list
Candygram
Hello, I am using the following code to fetch URL Is there a way to speed it. I cant't get rid of the time.sleep(1) for every request !!! Thank you for you advise Regards Salvatore from candygram import cg def fetchURL(): r = cg.Receiver() r.addHandler(cg.Any,getURL,cg.Message) for message in r: item.append(message) def getURL(name): url = DServeur[name]['urladmin'] try: s = urllib2.urlopen(url) except: return \n%s : HS%name return URL :%s%name,s.read()[1:10] socket.setdefaulttimeout(1) serveurs = DServeur.keys() serveurs.sort() def go(): proc = cg.spawn(fetchURL) for s in serveurs: proc.send(s) time.sleep(1)#How can I speed up this code ? go() -- http://mail.python.org/mailman/listinfo/python-list
Adding dictionnaries
Hello, Does anybody had the problem of adding the content of two dictionnaries. ? Regards -- http://mail.python.org/mailman/listinfo/python-list
Re: Adding dictionnaries
While reading the doc i've found 'update' :-) -- http://mail.python.org/mailman/listinfo/python-list
Re: Adding dictionnaries
Paul McGuire a écrit : Also, you will find a wealth of help by using (from the interactive Python prompt) help(dict) or help(str) or import unfamiliarModule; help(unfamiliarModule). Thanks Paul -- http://mail.python.org/mailman/listinfo/python-list
Re: Python types
Thank's Bruno. -- http://mail.python.org/mailman/listinfo/python-list
Re: Python types
Thank's everybody :-) Here is a type définition I've found on the net which I agree with : Attribute of a variable which determines the set of the values this variabe can take and the operations we can apply on it. -- http://mail.python.org/mailman/listinfo/python-list
Re: Python types
Grazie ALex, for your comment. -- http://mail.python.org/mailman/listinfo/python-list
Python types
Hello, I've read several articles where it's said that Python is weakly typed. I'm a little surprised. All objects seem to have a perfectly defined type Am i wrong? Regards -- http://mail.python.org/mailman/listinfo/python-list
Re: python
A new OS in Python : http://unununium.org/introduction :-) -- http://mail.python.org/mailman/listinfo/python-list
Nufox : Nouveaux examples...
Sur : http://www.salvatore.exolia.net:9090/ (Nécessite Firefox ou Mozilla) Cordialement Salvatore. -- http://mail.python.org/mailman/listinfo/python-list
Nufox : New examples
On : http://www.salvatore.exolia.net:9090/ (Firefox ou Mozilla) Regards -- http://mail.python.org/mailman/listinfo/python-list
Re: parabola
Here is an old piece of code I wrote when begining Python ;-) from Tkinter import * import string import Numeric from Canvas import Line import math class Tableau(Canvas): def __init__(self,master=None,size=400,col='black',colrep='red',colgrid='grey'): Canvas.__init__(self,master,width=size,height=size,bg=col,highlightthickness=0) self.pack(expand=1,fill=BOTH) self.width_table = 0; self.height_table = 0 self.nl = 20.0 self.bind(Configure,self.Redraw) self.colrep = colrep self.colgrid = colgrid def GetSize(self,event): self.width_table = event.width self.height_table = event.height def SetBgColor(self,color): self['bg'] = color def ChangeColGrid(self,col): self.colgrid = col self.itemconfig('grid',fill=col) def ChangeColAxe(self,col): self.colrep = col self.itemconfig('repere',fill=col) def Redraw(self,event): self.delete('all') self.TraceAxe() self.UpdateGraphe() self.update() def Redessine(self): self.delete('all') self.TraceAxe() #self.UpdateGraphe() self.update() def TraceAxe(self): self.delete('all') w , h = self.winfo_width(),self.winfo_height() #Trace Grille posx=0;posy=0 intervallex = w/self.nl intervalley = h/self.nl posx=intervallex;posy=intervalley for i in range(0,self.nl): self.create_line(posx,0,posx,h,fill=self.colgrid,tag=('repere','grid')) self.create_line(0,posy,w,posy,fill=self.colgrid,tag=('repere','grid')) posy += intervalley posx += intervallex #Trace des axes posx = w/2.0; posy = h/2.0 self.create_line(posx,0,posx,h,fill=self.colrep,tag=('repere','axe')) self.create_line(0,posy,w,posy,fill=self.colrep,tag=('repere','axe')) def UpdateGraphe(self): for f in F.keys(): try: name,color = F[f] Function(f,nom=name,col=color) except: Function(f) class Function: def __init__(self,fonction = '',nom='affine',col='yellow',epaiss = 1): w , h = t.winfo_width(),t.winfo_height() self.valeur = eval('lambda x: '+fonction) self.x = Numeric.arange(-200.0,200.0) self.y = 20*self.valeur(self.x/20.0) res = Numeric.arange(0.0,800.0) res.shape = (400,2) res[:,0] = self.x*w/400.0 + w/2.0 res[:,1] = -self.y*h/400.0 + h/2.0 Line(t,res.tolist(),fill=col,tag=nom,width=epaiss) def expression(exp): return eval('lambda x: '+exp) if __name__ == '__main__': print test sin = Numeric.sin F = {'x*x':('carre','green'),'2*sin(x)':('sin','blue'),'x*x*x':('cube','yellow')} t = Tableau() t.delete('grid') t.mainloop() from Tkinter import * import string import Numeric from Canvas import Line import math class Tableau(Canvas): def __init__(self,master=None,size=400,col='black',colrep='red',colgrid='grey'): Canvas.__init__(self,master,width=size,height=size,bg=col,highlightthickness=0) self.pack(expand=1,fill=BOTH) self.width_table = 0; self.height_table = 0 self.nl = 20.0 self.bind(Configure,self.Redraw) self.colrep = colrep self.colgrid = colgrid def GetSize(self,event): self.width_table = event.width self.height_table = event.height def SetBgColor(self,color): self['bg'] = color def ChangeColGrid(self,col): self.colgrid = col self.itemconfig('grid',fill=col) def ChangeColAxe(self,col): self.colrep = col self.itemconfig('repere',fill=col) def Redraw(self,event): self.delete('all') self.TraceAxe() self.UpdateGraphe() self.update() def Redessine(self): self.delete('all') self.TraceAxe() #self.UpdateGraphe() self.update() def TraceAxe(self): self.delete('all') w , h = self.winfo_width(),self.winfo_height() #Trace Grille posx=0;posy=0 intervallex = w/self.nl intervalley = h/self.nl posx=intervallex;posy=intervalley for i in range(0,self.nl): self.create_line(posx,0,posx,h,fill=self.colgrid,tag=('repere','grid')) self.create_line(0,posy,w,posy,fill=self.colgrid,tag=('repere','grid')) posy += intervalley posx += intervallex #Trace des axes posx = w/2.0; posy = h/2.0 self.create_line(posx,0,posx,h,fill=self.colrep,tag=('repere','axe')) self.create_line(0,posy,w,posy,fill=self.colrep,tag=('repere','axe')) def UpdateGraphe(self): for f in F.keys(): try: name,color = F[f] Function(f,nom=name,col=color) except: Function(f) class Function: def __init__(self,fonction = '',nom='affine',col='yellow',epaiss = 1): w , h =
Re: parabola
Here is an old piece of code I wrote to test Tkinter from Tkinter import * import string import Numeric from Canvas import Line import math class Tableau(Canvas): def __init__(self,master=None,size=400,col='black',colrep='red',colgrid='grey'): Canvas.__init__(self,master,width=size,height=size,bg=col,highlightthickness=0) self.pack(expand=1,fill=BOTH) self.width_table = 0; self.height_table = 0 self.nl = 20.0 self.bind(Configure,self.Redraw) self.colrep = colrep self.colgrid = colgrid def GetSize(self,event): self.width_table = event.width self.height_table = event.height def SetBgColor(self,color): self['bg'] = color def ChangeColGrid(self,col): self.colgrid = col self.itemconfig('grid',fill=col) def ChangeColAxe(self,col): self.colrep = col self.itemconfig('repere',fill=col) def Redraw(self,event): self.delete('all') self.TraceAxe() self.UpdateGraphe() self.update() def Redessine(self): self.delete('all') self.TraceAxe() #self.UpdateGraphe() self.update() def TraceAxe(self): self.delete('all') w , h = self.winfo_width(),self.winfo_height() #Trace Grille posx=0;posy=0 intervallex = w/self.nl intervalley = h/self.nl posx=intervallex;posy=intervalley for i in range(0,self.nl): self.create_line(posx,0,posx,h,fill=self.colgrid,tag=('repere','grid')) self.create_line(0,posy,w,posy,fill=self.colgrid,tag=('repere','grid')) posy += intervalley posx += intervallex #Trace des axes posx = w/2.0; posy = h/2.0 self.create_line(posx,0,posx,h,fill=self.colrep,tag=('repere','axe')) self.create_line(0,posy,w,posy,fill=self.colrep,tag=('repere','axe')) def UpdateGraphe(self): for f in F.keys(): try: name,color = F[f] Function(f,nom=name,col=color) except: Function(f) class Function: def __init__(self,fonction = '',nom='affine',col='yellow',epaiss = 1): w , h = t.winfo_width(),t.winfo_height() self.valeur = eval('lambda x: '+fonction) self.x = Numeric.arange(-200.0,200.0) self.y = 20*self.valeur(self.x/20.0) res = Numeric.arange(0.0,800.0) res.shape = (400,2) res[:,0] = self.x*w/400.0 + w/2.0 res[:,1] = -self.y*h/400.0 + h/2.0 Line(t,res.tolist(),fill=col,tag=nom,width=epaiss) def expression(exp): return eval('lambda x: '+exp) if __name__ == '__main__': print test sin = Numeric.sin F = {'x*x':('carre','green'),'2*sin(x)':('sin','blue'),'x*x*x':('cube','yellow')} t = Tableau() t.delete('grid') t.mainloop() -- http://mail.python.org/mailman/listinfo/python-list
Xul - Python
Hello, Nufox. You can give a try with Firefox or Mozilla on http://www.salvatore.exolia.net:9090/ Regards -- http://mail.python.org/mailman/listinfo/python-list
Nufox hosted.
Hello, I've been kindly authorized to host Nufox examples for free on : http://bsd.miki.eu.org:9090/ Regards -- http://mail.python.org/mailman/listinfo/python-list
Nufox examples hosted :-)
Hello, I've been kindly authorized to host Nufox examples for free on : http://bsd.miki.eu.org:9090/ Regards -- http://mail.python.org/mailman/listinfo/python-list
Re: Nufox : Xul + Python
Thank you for testing Indeed it is very interesting :-) I've had some problems with my ports forwarding and no-ip.org. Here is then the new address : http://artyprog.dyndns.org:8080 Regards Betwise, I live in France so the site is close when i'am at work -- http://mail.python.org/mailman/listinfo/python-list
Re: Nufox : Xul + Python
You are perfectly right ;-) And I've been a network technician !!! I've modified the address, thank you for testing Regards Salvatore -- http://mail.python.org/mailman/listinfo/python-list
Re: Nufox : Xul + Python
As you said this is in early stage 0.1-alpha-alpha :-) I'm not the author of this interesting piece of work it is Tim Stebbing I only wanted to share Tim's work. Don't hesitate to contact him on the nufox mailin list It runs on top of twisted-nevow. Indeed for now the application is not reinitialized on load, but those are simple examples and there is not yet 'session object' Regards -- http://mail.python.org/mailman/listinfo/python-list
Nufox : Xul + Python
Hello, You can test Nufox (with Firefox) at : http://artyprog.no-ip.org Regards -- http://mail.python.org/mailman/listinfo/python-list
Re: Nufox : Xul + Python
Oops: http://artyprog.noip.org:8080 -- http://mail.python.org/mailman/listinfo/python-list
Nufox : Simple Tree
Nufox allow XUL developement like you could do with any other GUI library If you want to see an example : http://www.google.com/url?sa=Dq=http://www.freezope.org/Members/artyprog/programmation/lienspython/nufox/examples/sortedcolumns Regards Salvatore -- http://mail.python.org/mailman/listinfo/python-list
PSE : Python Servlet Engine configuration
Hello, Is there someone who use PSE ? I have a strange problem, i don't see how pse.conf is managed. Indeed althoug I make modifications on it nothind is take in account. I have also erases it !!! and PSE doesn't claim anything !!! Can someone help me ? Regards Salvatore -- http://mail.python.org/mailman/listinfo/python-list