background preloader

Programming etc.

Facebook Twitter

Electrical Engineering and Computer Science | 6.00 Introduction to Computer Science and Programming, Fall 2008 | Assignments. Project Euler. 5. Built-in Types — Python v2.7.2 documentation. The following sections describe the standard types that are built into the interpreter. Note Historically (until release 2.2), Python’s built-in types have differed from user-defined types because it was not possible to use the built-in types as the basis for object-oriented inheritance. This limitation no longer exists. The principal built-in types are numerics, sequences, mappings, files, classes, instances and exceptions. Some operations are supported by several object types; in particular, practically all objects can be compared, tested for truth value, and converted to a string (with the repr() function or the slightly different str() function). 5.1. Any object can be tested for truth value, for use in an if or while condition or as operand of the Boolean operations below.

All other values are considered true — so objects of many types are always true. 5.2. These are the Boolean operations, ordered by ascending priority: Notes: 5.3. Comparison operations are supported by all objects. ! Minecraft Config Editor: Tkinter Text Widget and Frames « Python Tutorials for Kids 8+ Furtively he looks round, then takes from the desk drawer a comic-book entitled ‘Thrills and Adventure’. We see the frames of the comic strip. A Superman-type character and a girl are shrinking from an explosion. She is saying ‘My God, his nose just exploded with enough force to destroy his kleenex’. In the next frame, the Superman character is saying ‘If only I had a kleenex to lend him – or even a linen handkerchief – but these trousers…!! No back pocket!’ Last tutorial we covered ‘parsing’. Let’s start thinking about how a single key/value pair will look. Here we first create a Tk() object, then create a label widget and a text widget in that object.

If I run this code I get something like this: Which is sort of what I wanted – a label on the left, and an editable text box on the right (can you see the cursor in the screen shot?) Exercise: Type something into the text box. However, this isn’t really what I wanted. Here is a revised version which is nearer to what I was looking for: Pyjamas. Pyjamas is a toolkit and applications framework, for the Web. (see PyjamasDesktop for the desktop version). Pyjamas comprises a widget set, a library containing "AJAX tricks", and a python-to-javascript compiler. Although it can be helpful, no knowledge of CSS stylesheets, HTML, Javascript or AJAX is required to develop comprehensive applications very quickly. Just like the other webkits such as Yahoo's YUI and Google's GWT, Pyjamas' AJAX library provides you with all of the tricks of the Web trade (from Opera, Netscape, IE, Firefox and Safari) so that you don't have to know any of them.

You can therefore focus on developing your application as if the user's browser was truly a platform-independent Desktop development environment, rather than a web browser. Pyjamas' underlying widget set is very similar in concept to that of KiWi, with the difference being that it targets the Web rather than Desktop. If you want your Pyjamas application to run on the desktop, you can - unmodified! Pyjamas - Python Javascript Compiler, Desktop Widget Set and RIA Web Framework. Foundations: The Ministry of Silly Objects « Python Tutorials for Kids 8+ DENNIS: What I object to is that you automatically treat me like an inferior!

ARTHUR: Well, I am king! (Scene 3) This post is about “objects”. Not everyday sort of objects that you can touch. Programming objects. ... fileObject = open(nameOfFile,'w') >>> # fileObject is a file object ... # the open() function creates a file ... # and then ... # it opens the file for writing - 'w' ... # if the file already exists it just opens it >>> # see, now it exists >>> # let's write something to it: ... testMessage='This is a test message' >>> >>> fileObject.write(testMessage) >>> # after we've finished with a file we should close() it ... fileObject.close() The variable fileObject stores an object in much the same way as other variables store data - that is, they point to the object. ... fileObject.close() The object connected to a function (actually called a "method" in this context) using a dot. FileObject.write() ^ |----- Can you see the dot?

FileObject.name fileObject.mode Clean up: Confusing bit: Python Programming Tutorial - 2 - Numbers and Math. 20+ Computer Science Programming Online Courses | Free Download. Fundamentals of Java. Fundamentals of Java. Introduction to computer programming. Java tutorials. 1.3 - Introduction to Programming the ez430. Representing and manipulating data in computers. Data and processes in computing. Learn Python The Hard Way, 2nd Edition — Learn Python The Hard Way, 2nd Edition. Python Tutorials for Kids 8+ Lec 1 | MIT 6.01SC Introduction to Electrical Engineering and Computer Science I, Spring 2011. Lec 3 | MIT 6.00 Introduction to Computer Science and Programming, Fall 2008.