Introduction to Python Programming Course Notes

Total Page:16

File Type:pdf, Size:1020Kb

Introduction to Python Programming Course Notes Introduction to Python Programming Course Notes Phil Spector Department of Statistics, University of California Berkeley March 16, 2005 2 Contents 1 Introduction 7 1.1 What is Python? . 7 1.2 The very Basics of Python . 8 1.3 Invoking Python . 8 1.4 Basic Principles of Python . 11 1.4.1 Basic Core Language . 11 1.4.2 Modules . 12 1.4.3 Object Oriented Programming . 12 1.4.4 Namespaces and Variable Scoping . 13 1.4.5 Exception Handling . 15 2 String Data 17 2.1 String Constants . 17 2.2 Special Characters and Raw Strings . 18 2.3 Unicode Strings . 19 2.4 String Operations . 19 2.4.1 Concatenation . 19 2.4.2 Repetition . 21 2.4.3 Indexing and Slicing . 21 2.4.4 Functions and Methods for Character Strings . 23 3 Numeric Data 29 3.1 Types of Numeric Data . 29 3.1.1 Hexadecimal and Octal Constants . 31 3.1.2 Numeric Operators . 31 3.1.3 Functions for Numeric Data . 32 3.2 Conversion of Scalar Types . 33 3 4 CONTENTS 4 Lists, Tuples and Dictionaries 37 4.1 List Data . 37 4.2 List Indexing and Slicing . 39 4.3 List Operators . 42 4.3.1 Concatenation . 42 4.3.2 Repetition . 43 4.3.3 The in operator . 43 4.4 Functions and Methods for Lists . 44 4.5 Tuple Objects . 48 4.6 Operators and Indexing for Tuples . 49 4.7 Functions and Methods for Tuples . 49 4.8 Dictionaries . 51 4.9 Functions and Methods for Dictionaries . 52 5 Input and Output 55 5.1 The print command . 55 5.2 Formatting Strings . 55 5.3 Using Names in Format Strings . 57 5.4 File Objects . 57 5.4.1 Methods for Reading . 59 5.4.2 Methods for Writing . 60 5.4.3 “Printing” to a File . 60 5.4.4 Other Methods . 61 5.4.5 File Object Variables . 61 5.5 Standard Input and Output Streams . 62 5.6 Pipes . 63 6 Programming 67 6.1 Assignments . 67 6.2 Indentation . 72 6.3 Truth, Falsehood and Logical Operators . 72 6.4 if statement . 74 6.5 for loops . 76 6.6 for loops and the range function . 78 6.7 while loops . 80 6.8 Control in Loops: break and continue ............. 82 6.9 List Comprehensions . 84 CONTENTS 5 7 Functions 87 7.1 Introduction . 87 7.2 Scoping: How Python finds your variables . 88 7.3 Function Basics . 92 7.4 Named Arguments and Default Values . 93 7.5 Variable Number of Arguments . 96 7.6 Functional Programming, and anonymous functions . 98 8 Using Modules 103 8.1 Introduction . 103 8.2 Namespaces . 104 8.3 Functions for working with modules . 106 8.4 The string module . 106 8.4.1 String Constants . 106 8.4.2 Functions in the string module . 107 8.5 The re module: Regular Expressions . 109 8.5.1 Introduction to Regular Expressions . 109 8.5.2 Constructing Regular Expressions . 109 8.5.3 Compiling Regular Expressions . 110 8.5.4 Finding Regular Expression Matches . 111 8.5.5 Tagging in Regular Expressions . 113 8.5.6 Using Named Groups for Tagging . 115 8.5.7 Greediness of Regular Expressions . 116 8.5.8 Multiple Matches . 117 8.5.9 Substitutions . 119 8.6 Operating System Services: os and shutil modules . 121 8.7 Expansion of Filename wildcards - the glob module . 125 8.8 Information about your Python session - the sys module . 126 8.9 Copying: the copy module . 127 8.10 Object Persistence: the pickle/cPickle and shelve modules 128 8.10.1 Pickling . 128 8.10.2 The shelve module . 130 8.11 CGI (Common Gateway Interface): the cgi module . 131 8.11.1 Introduction to CGI . 131 8.11.2 Security Concerns . 134 8.11.3 CGI Environmental Variables . 135 8.12 Accessing Documents on the Web: the urllib module . 135 6 CONTENTS 9 Exceptions 139 9.1 Introduction . 139 9.2 Tracebacks . 139 9.3 Dealing with Multiple Exceptions . 140 9.4 The Exception Hierarchy . 142 9.5 Raising Exceptions . 142 10 Writing Modules 147 10.1 Introduction . 147 10.2 An Example . 148 10.3 Test Programs for Modules . 150 10.4 Classes and Object Oriented Programming . 151 10.5 Operator Overloading . 152 10.6 Private Attributes . 153 10.7 A First Example of Classes . 153 10.8 Inheritance . 158 10.9 Adding Methods to the Basic Types . 163 10.10Iterators . 164 Chapter 1 Introduction 1.1 What is Python? Python is a high-level scripting language which can be used for a wide variety of text processing, system administration and internet-related tasks. Unlike many similar languages, it’s core language is very small and easy to mas- ter, while allowing the addition of modules to perform a virtually limitless variety of tasks. Python is a true object-oriented language, and is available on a wide variety of platforms. There’s even a python interpreter written entirely in Java, further enhancing python’s position as an excellent solution for internet-based problems. Python was developed in the early 1990’s by Guido van Rossum, then at CWI in Amsterdam, and currently at CNRI in Virginia. In some ways, python grew out of a project to design a computer language which would be easy for beginners to learn, yet would be powerful enough for even advanced users. This heritage is reflected in python’s small, clean syntax and the thor- oughness of the implementation of ideas like object-oriented programming, without eliminating the ability to program in a more traditional style. So python is an excellent choice as a first programming language without sacri- ficing the power and advanced capabilities that users will eventually need. Although pictures of snakes often appear on python books and websites, the name is derived from Guido van Rossum’s favorite TV show, “Monty Python’s Flying Circus”. For this reason, lots of online and print documen- tation for the language has a light and humorous touch. Interestingly, many experienced programmers report that python has brought back a lot of the 7 8 CHAPTER 1. INTRODUCTION fun they used to have programming, so van Rossum’s inspiration may be well expressed in the language itself. 1.2 The very Basics of Python There are a few features of python which are different than other program- ming languages, and which should be mentioned early on so that subsequent examples don’t seem confusing. Further information on all of these features will be provided later, when the topics are covered in depth. Python statements do not need to end with a special character – the python interpreter knows that you are done with an individual statement by the presence of a newline, which will be generated when you press the “Return” key of your keyboard. If a statement spans more than one line, the safest course of action is to use a backslash (\) at the end of the line to let python know that you are going to continue the statement on the next line; you can continue using backslashes on additional continuation lines. (There are situations where the backslashes are not needed which will be discussed later.) Python provides you with a certain level of freedom when composing a program, but there are some rules which must always be obeyed. One of these rules, which some people find very surprising, is that python uses in- dentation (that is, the amount of white space before the statement itself) to indicate the presence of loops, instead of using delimiters like curly braces ({}) or keywords (like “begin” and “end”) as in many other languages. The amount of indentation you use is not important, but it must be consistent within a given depth of a loop, and statements which are not indented must begin in the first column. Most python programmers prefer to use an edi- tor like emacs, which automatically provides consistent indentation; you will probably find it easier to maintain your programs if you use consistent in- dentation in every loop, at all depths, and an intelligent editor is very useful in achieving this. 1.3 Invoking Python There are three ways to invoke python, each with its’ own uses. The first way is to type “python” at the shell command prompt. This brings up the 1.3. INVOKING PYTHON 9 python interpreter with a message similar to this one: Python 2.2.1 (#2, Aug 27 2002, 09:01:47) [GCC 2.95.4 20011002 (Debian prerelease)] on linux2 Type "help", "copyright", "credits" or "license" for more information. The three greater-than signs (>>>) represent python’s prompt; you type your commands after the prompt, and hit return for python to execute them. If you’ve typed an executable statement, python will execute it immediately and display the results of the statement on the screen. For example, if I use python’s print statement to print the famous “Hello, world” greeting, I’ll immediately see a response: >>> print ’hello,world’ hello,world The print statement automatically adds a newline at the end of the printed string. This is true regardless of how python is invoked. (You can suppress the newline by following the string to be printed with a comma.) When using the python interpreter this way, it executes statements im- mediately, and, unless the value of an expression is assigned to a variable (See Section 6.1), python will display the value of that expression as soon as it’s typed. This makes python a very handy calculator: >>> cost = 27.00 >>> taxrate = .075 >>> cost * taxrate 2.025 >>> 16 + 25 + 92 * 3 317 When you use python interactively and wish to use a loop, you must, as always, indent the body of the loop consistently when you type your statements.
Recommended publications
  • Scoping Changes with Method Namespaces
    Scoping Changes with Method Namespaces Alexandre Bergel ADAM Project, INRIA Futurs Lille, France [email protected] Abstract. Size and complexity of software has reached a point where modular constructs provided by traditional object-oriented programming languages are not expressive enough. A typical situation is how to modify a legacy code without breaking its existing clients. We propose method namespaces as a visibility mechanism for behavioral refine- ments of classes (method addition and redefinition). New methods may be added and existing methods may be redefined in a method namespace. This results in a new version of a class accessible only within the defining method namespace. This mechanism, complementary to inheritance in object-orientation and tradi- tional packages, allows unanticipated changes while minimizing the impact on former code. Method Namespaces have been implemented in the Squeak Smalltalk system and has been successfully used to provide a translated version of a library without ad- versely impacting its original clients. We also provide benchmarks that demon- strate its application in a practical setting. 1 Introduction Managing evolution and changes is a critical part of the life cycle of all software sys- tems [BMZ+05, NDGL06]. In software, changes are modeled as a set of incremental code refinements such as class redefinition, method addition, and method redefinition. Class-based object-oriented programming languages (OOP) models code refinements with subclasses that contain behavioral differences. It appears that subclassing is well adapted when evolution is anticipated. For example, most design patterns and frame- works rely on class inheritance to express future anticipated adaptation and evolution. However, subclassing does not as easily help in expressing unanticipated software evo- lution [FF98a, BDN05b].
    [Show full text]
  • Pexpect Documentation Release 4.8
    Pexpect Documentation Release 4.8 Noah Spurrier and contributors Apr 17, 2021 Contents 1 Installation 3 1.1 Requirements...............................................3 2 API Overview 5 2.1 Special EOF and TIMEOUT patterns..................................6 2.2 Find the end of line – CR/LF conventions................................6 2.3 Beware of + and * at the end of patterns.................................7 2.4 Debugging................................................8 2.5 Exceptions................................................8 2.6 Pexpect on Windows...........................................9 3 API documentation 11 3.1 Core pexpect components........................................ 11 3.2 fdpexpect - use pexpect with a file descriptor.............................. 23 3.3 popen_spawn - use pexpect with a piped subprocess.......................... 23 3.4 replwrap - Control read-eval-print-loops................................. 24 3.5 pxssh - control an SSH session...................................... 25 4 Examples 33 5 FAQ 35 6 Common problems 39 6.1 Threads.................................................. 39 6.2 Timing issue with send() and sendline()................................. 39 6.3 Truncated output just before child exits................................. 40 6.4 Controlling SSH on Solaris....................................... 40 6.5 child does not receive full input, emits BEL............................... 40 7 History 41 7.1 Releases................................................. 41 7.2 Moves and forks............................................
    [Show full text]
  • Ajuba Solutions Version 1.4 COPYRIGHT Copyright © 1998-2000 Ajuba Solutions Inc
    • • • • • • Ajuba Solutions Version 1.4 COPYRIGHT Copyright © 1998-2000 Ajuba Solutions Inc. All rights reserved. Information in this document is subject to change without notice. No part of this publication may be reproduced, stored in a retrieval system, or transmitted in any form or by any means electronic or mechanical, including but not limited to photocopying or recording, for any purpose other than the purchaser’s personal use, without the express written permission of Ajuba Solutions Inc. Ajuba Solutions Inc. 2593 Coast Avenue Mountain View, CA 94043 U.S.A http://www.ajubasolutions.com TRADEMARKS TclPro and Ajuba Solutions are trademarks of Ajuba Solutions Inc. Other products and company names not owned by Ajuba Solutions Inc. that appear in this manual may be trademarks of their respective owners. ACKNOWLEDGEMENTS Michael McLennan is the primary developer of [incr Tcl] and [incr Tk]. Jim Ingham and Lee Bernhard handled the Macintosh and Windows ports of [incr Tcl] and [incr Tk]. Mark Ulferts is the primary developer of [incr Widgets], with other contributions from Sue Yockey, John Sigler, Bill Scott, Alfredo Jahn, Bret Schuhmacher, Tako Schotanus, and Kris Raney. Mark Diekhans and Karl Lehenbauer are the primary developers of Extended Tcl (TclX). Don Libes is the primary developer of Expect. TclPro Wrapper incorporates compression code from the Info-ZIP group. There are no extra charges or costs in TclPro due to the use of this code, and the original compression sources are freely available from http://www.cdrom.com/pub/infozip or ftp://ftp.cdrom.com/pub/infozip. NOTE: TclPro is packaged on this CD using Info-ZIP’s compression utility.
    [Show full text]
  • Chapter 4 Programming in Perl
    Chapter 4 Programming in Perl 4.1 More on built-in functions in Perl There are many built-in functions in Perl, and even more are available as modules (see section 4.4) that can be downloaded from various Internet places. Some built-in functions have already been used in chapter 3.1 and some of these and some others will be described in more detail here. 4.1.1 split and join (+ qw, x operator, \here docs", .=) 1 #!/usr/bin/perl 2 3 $sequence = ">|SP:Q62671|RATTUS NORVEGICUS|"; 4 5 @parts = split '\|', $sequence; 6 for ( $i = 0; $i < @parts; $i++ ) { 7 print "Substring $i: $parts[$i]\n"; 8 } • split is used to split a string into an array of substrings. The program above will write out Substring 0: > Substring 1: SP:Q62671 Substring 2: RATTUS NORVEGICUS • The first argument of split specifies a regular expression, while the second is the string to be split. • The string is scanned for occurrences of the regexp which are taken to be the boundaries between the sub-strings. 57 58 CHAPTER 4. PROGRAMMING IN PERL • The parts of the string which are matched with the regexp are not included in the substrings. • Also empty substrings are extracted. Note, however that trailing empty strings are removed by default. • Note that the | character needs to be escaped in the example above, since it is a special character in a regexp. • split returns an array and since an array can be assigned to a list we can write: splitfasta.ply 1 #!/usr/bin/perl 2 3 $sequence=">|SP:Q62671|RATTUS NORVEGICUS|"; 4 5 ($marker, $code, $species) = split '\|', $sequence; 6 ($dummy, $acc) = split ':', $code; 7 print "This FastA sequence comes from the species $species\n"; 8 print "and has accession number $acc.\n"; splitfasta.ply • It is not uncommon that we want to write out long pieces of text using many print statements.
    [Show full text]
  • Functional Languages
    Functional Programming Languages (FPL) 1. Definitions................................................................... 2 2. Applications ................................................................ 2 3. Examples..................................................................... 3 4. FPL Characteristics:.................................................... 3 5. Lambda calculus (LC)................................................. 4 6. Functions in FPLs ....................................................... 7 7. Modern functional languages...................................... 9 8. Scheme overview...................................................... 11 8.1. Get your own Scheme from MIT...................... 11 8.2. General overview.............................................. 11 8.3. Data Typing ...................................................... 12 8.4. Comments ......................................................... 12 8.5. Recursion Instead of Iteration........................... 13 8.6. Evaluation ......................................................... 14 8.7. Storing and using Scheme code ........................ 14 8.8. Variables ........................................................... 15 8.9. Data types.......................................................... 16 8.10. Arithmetic functions ......................................... 17 8.11. Selection functions............................................ 18 8.12. Iteration............................................................. 23 8.13. Defining functions ...........................................
    [Show full text]
  • Practical Perl Tools: Scratch the Webapp Itch With
    last tIme, we had the pleasure oF exploring the basics of a Web applica- DaviD n. BLank-EdeLman tion framework called CGI::Application (CGI::App). I appreciate this particular pack- age because it hits a certain sweet spot in practical Perl tools: terms of its complexity/learning curve and scratch the webapp itch with power. In this column we’ll finish up our exploration by looking at a few of the more CGI::Application, part 2 powerful extensions to the framework that David N. Blank-Edelman is the director of can really give it some oomph. technology at the Northeastern University College of Computer and Information Sci- ence and the author of the O’Reilly book Quick review Automating System Administration with Perl (the second edition of the Otter book), Let’s do a really quick review of how CGI::App available at purveyors of fine dead trees works, so that we can build on what we’ve learned everywhere. He has spent the past 24+ years as a system/network administrator in large so far. CGI::App is predicated on the notion of “run multi-platform environments, including modes.” When you are first starting out, it is easi- Brandeis University, Cambridge Technology est to map “run mode” to “Web page” in your head. Group, and the MIT Media Laboratory. He was the program chair of the LISA ’05 confer- You write a piece of code (i.e., a subroutine) that ence and one of the LISA ’06 Invited Talks will be responsible for producing the HTML for co-chairs.
    [Show full text]
  • Higher-Order Functions 15-150: Principles of Functional Programming – Lecture 13
    Higher-order Functions 15-150: Principles of Functional Programming { Lecture 13 Giselle Reis By now you might feel like you have a pretty good idea of what is going on in functional program- ming, but in reality we have used only a fragment of the language. In this lecture we see what more we can do and what gives the name functional to this paradigm. Let's take a step back and look at ML's typing system: we have basic types (such as int, string, etc.), tuples of types (t*t' ) and functions of a type to a type (t ->t' ). In a grammar style (where α is a basic type): τ ::= α j τ ∗ τ j τ ! τ What types allowed by this grammar have we not used so far? Well, we could, for instance, have a function below a tuple. Or even a function within a function, couldn't we? The following are completely valid types: int*(int -> int) int ->(int -> int) (int -> int) -> int The first one is a pair in which the first element is an integer and the second one is a function from integers to integers. The second one is a function from integers to functions (which have type int -> int). The third type is a function from functions to integers. The two last types are examples of higher-order functions1, i.e., a function which: • receives a function as a parameter; or • returns a function. Functions can be used like any other value. They are first-class citizens. Maybe this seems strange at first, but I am sure you have used higher-order functions before without noticing it.
    [Show full text]
  • Investigating Powershell Attacks
    Investigating PowerShell Attacks Black Hat USA 2014 August 7, 2014 PRESENTED BY: Ryan Kazanciyan, Matt Hastings © Mandiant, A FireEye Company. All rights reserved. Background Case Study WinRM, Victim VPN SMB, NetBIOS Attacker Victim workstations, Client servers § Fortune 100 organization § Command-and-control via § Compromised for > 3 years § Scheduled tasks § Active Directory § Local execution of § Authenticated access to PowerShell scripts corporate VPN § PowerShell Remoting © Mandiant, A FireEye Company. All rights reserved. 2 Why PowerShell? It can do almost anything… Execute commands Download files from the internet Reflectively load / inject code Interface with Win32 API Enumerate files Interact with the registry Interact with services Examine processes Retrieve event logs Access .NET framework © Mandiant, A FireEye Company. All rights reserved. 3 PowerShell Attack Tools § PowerSploit § Posh-SecMod § Reconnaissance § Veil-PowerView § Code execution § Metasploit § DLL injection § More to come… § Credential harvesting § Reverse engineering § Nishang © Mandiant, A FireEye Company. All rights reserved. 4 PowerShell Malware in the Wild © Mandiant, A FireEye Company. All rights reserved. 5 Investigation Methodology WinRM PowerShell Remoting evil.ps1 backdoor.ps1 Local PowerShell script Persistent PowerShell Network Registry File System Event Logs Memory Traffic Sources of Evidence © Mandiant, A FireEye Company. All rights reserved. 6 Attacker Assumptions § Has admin (local or domain) on target system § Has network access to needed ports on target system § Can use other remote command execution methods to: § Enable execution of unsigned PS scripts § Enable PS remoting © Mandiant, A FireEye Company. All rights reserved. 7 Version Reference 2.0 3.0 4.0 Requires WMF Requires WMF Default (SP1) 3.0 Update 4.0 Update Requires WMF Requires WMF Default (R2 SP1) 3.0 Update 4.0 Update Requires WMF Default 4.0 Update Default Default Default (R2) © Mandiant, A FireEye Company.
    [Show full text]
  • 1. Introduction to Structured Programming 2. Functions
    UNIT -3Syllabus: Introduction to structured programming, Functions – basics, user defined functions, inter functions communication, Standard functions, Storage classes- auto, register, static, extern,scope rules, arrays to functions, recursive functions, example C programs. String – Basic concepts, String Input / Output functions, arrays of strings, string handling functions, strings to functions, C programming examples. 1. Introduction to structured programming Software engineering is a discipline that is concerned with the construction of robust and reliable computer programs. Just as civil engineers use tried and tested methods for the construction of buildings, software engineers use accepted methods for analyzing a problem to be solved, a blueprint or plan for the design of the solution and a construction method that minimizes the risk of error. The structured programming approach to program design was based on the following method. i. To solve a large problem, break the problem into several pieces and work on each piece separately. ii. To solve each piece, treat it as a new problem that can itself be broken down into smaller problems; iii. Repeat the process with each new piece until each can be solved directly, without further decomposition. 2. Functions - Basics In programming, a function is a segment that groups code to perform a specific task. A C program has at least one function main().Without main() function, there is technically no C program. Types of C functions There are two types of functions in C programming: 1. Library functions 2. User defined functions 1 Library functions Library functions are the in-built function in C programming system. For example: main() - The execution of every C program starts form this main() function.
    [Show full text]
  • GNU Grep: Print Lines That Match Patterns Version 3.7, 8 August 2021
    GNU Grep: Print lines that match patterns version 3.7, 8 August 2021 Alain Magloire et al. This manual is for grep, a pattern matching engine. Copyright c 1999{2002, 2005, 2008{2021 Free Software Foundation, Inc. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is included in the section entitled \GNU Free Documentation License". i Table of Contents 1 Introduction ::::::::::::::::::::::::::::::::::::: 1 2 Invoking grep :::::::::::::::::::::::::::::::::::: 2 2.1 Command-line Options ::::::::::::::::::::::::::::::::::::::::: 2 2.1.1 Generic Program Information :::::::::::::::::::::::::::::: 2 2.1.2 Matching Control :::::::::::::::::::::::::::::::::::::::::: 2 2.1.3 General Output Control ::::::::::::::::::::::::::::::::::: 3 2.1.4 Output Line Prefix Control :::::::::::::::::::::::::::::::: 5 2.1.5 Context Line Control :::::::::::::::::::::::::::::::::::::: 6 2.1.6 File and Directory Selection:::::::::::::::::::::::::::::::: 7 2.1.7 Other Options ::::::::::::::::::::::::::::::::::::::::::::: 9 2.2 Environment Variables:::::::::::::::::::::::::::::::::::::::::: 9 2.3 Exit Status :::::::::::::::::::::::::::::::::::::::::::::::::::: 12 2.4 grep Programs :::::::::::::::::::::::::::::::::::::::::::::::: 13 3 Regular Expressions ::::::::::::::::::::::::::: 14 3.1 Fundamental Structure ::::::::::::::::::::::::::::::::::::::::
    [Show full text]
  • Typescript Language Specification
    TypeScript Language Specification Version 1.8 January, 2016 Microsoft is making this Specification available under the Open Web Foundation Final Specification Agreement Version 1.0 ("OWF 1.0") as of October 1, 2012. The OWF 1.0 is available at http://www.openwebfoundation.org/legal/the-owf-1-0-agreements/owfa-1-0. TypeScript is a trademark of Microsoft Corporation. Table of Contents 1 Introduction ................................................................................................................................................................................... 1 1.1 Ambient Declarations ..................................................................................................................................................... 3 1.2 Function Types .................................................................................................................................................................. 3 1.3 Object Types ...................................................................................................................................................................... 4 1.4 Structural Subtyping ....................................................................................................................................................... 6 1.5 Contextual Typing ............................................................................................................................................................ 7 1.6 Classes .................................................................................................................................................................................
    [Show full text]
  • Cygwin User's Guide
    Cygwin User’s Guide Cygwin User’s Guide ii Copyright © Cygwin authors Permission is granted to make and distribute verbatim copies of this documentation provided the copyright notice and this per- mission notice are preserved on all copies. Permission is granted to copy and distribute modified versions of this documentation under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one. Permission is granted to copy and distribute translations of this documentation into another language, under the above conditions for modified versions, except that this permission notice may be stated in a translation approved by the Free Software Foundation. Cygwin User’s Guide iii Contents 1 Cygwin Overview 1 1.1 What is it? . .1 1.2 Quick Start Guide for those more experienced with Windows . .1 1.3 Quick Start Guide for those more experienced with UNIX . .1 1.4 Are the Cygwin tools free software? . .2 1.5 A brief history of the Cygwin project . .2 1.6 Highlights of Cygwin Functionality . .3 1.6.1 Introduction . .3 1.6.2 Permissions and Security . .3 1.6.3 File Access . .3 1.6.4 Text Mode vs. Binary Mode . .4 1.6.5 ANSI C Library . .4 1.6.6 Process Creation . .5 1.6.6.1 Problems with process creation . .5 1.6.7 Signals . .6 1.6.8 Sockets . .6 1.6.9 Select . .7 1.7 What’s new and what changed in Cygwin . .7 1.7.1 What’s new and what changed in 3.2 .
    [Show full text]