SlideShare a Scribd company logo
Python Component In Mule
The Python language has many similarities to Perl, C, and Java.
However, there are some definite differences between the
languages
 Python also allows the developer to configure
interceptors and alter the values or references of
particular properties in a script. Interceptors are
configured to provide additional services to a
message as it flows through a component. For
example, a developer can configure an
interceptor to execute scheduling or logging of a
particular event while a message is being
processed. The Python component also includes
a custom interceptor which allows you to
configure settings for Spring elements.
 The Python script is generally executed at
runtime (client-side request); the custom logic
embedded in the script can be used to trigger an
application to execute a database transaction, or
modify your web-page interface.
 Accessing Values in Strings
 Python does not support a character
type; these are treated as strings of
length one, thus also considered a
substring.
 To access substrings, use the square
brackets for slicing along with the index
or indices to obtain your substring. For
example −
 #!/usr/bin/python var1 = 'Hello World!'
var2 = "Python Programming" print
"var1[0]: ", var1[0] print "var2[1:5]: ",
 Here is a set of small scripts, which
demonstrate some features of Python
programming.
 # this is the first comment
 #! python
 # integer variables
 SPAM = 1
 #! python print "Hello, Python"
 #! Python
 # string variable
 STRING = "# This is not a comment." print
STRING
 #! Python
 # integer arith
 a=4
 print a
 b=12+5
 print b
 c=b%a
 print c
 #! python
 # input and operator if
 x = int(raw_input("Please enter an integer: "))
 if x < 0:
 x = 0
 print 'Negative changed to zero'
 elif x == 0:
 print 'Zero'
 elif x == 1:
 print 'Single'
 else:
 print 'More'
 ! python
 # range function
 print range(10)
 print range(5, 10)
 print range(0, 10, 3)
 a = ['Mary', 'had', 'a', 'little', 'lamb']
 for i in range(len(a)):
 print i, a[i]
Create a New Project
Enter project name as
demo_python click on finish
Drag components as shown in
the below and configure Http
Drag python component and
configure as below
Paste in script
 #! python
 print "Hello, Python"
Run as Mule Application
 Hit the URL on browser:
 http://localhost:8081/python
 Hello, Python is the output

More Related Content

What's hot (20)

PPTX
Mule message enricher
Anirban Sen Chowdhary
 
PPTX
Integration with Dropbox using Mule ESB
Rupesh Sinha
 
PPTX
Mulesoft file connector
kumar gaurav
 
PPTX
Testing mule
Sindhu VL
 
PPTX
Mule Python component
Ankush Sharma
 
PPTX
Routing in mule
Hari Gatadi
 
PPTX
Mule dataweave
Son Nguyen
 
PPT
2310 b 06
Krazy Koder
 
PPTX
Xslt in mule
Mohammed246
 
PPTX
Using spring task scheduler in java in mule
Anirban Sen Chowdhary
 
PPTX
Runing batch job in mule
Son Nguyen
 
PPTX
Enjoy Munit with Mule
Bui Kiet
 
PPTX
Machine Understandable code
janusathis
 
PDF
Chapter 2 - Structure of C++ Program
Deepak Singh
 
PPTX
Dynamic file attribute
Anirban Sen Chowdhary
 
PPTX
Mule ESB - Mock Salesforce Interface
krishananth
 
PPTX
Send email attachment using smtp in mule esb
Praneethchampion
 
PPTX
Batch processing
Ramakrishna kapa
 
PPTX
Xml to xml transformation in mule
Rajkattamuri
 
PPTX
Codefresh + BlazeMeter Webinar: Continuous Testing for Containerized Applicat...
Brittany Ingram
 
Mule message enricher
Anirban Sen Chowdhary
 
Integration with Dropbox using Mule ESB
Rupesh Sinha
 
Mulesoft file connector
kumar gaurav
 
Testing mule
Sindhu VL
 
Mule Python component
Ankush Sharma
 
Routing in mule
Hari Gatadi
 
Mule dataweave
Son Nguyen
 
2310 b 06
Krazy Koder
 
Xslt in mule
Mohammed246
 
Using spring task scheduler in java in mule
Anirban Sen Chowdhary
 
Runing batch job in mule
Son Nguyen
 
Enjoy Munit with Mule
Bui Kiet
 
Machine Understandable code
janusathis
 
Chapter 2 - Structure of C++ Program
Deepak Singh
 
Dynamic file attribute
Anirban Sen Chowdhary
 
Mule ESB - Mock Salesforce Interface
krishananth
 
Send email attachment using smtp in mule esb
Praneethchampion
 
Batch processing
Ramakrishna kapa
 
Xml to xml transformation in mule
Rajkattamuri
 
Codefresh + BlazeMeter Webinar: Continuous Testing for Containerized Applicat...
Brittany Ingram
 

Viewers also liked (20)

PDF
Tema 2 RRPP
Monica Mantilla Coronel
 
PDF
STOCK_ANALYSIS_PROJECT
Louise Miller
 
DOC
Agentschap Integratie en Inburgering heeft geschil met provincies
Thierry Debels
 
PPTX
Angular js
Ramakrishna kapa
 
PPTX
Groovy features
Ramakrishna kapa
 
PDF
Listino prezzi BMW Serie 3 Gran Turismo
autoblogpuntoit
 
PDF
ACI Mercato auto usate novembre 2012
autoblogpuntoit
 
PDF
Workforce Magazine - August 2015
Dylan Choong
 
PPT
1 introduction-to-computer-networking
Priya Manik
 
PDF
Listino Prezzi McLaren 570GT
Autoblog.it
 
PDF
Luis Alberto Marín- 'Horal', sus orillas extremas
Luis Alberto Marín Aguilar
 
PDF
Fiat-Chrysler 3,3% VEBA
Autoblog.it
 
PDF
Listino Prezzi Lancia Ypsilon
autoblogpuntoit
 
PPTX
Pembaharuan sumber tenaga
Zulina Farra Selamat Fawzi
 
PPTX
group 3
kilaye
 
PPTX
Catálogo de plantas para espacios abiertos.
Charlsarq
 
PDF
Bollo auto più caro con carta di credito: 3 milioni di multa all'Aci
Autoblog.it
 
PDF
はじめての UWP アプリ開発
hiyohiyo
 
STOCK_ANALYSIS_PROJECT
Louise Miller
 
Agentschap Integratie en Inburgering heeft geschil met provincies
Thierry Debels
 
Angular js
Ramakrishna kapa
 
Groovy features
Ramakrishna kapa
 
Listino prezzi BMW Serie 3 Gran Turismo
autoblogpuntoit
 
ACI Mercato auto usate novembre 2012
autoblogpuntoit
 
Workforce Magazine - August 2015
Dylan Choong
 
1 introduction-to-computer-networking
Priya Manik
 
Listino Prezzi McLaren 570GT
Autoblog.it
 
Luis Alberto Marín- 'Horal', sus orillas extremas
Luis Alberto Marín Aguilar
 
Fiat-Chrysler 3,3% VEBA
Autoblog.it
 
Listino Prezzi Lancia Ypsilon
autoblogpuntoit
 
Pembaharuan sumber tenaga
Zulina Farra Selamat Fawzi
 
group 3
kilaye
 
Catálogo de plantas para espacios abiertos.
Charlsarq
 
Bollo auto più caro con carta di credito: 3 milioni di multa all'Aci
Autoblog.it
 
はじめての UWP アプリ開発
hiyohiyo
 
Ad

Similar to Python component in mule (20)

PDF
Python (3).pdf
samiwaris2
 
PDF
Core python programming tutorial
Amarjeetsingh Thakur
 
PDF
python-online&offline-training-in-kphb-hyderabad (1) (1).pdf
KosmikTech1
 
DOCX
INTERNSHIP REPORT.docx
21IT200KishorekumarI
 
PPTX
Chapter 1-Introduction and syntax of python programming.pptx
atharvdeshpande20
 
PDF
Introduction of Python
ZENUS INFOTECH INDIA PVT. LTD.
 
PDF
Python Interview Questions PDF By ScholarHat.pdf
Scholarhat
 
PPTX
Getting started with the basics of python
asharjavidaj
 
PPTX
Python fundamentals
natnaelmamuye
 
PPTX
Python (Data Analysis) cleaning and visualize
IruolagbePius
 
DOCX
Python Course.docx
AdnanAhmad57885
 
PDF
First Steps in Python Programming
Dozie Agbo
 
PPT
An Overview Of Python With Functional Programming
Adam Getchell
 
PDF
Fundamentals of python
BijuAugustian
 
PPTX
Python Introduction
vikram mahendra
 
PPTX
python notes for MASTER OF COMPUTER APPLIICATION_ppt.pptx
yuvarajkumar334
 
PPTX
Introduction to Python for Data Science and Machine Learning
ParrotAI
 
PDF
WEB PROGRAMMING UNIT VIII BY BHAVSINGH MALOTH
Bhavsingh Maloth
 
PPT
Python slides for the beginners to learn
krishna43511
 
PPT
program on python what is python where it was started by whom started
rajkumarmandal9391
 
Python (3).pdf
samiwaris2
 
Core python programming tutorial
Amarjeetsingh Thakur
 
python-online&offline-training-in-kphb-hyderabad (1) (1).pdf
KosmikTech1
 
INTERNSHIP REPORT.docx
21IT200KishorekumarI
 
Chapter 1-Introduction and syntax of python programming.pptx
atharvdeshpande20
 
Introduction of Python
ZENUS INFOTECH INDIA PVT. LTD.
 
Python Interview Questions PDF By ScholarHat.pdf
Scholarhat
 
Getting started with the basics of python
asharjavidaj
 
Python fundamentals
natnaelmamuye
 
Python (Data Analysis) cleaning and visualize
IruolagbePius
 
Python Course.docx
AdnanAhmad57885
 
First Steps in Python Programming
Dozie Agbo
 
An Overview Of Python With Functional Programming
Adam Getchell
 
Fundamentals of python
BijuAugustian
 
Python Introduction
vikram mahendra
 
python notes for MASTER OF COMPUTER APPLIICATION_ppt.pptx
yuvarajkumar334
 
Introduction to Python for Data Science and Machine Learning
ParrotAI
 
WEB PROGRAMMING UNIT VIII BY BHAVSINGH MALOTH
Bhavsingh Maloth
 
Python slides for the beginners to learn
krishna43511
 
program on python what is python where it was started by whom started
rajkumarmandal9391
 
Ad

More from Ramakrishna kapa (20)

PPTX
Load balancer in mule
Ramakrishna kapa
 
PPTX
Anypoint connectors
Ramakrishna kapa
 
PPTX
Msmq connectivity
Ramakrishna kapa
 
PPTX
Scopes in mule
Ramakrishna kapa
 
PPTX
Data weave more operations
Ramakrishna kapa
 
PPTX
Basic math operations using dataweave
Ramakrishna kapa
 
PPTX
Dataweave types operators
Ramakrishna kapa
 
PPTX
Operators in mule dataweave
Ramakrishna kapa
 
PPTX
Data weave in mule
Ramakrishna kapa
 
PPTX
Servicenow connector
Ramakrishna kapa
 
PPTX
Introduction to testing mule
Ramakrishna kapa
 
PPTX
Choice flow control
Ramakrishna kapa
 
PPTX
Message enricher example
Ramakrishna kapa
 
PPTX
Mule exception strategies
Ramakrishna kapa
 
PPTX
Anypoint connector basics
Ramakrishna kapa
 
PPTX
Mule global elements
Ramakrishna kapa
 
PPTX
Mule message structure and varibles scopes
Ramakrishna kapa
 
PPTX
How to create an api in mule
Ramakrishna kapa
 
PPTX
Log4j is a reliable, fast and flexible
Ramakrishna kapa
 
PPTX
Jsf 2
Ramakrishna kapa
 
Load balancer in mule
Ramakrishna kapa
 
Anypoint connectors
Ramakrishna kapa
 
Msmq connectivity
Ramakrishna kapa
 
Scopes in mule
Ramakrishna kapa
 
Data weave more operations
Ramakrishna kapa
 
Basic math operations using dataweave
Ramakrishna kapa
 
Dataweave types operators
Ramakrishna kapa
 
Operators in mule dataweave
Ramakrishna kapa
 
Data weave in mule
Ramakrishna kapa
 
Servicenow connector
Ramakrishna kapa
 
Introduction to testing mule
Ramakrishna kapa
 
Choice flow control
Ramakrishna kapa
 
Message enricher example
Ramakrishna kapa
 
Mule exception strategies
Ramakrishna kapa
 
Anypoint connector basics
Ramakrishna kapa
 
Mule global elements
Ramakrishna kapa
 
Mule message structure and varibles scopes
Ramakrishna kapa
 
How to create an api in mule
Ramakrishna kapa
 
Log4j is a reliable, fast and flexible
Ramakrishna kapa
 

Recently uploaded (20)

PDF
Capcut Pro Crack For PC Latest Version {Fully Unlocked} 2025
hashhshs786
 
DOCX
Import Data Form Excel to Tally Services
Tally xperts
 
PDF
Alarm in Android-Scheduling Timed Tasks Using AlarmManager in Android.pdf
Nabin Dhakal
 
PPTX
MiniTool Power Data Recovery Full Crack Latest 2025
muhammadgurbazkhan
 
PPTX
The Role of a PHP Development Company in Modern Web Development
SEO Company for School in Delhi NCR
 
PPTX
Writing Better Code - Helping Developers make Decisions.pptx
Lorraine Steyn
 
PDF
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pdf
Varsha Nayak
 
PDF
Executive Business Intelligence Dashboards
vandeslie24
 
PPTX
Tally_Basic_Operations_Presentation.pptx
AditiBansal54083
 
PPTX
Feb 2021 Cohesity first pitch presentation.pptx
enginsayin1
 
PPTX
Java Native Memory Leaks: The Hidden Villain Behind JVM Performance Issues
Tier1 app
 
PPTX
Engineering the Java Web Application (MVC)
abhishekoza1981
 
PPTX
3uTools Full Crack Free Version Download [Latest] 2025
muhammadgurbazkhan
 
PDF
Mobile CMMS Solutions Empowering the Frontline Workforce
CryotosCMMSSoftware
 
PPTX
Migrating Millions of Users with Debezium, Apache Kafka, and an Acyclic Synch...
MD Sayem Ahmed
 
PDF
GetOnCRM Speeds Up Agentforce 3 Deployment for Enterprise AI Wins.pdf
GetOnCRM Solutions
 
PDF
vMix Pro 28.0.0.42 Download vMix Registration key Bundle
kulindacore
 
PDF
Automate Cybersecurity Tasks with Python
VICTOR MAESTRE RAMIREZ
 
PPTX
Revolutionizing Code Modernization with AI
KrzysztofKkol1
 
PPTX
Tally software_Introduction_Presentation
AditiBansal54083
 
Capcut Pro Crack For PC Latest Version {Fully Unlocked} 2025
hashhshs786
 
Import Data Form Excel to Tally Services
Tally xperts
 
Alarm in Android-Scheduling Timed Tasks Using AlarmManager in Android.pdf
Nabin Dhakal
 
MiniTool Power Data Recovery Full Crack Latest 2025
muhammadgurbazkhan
 
The Role of a PHP Development Company in Modern Web Development
SEO Company for School in Delhi NCR
 
Writing Better Code - Helping Developers make Decisions.pptx
Lorraine Steyn
 
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pdf
Varsha Nayak
 
Executive Business Intelligence Dashboards
vandeslie24
 
Tally_Basic_Operations_Presentation.pptx
AditiBansal54083
 
Feb 2021 Cohesity first pitch presentation.pptx
enginsayin1
 
Java Native Memory Leaks: The Hidden Villain Behind JVM Performance Issues
Tier1 app
 
Engineering the Java Web Application (MVC)
abhishekoza1981
 
3uTools Full Crack Free Version Download [Latest] 2025
muhammadgurbazkhan
 
Mobile CMMS Solutions Empowering the Frontline Workforce
CryotosCMMSSoftware
 
Migrating Millions of Users with Debezium, Apache Kafka, and an Acyclic Synch...
MD Sayem Ahmed
 
GetOnCRM Speeds Up Agentforce 3 Deployment for Enterprise AI Wins.pdf
GetOnCRM Solutions
 
vMix Pro 28.0.0.42 Download vMix Registration key Bundle
kulindacore
 
Automate Cybersecurity Tasks with Python
VICTOR MAESTRE RAMIREZ
 
Revolutionizing Code Modernization with AI
KrzysztofKkol1
 
Tally software_Introduction_Presentation
AditiBansal54083
 

Python component in mule

  • 1. Python Component In Mule The Python language has many similarities to Perl, C, and Java. However, there are some definite differences between the languages
  • 2.  Python also allows the developer to configure interceptors and alter the values or references of particular properties in a script. Interceptors are configured to provide additional services to a message as it flows through a component. For example, a developer can configure an interceptor to execute scheduling or logging of a particular event while a message is being processed. The Python component also includes a custom interceptor which allows you to configure settings for Spring elements.  The Python script is generally executed at runtime (client-side request); the custom logic embedded in the script can be used to trigger an application to execute a database transaction, or modify your web-page interface.
  • 3.  Accessing Values in Strings  Python does not support a character type; these are treated as strings of length one, thus also considered a substring.  To access substrings, use the square brackets for slicing along with the index or indices to obtain your substring. For example −  #!/usr/bin/python var1 = 'Hello World!' var2 = "Python Programming" print "var1[0]: ", var1[0] print "var2[1:5]: ",
  • 4.  Here is a set of small scripts, which demonstrate some features of Python programming.  # this is the first comment  #! python  # integer variables  SPAM = 1  #! python print "Hello, Python"  #! Python  # string variable  STRING = "# This is not a comment." print STRING
  • 5.  #! Python  # integer arith  a=4  print a  b=12+5  print b  c=b%a  print c
  • 6.  #! python  # input and operator if  x = int(raw_input("Please enter an integer: "))  if x < 0:  x = 0  print 'Negative changed to zero'  elif x == 0:  print 'Zero'  elif x == 1:  print 'Single'  else:  print 'More'
  • 7.  ! python  # range function  print range(10)  print range(5, 10)  print range(0, 10, 3)  a = ['Mary', 'had', 'a', 'little', 'lamb']  for i in range(len(a)):  print i, a[i]
  • 8. Create a New Project
  • 9. Enter project name as demo_python click on finish
  • 10. Drag components as shown in the below and configure Http
  • 11. Drag python component and configure as below
  • 12. Paste in script  #! python  print "Hello, Python"
  • 13. Run as Mule Application  Hit the URL on browser:  http://localhost:8081/python  Hello, Python is the output