Re: looking for a quote on age and technology
Rustom Mody writes: > For a new technology: > If you are a kid when it comes out, you just take it as a matter of course > If you are a young adult, then it becomes a hot topic for discussion > If you are past middle-age you never get it > > Anyone knows/remembers it? I think you're referring to an article by the late, great Douglas Adams, “How to Stop Worrying and Learn to Love the Internet”: I suppose earlier generations had to sit through all this huffing and puffing with the invention of television, the phone, cinema, radio, the car, the bicycle, printing, the wheel and so on, but you would think we would learn the way these things work, which is this: 1) everything that’s already in the world when you’re born is just normal; 2) anything that gets invented between then and before you turn thirty is incredibly exciting and creative and with any luck you can make a career out of it; 3) anything that gets invented after you’re thirty is against the natural order of things and the beginning of the end of civilisation as we know it until it’s been around for about ten years when it gradually turns out to be alright really. Apply this list to movies, rock music, word processors and mobile phones to work out how old you are. http://www.douglasadams.com/dna/19990901-00-a.html> -- \ “For fast acting relief, try slowing down.” —Jane Wagner, via | `\ Lily Tomlin | _o__) | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list
Re: Suggest an open-source log analyser?
In article , Alec Taylor wrote: > I use the Python logger class; with the example syntax of: > Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s') > > Can of course easily use e.g.: a JSON syntax here instead. > > Are there any open-source log viewers (e.g.: with a web-interface) > that you'd recommend; for drilling down into my logs? > > Thanks for your suggestions, > > Alec Taylor I've been experimenting with elasticsearch (to store JSON-format log messages) and kibana (as a front-end search tool). The jury is still out on how well it's going to work. It seems like a pretty powerful combination, but there's definitely a bit of a learning curve to using it. I certainly like the idea of logging structured data, as opposed to plain text. It opens up a world of better ways to search, slice, and dice your log data. -- https://mail.python.org/mailman/listinfo/python-list
Suggest an open-source log analyser?
I use the Python logger class; with the example syntax of: Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s') Can of course easily use e.g.: a JSON syntax here instead. Are there any open-source log viewers (e.g.: with a web-interface) that you'd recommend; for drilling down into my logs? Thanks for your suggestions, Alec Taylor -- https://mail.python.org/mailman/listinfo/python-list
Django filer plugins for django-cms installation
I'm trying to set up a python django_cms system using: Debian OS Wheezy distribution Python 2.7.3 ` Django 1.5.5 PostgreSQL 9.1 with pip and virtualenv. The last test errored out and I traced the problem to the missing cmsplugin-filer-0.9.4.tar.gz package not being installed. The settings.py file has been properly annotated. Where should I put the untared files in a typical Debian Wheezy installation. All help will be sincerely appreciated. Gary R. -- https://mail.python.org/mailman/listinfo/python-list
ipython and pyglet
Hello! Has anyone here tried to get ipython to interact with the event loop for pyglet? If so, would you be willing to share come example code? I would like to be able to interactively code in pyglet, creating and updating objects while the program is running. Thanks! -- https://mail.python.org/mailman/listinfo/python-list
Re: [OT] Culture and Empire
On 1/1/2014 10:01 AM, Amirouche Boubekki wrote: I stumbled on Culture and Empire a few days ago and I've been reading it since then. I'm not finished yet. It's insigthful, smart and provocative. It bridge past, present and future. I will put it in my armory *ahem* library between Fundation and The Cathedral and the Bazaar until I read Present Shock. This is the book you want, need and will read this year if any. ---8<-8<-8<-8<-8<-8<-8<-8<-8< Chapter 1. Magic Machines Far away, in a different place, a civilization called Culture had taken seed, and was growing. It owned little except a magic spell called Knowledge. In this chapter, I’ll examine how the Internet is changing our society. It’s happening quickly. The most significant changes have occurred during just the last 10 years or so. More and more of our knowledge about the world and other people is transmitted and stored digitally. What we know and who we know are moving out of our minds and into databases. These changes scare many people, whereas in fact they contain the potential to free us, empowering us to improve society in ways that were never before possible. -8<-8<-8<-8<-8<-8<-8<-8<- http://cultureandempire.com/ The entire book appears to be free and online with a liberal licence "Free to share and remix under CC-BY-SA-3.0" so this is not a commercial ad. I am reading it now. -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list
Re: PySerial for Python 2 vs. Python 3
On 1/1/2014 1:48 AM, Chris Angelico wrote: On Wed, Jan 1, 2014 at 5:39 PM, Travis McGee wrote: What OS? If Windows, did you install the -py3k version for 3.x? Anyway, I finally got it installed, but when I try to use a statement of the sort ser.write("string") I get an exception which seems to imply that the argument needs to be an integer, rather than a string. According to a Stackoverflow issue, .write(n) will write n 0 bytes because it will send bytes(n) == n * bytes(b'\0'). PySerial is written in Python, so you could look at the .write method of the Serial class (presuming that 'ser' is an instance thereof) to see what it does. Quoting the full exception would help! My suspicion is that it works with byte strings, not Unicode strings. That is what the doc either says or implies. So you could do: ser.write(b"string") or: ser.write("string".encode()) to turn it into a stream of bytes (the latter uses UTF-8, the former would use your source file encoding). -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list
Re: Python 2.x and 3.x usage survey
On Thu, 2 Jan 2014 01:07:54 +1100, David wrote: >On 1 January 2014 23:38, Steve Hayes wrote: >> >> I was thinking or of this: >> > python g:\work\module1.py >> File "", line 1 >> python g:\work\module1.py >>^ >> >> Which gave a different error the previous time I did it. >> >> But, hey, it worked from the DOS prompt >> >> C:\Python32>python g:\work\module1.py >> Hello Module World > >Your windows command shell prompt looks like this: "C:\Python32>" >It indicates that windows shell is waiting for you to type something. >It expects the first word you type to be an executable command. If you >do this: > C:\Python32>python g:\work\module1.py >it tells the shell to run the python interpreter and feed it all the >python statments contained in the file g:\work\module1.py > >If you do this: > C:\Python32>python >it tells the shell to run the python interpreter interactively, and >wait for you to directly type python statements. When the python >intepreter is ready for you to type a python statement, it gives you a >">>>" prompt. It expects you to type a valid python language >statement. > >The reason this gave an error: python g:\work\module1.py > >is because you are using the python interpreter as shown by ">>>", but >you typed a windows shell command, not a python statement. Thank you. Back to the book! -- Steve Hayes from Tshwane, South Africa Web: http://www.khanya.org.za/stevesig.htm Blog: http://khanya.wordpress.com E-mail - see web page, or parse: shayes at dunelm full stop org full stop uk -- https://mail.python.org/mailman/listinfo/python-list
Project from github
Hi, I'm trying to install this Django project https://github.com/changer/socialschools-cms and it 'success'. The problem is, there's no manage.py file in it and i don't know how to run this script on the server. May someone try to help me, please? Thank you very much! Ivan -- https://mail.python.org/mailman/listinfo/python-list
Re: Retaining drawing across paintevents
On Thu, Jan 2, 2014 at 1:53 AM, wrote: > I find that I have to re-paint the whole widget every time I call an > update(), as I have create a new QPainter() instance. Is there a way to > update only a small part of the widget, while retaining the rest of the > widget? In general, it would help to say which windowing toolkit you're using :) Fortunately you mention something that implies you're using QT, so I'm going to forge ahead with that. When you call update(), you're effectively saying "the whole object needs to be repainted". If you can restrict that to just a particular rectangle, simply pass those coordinates to the update call: http://pyqt.sourceforge.net/Docs/PyQt4/qwidget.html#update-4 I'm not sure if you're using PyQt4 or not, but if you're using something else, look through its docs for a similar function. Same goes for pretty much any windowing toolkit; it's always possible to report that a small area needs updating. Once you then get the update event, you should be given a rectangle that tells you which part needs to be repainted. But painting outside that area will be reasonably fast, so don't stress too much about that part if it's a lot of trouble. For instance, I have a MUD client that will always attempt to draw complete lines, even if only part of a line needs to be redrawn - but it'll repaint only those lines which need repainting (so it looks at the Y coordinates of the "please repaint me" rectangle, but not the X coords). ChrisA -- https://mail.python.org/mailman/listinfo/python-list
[OT] Culture and Empire
Héllo everybody, I stumbled on Culture and Empire a few days ago and I've been reading it since then. I'm not finished yet. It's insigthful, smart and provocative. It bridge past, present and future. I will put it in my armory *ahem* library between Fundation and The Cathedral and the Bazaar until I read Present Shock. This is the book you want, need and will read this year if any. I quick glimpse into the very readable book: ---8<-8<-8<-8<-8<-8<-8<-8<-8< Chapter 1. Magic Machines Far away, in a different place, a civilization called Culture had taken seed, and was growing. It owned little except a magic spell called Knowledge. In this chapter, I’ll examine how the Internet is changing our society. It’s happening quickly. The most significant changes have occurred during just the last 10 years or so. More and more of our knowledge about the world and other people is transmitted and stored digitally. What we know and who we know are moving out of our minds and into databases. These changes scare many people, whereas in fact they contain the potential to free us, empowering us to improve society in ways that were never before possible. -8<-8<-8<-8<-8<-8<-8<-8<- There is also a presentation of the content of the book that I didn't review yet. But it seems like you don't need to read all the book to understand what is in inside. There is also a related crowdfunding project, but I don't know more that since I want to finish the book first. http://cultureandempire.com/ Happy new year (indeed), Amirouche ~ http://hypermove.net/ -- https://mail.python.org/mailman/listinfo/python-list
Retaining drawing across paintevents
Hi all, I am sub-classing the paintevent at the moment to create a 2D plot. I find that I have to re-paint the whole widget every time I call an update(), as I have create a new QPainter() instance. Is there a way to update only a small part of the widget, while retaining the rest of the widget? Thanks in advance Ed BTW if this is the wrong forum to post this, pls let me know. -- https://mail.python.org/mailman/listinfo/python-list
Re: Python 2.x and 3.x usage survey
On Wed, 01 Jan 2014 14:38:59 +0200, Steve Hayes wrote: >>> python g:\work\module1.py File "", line 1 python g:\work\module1.py ^ Which gave a different error the previous time I did it. But, hey, it worked from the DOS prompt C:\Python32>python g:\work\module1.py Hello Module World You need to understand that you are using two VERY different languages, one at the DOS prompt, the other at the python prompt and in .py files. You cannot use shell syntax at the python prompt, any more than you can do the reverse. -- DaveA -- https://mail.python.org/mailman/listinfo/python-list
Re: Python 2.x and 3.x usage survey
On 1 January 2014 23:38, Steve Hayes wrote: > > I was thinking or of this: > python g:\work\module1.py > File "", line 1 > python g:\work\module1.py >^ > > Which gave a different error the previous time I did it. > > But, hey, it worked from the DOS prompt > > C:\Python32>python g:\work\module1.py > Hello Module World Your windows command shell prompt looks like this: "C:\Python32>" It indicates that windows shell is waiting for you to type something. It expects the first word you type to be an executable command. If you do this: C:\Python32>python g:\work\module1.py it tells the shell to run the python interpreter and feed it all the python statments contained in the file g:\work\module1.py If you do this: C:\Python32>python it tells the shell to run the python interpreter interactively, and wait for you to directly type python statements. When the python intepreter is ready for you to type a python statement, it gives you a ">>>" prompt. It expects you to type a valid python language statement. The reason this gave an error: >>> python g:\work\module1.py is because you are using the python interpreter as shown by ">>>", but you typed a windows shell command, not a python statement. -- https://mail.python.org/mailman/listinfo/python-list
Re: Python 2.x and 3.x usage survey
On 01/01/2014 12:38, Steve Hayes wrote: On Wed, 01 Jan 2014 22:37:45 +1100, Steven D'Aprano wrote: Steve Hayes wrote: I borrowed a book called "Learning Python" by Lutz and Asher, which is geared for 2.2/2.3. But the version I have in Windows is 3.2, and it seems that even "Hello World" presents and insurmountable problem. It certainly is not *insurmountable*. Not unless you consider typing brackets ( ) to be an inhumanly difficult task, in which case you might as well give up on being a programmer and take up something easier like brain surgery. # Python 2 version print "Hello World!" # Python 3 version print("Hello World!") I was thinking or of this: python g:\work\module1.py File "", line 1 python g:\work\module1.py ^ Which gave a different error the previous time I did it. But, hey, it worked from the DOS prompt C:\Python32>python g:\work\module1.py Hello Module World But hey, don't mind me. The biggest problem I have is that when something doesn't work, I don't know if I have done something stupid, or if it's just an incompatibility of the different versions. Almost inevitably if you search for the last line of the error that you get you'll find more than enough hits to point you in the right direction. Failing that ask here as we don't bite. There's also the tutor mailing list https://mail.python.org/mailman/listinfo/tutor -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list
Re: Python 2.x and 3.x usage survey
On Wed, Jan 1, 2014 at 11:38 PM, Steve Hayes wrote: > I was thinking or of this: > python g:\work\module1.py > File "", line 1 > python g:\work\module1.py >^ > > Which gave a different error the previous time I did it. > > But, hey, it worked from the DOS prompt > > C:\Python32>python g:\work\module1.py > Hello Module World That's how you invoke a script. Python isn't fundamentally a shell scripting language (like bash, REXX, batch, etc), so there's a distinct difference between Python commands (which go into .py files or are executed at the ">>>" prompt) and shell commands (including "python", which invokes the Python interpreter). > The biggest problem I have is that when something doesn't work, I don't know > if I have done something stupid, or if it's just an incompatibility of the > different versions. Easiest way to eliminate the confusion is to match your tutorial and your interpreter. That's why I recommend going with the python.org tutorial; you can drop down the little box in the top left and choose the exact version of Python that you're running. It WILL match. ChrisA -- https://mail.python.org/mailman/listinfo/python-list
Re: Python 2.x and 3.x usage survey
On Wed, 01 Jan 2014 22:37:45 +1100, Steven D'Aprano wrote: >Steve Hayes wrote: > >> I borrowed a book called "Learning Python" by Lutz and Asher, which is >> geared for 2.2/2.3. >> >> But the version I have in Windows is 3.2, and it seems that even "Hello >> World" presents and insurmountable problem. > >It certainly is not *insurmountable*. Not unless you consider typing >brackets ( ) to be an inhumanly difficult task, in which case you might as >well give up on being a programmer and take up something easier like brain >surgery. > ># Python 2 version >print "Hello World!" > ># Python 3 version >print("Hello World!") I was thinking or of this: >>> python g:\work\module1.py File "", line 1 python g:\work\module1.py ^ Which gave a different error the previous time I did it. But, hey, it worked from the DOS prompt C:\Python32>python g:\work\module1.py Hello Module World But hey, don't mind me. The biggest problem I have is that when something doesn't work, I don't know if I have done something stupid, or if it's just an incompatibility of the different versions. -- Steve Hayes from Tshwane, South Africa Web: http://www.khanya.org.za/stevesig.htm Blog: http://khanya.wordpress.com E-mail - see web page, or parse: shayes at dunelm full stop org full stop uk -- https://mail.python.org/mailman/listinfo/python-list
Re: Python 2.x and 3.x usage survey
Steve Hayes wrote: > I borrowed a book called "Learning Python" by Lutz and Asher, which is > geared for 2.2/2.3. > > But the version I have in Windows is 3.2, and it seems that even "Hello > World" presents and insurmountable problem. It certainly is not *insurmountable*. Not unless you consider typing brackets ( ) to be an inhumanly difficult task, in which case you might as well give up on being a programmer and take up something easier like brain surgery. # Python 2 version print "Hello World!" # Python 3 version print("Hello World!") > Eventually I discovered that one of the differences bytween 2.x and 3.x is > that the former has "print" and the latter has "print()" but weven using > that it tells me it cant find the PRN device or something. Possibly you're trying to run print("Hello World") at the DOS command prompt rather than using Python. I'm not sure exactly what you're doing, but I do know that you shouldn't get any errors about the PRN device from Python. That sounds like it is a Windows error. > I've got 2.x on Linux, so I booted into that and it seemed to work there, > but it seems that the differences between the versions are not trivial. For the most part, they are trivial. With only a few exceptions, everything in Python 2 can be easily, even mechanically, translated to Python 3. Python 3 includes a lot of new features that a Python 2.3 book won't even mention. But if course, since the book doesn't mention them, you won't need to deal with them. It also includes a few changes from statements to functions, like print and exec (but as a beginner, you shouldn't be using exec). A few modules have been renamed. In my personal opinion, the most annoying change from Python 2 to 3 is renaming modules, because I can never remember the new name. None of these are *difficult* changes. As a beginner, of course, you cannot be expected to automatically know how to deal with a problem like this one: py> from StringIO import StringIO Traceback (most recent call last): File "", line 1, in ImportError: No module named 'StringIO' But let me give you a secret known only to a few: to solve this problem is not hard. Just google for "StringIO renamed Python 3". which will take you to the "What's New in Python 3" document, which reveals that the StringIO module is renamed to io.StringIO, and so you should use this instead: from io import StringIO https://duckduckgo.com/?q=StringIO%20renamed%20Python%203 If googling fails, feel free to ask here! -- Steven -- https://mail.python.org/mailman/listinfo/python-list
Re: Python 2.x and 3.x usage survey
On Wed, Jan 1, 2014 at 9:41 PM, Steve Hayes wrote: > I borrowed a book called "Learning Python" by Lutz and Asher, which is geared > for 2.2/2.3. That's really REALLY old. Even Red Hat isn't still supporting 2.2. You can quite easily get started on 3.2 on Windows - though I would recommend grabbing 3.3 and using that - just start with this tutorial: http://docs.python.org/3/tutorial/ I don't know exactly what will be different in 2.2, but there's no point learning a version that old. If nothing else, you'll miss out on a lot of neat features. ChrisA -- https://mail.python.org/mailman/listinfo/python-list
Re: Python 2.x and 3.x usage survey
On Mon, 30 Dec 2013 13:56:30 -0800, Dan Stromberg wrote: >I keep hearing naysayers, nay saying about Python 3.x. > >Here's a 9 question, multiple choice survey I put together about >Python 2.x use vs Python 3.x use. > >I'd be very pleased if you could take 5 or 10 minutes to fill it out. I had a look at it, but I've got about as far as "Hello World" in both. I borrowed a book called "Learning Python" by Lutz and Asher, which is geared for 2.2/2.3. But the version I have in Windows is 3.2, and it seems that even "Hello World" presents and insurmountable problem. Eventually I discovered that one of the differences bytween 2.x and 3.x is that the former has "print" and the latter has "print()" but weven using that it tells me it cant find the PRN device or something. I've got 2.x on Linux, so I booted into that and it seemed to work there, but it seems that the differences between the versions are not trivial. So perhaps I should just try to install 2.x in Windows, and learn that. -- Steve Hayes from Tshwane, South Africa Web: http://www.khanya.org.za/stevesig.htm Blog: http://khanya.wordpress.com E-mail - see web page, or parse: shayes at dunelm full stop org full stop uk -- https://mail.python.org/mailman/listinfo/python-list
Re: Python/Django Extract and append only new links
Max Cuban writes: > I am putting together a project using Python 2.7 Django 1.5 on Windows 7. > I believe this should be on the django group but I haven't had help > from there so I figured I would try the python list > I have the following view: > views.py: [snip] > Right now as my code stands, anytime I run it, it scraps all the links > on the frontpage of the sites selected and presents them paginated all > afresh. However, I don't think its a good idea for the script to > read/write all the links that had previously extracted links all over > again and therefore would like to check for and append only new links. > I would like to save the previously scraped links so that over the > course of say, a week, all the links that have appeared on the > frontpage of these sites will be available on my site as older pages. > > It's my first programming project and don't know how to incorporate > this logic into my code. > > Any help/pointers/references will be greatly appreciated. > > regards, Max I don't know anything about Django, but I don't think this is a Django question. I think the best way would be to put the urls in a database with the time that they have been retrieved. Then you could retrieve the links from the database next time, and when present, sort them on time retrieved and put them at the end of the list. Now if you want to do this on a user basis you should add user 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
Happy New Year
Hi, ALL, I want to wish everybody who is reading and involved with the list Happy and oyful New Year! Let's have a great time in it and lets make a lot of good products and new releases with the software that everybody involve with. Thank you. -- https://mail.python.org/mailman/listinfo/python-list