Domain: python.org
Stories and comments across the archive that link to python.org.
Comments · 1,513
-
Re:Write your own tools
Certainly no one knows his little brother better than he does, but he may as well use Python and GCompris instead of Perl/Tk to hack together some educational games for his little brother. Why not use some of the already developed open source material out there targetted precisely toward this sort of thing. You could put together a new simple game with GCompris in no time flat, and it already has over 60 little games (from chess to algebra games to geography to reading) bundled already.
Jedidiah. -
Good choice.There are several reasons why Python is a good choice for such a thing. The Python licence allows any commercial project to embed it without releasing code. So rather then develop a custom solution (ie; UnrealScript), one comes ready made, and complete. And there are lots of reference books about. I did some modding in UnrealScript, and documentation was _very_ hard to find, and incomplete when you did find it.
Python intergrates well with C/C++. Amazingly well, actually, and I think any C/C++ coder should go through the tutorial, and see what python can do for you. Yes, I know other enviroments promised the same thing before, but Python delivers.
Python is powerful, but easy to learn. Personally, I think we should be teaching kids Python in elementary school. And if it's your first language, you won't get all hung up on the whitespace thing.
Anyone coding an app that could benifit from a scripting language needs to take a look at python.
-
Good point
How long before people finally get it that php is not for secure production mission critical environment? Another exploit, big deal. Just use secure software and get over it. Jeez.
Very good point. Unfortunately, there are literally tons of php fanboys always trying to force their little toy upon our throughts, even though /. itself is php-free, lol. -
Here is an even faster way to build your own site:
Zope plus Plone - if you are looking for a content management system, or Zwiki if you are looking for a wiki solution, or learn Python and roll your own inside of Zope's Management Interface (ZMI).
Before you know it you will have dynamic content coming out of your ears - and you won't have to muck about with a relational database at all (and the ZODB scales better anyway from my experience). -
Re:Business is business
Actually, I work for a small (less than 40 people) company in a very niche industry. Ignore the fact that the owner is one of my city's biggest charitable givers, or that he just let me release my last year's worth of work under the GPL, or that he routinely takes us all out to eat or on all-expense-paid daytrips to other cities. No, he's a businessman and therefore Evil.
-
vote for python + pygame
If you want to do something simple and don't know how to program at all, this is definitely the way to go.
Python is not only easy to learn, it's a great starting language. (enforces proper formatting, doesn't use crazy things like ; line endings
Python.org Beginner's Guide ;)
Dive Into Python (free on-line book, well written IMO)
and of course the http://pygame.org/ which the parent poster already said.I would NOT suggest using PyOpenGL if you're new to programming, it's an unnecessary layer of complexity for very simple projects. Use it after you know how to program and have created at least a few simple things already.
:)Anyway, just wanted to give my vote for Python.
-
SDL, C and Pygame
Without a doubt, Simple Directmedia Layer (SDL) is the best platform for writing cross platform games. It provides a very clean abstraction layer to the high performance APIs (DirectX, etc.) available on each platform. Many people who code only for Windows use it since the API is a lot nicer than the COM based DirectX API. A number of commercial games have been ported to Linux using SDL.
For serious game programming, you need to learn C or C++. I would guess that 99% of all commercial games for the PC are written in mostly C or C++. This doesn't mean you need to write all of your code in a low level language. Even the original Quake used an interpreted language (QuakeC) for the game logic. But almost no language other than C or C++ will provide the speed or memory usage necessary for most commercial games.
If you'd rather concentrate on writing your game rather than learning C, try Python with Pygame. Pygame is a Python binding to SDL. It is fairly fast since all the low level graphics stuff is done using SDL. Certain things will be slower in Python (collision detection, physics, etc.) but most code isn't speed critical anyway. Some things will be harder in Python since it's easier to manipulate bytes and bits in C.
Also check out PyOpenGL if you want to learn OpenGL. It can be used in conjunction with Pygame. I used this when I was learning OpenGL and it's quite nice. The API is almost exactly like the C based API, but it is easier to use. At least one of the popular OpenGL tutorials has been ported to PyOpenGL. -
Get Python + Pygame
You should definitely get Python and Pygame. Python is both easy to learn and more powerful than most languages. Better yet, there are plenty of example games to study. If you want to do 3D, also get PyOpenGL, and get the started with the NeHe tutorials (Python code available).
The downside with Python is that it can be slow (a fact that can be remedied to some degree, but not entirely, by also installing Psyco). Fortunately, the slowness doesn't matter (unless your aim is to compete with the next id Software engine). I've written a simple engine for a 2D platformer in Python myself, and even with a game logic and collision detection, 90% of the processor time is spent blitting the graphics to the screen. Since Pygame (written in C) does the rendering, using C++ for your game code won't provide any big advantage.
Good luck! -
Re:"Open source"? WTF?
Civ 4 will use Python, which means it encorporates open-source technology, but is not nescesarily open source itself.
-
Not ignored - not appreciated-Concordia.
"I think that everybody is in agreement that the Xanadu ideas are great, it's just that nothing has yet all that usefull has materialised."
The CIA was ahead.
Concordia was ahead.*
*The OS is still available.
-
Re:Heh
-
Re:Python?
-
Re:Python?
-
An alternative approach: PyQtFirst of all, my warmest regards to the gamba team. And I wish them all the success.
But I thought I should point out that there is a beautifull platfrom for cross-platftorm RAD. This is PyQt, used in conjunction with Qt Designer. It combines the power of Qt as a GUI dev platform, with the power, extendability and simplicity of Python. I think that gambas aims at a simpler approach though, so I am not saying that it is useless. What I am saying is, if you need a very powerfull yet simple RAD with graphical capabilities, maybe you would like to consider QtDesinger + PyQt. It also has the advantage that is a really mature platform.
Cheers !
-
Re:PythonDoes anyone have ideas on how Ruby would fare vs. Python as a first language?
Either language would be a fine choice for a first language.
I think Python has a few small advantages. First, there are many tutorials for Python that are aimed at new programmers. Examples include:
- How to Think Like a Computer Scientist
- Python 101
- Learning to Program
- Non-Programmers Tutorial For Python
- The Python tutorial that ships with Python itself (not really for absolute beginners, but this is where I learned Python)
- Plus many others, and I haven't even mentioned printed books.
The other advantange Python has over Ruby is the interactive Python interpreter. I can't explain how fantastic this is. With many other interpreted languages (Ruby, Perl), you really should write your program in a text editor and then run it through the interpreter. This is because the commands you type don't execute until you stop entering your program. The interpreter is not interactive. So every time you want to try something, you have make the change in your text editor and then run it through the interpreter.
Python's interpreter is much nicer to work with. You type in commands, and each command executes immediately. This is very useful when you want to experiment with the language, and is ideal for beginners. I don't know why Ruby's creator didn't include this feature.
Anyway, you'll be happy no matter which language you choose. They are both very nice. You might also consider learning PHP as a first languages. It's nice to be able to view the results of your work in a web browser, and PHP is probably the quickest way to do that. Another good choice for first language is Scheme. Check out the free online book Structure and Interpretation of Computer Programs (SICP). If you like video, there are also some video lectures available.
-
My thoughts
I just got back from celebrating my nephew's third birthday. He takes after me in a lot of ways, and so I'm guessing he'll have fun with programming.
For Christmas and his birthday, I got him a KidzMouse (icky website, great product) and some non-computer stuff. The KidzMouse was because his hands can't use his Mom and Dad's mouse, so he has to have Mom do all his mousing when he plays games. I felt that this interface might discourage him from exploring on his own; hence the KidzMouse.
I've been thinking about him learning a lot lately. Buffy fans remember what she said to her kid sister in "Grave": "I don't want to protect you from the world. I want to show it to you." That's how I feel about my nephew. I want him to be able to experience art, and music, and science, and nature, and-- of course-- technology. I'm not going to shove anything down his throat, but by golly I'll make sure he has the tools he needs to discover them on his own.
That's shaped my choices of gifts for him a lot. I'm trying to stay on the topic of computers here, so the KidzMouse is one example. (I also set up video conferencing, mostly because I'm tired of only seeing him once or twice a year.) I think that this is the most important thing you can do: make sure that the kid has the tools to explore, and learn whatever they want on their own.
So here's what I see as needs. First off, an interactive environment: you should be able to give a command, and immediately see the results. Second, no file editor, no IDE, none of that mess. He should be able to concentrate on playing with the environment, instead of learning the editor (and the associated problem of saving from the editor and loading into the program). You should be ready to introduce an editor, but wait until his programs get long enough that the editor becomes a programming aid, not a necessary step.
You can easily set up a
.bash_profile or .xsession to launch a programming environment, and exit when it's done. That can spare him from bash. (Again, remove everything that's not an actual aid to programming at this stage!) But which environment?Python is probably the closest thing you'll get to our old ROM BASIC. It's fast and easy, and pygame sets the stage for much fun. But without a save or list facility, Python may have some problems. I'm not aware of any way to save an entire Python state, a la Lisp, but you could probably write it based on unexec. You can use this idea to implement a "save" command, and just use exec for "load". It's probably pretty simple to write in a kludge to save functions for listings.
The other problem with Python is that it's difficult to edit programs in the interactive mode. You can redefine functions, but you have to retype the whole thing. The one good thing about line-numbered BASIC was that you could quickly make a simple change to a routine.
So you might prefer StarLogo or the like. Many of us started on LOGO or Pilot before we got into BASIC, and I think it's a good environment. Also look at Squeak, which I think has great potential in teaching to program. If I were in your shoes, I'd probably focus on Squeak, unless you're scared of Smalltalk. StarLogo and Squeak deal with the editor issue pretty well.
You will need to provide him with some starting points for exploration. Our generation learned by typing in listings, and then modifying them. I can't really think of a better way. Programming books are too linear; they don't tend to encourage as much exploration. Certainly, have some books available, but I think that "let's play with this and see what we can do" is much, much more important than "let's proceed along these lessons in this order". I'm teaching a friend of mine how to program, and I'm always thrilled when he starts going down his own path instead of staying on my lesson plan. (Well, al
-
Logo lives!I'm a big fan of Logo. One of the reasons is that it's not written for programmers, it's written for kids who may or may not become programmers. It has things that would make normal programmers cringe -- like all the shortcuts (FD for FORWARD). But have you seen a young child type? Believe me, FD is enough of a struggle, "intention-revealing selectors" is not one of their top priorities.
Really Logo wasn't intended to teach programming (though of course it did that). It was intended to teach math, and algorithmic thinking, and thinking in general. And, paired with the right teacher and an interested pupil, it's really great at that. Without realizing it, a child can end up learning not just geometry (through the turtle graphics), but a lot of pre-algebra. I think programming is a far more accessible way to introduce algebra than the traditional techniques; even young children can understand variables in programs, when the declarative variables that are used in mathematics are much more challenging.
It's also a better language than many of "teaching" languages, like Basic. It's an old-school version of Lisp, with a little tweak to avoid the parenthesis. And don't be fooled by things that call themselves Logo when they are just turtle graphics. Turtle graphics are cool, but just a piece of the equation. (Though not-so-coincidentally, Python has built-in turtle graphics).
If you are really interested in programming as education, I might recommend the book Mindstorms, which is a classic about some of the theory behind teaching with Logo. It's not a practical guide, though many of those also exist.
If you are looking for a Logo implementation, on Windows I would recommend Elica, MSWLogo, and UCBLogo, in that order. On Mac or Linux, you can use UCBLogo, Turtle Tracks (a cross-platform Java implementation), or on Mac one of a number of (rather expensive) commercial Logos. If you are a programmer and feel like fiddling alongside your child, you might try my project PyLogo, which is cross-platform and written in Python, but quite rough around the edges. Or if you want something that is Logo, but pretends to be a general-purpose scripting language, look at Rebol. Or for a slightly-lame but functional embedded robot Logo, Cricket Logo. Or for older people, NetLogo is a massively-multitasking implementation to use to play around with autonomous entities (e.g., ant simulations). NetLogo is kind of the successor to StarLogo.
For more information on Logo, you can look at the Logo Foundation, or get in touch with many helpful users in the LogoForum Yahoo Group.
-
My experience/rant
My first experience with a computer was when I was five. My dad had an Atari 800. (He ended up selling it because he couldn't afford a disk drive! This was when disk drives cost hundreds of dollars.) I remember one night he typed in a program that acted like an etch-a-sketch.
I few years later, my parents bought me an Atari ST. I was hooked on computers from that point on. One day I was reading an article in Atari Explorer magazine about programming. The article presented a simple "Hello, world" type program in BASIC. I decided to play around with it and see if I could change it slightly. (This was back when every computer came with a copy of BASIC.)
I ended up teaching myself BASIC over the summer.
Anybody remember when computer magazines used to publish type-in programs? :-)
I know nowadays a lot of people don't like BASIC because of goto and what not. But I think it is a good language to teach some basic principles (what a variable is, what a loop is, etc).
I'm currently learning python. I've wondered if it would be a good first language for someone. I'm not sure it would be. For one, I'm not sure if someone who learns it would appreciate all the things it does for you. Second, when they learn another language, I'm not sure what the learning curve will be like. It might take them a while to get used to the new ideas. On the other hand, maybe starting fresh and not carrying some of the baggage of older languages would be good for a new generation of programmers.
I've never used Pascal, but I've heard it's a good language for learning programming.
Now, I've heard some people say that OO is the way to go and should be taught to newbies. But even with OO you still use parts from procedural programming: you still use variables, still use loops, still call functions, etc. I see no harm in using a simpler language to teach the fundamentals before moving on to objects.
Maybe what we need is a version of knoppix set up for teaching programming.
Python links:
Main python site: http://www.python.org/
Dive Into Python book: http://diveintopython.org/
Pascal:
A free Pascal compilerhttp://www.freepascal.org/
Basic:
I don't have a link for a version of basic. But I know there are some on the web. And Win 95 & 98 have a copy (buried) on the setup disk. Look in the other\oldmsdos folder.
More:
http://thefreecountry.com/ Has links to free compilers & more for various languages.
Old computer magazine archives:
http://www.atarimagazines.com/
-
Re:Several frustrating points
- No decent scripting language? In Unix? What do you suggest? BASIC? JCL? Microsoft's batch language?
Unix needs something like MSH, I think.
Of course, there are plenty of good scripting of languages for Unix. The question is whether we need some higher-level glue between scriptable components, and I think we do.
-
Re:35%
Bram Cohen is innocent. This guy is responsible for everything: he created the language for such an abomination. Without Python, no BitTorrent!
-
Quantian articleI own the quantian.org domain. The following is from my article on the Quantian Distribution. Here is a brief run down of links, programs, and other goodies in Quantian.
- R, including several add-on packages (such as tseries, RODBC, coda, mcmcpack, gtkdevice, rgtk, rquantlib, qtl, dbi, rmysql), out-of-the box support for the powerful ESS modes for XEmacs as well as the Ggobi visualisation program;
- A complete teTeX, TeX, and LaTeX setup for scientific publishing, along with TeXmacs and LyX for wysiwyg editing;
- Perl and Python with loads of add-ons, plus ruby, tcl, Lua, and Scientific and Numeric Python;
- The Emacs and Vim editors, as well as Gnumeric, kate, Koffice, jed, joe, nedit and zile;
- Octave, with add-on packages octave-forge, octave-sp, octave-epstk, and matwrap;
- Computer-algebra systems Maxima, Pari/GP, GAP, GiNaC and YaCaS;
- the QuantLib quantitative finance library including its Python interface;
- GSL, the Gnu Scientific Library (GSL) including example binaries;
- The GNU compiler suite comprising gcc, g77, g++ compilers;
- the OpenDX, Plotmtv, and Mayavi data visualisation systems;
- it includes apcalc,aribas,autoclass,
-
Quantian articleI own the quantian.org domain. The following is from my article on the Quantian Distribution. Here is a brief run down of links, programs, and other goodies in Quantian.
- R, including several add-on packages (such as tseries, RODBC, coda, mcmcpack, gtkdevice, rgtk, rquantlib, qtl, dbi, rmysql), out-of-the box support for the powerful ESS modes for XEmacs as well as the Ggobi visualisation program;
- A complete teTeX, TeX, and LaTeX setup for scientific publishing, along with TeXmacs and LyX for wysiwyg editing;
- Perl and Python with loads of add-ons, plus ruby, tcl, Lua, and Scientific and Numeric Python;
- The Emacs and Vim editors, as well as Gnumeric, kate, Koffice, jed, joe, nedit and zile;
- Octave, with add-on packages octave-forge, octave-sp, octave-epstk, and matwrap;
- Computer-algebra systems Maxima, Pari/GP, GAP, GiNaC and YaCaS;
- the QuantLib quantitative finance library including its Python interface;
- GSL, the Gnu Scientific Library (GSL) including example binaries;
- The GNU compiler suite comprising gcc, g77, g++ compilers;
- the OpenDX, Plotmtv, and Mayavi data visualisation systems;
- it includes apcalc,aribas,autoclass,
-
Re:Yah, good for Javascript!
- The reason I'm not taking you seriously is because you don't even seem to be aware of the arguments for and against dynamically types languages. I mean, you havn't even mentioned unit testing yet.
Please. I mentioned unit testing in my first reply, where I wrote:
- The uncertainty involved in the dynamic typing/late binding model of such languages is compensated for through unit testing.
I also linked to an interview with Guido van Rossum where he talks about this very topic, so if you think I'm ignorant of the issues involved, you must be purposely ignoring what I'm writing. Thanks for trolling again.
- This has already happened for languages like Eiffel where verification of object contracts is now automated. These methods are becoming available for Java too.
Sorry, but interface contracts have very little to do with static type checking.
A pre-condition is typically something like whether a value is within a range, or that an argument is not null, or an array has a certain length, or that an instance is of a certain class at runtime; not whether it's an integer or a string.
Design by contract, being unrelated to static type checking, is therefore a concept that is equally applicable to both statically- and dynamically-typed languages, the main difference being that in a dynamically typed language, the checks may only occur at runtime.
There is nothing preventing dynamically typed languages from doing automated type checking. This and this make a good start. The latter is similar to Java 5.0's annotation system.
As for unit tests consisting of type checks, you will probably find that the overlap is larger than you think. Even if a method in Java returns a StringBuffer object, the Java interface can never explain what the contract is: whether it's allowed to return null, whether it always returns a different instance, what that object is supposed to contain.
You will find that in Python, for example, the checks are more or less the same; if the method returned Fnarg instead of the expected object, your test will fail -- unless Fnarg happens to behave like what you wanted, in which case everything is all right. As for input, regardless of the type of language, throwing garbage at functions is always useful; with dynamically typed languages, you might just end up throwing a little more garbage.
Unit tests are supposed to be simple and quick to write. Languages like Python are known to support much more rapid development. Even if you add 20% more checks, you'll still come out on top. Ever worked with lists and maps in Java? They're not first-class objects, so they're a nightmare to manipulate. Such structures are extremely common in tests. (I have been writing Java and Python unit tests every day for four years, so I know where the differences are.)
(As an aside, if in your mention of Eiffel you're referring to design by contract, the concept was invented for Eiffel, so saying it's "now automated" is like saying the Eiffel tower is now made out of steel.)
-
Wow...
Someone wrote an entire musical in python? Not sure what junk email has to do with it though. Guess I should have RTFA.
-
Please don't try this...
...at home. Seriously, recommending C++ or Java as introductory languages is IMHO a really bad idea. Both languages suffer from design problems that will take a lot of fun from the learning experience.
C++ is probably the worst choice besides C or Assembler (not talking about Braindead et al :) for learning a new language. With manual memory management, heavy generic programming (templates) and mostly speed-optimized libraries (easy interfaces vs. performance) C++ is the heavy machine gun of languages that can be very difficuly to handle...
Java does sufficently abstract low-level aspects of programming and thus is often used as introductory language, but in my experience teaching it at my university I noticed one huge problem that's very difficult to get over: the massive SDK, with it's miles deep object hierarchies, doesn't make sense for people not yet thinking in object oriented terms (arguably it does for the rest ;). It's too strict in this sense, at least for learning purposes. Take a look at the Java version of Hello world, does this look intuitive?
Lua might not be a good choice either, as it is very lightweight (missing some nice functionality you might better get a grip of early on).
Personally I would recommend Ruby (the cleanest language around) or Python (also very clean, with more mature community support) for a start. Both offer everything necessary to develop computer games... -
Re:Python annoyances
Try help(strftime). Or use the excellent library reference instead
:) -
Re:genexps
Also, iterator and generator resumption is faster than a function call.
Yup. Like the PEP says,
Early timings showed that generators had a significant performance advantage over list comprehensions. However, the latter were highly optimized for Py2.4 and now the performance is roughly comparable for small to mid-sized data sets. As the data volumes grow larger, generator expressions tend to perform better because they do not exhaust cache memory and they allow Python to re-use objects between iterations.
I think I know where the OP got the idea that genexps would be slow .. function calls are slow in Python .. in things like for loops, but not in places like genexps and maps. It's a good idea to test something out before you make claims about its speed. -
Re:sigils sneaking in
-
Not a Python Programmer......but I am impressed with the whole funciton-decorator addition to the language.
Function Decorator Proposal/Specification
Its nice to see a language evolve in favor of use without sacrificing readability and overall utility.
Before:def foo(cls):
After:
pass
foo = synchronized(lock)(foo)
foo = classmethod(foo)@classmethod
Readable is of course in the eye of the beholder... and I am a C and Java programmer with a sizable fetish for D. So while I don't find the syntax all that pleasing to me in terms of my own work, it certainly changes things for reading python code.
@synchronized(lock)
def foo(cls):
pass
I was also stunned to learn how flexible decorators were in the previous version of python. It's refreshing to be see functions treated as objects... unless I'm mistaken about the concept.
However its a huge shame that the new decorator syntax isn't supported for classes in 2.4. Seems like that's going to become a wart on a rather consistent language syntax, IMO.
-
Re:Use a toolkit
-
SupprisedI was supprised that even though a good number of Slashdotters are programmers themselves, http://www.python.org/ was not slashdotted.
Can one tell me why I should learn python and not any other programming language anyway?
From the little I have seen, python seems to be a command line language. Is it anywhere similar to Visual Basic, which I have come to see and experience through a GUI?
-
modern danceModern dance is the perfect antidote to long hours sitting and puzzling over IT problems. I am in two modern dance companies and find that my two jobs compliment each other beautifully -- each one refreshes me from the difficulties of the other.
I also tutor high school students in math, and I occasionally do work as a ninja for hire.
An easy way to get into modern dance is to do Contact Improvisation. That's how I started. Guido von Rossum, who wrote python does it too.
-
modern danceModern dance is the perfect antidote to long hours sitting and puzzling over IT problems. I am in two modern dance companies and find that my two jobs compliment each other beautifully -- each one refreshes me from the difficulties of the other.
I also tutor high school students in math, and I occasionally do work as a ninja for hire.
An easy way to get into modern dance is to do Contact Improvisation. That's how I started. Guido von Rossum, who wrote python does it too.
-
Script it dear liza...
perl or python ?
Replies to this post will accept single line or short solutions in the language of your choice which work with the following command line (assuming source and dest dirs already exist and mp3/ogg/flac tools have been installed and in the path):
convert [source directory] [destination directory] [format=mp3/ogg] [bitrate(int)] -
Re:Usability in Non-MS Environments
Eclipse is not just for Java. You can use it for C and C++, python, COBOL, among others.
-
Re:Is it all there?Does it matter? I mean, it's written in Python so it has to be good. The great thing about Python is you can write things like word processors in two or three lines of code. This is, in many ways, the perfect project to demonstrate Python's abilities. Python supports many things that lesser languages like C and Java don't, such as TCP/IP access, object orientated programming, file handling, and such. Because of that, you can do really complicated things in it that would take you ages with Java.
I mean, can you see such a program being written in Perl or TCL? And because Python is interpreted, it's much faster than something written in a language like C where it has to be compiled before you can even run it. Python's also easy to learn which means it'll be easier to maintain the results afterwards, if you have to change the head of Scotland Yard, for example. It's also more secure, because you don't have C's crappy strings, instead you have properly secure strings: programsd written in Python are secure, inherently secure, you an't break into them, and that's what you want in a game because it makes it harder for people to cheat.
My advice, download it, learn a bit of Python (use one of the many good books about Python, or Ruby if you can't find a book on Python) and add the realism yourself. Behold the power of Python!
-
Two quick commentsI can't really tell when you're asking questions and when you're stating project requirements, but
..
I was investigating whether to start from an existing compiler and extend it. The compiler will be based on yacc, or bison.
you might want to check out ANTLR.
Perl also has the right license (GPL). Is Python out of the question for such a project, since it's not GPL?
Did you just say "I can only use GPL'd things. Python isn't GPL'd. Can I use it?" I'll assume you meant something like "I want something with a nice license. Does Python have a nice license?" instead. If that's what you meant, you should check out the Python license for yourself. Summary: it's a nice license. It's a certified Open Source license, imposes fewer restrictions than the GPL and is compatible with the GPL.
Python definitely doesn't fit into 5000 lines of source, though, so Perl1 might be a better bet. PyPy is pretty cool, if you're looking for something smallish and Pythonish.
Sorry if you're looking for something else and these comments turn out to be totally useless. -
AdoptionYears ago, Eric Raymond wrote:
"Perl XS is acknowledged to be a nasty mess. My guess is the Perl guys would drop it like a hot rock for our [Python's] stuff -- that would be as clear a win for them as co-opting Perl-style regexps was for us." [emphasis added]
Maybe I misinterpreted ESR's intended message, but it would be disappointing if hypercompetition prevented Perl's already-influential regex extensions from exerting a positive influence on other platforms. Raymond seems to imply that the Python team only grudgingly included support for Perl-style regex. I understand that developement teams in similar niches each want to make a big splash in the industry, hopefully Python's great increase in popularity has softened the survivalist attitude that seems to characterize this Raymond quote from Python-Dev. Evolving regex can benefit everyone.
Note to those ready to mod me Troll/Flamebait: I'm not trying to pick on Python, I just happened to be acquainted with this candid quote. -
Re:Advice from a student
Learn to love whitespaces
That's one of the main reasons why instructors should use Python in introductory programming assignements. Once students get into the habit of properly indenting code (because, with Python, they must), they'll stick to it later in their professional life too.
-
It is extremely important to mention Parrot
Can I get any advice? Is Ruby really "more powerful than Perl and more object oriented than Python" - is this what I'm looking for, or should I put it off and learn Python first?
No, it is not more powerful than Perl. But than again, nothing is. The points is not what is more powerful per se, but rather which is more powerful in your hands and which one best fits your own brain. At this point it is extremely important to mention Parrot: "The amazing project [...] to really unite Perl and Python one day (not to mention Tcl, Scheme, Forth and Ruby, to name just a few)."
Perl, Python and Ruby, while not the only ones, are certainly the most important languages for the Parrot development. Parrot will not be considered ready until all of them are fully supported, and at this point Parrot will be their main target Virtual Machine, running each of them and allowing them to interoperate. At this point it won't matter which of those languages you personally use, because whatever you choose you will still have access to all of the libraries and module, class and object, of each of them.
Few years ago I will tell you: "go for Perl because of CPAN." Now my advice woule be: "go for whatever you please, for in few years it won't really matter. We will be able to work on the same project, write the same application. I will write my part in Perl 6, you will write yours in Ruby, someone will write in Python and another one in Scheme. We will all subclass our classes, invoke our methods, use our objects, and we will produce a single, monolithic Parrot application anyway."
Just imagine picking up some fresh, young and cutting-edge language designed weeks ago--or even designing your own language--and having every module from CPAN available at once, working just fine using your new language syntax. This is the future Perl, Python and Ruby. Interoperation instead of competition.
-
Re:Too many new languages at once...
1) why do I need to include 'self' as the first parameter of each method definition?
It's nicer for unbound methods, and makes calls to superclass methods clearer. This is also answered in the Python FAQ.
2) In Python people tend to prefer, for example, to find the length of an array by saying:
See my previous post in this thread. I agree that this is something of a wart, but a minor one.
length( array ) instead of array.length (the latter being the way you would do it in Ruby). Of course Pythonistas are now screaming that you can also say: array.__length__ (or something similar) in Python as well.
As for Ruby vs. Python, I don't think it's a big deal as they are similar in many ways. If you're comfortable with either language, there's probably no need to switch to the other. Myself, I don't think the higher level of consistency in Ruby's object system offers any practical advantage, and find Python's syntax much nicer. Haven't seen anything particularly interesting in Ruby that isn't also in Python.
Indeed, if I had discovered Ruby before Python, it's quite possible that I would've stuck to that instead. -
Re:Look, I program in Perl
Do you want to call modules you wrote from a python program? Or do you want to call python modules from perl. For the latter look no farther than cpan
For the former, first check out the python package index , which is the equivelent of CPAN to see if someone else has created a relevant package. If not, creating a python module from C code from python is easy . As far as calling perl modules from python, that is one of the things Parrot is intended to do, so your savior will come with the apoclypse. -
Re:Look, I program in Perl
Do you want to call modules you wrote from a python program? Or do you want to call python modules from perl. For the latter look no farther than cpan
For the former, first check out the python package index , which is the equivelent of CPAN to see if someone else has created a relevant package. If not, creating a python module from C code from python is easy . As far as calling perl modules from python, that is one of the things Parrot is intended to do, so your savior will come with the apoclypse. -
Python Again
I Agree with an earlier post, i learnt Basic as a child and it was fun, but when i look back, i understand that python would have been much better! Python can be used to serious tasks, unlike basic and it is a much cooler language http://www.python.org/ Plus it is free (both meanings of the word), at least since 1.52 (or something).
-
Not trolling in a java story, but ..Another example of excellent documentation is python (http://www.python.org/). Clearly presented, accurate, well organized and indexed, but most important of all: well written.
Information is presented in bite-sized chunks matching the 'fits your brain' philosophy that is one of the reasons that make python attractive.
Tip top job Guido, Fred Drake et al.
-
Computer Programming for Everybody
I think that any software development tool that liberates people from being users to active developers is a good thing.
I know that BASIC does not appeal to the Slashdot crowd, but what about those people who have never programmed before? If this program helps a few people write a small program or two on their own, I think it is a great deal.
Personally, I am excited by the Computer Programming for Everybody (CP4E) proposal that Guido van Rossum proposed a while back. I think everybody in the modern, western world could benefit from a rudimentary, working knowledge of computer programming, considering the ubiquity of computers and other programmed devices. -
Learn Python instead.
Seriously. I learned Basic when I was a kid, but if I could be a kid again, I would have learned Python instead (if it had been invented then). the limitations of Basic (no pointers, etc), give it serious problems with anything but low end programs. It certainly has no place in modern commercial development. Visual Basic programmers might disagree, but it's my experience that you're all brutally retarded anyway.
Basic might be good for beginning programmers to get a brief overview of how to code, but before long I would expect them to move onto a better, more capable language before it gives them bad habbits and slows them down. C is a complex language, but Python is exactly right for learners - it's complicated and hugely capable if you want it to be, but is quite capable of small projects and is forgiving for learners.
* Python - A modern, neet-o general purpose language.
* Psyco - Runtime compiler.
* Py2Exe - Converts Python scripts to Windows executables.
* Pythonwin - Windows extensions (and an excellent code editor).
(I want to recommend learning assembler for beginners, since you'll understand exactly what's going on, but almost nobody cares about it these days.. sigh..) -
Learn Python instead.
Seriously. I learned Basic when I was a kid, but if I could be a kid again, I would have learned Python instead (if it had been invented then). the limitations of Basic (no pointers, etc), give it serious problems with anything but low end programs. It certainly has no place in modern commercial development. Visual Basic programmers might disagree, but it's my experience that you're all brutally retarded anyway.
Basic might be good for beginning programmers to get a brief overview of how to code, but before long I would expect them to move onto a better, more capable language before it gives them bad habbits and slows them down. C is a complex language, but Python is exactly right for learners - it's complicated and hugely capable if you want it to be, but is quite capable of small projects and is forgiving for learners.
* Python - A modern, neet-o general purpose language.
* Psyco - Runtime compiler.
* Py2Exe - Converts Python scripts to Windows executables.
* Pythonwin - Windows extensions (and an excellent code editor).
(I want to recommend learning assembler for beginners, since you'll understand exactly what's going on, but almost nobody cares about it these days.. sigh..) -
Developing on Windows, Unix style.Let's see. We need a compiler:
C:\>cl
Wow! That was tricky. Next we need a version control system. I don't like CVS (even though I know a Windows version is available), so let's try something a bit more modern:
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8804 for 80x86
Copyright (C) Microsoft Corp 1984-1998. All rights reserved.
usage: cl [ option... ] filename... [ /link linkoption... ]C:\>svn
Holy cow! We have a version control system installed.
Type 'svn help' for usage.
Now.. build system. How about something modern, cross-platform, that used Python scripts to control the build process...C:\>scons
Sweet! I guess I'm all set then! Here's how you can get all of the above - for free:
scons: *** No SConstruct file found.
File "c:\python23\scons\SCons\Script\__init__.py", line 794, in _main
* Scons build system (requires Python to be installed first).
* Subversion (SVN) version control system.
* Visual C++ 2003 Optimizing Compiler with the Windows Platform SDK.
* Microsoft Developer Network - free documentation and API reference (although this should be included in the platform SDK above).
* TortoiseSVN - a nice front-end to SVN on Windows. Included with the SVN installer by default.
* TortoiseMerge is included with TortoiseSVN, but you might also want to try WinMerge as an excellent stand-alone merge utility.
For editing code, you can use anything from Notepad to Edit to Emacs. I most frequently use the Microsoft Visual Studio IDE, but I also sometimes use the editor that comes with the Pythonwin extension package for Python as it also does syntax highlighting for C / C++ code.
Also note that any new programmers you hire with "Visual Studio" experience will be expecting to use the IDE. If you don't use external build tools, The VC project files are nothing more than text, so they can be merged quite nicely if you take a little time and effort. If you're each working on lots of different sections of code (and are used to having your own makefiles for each section), you can build libraries - each library having it's own .vcproj file so they can be edited independantly of the rest of the project. The sections are then brought together through a single solution (.sln). -
Developing on Windows, Unix style.Let's see. We need a compiler:
C:\>cl
Wow! That was tricky. Next we need a version control system. I don't like CVS (even though I know a Windows version is available), so let's try something a bit more modern:
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8804 for 80x86
Copyright (C) Microsoft Corp 1984-1998. All rights reserved.
usage: cl [ option... ] filename... [ /link linkoption... ]C:\>svn
Holy cow! We have a version control system installed.
Type 'svn help' for usage.
Now.. build system. How about something modern, cross-platform, that used Python scripts to control the build process...C:\>scons
Sweet! I guess I'm all set then! Here's how you can get all of the above - for free:
scons: *** No SConstruct file found.
File "c:\python23\scons\SCons\Script\__init__.py", line 794, in _main
* Scons build system (requires Python to be installed first).
* Subversion (SVN) version control system.
* Visual C++ 2003 Optimizing Compiler with the Windows Platform SDK.
* Microsoft Developer Network - free documentation and API reference (although this should be included in the platform SDK above).
* TortoiseSVN - a nice front-end to SVN on Windows. Included with the SVN installer by default.
* TortoiseMerge is included with TortoiseSVN, but you might also want to try WinMerge as an excellent stand-alone merge utility.
For editing code, you can use anything from Notepad to Edit to Emacs. I most frequently use the Microsoft Visual Studio IDE, but I also sometimes use the editor that comes with the Pythonwin extension package for Python as it also does syntax highlighting for C / C++ code.
Also note that any new programmers you hire with "Visual Studio" experience will be expecting to use the IDE. If you don't use external build tools, The VC project files are nothing more than text, so they can be merged quite nicely if you take a little time and effort. If you're each working on lots of different sections of code (and are used to having your own makefiles for each section), you can build libraries - each library having it's own .vcproj file so they can be edited independantly of the rest of the project. The sections are then brought together through a single solution (.sln).