Domain: python.org
Stories and comments across the archive that link to python.org.
Comments · 1,513
-
Re:Sqlite included!
I understand where you come from. I fought with the Perl DB* stuff years ago. However, in previous cases Guido and crew have followed the "batteries included" philosophy of Python by making sure that modules added in were complete in form as well as function.
That is why I was happy to hear about Sqlite getting added in- it will be a complete interface for creating, dropping, renaming, you name it.
Reserving my cheers until I see the docs, however. Nothing updated at their main Modules site at this time.
Cheers -
Re:Woot -- conditional expressions!
I suppose that would have been too easy, though.
It's not about "too easy", it was rejected after lenghy discussions on python-dev. You can read explanations, modivations, and get links to quite a lot of discussions on the PEP 308 - Conditional Expressions page.
Whatever your thought on the result is, don't think for a second that the decision of this was easy, or a side-note on a receipt.
-
Re:Too many pirates riding the snake...
Dive Into Python really helped me to get started. You can buy it as a book, but it's also available for free on the web. Guido's own tutorial is also a good way to get started, as python's creator wrote it himself, and is a pretty good teacher too. Both of these are no big secret, but both are well written and clear, so i'd check them out first before looking for more detailed tutorials. Python's official documentation/website are really so good that looking elsewhere is for the most part unnecessary.
-
Re:Too many pirates riding the snake...Python Tutorial
Dive Into Python is a great online book if you have some programming experience. Buy the dead tree if you like it.
-
Re:Yes, but....
Deal.
As a matter of fact, there are a bunch of GUI libraries being or already developed for python.
The point is, you don't have to drink the purple koolaid if you don't want to. ;) -
Re:Python?!
That surprised me too. On the second page, he explains his problem with Python. BASIC has lines that each do one thing, and you have conditional and unconditional jumps to line numbers, no fancy-schmancy control structures. Brin feels that BASIC is much closer to how the microprocessor interprets instructions. Python compiles to a bytecode that is equally analogous to a processor's instruction set, also with conditional and unconditional jumps to numbered locations in the code, which can be disassembled and studied; see http://docs.python.org/lib/module-dis.html. One could pick nits and say that BASIC's variables are closer to processor registers than Python's stack, but feh. Bytecodes running on the Python VM or the Java VM would be EXACTLY as pedagogically valuable as BASIC, except that BASIC statements are much more human-readable where Python bytecodes. So what we need is an alternative Python front end that looks like BASIC, which I'll call PYSIC. The PYSIC language has the readability of BASIC (including line numbers and conditional/unconditional GOTOs) and compiles to Python bytecodes. PYSIC runs inside a Python session so you can use everything normally available in Python. It should be possible to mix-and-match bits of PYSIC and standard Python. What I think would REALLY fulfill Brin's agenda, beyond PYSIC, would be to get Python and PYSIC running on embedded platforms, especially toys, where kids can write programs and make things happen. That's what sucked me into the whole electronics and computers thing when I was a kid.
-
Re:Kids today...... :-)
-
Re:Snakes...
-
Re:Hrm
http://www.python.org/dev/culture/ According to the Python Development Culture page, maintainability is more important in CPython than fast execution times. "Correctness and Clarity before Speed", is a direct quote from the page. I'm not saying Python is slow; but I am saying that someone saying they're 1.7x as fast as CPython isn't really all that impressive. Mark
-
Re:Sometimes I feel like a Luddite...
The standard win32 dist of python is (only) about 9MB. There is also py2exe which bundles your bytecode with a slimmed-down interpreter.
-
Re:Why isn't google releasing their modifications?
They pay Guido's salary.
-
Re:Uh...
It works, and works well.
Also, it doesn't actually require any mucking about in python; it works out of the box, once python's installed. If you're mucking about, it better be to add 'faad -a dump_xx.decoded.aac dumpxx.aac' to the end of the dump process.
Meanwhile, the link in the forum linked by the engadget article is to rapidshare.de. I hate these things, and I assume most others do. Additionally, that zip doesn't have FAAD in it. So, I took the liberty of putting it in and hosting it myself. It's not offshore, and I'm nothing like anonymous, so the first Cease and Desist will get it off my site. If I get a lawsuit instead, you can be sure I'm going to grab the EFF's attention on the matter.
Enjoy! -
Re:Scheme? *ducks*Add my name to the growing list of those who think Scheme is a good suggestion. The key is to choose a language that a) teaches good programming techniques which can be applied to learning other languages in the future and b) is as interactive as possible. If a student can immediately see the results of their efforts and/or correct problems they will become engaged. A write/compile/run/debug sequence will prey upon the impatience of youth and ultimately you'll lose their attention.
In addition to Scheme, others have mentioned Logo which is a wonderful language that many of us learned in our youth. I would also suggest looking at Kid's Programming Language, Squeak (a Smalltalk implementation that seems tailor-made for the way kids think and learn), Alice and perhaps even Ruby or Python both of which have the advantage of a wealth of documentation and code samples. You might even consider the first lesson to be a discussion of programming languages, their differences and their applications. Context always makes it easier to learn specifics. The Hello World! page is a good place to grab examples of different languages for comparision.
Do NOT teach them a markup language (although McDonald's is hiring) or BASIC (there is no need to damage another generation of brains). Last but not least, if anyone suggests PERL thank them for their suggestion and get away from them as fast as possible as they are clearly mentally unstable. -
You can have Python with turtle power!
Logo is another excellent suggestion.
[snip...]
Of course it's not a general purpose language (like Python, which I suggested in another comment).Both are excellent suggestions, and the good news is that you can have the best of both worlds!
Simply download Python and xturtle.py (the module is a single
.py file, no need for complicated installation and no dependencies beyond the standard Python library).The xturtle site has extensive documentation, interesting examples and, of course, screenshots (because everyone love screenshots!).
-
Re:c++ elitism?
This is true. I use emacs and ipython as my Python IDE. They work fairly well, but don't look nearly as slick as Eclipse. There is IDLE and PyPE, but they are a lot less ambitious (or, from another perspective, overfeatured and bloated) than Eclipse. But, I wouldn't generally use them as I've rarely found that sort of development tool useful. And I've made a go of using them for a long time too because everybody else has raved so much about them. I've come to the conclusion that they prefer an illusion to reality.
But, I personally find Eclipse to be cumbersome and to do a great deal to obscure what's really going on. I find it highly amusing that a tool like that is all the fashion in Java. It reinforces my opinion of it as the new COBOL. A hand holding tool for programmers who don't really want to know how their computer actually does anything and want a tinkertoy programming environment that attempts to dumb down complicated things so they appear superficially simple.
-
What about a snake?
Have you considered python? It has an interactive shell, which will let the basic concepts of programming come through. Also, you could take the first parts of How to Think Like a Computer Scientist (freely available and modifiable) and adapt them to the age level. The first few lessons should be fine, although they might need expanded somewhat.
Alternately, perhaps something more graphic-oriented would be desirable. If it were still around and supported, I would suggest Apple's Hypercard program. It appears there are some clones out there also, although I have no idea how good they are. (The first alternative listed says it is popular with educators.)
Good luck. -
Python
My almost reflexive reaction is to suggest Python. This is because it is a proper, well-designed programming language that is also compact. It is free and widely used, but more importantly it is easy to make it do stuff. The Python interpreter usually runs programs from files, but you can start it in a terminal mode in which you can enter programs and simple expressions. Demonstrate programming to your class live, by entering fragments of code, explaining how they work and showing what they do. There is no extra stuff to explain, no compiler, no headers, no IDE, no mysterious commands. So you can concentrate on the code.
-
Re:WhitespaceNo lambdas? Seriously? So the lambda keyword that my copy of Python 2.5 recognises is..what? A local patch? Or simply evidence that you don't have the slightest clue of what you're talking about?
No ternary operator? Firstly, this isn't C, and secondly, you'll be happy to know that people who're unwilling to learn new approaches have bitched often and hard enough that it now exists in a pythonic form: http://www.python.org/dev/peps/pep-0308/ You'll find the PEP interesting for at least two reasons (hint: it includes an example that uses a lambda).
No switch statement? What's wrong with using a dictionary dispatch method instead? It's faster.
Confused by the performance of range? Try using the goddamn help:
In [1]: help(range)
It seems to be behaving exactly the way it's supposed to, assuming you put aside your preconceptions from other languages and actually take the time to understand how it works.
Help on built-in function range in module __builtin__:
range(...)
range([start,] stop[, step]) -> list of integers
Return a list containing an arithmetic progression of integers.
range(i, j) returns [i, i+1, i+2, ..., j-1]; start (!) defaults to 0.
When step is given, it specifies the increment (or decrement).
For example, range(4) returns [0, 1, 2, 3]. The end point is omitted!
These are exactly the valid indices for a list of 4 elements.And you hate the use of double-underscores to indicate an implementation detail, is that correct? I'm guessing that's what your point is, as it appears to be just petty aesthetic sniping.
Yes, Guido, map and filter suck, but only because Python lambdas suck. And nested list comprehensions look awful. And sometimes you really do want a one-liner.
I can imagine that allegedly non-existent lambdas would suck. And if you really hate, as you appear to, everything that makes Python pythonic apart from its use of significant whitespace, I just have to ask: why the hell don't you stick to a language that better fits the way you want to code?
Or better yet, how about sticking to a language you actually seem to know something about? Because puffed up posturing of your multilinguistic abilities aside, you clearly don't know jackshit about Python.
-
Java for String Processing
Really, Java is not meant to be a string processing utility. It is honestly too slow with too much overhead for this type of functionality. Regex expressions were meant to be used in the occassional light occurrence of string processing in Java. If you are really needing some string processing, like over a large dataset, stick with something like Python which is based on C++. It is fast with some very cool tools, such as regex, dictionary use, etc. Even if you need a light GUI, you could always interlace some Python with TK.
-
Java for String Processing
Really, Java is not meant to be a string processing utility. It is honestly too slow with too much overhead for this type of functionality. Regex expressions were meant to be used in the occassional light occurrence of string processing in Java. If you are really needing some string processing, like over a large dataset, stick with something like Python which is based on C++. It is fast with some very cool tools, such as regex, dictionary use, etc. Even if you need a light GUI, you could always interlace some Python with TK.
-
Can you do modules in Matlab?
Well., I dont know about matlab. If you were using python, you could have built a prototype first using python., then start optimizing it by converting the bottlneck modules to C++/C.
See whether Matlab provides something like that. If it does not., you'll be wasting a lot of time converting it all to C++ and then continuing research on a C++ base., which means half your R&D team would have to be re-educated.
http://mail.python.org/pipermail/python-list/1999- November/016220.html
The above link should be of help. -
The easy way
Use Python
--
If everyone is thinking alike, then somebody isn't thinking. (George S. Patton) -
Guido prefers Django
FYI Guido van Rossum prefers Django (from his blog).
And people that use web frameworks in Python will probably be interested in WSGI 1.0 (the Python Web Server Gateway Interface) that will be added to the standard library in Python 2.5: it will probably be supported by all the major Python web frameworks.
-
Guido prefers Django
FYI Guido van Rossum prefers Django (from his blog).
And people that use web frameworks in Python will probably be interested in WSGI 1.0 (the Python Web Server Gateway Interface) that will be added to the standard library in Python 2.5: it will probably be supported by all the major Python web frameworks.
-
The book talks about ...
... wxPython, "a blending of the wxWidgets C++ class library with the Python programming language". Please, do not forget to put links on the articles, because the
/. effect need'em. -
Re:A standard tab length would be easier
Linus is already on record saying that tabs == 8 spaces. However (and sorry to burst your bubble) Linus isn't God. He isn't even Moses.
8 spaces makes very little sense for some environments, especially this newfangled web programming thingy all the cool kids are doing these days. -
Re:A standard tab length would be easier
This idea is actually about seperateing sementic and content info. Programmers use tabs (those who do) to convey sementic info. If we can make the program understand that, then we can offer more flexiblity to the user on how to present the information.
Yeah, imagine a language that doesn't need braces because tabs already contain the same semantic (sic) information. -
Re:Why Yahoo
> I would actually be interested to know what products (if any) they have that are powered
> mostly or entirely by Python. Does anyone know?
At least they have Guido van Rossum http://www.python.org/~guido/ who invented Python.
So I suppose they need this language one way or another... -
How about C library redistribution?
Microsoft executives have recently said they are committed to a greater outreach to the open source community and to make Windows software interoperable with that licensed under the GNU General Public License (GPL).
A nice start would be allowing redistribution of MSVCP71.DLL and MSVCR71.DLL as part of GPL applications? Python 2.4 switched to a newer Microsoft compiler and requires these DLLs on machines. Microsoft provides free compilers - see http://wiki.python.org/moin/Building_Python_with_
t he_free_MS_C_Toolkit However the C libraries that the compilers use can only be redistributed under terms that preclude GPL licensed software, although some debate the interpretation.Consequently that means that people who have GPL licensed Python apps can't move to Python 2.4 or newer because of Microsoft's licensing.
-
Programming trends
You want to know the latest trends for Java-based web development? Fewer and fewer people are going to be doing Java-based web development in the future.
Fuck trends. They're wrong. Every day the industry continues to stay with its current ridiculous technologies when vastly superior ones were invented decades ago infuriates me further. If it doesn't infuriate you, you're not paying close enough attention.
My advice: read Lambda the Ultimate and Steve Yegge's blog. Endeavor to learn what the lambda calculus and referential transparency are. If you are sincerely interested in bettering yourself as a programmer and don't go find out who Alonzo Church was then so help me God I will kick you in the balls. Learn about SML and type inference. Learn about Haskell and monads. Learn about process calculi and Erlang. Learn about Lisp and code generation and domain-specific languages. Learn about Scheme and lexical closures and continuations. Learn about Smalltalk and what OO was really supposed to be. Learn about type theory and formalism and the Curry-Howard correspondence. Learn about Forth and Joy and how you can have a powerful, expressive language without even so much as a grammar. Learn about Intercal and Befunge and just how badly your choice of programming language can torture you. Learn about UML and Ruby on Rails and Seaside and agile programming and Java generics and Python generators. Learn about aspect-oriented programming, context-oriented programming and concept programming. Learn about multi-paradigm languages like OCaml or Oz. Learn about weird Lisp dialects with syntax like Rebol or Dylan.
Realize that library design is language design. Realize that asynchronous programming with callbacks and explicit state in a world where lightweight coroutines were around in the days of fucking Simula in the 60s for Christ's sake is cruel and unusual torture. (Sorry, pet programming construct.) Realize that the programming language research community, while considering systems programming a solved problem and generally not interested in talking about human factors, is doing some genuinely promising work. Did you know that there are conc -
Re:Static Typing?
I'd love to see Python get optional static typing.
Well, to each his own. But if that is the only thing you miss about python help is available. -
Re:you're not alone doing this
Python just had a sprint in Iceland, too.
-
way to go...
If they wanted to post something funny about python, instead of this nonsense, they could've just posted that:
http://www.python.org/doc/Humor.html -
Meanwhile...
... actual Python gurus are off at a sprint in Iceland for a week of hacking that started yesterday.
-
python what
Agreed, what a waste of time. http://www.python.org/ would have been a lot more useful, albeit already known by most.
To summorize:
if you want to waste time:
click on link in article
else:
skip to next slashdot article and make believe this one does not exist -
Re:I suppose this will end Java innovation for me
If you're looking for the cleanest-looking, most-readable syntax out there... what about Python? Readability and maintainability was a primary design goal.
-
Re:Wow
Perhaps Web 2.0 is tired?
No, PHP is tired. It's now all about Ruby, Python, LISP, and the more obscure but no less interesting Lua, Scala, Qi, OCaml, among others, and various derivatives and frameworks. -
Python Software Foundation
The Python Software Foundation is also one of the organizations sponsoring projects. There's a guide for students that includes project ideas.
-
Re:Third-Party JVMThere are two main causes of java slowness. The most well-known is swing, the java graphics api which has one too many layers of indirection to be useful. The other main problem is Checked Exceptions, which force a programmer to write "try{" before the body of every method and "} catch (Exception e) {}" after the body. Although relatively useless (if not harmful), these checked exceptions lead to a minimum of 122 extra CPU cycles per method invocation.
Luckily, you there are workarounds, such as using Eclipse instead of swing and a different language to avoid checked exceptions.
-
Re:yes, they do!
So you used this implementation?
The Python interpreter is not fully thread safe. In order to support multi-threaded Python programs, there's a global lock that must be held by the current thread before it can safely access Python objects. Without the lock, even the simplest operations could cause problems in a multi-threaded program: for example, when two threads simultaneously increment the reference count of the same object, the reference count could end up being incremented only once instead of twice. -
For Newbie Coders: Python
I recommend Python to kids wanting to learn programming. It's free, it's very easy to get started with command-line stuff and simple programs, and it doesn't take some rediculously complex installation process just to get it working. (Although creating a shortcut to IDLE is an unadvertised Useful Thing To Do.) There's also Pygame, a library for graphics/sound/other game stuff, and I'm just starting to play with Panda3D, a Python 3D engine (that includes a copy of Python itself). I found that C/C++ gave me headaches, as did attempting to get other 3D engines working with Python bindings, while Python simplifies a lot of tasks (variable declarations, memory management) without sacrificing functionality. So, Python is a relatively easy way to get into programming.
-
Re:Learning curve of linear vs OO?
Well, to me, the obvious modern answer to BASIC is Python( http://www.python.org/ ). It's about as easy as BASIC, has an easy-to-understand help library, and runs best by command line interpreter. The IDE even comes with a Windows-based command line interpreter! In fact it looks a lot like BASIC, too, but also has more modern programming concepts fully built-in. I started in on BASIC in 3rd grade and taught people BASIC in middle school, before switching to C++ and Windows programming in high school(graduated in 2000). I now have a BS in Comp Sci and am a PhD student.
-
ssh tunneling
As long as it's not against company policy, you could try using SSH tunneling to hit a proxy at home. It might be a lot slower, but you can go anywhere. I've been using one written in Python for six months and haven't had a hitch.
-
Powered By Python
"Python plays a key role in our production pipeline. Without it a project the size of Star Wars: Episode II would have been very difficult to pull off. From crowd rendering to batch processing to compositing, Python binds all things together," said Tommy Burnette, Senior Technical Director, Industrial Light & Magic.
"Python is everywhere at ILM. It's used to extend the capabilities of our applications, as well as providing the glue between them. Every CG image we create has involved Python somewhere in the process," said Philip Peterson, Principal Engineer, Research & Development, Industrial Light & Magic.
Python Quotes -
Software Stack
Role
I work 60-70% of my time as a member of the core consulting team here and the rest of the time on "IT" administration and management around the local office. I should note though that I am a software engineer first and fore most, but it so happens that in small businesses one must wear many hats. Last year I was also heavily involved in accounting activities and managed a marketing program.
Scale
I only have 30 workstations and 27 servers (only 2 are publicly accessible and 8 are in a RCF) to worry about presently:
Culture
It should be noted that my users are technically very competent, which is a totally different can of worms to you (I assume from your comments), but there are plenty of issues to guard against with too competent a user as well!:) The issues are just different.
Environment
Server OS: RHEL 3
Workstation OS: Fedora Core 4 and 2 MacOS X (those damn graphic designers/marketing folk!:)
VPN Server OS: NetBSD 3 (runs on an Alpha box)
Software Tools
SCM: Subversion http://subversion.tigris.org/
Issue Tracking: Trac, which integrates nicely with Subversion http://edgewall.com/trac/
Internal Documentation (for future growth): Trac's built-in wiki http://edgewall.com/trac/
Web Server: Apache, mod_python, mod_ssl, mod_dav, and all that good stuff http://apache.org/
Knowledge Base: OpenCyc (but looking for something better that is still open source)
Intranet Framework: Python 2.4/TurboGears/Apache/mod_python http://python.org/ and http://turbogears.org/
Authentication: Fedora Directory Server (LDAP)
Updates: Yum, up2date
Server Monitoring: Nagios http://www.nagios.org/
[Internal] Remote Access: ssh and Gnome/VNC for the rare visual task
[External] Remote Access (i.e. VPN): OpenVPN
Internal Tools
Fixed Asset Management: Rolled my own TurboGears Web/AJAX application that hooks into our accounting system (it took 3 days part-time).
Backups: Rolled own Python backup mechanisms including scripts
Deployment Tools: Using Python's autoinst http://autoinst.tigris.org/
Continous Integration: I have started using Bitten instead of using cron and shell scripts to launch Python distribution builds and tests on a nightly and "continuous" basis for immediate feedback - something I find invaluable.
Office Software
As mentioned in a previous posting using a good calendaring tool is a very good idea. My recommendation is the Calendar extension for the Mozilla suite of tools. -
Re:Why?
-
VB is great for beginners, Python is not
Python is way over-hyped. It is slow and not designed for beginners at all: See http://wiki.python.org/moin/BeginnerErrorsWithPyt
h onProgramming
If anything, Ruby is better for beginners than python.
VB.NET fixes a lot of the issues with VB6 (though not all). It really is the only full featured programming language out there that IS designed with beginners in mind. Case-insensitive, no =/== mistakes, no whitespace debugging issues, and dozens of other design decisions like those are all made with beginners in mind. -
Re:Bad idea
Let me get this right -- two instance of the base class's variables within a single instance of a class which has inherited from two subclasses... and you *want* this behaviour? I'll grant that there may be cases where it's useful, but I just don't see them off the top of my head -- especially when using something like super() for calling one's superclasses' constructors in MRO order such that a given constructor never gets called more than once.
For an example of why I consider Python's multiple inheritance implementation to be superior, see the MRO algorithm used in modern interpreters (for new-style objects only, to prevent backwards compatibility issues).
That said, I've never much liked C++ -- for low-level work I've always tended towards C, and for high-level work I prefer powerful languages that didn't have the kitchen sink thrown into the syntax (read: not Perl either) -- so I probably don't know C++ as well as you do. That said, I do use Python on a regular basis, including some code that makes heavy use of some of its more obscure features. ("Obscure features" is relative, of course -- there's no syntax specifically for most of them [take swapping out an object's class with another dynamically constructed class inheriting from a dynamically generated list of bases as an example], and they work pretty naturally with the language, but they're things most folks not used to Python wouldn't expect to be able to do). (And wrt the dynamic-class-generation thing -- yes, I have a real-world use for that). -
The best starting out language is ...
Smalltalk, because you are completely isolated from the boring mechanics of programming. Nasty things like files, editors, compilers, linkers.
http://www.smalltalk.org/main/
http://en.wikipedia.org/wiki/Smalltalk
Smalltalk, because there are 2 very good free (gratis),
http://www.exept.de/exept/english/Smalltalk/frame_ uebersicht.html
http://smalltalk.cincom.com/index.ssp
and at least 2 Free ( Libre ) implementations.
http://www.squeak.org/
http://www.gnu.org/software/smalltalk/smalltalk.ht ml
Smalltalk, because is was deliberately designed for small people to have fun,
yet you can grow-up with it.
http://www.squeakland.org/
Smalltalk, because it is well documented.
http://www.iam.unibe.ch/~ducasse/FreeBooks.html
http://www.whysmalltalk.com/tutorials/visualworks. htm
In a couple of words, it Just Works, and your sanity will not be harmed.
If you can't drop the "program in a file" paradigm, then checkout
http://www.ruby-lang.org/
http://www.python.org/
Don't even dream about anything BASIC because your dreams will turn into really horrendous nightmares before you can even turn around twice. -
Re:Still looking for an IDE
- http://wiki.python.org/moin/IntegratedDevelopment
E nvironments
If you need a drag'n'drop gui editor, try Eric (pyQT( or BoaConstructor (wxWindows).