This document discusses using Python code in the browser with Silverlight and IronPython. It begins with an introduction to Silverlight and IronPython, then provides examples of how to load the IronPython runtime, reference external Python files, and run Python code that interacts with the browser DOM and uses .NET APIs. Key points covered include loading the JavaScript that enables Python execution, how the Python runtime is loaded into the Silverlight control, and how Python code can import modules and packages to access libraries like unittest for testing purposes.
This documentation speaks about the history of the famous libraries tensorflow and open cv (aka computer vison). It also show the installation proces for both the libraries.
Managing Plone Projects with Perl and SubversionLuciano Rocha
How an in-house solution developed in Perl helped our Plone developers to streamline their work.
From the use of Subversion (and Trac) to keep track of development, sharing code, and bundling packages, to the creation of a program for managing dependencies, building the system, creating release RPMs and tracking deployments.
A test case by Eurotux Informática.
API Documentation Workshop tcworld India 2015Tom Johnson
This is a workshop I gave on API documentation at tcworld India 2015. The workshop covers 3 main areas:
- General overview of API documentation
- Deep dive into REST API documentation
- Deep dive into Javadoc documentation
Workshop: Introduction to Web Components & Polymer John Riviello
From Little Rock Tech Fest 2017
With the updates to iOS and Android phones released earlier this year, Web Components are now supported natively. With libraries such as Polymer that are built on top of Web Components, it is now possible to easily create fast Progressive Web Apps (PWAs) without the overhead of a framework. In this workshop, we'll begin with a brief introduction to Web Components and Polymer, and then dive into hands-on experiences with the core aspects of Web Components: the <template> tag, Custom Elements, and the Shadow DOM.
This workshop assumes an understanding of HTML, CSS & JavaScript. No prior experience with Web Components, Polymer, or any library or framework (Web Components or otherwise) is required.
This documentation speaks about the history of the famous libraries tensorflow and open cv (aka computer vison). It also show the installation proces for both the libraries.
Managing Plone Projects with Perl and SubversionLuciano Rocha
How an in-house solution developed in Perl helped our Plone developers to streamline their work.
From the use of Subversion (and Trac) to keep track of development, sharing code, and bundling packages, to the creation of a program for managing dependencies, building the system, creating release RPMs and tracking deployments.
A test case by Eurotux Informática.
API Documentation Workshop tcworld India 2015Tom Johnson
This is a workshop I gave on API documentation at tcworld India 2015. The workshop covers 3 main areas:
- General overview of API documentation
- Deep dive into REST API documentation
- Deep dive into Javadoc documentation
Workshop: Introduction to Web Components & Polymer John Riviello
From Little Rock Tech Fest 2017
With the updates to iOS and Android phones released earlier this year, Web Components are now supported natively. With libraries such as Polymer that are built on top of Web Components, it is now possible to easily create fast Progressive Web Apps (PWAs) without the overhead of a framework. In this workshop, we'll begin with a brief introduction to Web Components and Polymer, and then dive into hands-on experiences with the core aspects of Web Components: the <template> tag, Custom Elements, and the Shadow DOM.
This workshop assumes an understanding of HTML, CSS & JavaScript. No prior experience with Web Components, Polymer, or any library or framework (Web Components or otherwise) is required.
Abstract:
Secure code practices, system hardening, due diligence and due care principles are paramount in mitigating application level DoS attacks. These attacks often result in significant damage against unprepared and vulnerable organisations.
The intent of this talk is to help organisations in strengthening their security posture against such attacks. The talk will explore most common application level DoS attacks and will provide recommendations for protecting applications, detecting attacks and how to react under stressful conditions.
Easy contributable internationalization process with Sphinx @ pyconsg2015Takayuki Shimizukawa
Sphinx can extract paragraphs from sphinx document and store them into gettext format translation catalog files.
Gettext format translation catalog is easy to translate from one language to other languages.
Also Sphinx support internationalization by using such catalog files.
You can use your favorite editors or services to translate your sphinx docs.
In this session, I'll explain 3 things; (1) entire process to translate sphinx docs. (2) automation mechanism for the process. (3) tips, tricks and traps for writing docs and translating.
Survival Strategies for API Documentation: Presentation to Southwestern Ontar...Tom Johnson
This is a presentation I gave to the Southwestern Ontario STC chapter on API documentation on Feb 2, 2015. For more details, see my blog at http://idratherbewriting.com. You can listen to the recorded presentation here: http://youtu.be/I8rGe2w1sAo.
Publishing API documentation -- WorkshopTom Johnson
These slides are from the REST API documentation workshop that I gave at the STC Summit 2015. For more details, see http://idratherbewriting.com/publishingapidocs.
Python Web Framework – A Detailed List of Web Frameworks in Pythonabhishekdf3
If your mission with Python is to develop for the Web, Python will help you with that with its range of frameworks.
Today in Python Web Framework tutorial, we will briefly discuss Web Frameworks offered by Python Programming Langauge: Full-Stack Frameworks in Python, and Non- Full-Stack Frameworks in Python.
So, let’s talk about Python Web Framework Tutorial.
Learn more at :- https://data-flair.training/courses/python-course/
Rapid Web Development with Python for Absolute BeginnersFatih Karatana
This slide covers Python basics, Python key features, Web development basis, RESTful architecture key points, Agile Web Development, Python web framework basis and fundamentals.
Abstract:
Secure code practices, system hardening, due diligence and due care principles are paramount in mitigating application level DoS attacks. These attacks often result in significant damage against unprepared and vulnerable organisations.
The intent of this talk is to help organisations in strengthening their security posture against such attacks. The talk will explore most common application level DoS attacks and will provide recommendations for protecting applications, detecting attacks and how to react under stressful conditions.
Easy contributable internationalization process with Sphinx @ pyconsg2015Takayuki Shimizukawa
Sphinx can extract paragraphs from sphinx document and store them into gettext format translation catalog files.
Gettext format translation catalog is easy to translate from one language to other languages.
Also Sphinx support internationalization by using such catalog files.
You can use your favorite editors or services to translate your sphinx docs.
In this session, I'll explain 3 things; (1) entire process to translate sphinx docs. (2) automation mechanism for the process. (3) tips, tricks and traps for writing docs and translating.
Survival Strategies for API Documentation: Presentation to Southwestern Ontar...Tom Johnson
This is a presentation I gave to the Southwestern Ontario STC chapter on API documentation on Feb 2, 2015. For more details, see my blog at http://idratherbewriting.com. You can listen to the recorded presentation here: http://youtu.be/I8rGe2w1sAo.
Publishing API documentation -- WorkshopTom Johnson
These slides are from the REST API documentation workshop that I gave at the STC Summit 2015. For more details, see http://idratherbewriting.com/publishingapidocs.
Python Web Framework – A Detailed List of Web Frameworks in Pythonabhishekdf3
If your mission with Python is to develop for the Web, Python will help you with that with its range of frameworks.
Today in Python Web Framework tutorial, we will briefly discuss Web Frameworks offered by Python Programming Langauge: Full-Stack Frameworks in Python, and Non- Full-Stack Frameworks in Python.
So, let’s talk about Python Web Framework Tutorial.
Learn more at :- https://data-flair.training/courses/python-course/
Rapid Web Development with Python for Absolute BeginnersFatih Karatana
This slide covers Python basics, Python key features, Web development basis, RESTful architecture key points, Agile Web Development, Python web framework basis and fundamentals.
Why Your Next Project Should have Expert Hire Python Developers?EmilySmith271958
Python and web development are going to be our focus, so let’s begin by reviewing both of those terms. The interpretable, high-level, and object-oriented programming language in contrast to being compiled, which runs a complete Hire python developers India in one go, having a Python program interpreted implies that it is executed one line at a time.
Top 10 python frameworks for web development in 2020Alaina Carter
Python is a high-level language and offers a broad scope of frameworks to developers. Read further to find out 11 Python frameworks for web development that developers should choose in 2020 to enhance the performance of the website.
Tweepy is an open source Python package that gives you a very convenient way to access the Twitter API with Python. Tweepy includes a set of classes and methods that represent Twitter's models and API endpoints, and it transparently handles various implementation details, such as: Data encoding and decoding.
Python doesn't have built-in mobile development capabilities, but there are packages you can use to create mobile applications, like Kivy, PyQt, or even Beeware's Toga library. These libraries are all major players in the Python mobile space.
This text presentation attempts to hit on the highlight features and structure of Django and its ecco-system. It is intended as an introduction for those who are curious about , what is it?
Welocme to ViralQR, your best QR code generator.ViralQR
Welcome to ViralQR, your best QR code generator available on the market!
At ViralQR, we design static and dynamic QR codes. Our mission is to make business operations easier and customer engagement more powerful through the use of QR technology. Be it a small-scale business or a huge enterprise, our easy-to-use platform provides multiple choices that can be tailored according to your company's branding and marketing strategies.
Our Vision
We are here to make the process of creating QR codes easy and smooth, thus enhancing customer interaction and making business more fluid. We very strongly believe in the ability of QR codes to change the world for businesses in their interaction with customers and are set on making that technology accessible and usable far and wide.
Our Achievements
Ever since its inception, we have successfully served many clients by offering QR codes in their marketing, service delivery, and collection of feedback across various industries. Our platform has been recognized for its ease of use and amazing features, which helped a business to make QR codes.
Our Services
At ViralQR, here is a comprehensive suite of services that caters to your very needs:
Static QR Codes: Create free static QR codes. These QR codes are able to store significant information such as URLs, vCards, plain text, emails and SMS, Wi-Fi credentials, and Bitcoin addresses.
Dynamic QR codes: These also have all the advanced features but are subscription-based. They can directly link to PDF files, images, micro-landing pages, social accounts, review forms, business pages, and applications. In addition, they can be branded with CTAs, frames, patterns, colors, and logos to enhance your branding.
Pricing and Packages
Additionally, there is a 14-day free offer to ViralQR, which is an exceptional opportunity for new users to take a feel of this platform. One can easily subscribe from there and experience the full dynamic of using QR codes. The subscription plans are not only meant for business; they are priced very flexibly so that literally every business could afford to benefit from our service.
Why choose us?
ViralQR will provide services for marketing, advertising, catering, retail, and the like. The QR codes can be posted on fliers, packaging, merchandise, and banners, as well as to substitute for cash and cards in a restaurant or coffee shop. With QR codes integrated into your business, improve customer engagement and streamline operations.
Comprehensive Analytics
Subscribers of ViralQR receive detailed analytics and tracking tools in light of having a view of the core values of QR code performance. Our analytics dashboard shows aggregate views and unique views, as well as detailed information about each impression, including time, device, browser, and estimated location by city and country.
So, thank you for choosing ViralQR; we have an offer of nothing but the best in terms of QR code services to meet business diversity!
Key Trends Shaping the Future of Infrastructure.pdfCheryl Hung
Keynote at DIGIT West Expo, Glasgow on 29 May 2024.
Cheryl Hung, ochery.com
Sr Director, Infrastructure Ecosystem, Arm.
The key trends across hardware, cloud and open-source; exploring how these areas are likely to mature and develop over the short and long-term, and then considering how organisations can position themselves to adapt and thrive.
UiPath Test Automation using UiPath Test Suite series, part 4DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 4. In this session, we will cover Test Manager overview along with SAP heatmap.
The UiPath Test Manager overview with SAP heatmap webinar offers a concise yet comprehensive exploration of the role of a Test Manager within SAP environments, coupled with the utilization of heatmaps for effective testing strategies.
Participants will gain insights into the responsibilities, challenges, and best practices associated with test management in SAP projects. Additionally, the webinar delves into the significance of heatmaps as a visual aid for identifying testing priorities, areas of risk, and resource allocation within SAP landscapes. Through this session, attendees can expect to enhance their understanding of test management principles while learning practical approaches to optimize testing processes in SAP environments using heatmap visualization techniques
What will you get from this session?
1. Insights into SAP testing best practices
2. Heatmap utilization for testing
3. Optimization of testing processes
4. Demo
Topics covered:
Execution from the test manager
Orchestrator execution result
Defect reporting
SAP heatmap example with demo
Speaker:
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
Elevating Tactical DDD Patterns Through Object CalisthenicsDorra BARTAGUIZ
After immersing yourself in the blue book and its red counterpart, attending DDD-focused conferences, and applying tactical patterns, you're left with a crucial question: How do I ensure my design is effective? Tactical patterns within Domain-Driven Design (DDD) serve as guiding principles for creating clear and manageable domain models. However, achieving success with these patterns requires additional guidance. Interestingly, we've observed that a set of constraints initially designed for training purposes remarkably aligns with effective pattern implementation, offering a more ‘mechanical’ approach. Let's explore together how Object Calisthenics can elevate the design of your tactical DDD patterns, offering concrete help for those venturing into DDD for the first time!
Accelerate your Kubernetes clusters with Varnish CachingThijs Feryn
A presentation about the usage and availability of Varnish on Kubernetes. This talk explores the capabilities of Varnish caching and shows how to use the Varnish Helm chart to deploy it to Kubernetes.
This presentation was delivered at K8SUG Singapore. See https://feryn.eu/presentations/accelerate-your-kubernetes-clusters-with-varnish-caching-k8sug-singapore-28-2024 for more details.
UiPath Test Automation using UiPath Test Suite series, part 3DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 3. In this session, we will cover desktop automation along with UI automation.
Topics covered:
UI automation Introduction,
UI automation Sample
Desktop automation flow
Pradeep Chinnala, Senior Consultant Automation Developer @WonderBotz and UiPath MVP
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
Essentials of Automations: Optimizing FME Workflows with ParametersSafe Software
Are you looking to streamline your workflows and boost your projects’ efficiency? Do you find yourself searching for ways to add flexibility and control over your FME workflows? If so, you’re in the right place.
Join us for an insightful dive into the world of FME parameters, a critical element in optimizing workflow efficiency. This webinar marks the beginning of our three-part “Essentials of Automation” series. This first webinar is designed to equip you with the knowledge and skills to utilize parameters effectively: enhancing the flexibility, maintainability, and user control of your FME projects.
Here’s what you’ll gain:
- Essentials of FME Parameters: Understand the pivotal role of parameters, including Reader/Writer, Transformer, User, and FME Flow categories. Discover how they are the key to unlocking automation and optimization within your workflows.
- Practical Applications in FME Form: Delve into key user parameter types including choice, connections, and file URLs. Allow users to control how a workflow runs, making your workflows more reusable. Learn to import values and deliver the best user experience for your workflows while enhancing accuracy.
- Optimization Strategies in FME Flow: Explore the creation and strategic deployment of parameters in FME Flow, including the use of deployment and geometry parameters, to maximize workflow efficiency.
- Pro Tips for Success: Gain insights on parameterizing connections and leveraging new features like Conditional Visibility for clarity and simplicity.
We’ll wrap up with a glimpse into future webinars, followed by a Q&A session to address your specific questions surrounding this topic.
Don’t miss this opportunity to elevate your FME expertise and drive your projects to new heights of efficiency.
Epistemic Interaction - tuning interfaces to provide information for AI supportAlan Dix
Paper presented at SYNERGY workshop at AVI 2024, Genoa, Italy. 3rd June 2024
https://alandix.com/academic/papers/synergy2024-epistemic/
As machine learning integrates deeper into human-computer interactions, the concept of epistemic interaction emerges, aiming to refine these interactions to enhance system adaptability. This approach encourages minor, intentional adjustments in user behaviour to enrich the data available for system learning. This paper introduces epistemic interaction within the context of human-system communication, illustrating how deliberate interaction design can improve system understanding and adaptation. Through concrete examples, we demonstrate the potential of epistemic interaction to significantly advance human-computer interaction by leveraging intuitive human communication strategies to inform system design and functionality, offering a novel pathway for enriching user-system engagements.
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfPaige Cruz
Monitoring and observability aren’t traditionally found in software curriculums and many of us cobble this knowledge together from whatever vendor or ecosystem we were first introduced to and whatever is a part of your current company’s observability stack.
While the dev and ops silo continues to crumble….many organizations still relegate monitoring & observability as the purview of ops, infra and SRE teams. This is a mistake - achieving a highly observable system requires collaboration up and down the stack.
I, a former op, would like to extend an invitation to all application developers to join the observability party will share these foundational concepts to build on:
State of ICS and IoT Cyber Threat Landscape Report 2024 previewPrayukth K V
The IoT and OT threat landscape report has been prepared by the Threat Research Team at Sectrio using data from Sectrio, cyber threat intelligence farming facilities spread across over 85 cities around the world. In addition, Sectrio also runs AI-based advanced threat and payload engagement facilities that serve as sinks to attract and engage sophisticated threat actors, and newer malware including new variants and latent threats that are at an earlier stage of development.
The latest edition of the OT/ICS and IoT security Threat Landscape Report 2024 also covers:
State of global ICS asset and network exposure
Sectoral targets and attacks as well as the cost of ransom
Global APT activity, AI usage, actor and tactic profiles, and implications
Rise in volumes of AI-powered cyberattacks
Major cyber events in 2024
Malware and malicious payload trends
Cyberattack types and targets
Vulnerability exploit attempts on CVEs
Attacks on counties – USA
Expansion of bot farms – how, where, and why
In-depth analysis of the cyber threat landscape across North America, South America, Europe, APAC, and the Middle East
Why are attacks on smart factories rising?
Cyber risk predictions
Axis of attacks – Europe
Systemic attacks in the Middle East
Download the full report from here:
https://sectrio.com/resources/ot-threat-landscape-reports/sectrio-releases-ot-ics-and-iot-security-threat-landscape-report-2024/
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...James Anderson
Effective Application Security in Software Delivery lifecycle using Deployment Firewall and DBOM
The modern software delivery process (or the CI/CD process) includes many tools, distributed teams, open-source code, and cloud platforms. Constant focus on speed to release software to market, along with the traditional slow and manual security checks has caused gaps in continuous security as an important piece in the software supply chain. Today organizations feel more susceptible to external and internal cyber threats due to the vast attack surface in their applications supply chain and the lack of end-to-end governance and risk management.
The software team must secure its software delivery process to avoid vulnerability and security breaches. This needs to be achieved with existing tool chains and without extensive rework of the delivery processes. This talk will present strategies and techniques for providing visibility into the true risk of the existing vulnerabilities, preventing the introduction of security issues in the software, resolving vulnerabilities in production environments quickly, and capturing the deployment bill of materials (DBOM).
Speakers:
Bob Boule
Robert Boule is a technology enthusiast with PASSION for technology and making things work along with a knack for helping others understand how things work. He comes with around 20 years of solution engineering experience in application security, software continuous delivery, and SaaS platforms. He is known for his dynamic presentations in CI/CD and application security integrated in software delivery lifecycle.
Gopinath Rebala
Gopinath Rebala is the CTO of OpsMx, where he has overall responsibility for the machine learning and data processing architectures for Secure Software Delivery. Gopi also has a strong connection with our customers, leading design and architecture for strategic implementations. Gopi is a frequent speaker and well-known leader in continuous delivery and integrating security into software delivery.
When stars align: studies in data quality, knowledge graphs, and machine lear...
Python in the browser
1. Python in the Browser 01/06/2010 13:45
Python in the Browser
Web Programming with Silverlight & IronPython
Michael Foord
michael@voidspace.org.uk
www.voidspace.org.uk
@voidspace
Python in the browser with Silverlight & IronPython
Introduction
Silverlight
Say Hello to Vera
Getting Started: One JS File
External Python Files
How it works
Loading the Javascript
Loading the Python Runtime
The IronPython Payload
Running the Python Code
So we can write code...
Using .NET APIs
Silverlight Toolkit
Try Python
Questions
Introduction
You, the Python developer, use Python because you want to, but in the browser you use
JavaScript because you think you have to. With Silverlight you can write Python code in the
file:///Users/michael/Dev/repository/Presentation/Talk/silverlight.html Page 1 of 12
2. Python in the Browser 01/06/2010 13:45
browser.
Silverlight
Microsoft browser plugin
Now installed in over 50% of browsers (riastats)
Cross platform: Windows and Mac, plus Linux with Moonlight
Cross browser: Safari, Firefox, IE and Chrome
Runs IronPython and IronRuby
Sockets, threading, local browser storage APIs
Webcam access, out of browser apps
IronPython docs at ironpython.net/browser/
IronPython 2.6 - the equivalent of Python 2.6.
Silverlight features include:
A ui system based on WPF
Full access to the browser DOM
Calling between Javascript and Silverlight code
Out of browser applications
Video, streaming media and 'deep zoom'
Local browser storage
Socket and threading APIs (etc)
Lots more...
Say Hello to Vera
file:///Users/michael/Dev/repository/Presentation/Talk/silverlight.html Page 2 of 12
3. Python in the Browser 01/06/2010 13:45
Over 19000 lines of Python code (plus hundreds of lines of xaml) written over a 7 month period by two
developers.
Getting Started: One JS File
Loading IronPython:
<script
src="http://gestalt.ironpython.net/dlr-latest.js"
type="text/javascript"></script>
Python in script tags:
<script type="text/python">
def onclick(s, e):
window.Alert("Hello from Python!")
document.button.events.onclick += handler
document.message.innerHTML = 'Hello Python!'
</script>
To develop a Python application in the browser, you just need your favorite text editor; so open it up,
create a HTML file, reference dlr.js, and then you can use script-tags for running Python code.
file:///Users/michael/Dev/repository/Presentation/Talk/silverlight.html Page 3 of 12
4. Python in the Browser 01/06/2010 13:45
External Python Files
<script type="text/python" src="repl.py"></script>
This creates a console when you add ?console to the url.
We can reference Python files as well as inline Python.
The console is hooked up to sys.stdout, so your existing text-based Python scripts can come alive in the
browser (sans reading from stdin). Also, any print statements you use in the app will show up in the
console as well, making it a great println-debugging tool.
Let's play around with the page a bit, adding a DOM element and changing it's HTML content to
"Ouch!" when clicked:
>>> dir(document)
[..., 'CreateElement', ...]
>>> div = document.CreateElement("div")
>>> div.innerHTML = "Hello from Python!"
>>> document.Body.AppendChild(div)
>>> div.id = "message"
>>> div.SetStyleAttribute("font-size", "24px")
>>> def say_ouch(o, e):
... o.innerHTML = "Ouch!"
...
>>> document.message.events.onclick += say_ouch
How it works
file:///Users/michael/Dev/repository/Presentation/Talk/silverlight.html Page 4 of 12
5. Python in the Browser 01/06/2010 13:45
dlr.js contains a collection of functions for creating a Silverlight control on the HTML page that is
capable of running IronPython code.
Loading the Javascript
file:///Users/michael/Dev/repository/Presentation/Talk/silverlight.html Page 5 of 12
6. Python in the Browser 01/06/2010 13:45
By default, just running dlr.js injects a Silverlight <object> tag into the page (immediately after the
script-tag) so it can run only DOM-based scripts, and also scans for other script-tags indicating that you
want a Silverlight rendering surface, but more on that later.
Loading the Python Runtime
file:///Users/michael/Dev/repository/Presentation/Talk/silverlight.html Page 6 of 12
7. Python in the Browser 01/06/2010 13:45
The injected Silverlight control points to a Silverlight application made specifically to embed the
dynamic language runtime, the compiler/runtime/embedding infrastructure IronPython is built on, find all
the Python code the HTML page uses, and executes it.
The XAP is tiny, as the DLR and IronPython are in separate packages which are downloaded on-
demand; the DLR and IronPython are not installed with Silverlight, so they must be downloaded with
the application.
The IronPython Payload
file:///Users/michael/Dev/repository/Presentation/Talk/silverlight.html Page 7 of 12
8. Python in the Browser 01/06/2010 13:45
However, if the application depends on the ironpython.net binaries, the user's browser will cache them
and they won't be re-downloaded for any other app; almost as good as being part of the installer, while
still being able to be open-source.
Running the Python Code
file:///Users/michael/Dev/repository/Presentation/Talk/silverlight.html Page 8 of 12
9. Python in the Browser 01/06/2010 13:45
Now user-code is able to run. Each inline Python script-tag is executed as if it was one Python module,
and all other Python files execute as their own modules.
To allow Python to be indented inside a script tag, the margin of the first line which does not only
contain whitespace is removed. Line numbers in the HTML are preserved, so error messages show up
correctly.
So we can write code...
What about testing it? Well, Python comes batteries included.
<script type="application/x-zip-compressed"
src="PythonStdLib.zip"></script>
<script type="text/python">
if document.QueryString.ContainsKey("test"):
import sys
sys.path.append("PythonStdLib")
import repl
repl.show()
file:///Users/michael/Dev/repository/Presentation/Talk/silverlight.html Page 9 of 12
10. Python in the Browser 01/06/2010 13:45
import unittest
...
That PythonStdLib.zip file contains the pieces of the Python standard-library that unittest depends on.
The Python standard library is a little less than 5MB compressed, so it's not unthinkable to include the
whole thing for development, but for deployment you should just include the dependencies; unittest's
dependencies are 58 KB.
When a zip file's filename is added to the path, it is treated like any other directory; import looks inside it
to find modules. You'll also notice that import repl just worked, even though repl.py isn't in the zip file; it
was referenced by a script-tag earlier. It works because script-tags actually represent file-system entries;
doing open("repl.py"), or open("PythonStdLib/unittest.py") would also work.
Using .NET APIs
Using WritableBitmap to render fractals.
Silverlight has a ton of functionality, and as I was only able to discuss a few Python libraries in
Silverlight, I'll only be able to show a few Silverlight libraries being used from Python, but the entirety
of Silverlight can be used from Python. See all the features Silverlight provides, as well as how to use
.NET APIs in-general from Python.
One interesting API is the WritableBitmap, which gives you per-pixel access to render whatever you
want. For example, here its used to render a fractal. The number crunching is actually done from C#, but
called from IronPython.
As with any computationally-intensive operations, it's a good idea to write them in a static pre-compiled
file:///Users/michael/Dev/repository/Presentation/Talk/silverlight.html Page 10 of 12
11. Python in the Browser 01/06/2010 13:45
language; for example the scientific-computation libraries for Python are actually written in C, but the
library provide an API accessible to Python programmers. Unfortunately, CPython puts that
responsibility on the library developer; not every C library can be directly consumed by Python code.
However, this example shows that IronPython can call into any C# library, or any library written in a
.NET language for that matter. This makes it trivial to just begin writing your application in Python, and
then decide to convert the performance-sensitive sections to C#.
We could also use the WritableBitmap to hook up to a webcam...
Silverlight Toolkit
silverlight.codeplex.com
A rich set of user interface controls including charting components.
Try Python
file:///Users/michael/Dev/repository/Presentation/Talk/silverlight.html Page 11 of 12
12. Python in the Browser 01/06/2010 13:45
Questions
blog.jimmy.schementi.com
ironpythoninaction.com
voidspace.org.uk/blog
trypython.org
file:///Users/michael/Dev/repository/Presentation/Talk/silverlight.html Page 12 of 12