Python 20021080 Hyunjong Lee. contents  Introduction  Syntax & data types  Tools  Python as CGI.

Slides:



Advertisements
Similar presentations
Chapter 7 JavaScript: Introduction to Scripting. Outline Simple Programs Objects and Variables Obtaining User Input with prompt Dialogs – –Dynamic Welcome.
Advertisements

Copyright © 2004 ProsoftTraining, All Rights Reserved. Lesson 11: Advanced Web Technologies.
1 I256: Applied Natural Language Processing Marti Hearst Aug 30, 2006.
건전지로 달리는 쟝고 세미나. 정재성 Django Web Framework CGI.
Web Technologies Using the Internet to publish data and applications.
A Crash Course Python. Python? Isn’t that a snake? Yes, but it is also a...
28/1/2001 Seminar in Databases in the Internet Environment Introduction to J ava S erver P ages technology by Naomi Chen.
CIS-5301 Introduction to Python Edward Loper. CIS-5302 Outline Data –strings, variables, lists, dictionaries Control Flow Working with files Modules Functions.
Kashif Jalal CA-240 (072) Web Development Using ASP.NET CA – 240 Kashif Jalal Welcome to week – 2 of…
Python By Steve Wright. What is Python? Simple, powerful, GP scripting language Simple, powerful, GP scripting language Object oriented Object oriented.
Python Brandon Jeffcoat Dashaun West “Why settle for snake oil when you can have the whole snake?” -- From Usenet posting by Mark Jackson, June 1998.
Introduction to Python. Outline Python IS ……. History Installation Data Structures Flow of Control Functions Modules References.
Python Jordan Miller and Lauren Winkleman CS 311 Fall 2011.
PHP Scripts HTML Forms Two-tier Software Architecture PHP Tools.
Python Web Applications A KISS Introduction. Web Applications with Python Fetching, parsing, text processing Database client – mySQL, etc., for building.
 2004 Prentice Hall, Inc. All rights reserved. Chapter 25 – Perl and CGI (Common Gateway Interface) Outline 25.1 Introduction 25.2 Perl 25.3 String Processing.
Python Introduction.
Server Side Scripting Norman White. Where do we do processing? Client side – Javascript (embed code in html) – Java applets (send java program to run.
Programming 101 with Python: an open-source, cross-platform, and fun language By J. Burton Browning, Ed.D. Copyright © J. Burton Browning All rights reserved.
M. Taimoor Khan * Java Server Pages (JSP) is a server-side programming technology that enables the creation of dynamic,
4.1 JavaScript Introduction
NETWORK CENTRIC COMPUTING (With included EMBEDDED SYSTEMS)
 2004 Prentice Hall, Inc. All rights reserved. Chapter 35 – Python Outline 35.1 Introduction First Python Program Python Keywords 35.2 Basic.
CSE3310: Web training A JumpStart for Project.
Basics of Web Databases With the advent of Web database technology, Web pages are no longer static, but dynamic with connection to a back-end database.
Liang, Introduction to Java Programming, Ninth Edition, (c) 2013 Pearson Education, Inc. All rights reserved. 1 Chapter 1 Introduction to Computer Science.
General Computer Science for Engineers CISC 106 Lecture 02 Dr. John Cavazos Computer and Information Sciences 09/03/2010.
Python 0 Some material adapted from Upenn cmpe391 slides and other sources.
1 Python CIS*2450 Advanced Programming Concepts Material for this lecture was developed by Dr. D. Calvert.
Introduction to PythonIntroduction to Python SPARCS `08 서우석 (pipoket) `09 Summer SP ARCS Seminar`09 Summer SP ARCS Seminar.
Python MySQL Database Access
Class 1Intro to Databases Goals of this class Understand the architecture behind web database applications Gain a basic understanding of what relational.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley STARTING OUT WITH Python Python First Edition by Tony Gaddis Chapter 6 Value-Returning.
An overview of scripting languages Alexander Kanavin Teachers: Barbara Miraftabi, Jan Voracek.
Technical Review - PHP Jang Jaeseok. Overview Introduction  What is PHP?  History of PHP  What can do with PHP?  Advantages of PHP PHP syntax.
Extending HTML CPSC 120 Principles of Computer Science April 9, 2012.
Python. By Jawad. What Is Python? Python is an open-source object-orientated scripting language. Python is good for embedding snippets to run a program.
C463 / B551 Artificial Intelligence Dana Vrajitoru Python.
Abstracting and alternatives for XBRL implementation Abstracting the XBRL Formula Piotr Malczak (GPM Systemy) April 22, 2010.
OCR GCSE Computing © Hodder Education 2013 Slide 1 OCR GCSE Computing Python programming 1: Introduction.
הרצאה 4. עיבוד של דף אינטרנט דינמי מתוך Murach’s PHP and MySQL by Joel Murach and Ray Harris.  דף אינטרנט דינמי משתנה עפ " י הרצת קוד על השרת, יכול להשתנות.
CS562 Advanced Java and Internet Application Introduction to the Computer Warehouse Web Application. Java Server Pages (JSP) Technology. By Team Alpha.
Class 1Intro to Databases Goals of this class Understand the architecture behind web database applications Gain a basic understanding of what relational.
1. COMPUTERS AND PROGRAMS Rocky K. C. Chang September 6, 2015 (Adapted from John Zelle’s slides)
10 Copyright © 2004, Oracle. All rights reserved. Building ADF View Components.
Alexandria University Faculty of Science Computer Science Department Introduction to Programming C++
Dept. of Animal Breeding and Genetics Programming basics & introduction to PERL Mats Pettersson.
Web Page Designing With Dreamweaver MX\Session 1\1 of 9 Session 1 Introduction to PHP Hypertext Preprocessor - PHP.
CSE3310: Web training A JumpStart for Project. Outline Introduction to Website development Web Development Languages How to build simple Pages in PHP.
Python Programming Language by Vasu Chetty. Origins of Python Created by: Guido van Rossum, a Dutch Programmer Created during: Christmas Break, 1989 Created.
Python Joseph Eckstrom, Benjamin Moore, Willis Kornegay.
Sending data with CGI/Perl Please use speaker notes for additional information!
Lesson 11. CGI CGI is the interface between a Web page or browser and a Web server that is running a certain program/script. The CGI (Common Gateway Interface)
PHP Basics and Syntax Lesson 3 ITBS2203 E-Commerce for IT.
Internet/Web Databases
Fundamentals of Programming I Overview of Programming
Python: Experiencing IDLE, writing simple programs
Web Applications Security What are web Applications?
Introduction to Advance Web Technologies
Python is a general-purpose interpreted, interactive, object-oriented, and high-level programming language. It was created by Guido van Rossum during.
PHP / MySQL Introduction
Introduction to Python
Introduction to Python
Python Primer 2: Functions and Control Flow
Tutorial 6 PHP & MySQL Li Xu
Python Syntax Errors and Exceptions
General Computer Science for Engineers CISC 106 Lecture 03
Product Training Program
Web Application Development Using PHP
PYTHON - VARIABLES AND OPERATORS
Presentation transcript:

Python Hyunjong Lee

contents  Introduction  Syntax & data types  Tools  Python as CGI

Introduction  Developed by Guido Van Rossum in 1990  Interpret based language  Has simple syntax  Dynamic type binding  Embedded high level data structure  Garbage collection  Module structure (glue language)  Fast development cycle

Syntax  Syntax is very simple  Similar to most of other languages  Indentation sensitive

High level built-in data types  Complex number  List (can be nested)  Tuples  Dictionary

Tools  Py2exe – convert python script into exe file  Python2c – convert python script into C source file  SWIG(simplified wrapper and interface generator) – glue code generator

Python as CGI  #!/usr/bin/python import cgi#import CGI module print "Content-Type: text/plain\n\n" The_Form = cgi.FieldStorage() for name in The_Form.keys(): print "Input: " + name print " value: " + The_Form[name].value + “\n” print "Finished!“  name:  name:

Python as CGI  template.html <html><head> Python is Fun! Python is Fun! </head><body> </body></html>

Python as CGI  #!/usr/bin/python  #!/usr/bin/python import re #import regular expression module import cgi TemplateFile = "template.html" # Display function def def Display(Content): fp = open(TemplateFile, "r") TemplateInput = fp.read() #open & read entire file fp.close() BadTemplateException = “problem in template file" SubResult = re.subn(" ", Content,TemplateInput) if SubResult[1] == 0: raise BadTemplateException print "Content-Type: text/html\n\n“ print SubResult[0] #make dynamic contents here …

Python as CGI  import MySQLdb# import SQL module connection = MySQLdb.connect(user=‘uuu', passwd=‘ppp', db=‘db') cursor = connection.cursor() cursor.execute(“SELECT * FROM some_table”) cursor.close()

References 