Introduction to Programming Languages Lecture 2 (cod2271-INE-2) PDF

Summary

This document provides an introduction to programming languages, focusing on fundamental concepts and examples. It covers data input and manipulation, and introduces Python programming and different types of programming languages. It also provides examples of program codes in Small Basic.

Full Transcript

Introduction to Programming Language Data Input and Manipulation 2271-INE-2 DATA INPUT AND MANIPULATION (2271-INE-2) Introduction Python Programming Language LEARNING OBJECTIVES Become familiar with the terminologies used in programming languages and coding....

Introduction to Programming Language Data Input and Manipulation 2271-INE-2 DATA INPUT AND MANIPULATION (2271-INE-2) Introduction Python Programming Language LEARNING OBJECTIVES Become familiar with the terminologies used in programming languages and coding. Acquire a fundamental understanding of programming and software. DATA INPUT AND MANIPULATION (2271-INE-2) Introduction Python Programming Language LEARNING OBJECTIVES Know how interpreters and compilers facilitate collaboration between a computer’s hardware and software in the system’s architecture. Overview of the Python Integrated and Learning Environment. Ability to use Python as a scripting language. Provide awareness about Python programming resources. Overview of Python documentation and Support. DATA INPUT AND MANIPULATION (2271-INE-2) Introduction to Programming Language Computer programming Computer Programming is defined as the process of creating computer software using a programming Language. Computer programs are written by Human individuals(Programmers) A computer program is a step by step set of instructions that a computer has to work through in a logical sequence in order to carry out a particular task. The computer executes these instructions (obeys the instructions) when told to do so by the user. DATA INPUT AND MANIPULATION (2271-INE-2) Introduction to Programming Language Programming Languages Programming languages are the vocabulary and set of grammatical rules for instructing a computer to perform specific tasks. There are many different types of programming languages each having a unique set of keywords (words that it understands) and a special syntax (grammar)for organising program instructions. DATA INPUT AND MANIPULATION (2271-INE-2) Introduction to Programming Language Syntax Syntax refers to the spelling and grammar of a programming language. Each program defines its own syntactical rules that control which words the computer understands, which combinations of words are meaningful, and what punctuation is necessary. Text-based programming languages are based on sequences of characters, while visual programming languages are based on the spatial layout and connections between symbols (which may be textual or graphical). DATA INPUT AND MANIPULATION (2271-INE-2) Introduction to Programming Language Example of a program code (small basic) TextWindow.Writeline("enter the Temperature in fahrenheit ") fahr = TextWindow.ReadNumber() celsius = (5 * (fahr - 32) / 9) TextWindow.WriteLine("This Temperature in celcius is " + celsius +" degrees") DATA INPUT AND MANIPULATION (2271-INE-2) Introduction to Programming Language Example of a program code (small basic) This code in previous example of a simple program written in Small Basic, a beginner-friendly programming language designed to teach basic programming concepts. Here's a breakdown of what each line does: Code Explanation: 1. TextWindow.Writeline("enter the Temperature in fahrenheit ")  This displays the message "enter the Temperature in fahrenheit " in the console or text window.  It prompts the user to input a temperature in Fahrenheit. 2. fahr = TextWindow.ReadNumber()  This waits for the user to input a numeric value (the temperature in Fahrenheit) and assigns it to the variable fahr. 3. celsius = (5 * (fahr - 32) / 9)  This calculates the equivalent temperature in Celsius using the formula: Celsius=59×(Fahrenheit−32)Celsius= 95​ ×(Fahrenheit−32) 4. TextWindow.WriteLine("This Temperature in celcius is " + celsius +" degrees")  This outputs the result in Celsius to the console or text window.  The message includes the calculated Celsius value (celsius) and appends " degrees" to make the output clear and user-friendly. Introduction to Programming Language Small Basic TextWindow.Write("Enter the temperature today (in F):") temp = TextWindow.ReadNumber() If temp > 100 Then TextWindow.WriteLine("It is pretty hot.") ElseIf temp > 70 Then TextWindow.WriteLine("It is pretty nice.") ElseIf temp > 50 Then TextWindow.WriteLine("Don't forget your coat.") Else TextWindow.WriteLine("Stay home.") EndIf DATA INPUT AND MANIPULATION (2271-INE-2) Introduction to Programming Language Levels of programming languages There are many computer programming languages and so the programmer will have to decide which one to use for solving a particular problem. These languages must be learnt just as Swahili, English or French etc. Programming languages are classified into five major categories: machine languages (first generation languages), assembly languages (second generation languages), third generation languages, fourth generation languages, and natural languages. Machine and assembly languages are referred to as low level languages; third generation, fourth generation and natural languages are categorised as high level languages. DATA INPUT AND MANIPULATION (2271-INE-2) Introduction to Programming Language Levels of programming languages A low level language is machine dependent; that is, it is written to run on one particular computer. A high level language is machine independent, which means the high level language code can run on many different types of computer. There are two types of low-level programming languages: Machine Language and Assembly Language. DATA INPUT AND MANIPULATION (2271-INE-2) Introduction to Programming Language Machine language – First Generation Language (1GL) The machine language writes programs using the machine code of 1s and 0s, which is directly understood by the computer. The main problems with using machine code directly are that it is very easy to make a mistake, and very hard to find it once you realise the mistake has been made. DATA INPUT AND MANIPULATION (2271-INE-2) Introduction to Programming Language Characteristics of 1GL Fastest to execute because it is already in the language that the computer can understand Difficult to interpret (requires the aid of a reference manual to interpret the meaning of each code) Easy to make mistakes in the sequence of 1s and 0s; replacing a 1 for a 0 can result in the wrong command/instruction being executed It is difficult to identify mistakes made Time-consuming and tedious to write Machine dependent Programing becomes more difficult as the complexity of the program increases DATA INPUT AND MANIPULATION (2271-INE-2) Introduction to Programming Language Assembly language – Second Generation Language (2GL) Assembly language is written using mnemonic codes (abbreviated English words) or short codes that suggest their meaning and are therefore easier to remember. These codes represent operations, addresses that relate to main memory, and storage registers of the computer. Typical codes might be: LDA, STO, ADD, NOP, etc. DATA INPUT AND MANIPULATION (2271-INE-2) Introduction to Programming Language Assembly language – Second Generation Language (2GL) An example of a program code to add and store two numbers would be: LDA A, 20 : load accumulator A with the value 20 ADD A, 10 : add the value 10 to accumulator A STO B, A : store contents of accumulator A into storage register B NOP : no operation (stop here) DATA INPUT AND MANIPULATION (2271-INE-2) Introduction to Programming Language Characteristics of 2GL As with machine language, assembly language is machine dependent. Assembly language, being machine dependent, is faster and more efficient in the use of hardware than high-level programming languages. Assembly languages have to be translated into machine language by language translators known as assemblers for the processor to understand. Easier to write than machine language The code is not very easy to understand, hence the introduction of high level programming languages. DATA INPUT AND MANIPULATION (2271-INE-2) Introduction to Programming Language High-level programming languages High level programming language is defined as one that is machine independent and uses variables and objects, Boolean expressions, functions, loops, arrays, threads, locks which are similar to their meaning (abstraction). High-level languages have evolved over the years and can be grouped into five categories: Third Generation Languages (3GL), Fourth Generation Languages (4GL), Object Oriented Programming Languages (OOP), Fifth Generation Languages (5GL) and Scripting Languages DATA INPUT AND MANIPULATION (2271-INE-2) Introduction to Programming Language High-level programming languages These languages are problem oriented, so they are machine independent. Since high-level languages reflect the logic and procedures used in a human algorithm, the programmer is able to concentrate on developing task algorithms rather than on how the computer will carry out the instructions. the programmer must still specify a complete set of detailed instructions. The words and grammar of high-level languages are English-like and this makes the programs more readable and easy to write. DATA INPUT AND MANIPULATION (2271-INE-2) Introduction to Programming Language High-level programming languages high-level languages are machine independent (they can be used on different computer systems); Since the syntaxes of high-level languages are standardised, the languages are portable. A high-level language is governed by a strict syntax (set of grammatical rules). they are easier to read, write, and maintain. They also permit faster development of large programs. programs written in a high-level language must be translated into machine language by a compiler or interpreter. DATA INPUT AND MANIPULATION (2271-INE-2) Introduction to Programming Language Characteristics of high-level languages They are machine independent hence portable They are user friendly and easy to learn High-level language programs are easy to debug They are more flexible hence they enhance the creativity of the programmer, increasing productivity They are executed much slower than low-level programming languages They have to be translated into machine code before execution, this is done by compilers and Assemblers. One instruction translates into several machine code instructions DATA INPUT AND MANIPULATION (2271-INE-2) Introduction to Programming Language Major high level programming languages used FORTRAN (FOTmula TRAnslator)developed in the late 1950s developed to design scientific applications COBOL (Common Business Oriented Language) developed in early 1960s to develop business applications. RPG (Report Program generator) was developed in early 1960s to assist in generating reports and complex calculations. BASIC (Beginner’s All-purpose symbolic instruction code) developed in mid 1960 Basic versions include MS-BASIC, QBASIC, SmallBASIC and visual basic. Pascal was developed in the late 1960s for the purpose of teaching structured programming concepts DATA INPUT AND MANIPULATION (2271-INE-2) Introduction to Programming Language Major high level programming languages used C developed in the early 1970s to write system software Ada was developed in the late 1970s originally developed to meet the needs of embedded computer systems C++ developed in the 1980s is an object-oriented language mainly to develop application software There are many other programming languages that have been developed such as JavaScript, and Python DATA INPUT AND MANIPULATION (2271-INE-2) Introduction to Programming Language Language Translators Language translators are system programs that convert assembly language and high-level language into the machine language. The computer does not understand assembly languages or high-level languages. Computers work in machine code or machine language. Source code Source code is a program code of either an assembly language or high- level language that the programmers write in a program editor.  Source code cannot be understood by the computer until it has been translated into machine code. DATA INPUT AND MANIPULATION (2271-INE-2) Introduction to Programming Language Object code Object code is a program code in machine-readable form (a source program that has been translated). DATA INPUT AND MANIPULATION (2271-INE-2) Introduction to Programming Language Assemblers and Compilers and Interpreters Assemblers and Compilers are programs that convert high level languages into machine code. A Compiler is a program that converts the entire source code(compiles it) into machine language at one time before the computer can run the program at a later time. While compiling the source code into machine code, it checks that the syntax is properly written by the programmer for the programmer to debug the program..‫ يتم التحقق من أن بناء الجملة قد تم كتابته بشكل صحيح بواسطة المبرمج حتى يتمكن المبرمج من تصحيح أخطاء البرنامج‬ DATA INPUT AND MANIPULATION (2271-INE-2) Introduction to Programming Language Assemblers and Compilers and Interpreters The interpreters are programs that translates the high level program code one statement at a time, that is, it reads a code statement, converts it to one or more machine language instructions, and then executes the instruction before moving translating the next code statement in the program. If there is any error in the statement, the programmer can correct the error before the interpreter evaluates the next statement. Interpreters are slower than Compilers because interpreters convert a statement at a time and runs it before moving to the next line. DATA INPUT AND MANIPULATION (2271-INE-2) Introduction to Programming Language Assemblers The assembly-language program must be translated into machine code by a separate program called an assembler. The assembler program recognises the character strings that make up the symbolic names of the various machine operations, and substitutes the required machine code for each instruction. DATA INPUT AND MANIPULATION (2271-INE-2) Introduction to Programming Language Compilers Compilers are language translators that translate high-level languages into machine code. A compiler translates the entire program (source code) to machine code, and then the code is executed. The translated codes are known as How a Compiler works object codes and are saved as a file on disk. The object code (machine code) stored on disk has an EXE file name extension. It is then loaded or linked (stored in memory) and executed DATA INPUT AND MANIPULATION (2271-INE-2) Introduction to Programming Language Interpreters Interpreters are language translators that translate high-level language into machine code. An interpreter translates and executes one instruction at a time as it is encountered. The machine codes are not saved after execution How an Interpreter works DATA INPUT AND MANIPULATION (2271-INE-2) Introduction to Programming Language Defining the problem In defining the problem there must be no ambiguity. The problem should be clear and concise and have only one meaning. Examples of unambiguous ‫ غير مبهم‬problems are: i) Calculating the price of an item after a 10% discount ii) Converting a temperature from ° C to ° F iii) Computing the average rainfall for the month of May in a certain place. DATA INPUT AND MANIPULATION (2271-INE-2) Introduction to Programming Language Input and storage instructions These instructions allow data to be accepted by the computer. The data input is needed by the computer to solve the problem. Words such as ‘Enter’, ‘Input’ and ‘Read’ within problem statements usually indicate what data the computer requires. DATA INPUT AND MANIPULATION (2271-INE-2) Introduction to Programming Language Input and storage instructions i) Calculating the price of an What are the input and storage item after a 10% discount instructions here? ii) Calculate the age of the Read the price of an item and calculate students the discount of 10%. iii) temperature in degrees Enter the name and year of birth of a Fahrenheit. person and calculate the person’s age. Enter a temperature in degrees Celsius and convert it to degrees Fahrenheit. DATA INPUT AND MANIPULATION (2271-INE-2) Introduction to Programming Language Processing instructions These instructions manipulate the input data. They involve calculations, that is, mathematical operations (e.g. addition, subtraction, multiplication and division), repeating instructions, selecting instructions and comparison instructions. They also include commands and constructs. DATA INPUT AND MANIPULATION (2271-INE-2) Introduction to Programming Language Processing instructions Let’s analyse these instructions to What are the processing instructions here? determine what we need to process. Read the price of an item and calculate the new price after a 10% Calculate the new price after a discount. 10% discount. Enter a temperature in degrees Convert it to degrees Celsius and convert it to degrees Fahrenheit. Fahrenheit. Input the name and year of birth and Compute the age of a person. compute and print the age of a person. DATA INPUT AND MANIPULATION (2271-INE-2) Introduction to Programming Language A command is a word that instructs the computer what must be done to accomplish a specific task. Commands are specific to a particular programming language: for example, WRITE, PRINT, READ, INPUT, etc. A construct is a group of instructions that work together with commands to accomplish a specific task. An example is the ‘IF-THEN’ construct: IF a < 10 THEN READ Num ENDIF Example of a construct DATA INPUT AND MANIPULATION (2271-INE-2) Introduction to Python DATA INPUT AND MANIPULATION (2271-INE-2) Introduction Python Programming Language Basics of Programming Language Problem-solving skill involves identifying issues, formulating problems, devising solutions, and communicating them ‫ وتوصيلها‬،‫ ووضع الحلول‬،‫ وصياغة المشاكل‬،‫تتضمن المهارة تحديد القضايا‬ Computer program is a comprehensive, step-by-step set of instructions that tells a computer exactly what it should be doing. ‫برنامج الكمبيوتر هو مجموعة شاملة من التعليمات خطوة بخطوة التي تخبر الكمبيوتر بالضبط‬.‫ما يجب أن يفعله‬ DATA INPUT AND MANIPULATION (2271-INE-2) Introduction Python Programming Language Basics of Programming Language DATA INPUT AND MANIPULATION (2271-INE-2) Introduction Python Programming Language Basics of Programming Language Coding Mechanism-Coding guarantees that a computer’s software and hardware can connect by compiling the code into assembly language. ‫يضمن الترميز إمكانية اتصال برامج وأجهزة الكمبيوتر عن طريق تجميع الكود إلى لغة‬ ‫التجميع‬ High-level and assembly-level languages are then converted into binary coded signals (1’s and 0’s) to allow computational hardware and software to communicate. )0‫ و‬1( ‫يتم بعد ذلك تحويل اللغات عالية المستوى ولغات التجميع إلى إشارات مشفرة ثنائية‬.‫للسماح لألجهزة والبرامج الحاسوبية بالتواصل‬ DATA INPUT AND MANIPULATION (2271-INE-2) Introduction Python Programming Language Basics of Programming Language Learning to code is crucial because it enhances problem-solving and logic abilities, leverages technology to power business operations, and facilitates fine-tuning. ‫ ويستفيد من التكنولوجيا‬،‫أمرا بالغ األهمية ألنه يعزز القدرة على حل المشكالت والقدرات المنطقية‬ ً ‫يعد تعلم البرمجة‬.‫ ويسهل الضبط الدقيق‬،‫لتشغيل العمليات التجارية‬ Learning to code leads to better job prospects..‫تعلم البرمجة يؤدي إلى فرص عمل أفضل‬ Programmers make apps, websites, and other digital products that change how people live worldwide. ‫يقوم المبرمجون بإنشاء تطبيقات ومواقع ويب ومنتجات رقمية أخرى تعمل على تغيير طريقة حياة األشخاص في‬.‫جميع أنحاء العالم‬ DATA INPUT AND MANIPULATION (2271-INE-2) Introduction Python Programming Language Programming Versus Software “Programming” involves giving the computer the instructions and data it needs on time..‫يتضمن إعطاء الكمبيوتر التعليمات والبيانات التي يحتاجها في الوقت المناسب‬ Programming Mechanism-The process of programming is intricate. Programming is done in phases, such as composing problem statements, drawing flowcharts, designing coding algorithms, writing a computer program, analyzing and evaluating software, technical writing, keeping software up to date, and so on. ‫ ورسم‬،‫ مثل صياغة عبارات المشكلة‬،‫ تتم البرمجة على مراحل‬.‫ عملية البرمجة معقدة‬- ‫آلية البرمجة‬ ‫ والكتابة‬،‫ وتحليل وتقييم البرامج‬،‫ وكتابة برنامج كمبيوتر‬،‫ وتصميم خوارزميات الترميز‬،‫مخططات التدفق‬.‫ وما إلى ذلك‬،‫ وتحديث البرامج‬،‫الفنية‬ DATA INPUT AND MANIPULATION (2271-INE-2) Introduction Python Programming Language Programming Versus Software Computer software is a set of program instructions..‫برمجيات الكمبيوتر هي مجموعة من تعليمات البرنامج‬ An algorithm is a set of instructions explaining how a particular computation should be performed in detail..‫الخوارزمية هي مجموعة من التعليمات التي تشرح كيفية إجراء عملية حسابية معينة بالتفصيل‬ A programming language is a language for writing down the instructions that a computer will follow. It has a structure of syntax (precise form) and semantics (actual meaning). )‫ وهي تتكون من بنية لغوية (الشكل الدقيق‬.‫لغة البرمجة هي لغة لكتابة التعليمات التي يتبعها الكمبيوتر‬.)‫ودالالت (المعنى الفعلي‬ DATA INPUT AND MANIPULATION (2271-INE-2) Introduction Python Programming Language Programming Versus Software There are two types of languages, namely low-level languages and high- level languages. Computer hardware's can only run programs written in low-level languages/machine languages/ assembly languages. A computer program is a series of instructions written in a high- level language to solve a problem. DATA INPUT AND MANIPULATION (2271-INE-2) Object Oriented Programming Vs. Procedural Programming Vs. Functional Programming‫المقانه بين البرمجة الشيئية والبرمجة اإلجرائية و البرمجة الوظيفية‬ DATA INPUT AND MANIPULATION (2271-INE-2) DATA INPUT AND MANIPULATION (2271-INE-2) Introduction Python Programming Language Python Programming Language an open-source, high-level, interpreted, general-purpose, dynamic programming language ‫لغة برمجة ديناميكية مفتوحة المصدر وعالية المستوى ومفسرة ومتعددة األغراض‬ relatively easy to pick up and use..‫من السهل نسبيًا التقاطها واستخدامها‬ Extensive libraries are available.‫من السهل نسبيًا التقاطها واستخدامها‬ DATA INPUT AND MANIPULATION (2271-INE-2) Introduction Python Programming Language Python Programming Language flexibility as a programming language means it can also be used as an add-on to make highly customizable programs. ‫ضا كإضافة إلنشاء برامج قابلة للتخصيص بدرجة كبيرة‬ ً ‫المرونة كلغة برمجة تعني أنه يمكن استخدامها أي‬ Cross-platform language ‫لغة متعددة المنصات‬ Software quality..‫جودة البرمجيات‬ Python data types are strongly and dynamically typed. ‫أنواع البيانات في بياثون هي أنواع قوية وديناميكية‬ DATA INPUT AND MANIPULATION (2271-INE-2) Introduction Python Programming Language Python Programming Language embedded easily into any application to provide a programmable interface..‫يتم دمجها بسهولة في أي تطبيق لتوفير واجهة قابلة للبرمجة‬ Developer productivity. ‫إنتاجية المطور‬ Python’s rapid edit-test-debug cycle and lack of a compilation step make development and debugging much more efficient. ‫إن دورة التحرير واالختبار والتصحيح السريعة في بياثون وعدم وجود خطوة التجميع تجعل التطوير‬ DATA INPUT AND MANIPULATION (2271-INE-2) ‫والتصحيح أكثر كفاءة‬ Introduction Python Programming Language Python Programming Language Limitations Speed is an issue. As Python is an interpreted language, it is slower than compiled languages. ‫ فهي أبطأ من اللغات المترجمة‬،‫نظرا ألن بياثون هي لغة مفسرة‬ ً.‫السرعة هي مشكلة‬ Design restrictions. The dynamically typed language comes with errors only at runtime; Python’s global interpreter lock and whitespace are a few design issues. ‫ تأتي اللغة ذات الكتابة الديناميكية مع أخطاء فقط في وقت التشغيل؛ قفل المترجم العالمي والمسافة البيضاء في‬.‫قيود التصميم‬ ‫البايثون هي بعض مشكالت التصميم‬ DATA INPUT AND MANIPULATION (2271-INE-2) Introduction Python Programming Language Python Programming Language Implementations‫عمليات التنفيذ‬ utilized for database access, Internet scripting, distributed programming, and extension-language works. ‫ وأعمال لغة‬،‫ والبرمجة الموزعة‬،‫ وبرمجة اإلنترنت‬،‫يتم استخدامها للوصول إلى قواعد البيانات‬.‫التوسعة‬ used as Graphical User Interfaces (GUI), shell tools -system admin tools, and command line programs. ‫تستخدم كواجهات مستخدم رسومية وأدوات وأدوات الصدفه إدارة النظام وبرامج سطر األوامر‬ language-based modules -instead of special-purpose parsers..‫ بدالً من المحلالت ذات األغراض الخاصة‬- ‫وحدات تعتمد على اللغة‬ DATA INPUT AND MANIPULATION (2271-INE-2) Introduction Python Programming Language Python Programming Language Implementations helpful for rapid prototyping and development.  Video Games ‫مفيدة في النمذجة السريعه والتطوير‬ Development. used in Web Application development,  Desktop applications, ‫يستخدم في تطوير تطبيقات الويب‬  building desktop GUIs,  Internet Protocol,  Email Parsing,  Network programs,  System administration, DATA INPUT AND MANIPULATION (2271-INE-2) Introduction Python Programming Language Python Programming Language The Process of Creating a Computer Program High-Level Block diagram of an Interpreter DATA INPUT AND MANIPULATION (2271-INE-2) Python Interpreter Introduction Python Programming Language Python Integrated Development Environment (IDE) IDE stands for Interactive Development Environment, as an interpreter, translates the code into a language the computer can understand..‫ حيث تقوم كمترجم بترجمة الكود إلى لغة يمكن للكمبيوتر فهمها‬،‫يعني بيئة التطوير التفاعلية‬ An IDE is a bundled set of software tools for program development..‫بيئة التطوير المتكاملة هي مجموعة مجمعة من أدوات البرمجيات لتطوير البرامج‬ IDEs are full-fledged environment which provide all the essential tools needed for software development..‫بيئة التطوير المتكاملة هي بيئة كاملة توفر جميع األدوات األساسية الالزمة لتطوير البرامج‬ It just doesn’t handle the code (for example, write, edit, syntax highlighting and auto completion) but also provides other features such as debugging, execution, testing, and code formatting that helps programmers. ‫ الكتابة والتحرير وتسليط الضوء على بناء الجملة واإلكمال التلقائي) ولكنها‬،‫ال تتعامل فقط مع الكود (على سبيل المثال‬.‫ضا ميزات أخرى مثل التصحيح والتنفيذ واالختبار وتنسيق الكود التي تساعد المبرمجين‬ ً ‫توفر أي‬ Introduction Python Programming Language Integrated Development Environment (IDE) It understands your code much better than a text editor. ‫إنه يفهم الكود الخاص بك بشكل أفضل بكثير من محرر النصوص‬ It usually provides features such as build automation, code writing, testing and debugging. This can significantly speed up your work. The downside is that IDEs can be complicated to use. ‫ يمكن أن يؤدي هذا‬.‫يوفر عادة ً ميزات مثل أتوماتكية البناء وكتابة الكود واالختبار وتصحيح األخطاء‬.‫ الجانب السلبي هو أن بيئات التطوير المتكاملة قد تكون معقدة االستخدام‬.‫إلى تسريع عملك بشكل كبير‬ DATA INPUT AND MANIPULATION (2271-INE-2) Introduction Python Programming Language Types of Integrated Development Environment (IDE) IDLE Pycharm Jupyter Spyder Sublime Text DATA INPUT AND MANIPULATION (2271-INE-2) Introduction Python Programming Language Integrated Development and Learning Environment (IDLE) IDLE (Integrated Development and Learning Environment). It includes an editor for creating and modifying programs ‫محررا إلنشاء البرامج وتعديلها‬ ً ‫يتضمن‬ A translator for executing programs ‫مترج ًما لتنفيذ البرامج‬ Program debugger to aid in finding program errors..‫مصحح أخطاء البرامج للمساعدة في العثور على أخطاء البرنامج‬ Python provides the very useful ability to execute in interactive mode..‫يوفر بايثون القدرة المفيدة للغاية على التنفيذ في الوضع التفاعلي‬ The window that provides this interaction is referered to as the Python shell..‫يُشار إلى النافذة التي توفر هذا التفاعل باسم غالف بايثون‬ Introduction Python Programming Language Integrated Development and Learning Environment (IDLE) Working in the Python shell is convenient, the entered code is not saved in shell. Interacting with the shell is much like using a calculator, except that, instead of being limited to the operations built into a calculator (addition, subtraction, etc) It is a default editor that accompanies Python This IDLE is suitable for beginner level developers 3 The IDLE tool can be used on Mac OS, Windows, and Linux. ‫ وال يتم حفظ الكود المدخل في الغالف‬،‫العمل في غالف البايثون مريح‬  ‫ إال أنه بدالً من االقتصار على العمليات المضمنة في اآللة الحاسبة (الجمع‬،‫التفاعل مع الغالف يشبه إلى حد كبير استخدام اآللة الحاسبة‬.  )‫والطرح وما إلى ذلك‬ ‫إنه محرر افتراضي يأتي مع البايثون‬  DATA INPUT AND MANIPULATION (2271-INE-2) 3 ‫مناسب للمطورين المبتدئين‬  Introduction Python Programming Language Integrated Development and Learning Environment (IDLE) Features of IDLE: ✓ Ability to search for multiple files ✓ Interactive interpreter with syntax highlighting, and error and i/o messages ✓ Smart indenting, along with basic text editor features ✓ A very capable debugger ‫✓ القدرة على البحث عن ملفات متعددة‬ ‫اإلخراج‬/‫ ورسائل الخطأ واإلدخال‬،‫✓ مترجم تفاعلي مع تمييز بناء الجملة‬ ‫ إلى جانب ميزات محرر النصوص األساسية‬،‫✓ مسافة بادئة ذكية‬ ‫✓ قادر جدًا على تصحيح االخطاء‬ DATA INPUT AND MANIPULATION (2271-INE-2) Introduction Python Programming Language Integrated Development and Learning Environment (IDLE) Advantage: Disadvantage: It can be used to execute a single statement. IDLE is not available by default It can be used to create, modify, and execute Python scripts. in python distribution for Linux. It offers features like syntax highlighting, auto- It needs a respective package completion & smart indent. manager for installation It has a debugger with stepping & breakpoint features..‫ يمكن استخدامه لتنفيذ عبارة واحدة‬ ‫ يحتاج إلى مدير حزمة مناسب للتثبيت‬ ‫ يمكن استخدامه إلنشاء وتعديل وتنفيذ نصوص البايثون‬ ‫ يوفر ميزات مثل تمييز بناء الجملة واإلكمال التلقائي والمسافة‬.‫البادئة الذكية‬.‫ يحتوي على مصحح أخطاء مع ميزات الخطوة ونقطة التوقف‬ DATA INPUT AND MANIPULATION (2271-INE-2) Introduction Python Programming Language PyCharm PyCharm is a widely used Python IDE created by JetBrains It has been considered the best IDE for python developers. This IDE is suitable for professional developers and facilitates the development of large projects. JetBrains ‫ هي بيئة تطوير متكاملة واسعة االستخدام للغة البايثون تم إنشاؤها بواسطة‬ByCharm  ‫ وقد تم اعتبارها أفضل بيئة تطوير متكاملة لمطوري البياثون‬.‫ هذه البيئة المتكاملة مناسبة للمطورين المحترفين وتسهل تطوير المشاريع الكبيرة‬ DATA INPUT AND MANIPULATION (2271-INE-2) Introduction Python Programming Language PyCharm Features: ✓ Support for JavaScript, CSS, and TypeScript ✓ Smart code navigation ✓ Quick and safe code refactoring ✓ Support features like accessing databases directly from the IDE ✓ It is considered as an intelligent code editor, fast and safe refactoring, and smart code. ‫التنقل الذكي في الكود‬  ‫إعادة هيكلة الكود بسرعة وأمان‬  ‫دعم ميزات مثل الوصول إلى قواعد البيانات مباشرة من‬ .‫يعتبر محرر أكواد ذكيًا وإعادة هيكلة سريعة وآمنة وكود ذكي‬  DATA INPUT AND MANIPULATION (2271-INE-2) Introduction Python Programming Language PyCharm Features: ✓ Features for debugging, profiling, remote development, testing the code, auto code completion, quick fixing, error detection and tools of the database. ✓ Support for Popular web technologies, web frameworks, scientific libraries and version control. ‫ واكتشاف‬،‫ واإلصالح السريع‬،‫ وإكمال الكود تلقائيًا‬،‫ واختبار الكود‬،‫ والتطوير عن بعد‬،‫ وإنشاء ملفات التعريف‬،‫ ميزات التصحيح‬.‫األخطاء وأدوات قاعدة البيانات‬.‫ والتحكم في اإلصدارات‬،‫ والمكتبات العلمية‬،‫ وأطر عمل الويب‬،‫ دعم تقنيات الويب الشائعة‬ DATA INPUT AND MANIPULATION (2271-INE-2) Introduction Python Programming Language PyCharm Advantage: Disadvantage: Active community support Slow loading time Live code verification and syntax highlighting The default setting may require Executes edits and debugs Python code adjustment before existing projects can without any external requirements. be used. ‫ وقت تحميل بطيء‬ ‫ دعم المجتمع النشط‬ ‫ قد يتطلب اإلعداد االفتراضي إجراء تعديل قبل أن تتمكن‬ ‫ التحقق المباشر من الكود وتسليط الضوء على بناء الجملة‬.‫من استخدام المشاريع الحالية‬ ‫ تنفيذ عمليات التحرير وتصحيح أخطاء كود البايثون دون أي‬.‫متطلبات خارجية‬ DATA INPUT AND MANIPULATION (2271-INE-2) Introduction Python Programming Language Jupyter Notebook Jupyter is widely used in the field of Data Input and manipulation (data science) )‫يستخدم على نطاق واسع في مجال إدخال البيانات ومعالجتها (علم البيانات‬ It is easy to use, interactive and allows live code sharing and visualization ‫إنه سهل االستخدام وتفاعلي ويسمح بمشاركة الكود المباشر وتصوره‬ It is easy to use, interactive data science IDE across many programming languages ‫ وهو عبارة عن بيئة تطوير متكاملة تفاعلية لعلوم البيانات عبر العديد من لغات البرمجة‬،‫إنه سهل االستخدام‬ It is not work as an editor, but also as an educational tool or presentation. ً ‫ بل كأداة تعليمية أو عرض تقديمي أي‬،‫إنه ليس عمالً كمحرر‬ ‫ضا‬ DATA INPUT AND MANIPULATION (2271-INE-2) Introduction Python Programming Language Jupyter Notebook Features: ✓ Supports for the numerical calculations and machine learning workflow ✓ Combine code, text, and images for greater user experience ✓ Inter generation of data science libraries like NumPy, Pandas, and Matplotlib ‫ دعم الحسابات الرقمية وسير عمل التعلم اآللي‬ ‫ دمج الكود والنص والصور لتجربة مستخدم أفضل‬ NumPy, Pandas, and Matplotlib ‫ إنشاء مكتبات علوم البيانات مثل‬ DATA INPUT AND MANIPULATION (2271-INE-2) Introduction Python Programming Language Jupyter Notebook Features: ✓ It is one of the best Python IDE that supports for Numerical simulation, data cleaning machine learning data visualization, and statistical modeling. ✓ Combine code, text, and images. ✓ Support for many programming languages. ✓ Integrated data science libraries (matplotlib, NumPy, Pandas). ‫ إنه أحد أفضل بيئات التطوير المتكاملة للغة البايثون التي تدعم المحاكاة الرقمية وتنظيف البيانات وتعلم اآللة‬.‫وتصور البيانات والنمذجة اإلحصائية‬.‫ دمج الكود والنص والصور‬.‫ دعم العديد من لغات البرمجة‬ DATA INPUT AND MANIPULATION (2271-INE-2) ‫ مكتبات علوم البيانات المتكاملة‬ Introduction Python Programming Language Jupyter Notebook Advantage: It combines code, text, images, videos, mathematical equations, plots, maps, graphical user interface and widgets to a single document. It allows users to convert the notebooks into other formats such as HTML and PDF. It saved in the structured text files (JSON format), which makes them easily shareable. It is platform-independent because it is represented as JSON (JavaScript Object Notation) format, which is a language-independent, text-based file format..‫يجمع بين الكود والنص والصور والفيديوهات والمعادالت الرياضية والرسوم البيانية والخرائط وواجهة المستخدم الرسومية واألدوات في مستند واحد‬  HTML & pdf ‫يسمح للمستخدمين بتحويل الدفاتر إلى تنسيقات أخرى مثل‬ .‫يتم حفظها في ملفات نصية منظمة مما يجعلها قابلة للمشاركة بسهولة‬ .‫ وهو تنسيق ملف نصي مستقل عن اللغة‬،JSON ‫انه مستقل عن النظام األساسي ألنه يتم تمثيله بتنسيق‬  DATA INPUT AND MANIPULATION (2271-INE-2) Introduction Python Programming Language Jupyter Notebook Disadvantage: It is very hard to test long asynchronous tasks. Less Security It runs cell out of order In Jupyter notebook, there is no IDE integration, no linting, and no code-style correction..‫من الصعب جدًا اختبار المهام غير المتزامنة الطويلة‬  ‫أمان أقل‬  ‫تشغيل الخلية خارج الترتيب‬ .‫ وال تصحيح ألسلوب الكود‬،‫ وال تدقيق‬، IDE‫ ال يوجد تكامل مع‬، Jupyter‫في دفتر مالحظات‬  DATA INPUT AND MANIPULATION (2271-INE-2) Introduction Python Programming Language Spyder Spyder is an open-source IDE most commonly used for scientific development ‫هي بيئة تطوير متكاملة مفتوحة المصدر تُستخدم بشكل شائع في التطوير العلمي‬ It is also called Scientific Python Development IDE and it is the most lightweight IDE for Python ‫ضا ببيئة التطوير المتكاملة العلمية للغة البايثون وهي أخف بيئة تطوير متكاملة للغة‬ ً ‫وتُسمى أي‬ Spyder comes with Anaconda distribution, which is popular for data science and machine learning..‫ وهو شائع في مجال علم البيانات والتعلم اآللي‬، ‫يأتي مع توزيع‬ It allows you to access PostgreSQL, Oracle, MySQL, SQL Server, and many other databases from the IDE. DATA INPUT AND MANIPULATION (2271-INE-2) Introduction Python Programming Language Spyder Features: ✓ Support for automatic code completion and splitting ✓ Supports plotting different types of charts and data manipulation ✓ Integration of data science libraries like NumPy, Pandas, and Matplotlib ✓ Auto code completion and syntax highlighting ‫دعم اإلكمال التلقائي للكود وتقسيمه‬  ‫يدعم رسم أنواع مختلفة من المخططات ومعالجة البيانات‬  NumPy, Pandas, and Matplotlib ‫دمج مكتبات علوم البيانات مثل‬  ‫اإلكمال التلقائي للكود وتسليط الضوء على بناء الجملة‬  DATA INPUT AND MANIPULATION (2271-INE-2) Introduction Python Programming Language Spyder Features: ✓ An interactive way to trace each step of Python code execution ✓ It is very efficient in tracing each step of the script execution by a powerful debugger ✓ It offers automatic code completion and horizontal/vertical splitting. ‫ طريقة تفاعلية لتتبع كل خطوة من خطوات تنفيذ كود بايثون‬ ‫ إنها فعالة للغاية في تتبع كل خطوة من خطوات تنفيذ البرنامج النصي من خالل مصحح أخطاء قوي‬ ً.‫رأسيًا‬/‫إكماال تلقائيًا للكود وتقسي ًما أفقيًا‬ ‫ توفر‬ DATA INPUT AND MANIPULATION (2271-INE-2) Introduction Python Programming Language Spyder Advantage: Disadvantage: Community support Execution dependencies Rich in development tool features Optional dependencies. Complete documentation. ‫ تبعيات التنفيذ‬ ‫ تبعيات اختيارية‬ ‫ دعم عام‬ ‫ ميزات غنية ألدوات التطوير‬.‫ وثائق كاملة‬ DATA INPUT AND MANIPULATION (2271-INE-2) Introduction Python Programming Language Sublime Text Sublime Text is a generic text editor coded in C++ and Python. This software supports 44 major programming languages, including Python. It was first published in 2007, and Jon Skinner developed it. It is one of the best Python editor that has basic built-in support for Python. The editor supports OS X, Windows, and Linux operating systems Sublime text is used to create a full-fledged Python development environment. C++ & Python ‫ هو محرر نصوص عام مبرمج بلغة‬. ‫ بما في ذلك البايثون‬،‫ لغة برمجة رئيسية‬44 ‫ يدعم هذا البرنامج‬.‫ وقام جون سكينر بتطويره‬،2007 ‫ تم نشره ألول مرة في عام‬ ‫ إنه أحد أفضل محررات البايثون التي تحتوي على دعم أساسي مدمج للبايثون‬ ‫النشاء بيئة تطوير البياثون‬Sublime text ‫ يتم استخدام‬ DATA INPUT AND MANIPULATION (2271-INE-2) Introduction Python Programming Language Sublime Text Features: ✓ Discreet, minimal interface: we must be able to focus on the text and not a myriad of toolbars; ✓ The text is not hidden by the windows; ✓ Use as much space as possible: full screen, multi-screen, side-by-side file  editing should be possible. ‫ يجب أن نتمكن من التركيز على النص وليس على عدد ال يحصى من أشرطة األدوات؛‬:‫ واجهة بسيطة وواضحة‬ ‫ ال يتم إخفاء النص بواسطة النوافذ؛‬ ‫ يجب أن يكون تحرير الملفات على الشاشة الكاملة أو على شاشات متعددة أو‬:‫ استخدم أكبر قدر ممكن من المساحة‬.‫جنبًا إلى جنب ممكنًا‬ DATA INPUT AND MANIPULATION (2271-INE-2) Introduction Python Programming Language Sublime Text Features: ✓ It supports different plugins and packages. ✓ It is high quality and powerful IDE. ✓ It incorporates most of the features of a basic Python text editor, including customizable syntax highlighting..‫ يدعم العديد من المكونات اإلضافية والحزم‬.‫ إنه بيئة تطوير متكاملة عالية الجودة وقوية‬ ‫ بما في‬،‫ يشتمل على معظم ميزات محرر نصوص البايثون األساسي‬ ‫ذلك تمييز بناء الجملة القابل للتخصيص‬ DATA INPUT AND MANIPULATION (2271-INE-2) Introduction Python Programming Language Sublime Text Disadvantage: Advantage: Difficult to modify, everything goes Fast with very few bugs (big advantage) through JSON. Opens large files License required Supports many languages. Learning the shortcuts. ‫ سريع مع عدد قليل جدًا من األخطاء (ميزة‬ )‫كبيرة‬ JSON ‫ كل شيء يمر عبر‬،‫ من الصعب تعديله‬ ‫ يفتح الملفات الكبيرة‬ ‫ مطلوب ترخيص‬.‫ يدعم العديد من اللغات‬.‫ تعلم االختصارات‬ DATA INPUT AND MANIPULATION (2271-INE-2)

Use Quizgecko on...
Browser
Browser