<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-4103056068311275815</id><updated>2026-11-01T19:47:32.646+05:00</updated><category term="ora-code"/><category term="oracle"/><category term="interview questions"/><category term="sql server"/><category term="HTML"/><category term="OOP"/><category term=".Net"/><category term="c#"/><category term="Java Script"/><category term="Java Script Beginner"/><category term="CSS"/><category term="HTML Beginner"/><category term="HTML Advance"/><category term="python"/><category term="CSS Beginner"/><category term="ADO.NET"/><category term="Java Script Advanced"/><category term="XHTML"/><category term="CSS Advance"/><category term="Entity Framework"/><category term="web service"/><category term="ASP.NET"/><category term="AWS"/><category term="Amazon S3"/><category term="Google"/><category term="Linux"/><category term="Ubuntu"/><category term="django"/><category term="eclipse"/><category term="API"/><category term="JQuery"/><category term="LINQ"/><category term="Mobile"/><category term="Silverlight"/><category term="Win RT"/><category term="Windows Phone"/><category term="XPath"/><category term="c++."/><category term="cron job"/><category term="requests"/><title type='text'>Web Design Plus Code</title><subtitle type='html'>Programming Tutorials on XHTML, CSS, JavaScript, JQuery, JSON, Python, Django, Amazon Web Services, ASP.NET,  Web Forms, and SQL </subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://webdesignpluscode.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4103056068311275815/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://webdesignpluscode.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/4103056068311275815/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Waqas Ali</name><uri>http://www.blogger.com/profile/00458603368045512811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi84d3OPcVaH5dEEXYUc09MMM5UWPa5KLFkRFV-BORRBpASebtv4W8YWxVetuXKOwnYBd031-f_HaC5Zc3w-iz2AdWvuf51a0VUGHUxOx_u8xxKeglselSnBik5Sai0wPo/s220/1918953_1058549159885_1783287_n.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>408</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-4103056068311275815.post-4863971499061869622</id><published>2021-03-11T20:38:00.002+05:00</published><updated>2021-03-11T20:38:54.201+05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="API"/><category scheme="http://www.blogger.com/atom/ns#" term="python"/><category scheme="http://www.blogger.com/atom/ns#" term="requests"/><title type='text'>How to Set Timeout and Max Retries in Python Request Module</title><content type='html'>&lt;h3 style=&quot;text-align: left;&quot;&gt;Introduction&lt;/h3&gt;&lt;p&gt;In this tutorial we will use python requests module with max retries and timeout values. It is strongly recommended to implement retries and timeout mechanism for production code as connections can close at any time, even in non-error conditions. HTTP applications have to be ready to properly handle unexpected closes. If a transport connection closes while the client is performing a transaction, the client should reopen the connection and retry one time, unless the transaction has side effects.&amp;nbsp;&lt;/p&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;1. Set Max Retries Values&lt;/h3&gt;&lt;p&gt;We will create python session and define our retry strategy for that. Our retry strategy will consists of connect retries, read retries, backoff factor (delay between attempts after second try), and status_forcelist (list of status, against which we want to retry).&lt;/p&gt;&lt;p&gt;Use following code to create request session, and setup retry strategy.&lt;/p&gt;
&lt;div style=&quot;background: rgb(236, 236, 236); margin-bottom: 15px; margin-top: 15px; padding-bottom: 15px; padding-top: 15px; width: 100%;&quot;&gt;
	&lt;div style=&quot;padding-left: 15px;&quot;&gt;
&lt;p&gt;# import request module&lt;/p&gt;&lt;p&gt;import requests&lt;/p&gt;&lt;p&gt;# define some values of retries. You can update it according to your requirements.&lt;/p&gt;&lt;p&gt;MAX_RETRIES = 3&lt;/p&gt;&lt;p&gt;BACKOFF = 1&lt;/p&gt;&lt;p&gt;STATUS_FORCELIST = [&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; 413,&amp;nbsp; # Payload Too Large&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; 429,&amp;nbsp; # Too Many Requests&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; 500,&amp;nbsp; # Internal Server Error&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; 502,&amp;nbsp; # Bad Gateway&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; 503,&amp;nbsp; # Service Unavailable&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; 504&amp;nbsp; # Gateway Timeout&lt;/p&gt;&lt;p&gt;]&lt;/p&gt;&lt;p&gt;# Set both connect and read timeout. (we can set only one value to represent both.)&lt;/p&gt;&lt;p&gt;REQUEST_TIMEOUT = (3.05, 10)&amp;nbsp; # (connect, read)&lt;/p&gt;&lt;p&gt;# create request session&lt;/p&gt;&lt;p&gt;session = requests.Session()&lt;/p&gt;&lt;p&gt;# set some default values in session header, these values will be merged with request header, if we want to send some additional headers at runtime.&lt;/p&gt;&lt;p&gt;session.headers.update({&#39;Connection&#39;: &#39;close&#39;})&lt;/p&gt;&lt;p&gt;# define retry strategy, and set required values&lt;/p&gt;&lt;p&gt;retry = Retry(&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;total=MAX_RETRIES,&amp;nbsp; # Total number of retries to allow. Takes precedence over other counts.&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;read=MAX_RETRIES,&amp;nbsp; # How many connection-related errors to retry on.&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;connect=MAX_RETRIES,&amp;nbsp; # How many times to retry on read errors.&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;backoff_factor=BACKOFF,&amp;nbsp; # A backoff factor to apply between attempts after the second try&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;status_forcelist=STATUS_FORCELIST,&lt;/p&gt;&lt;p&gt;)&lt;/p&gt;&lt;p&gt;adapter = HTTPAdapter(max_retries=retry)&lt;/p&gt;&lt;p&gt;session.mount(&#39;http://&#39;, adapter)&lt;/p&gt;&lt;p&gt;session.mount(&#39;https://&#39;, adapter)&lt;/p&gt;
  &lt;/div&gt;
&lt;/div&gt;
      
      &lt;p&gt;At this point, we have session ready with required values of retries, back off factor, and status force list. We will use this session to send API requests.&lt;/p&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;2. Set Timeout Value&lt;/h3&gt;&lt;p&gt;Use following code to send API requests with required value of request timeout we have set above&lt;/p&gt;
&lt;div style=&quot;background: rgb(236, 236, 236); margin-bottom: 15px; margin-top: 15px; padding-bottom: 15px; padding-top: 15px; width: 100%;&quot;&gt;
	&lt;div style=&quot;padding-left: 15px;&quot;&gt;
&lt;p&gt;response = session.get(&#39;httpbin.org/delay/10&#39;, timeout=REQUEST_TIMEOUT)&lt;/p&gt;
  &lt;/div&gt;
&lt;/div&gt;
      &lt;p&gt;This request will attempt retries against given list of status force list before raising any exception.&lt;/p&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;Conclusion&lt;/h3&gt;&lt;p&gt;We have configured both timeout and max retries of python request module. Make sure to set some appropriate value of timeout on production, by default value of timeout is None which means it never expire which can cause your production code to hang for too long.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://webdesignpluscode.blogspot.com/feeds/4863971499061869622/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://webdesignpluscode.blogspot.com/2021/03/how-to-set-timeout-and-max-retries-in.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4103056068311275815/posts/default/4863971499061869622'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4103056068311275815/posts/default/4863971499061869622'/><link rel='alternate' type='text/html' href='http://webdesignpluscode.blogspot.com/2021/03/how-to-set-timeout-and-max-retries-in.html' title='How to Set Timeout and Max Retries in Python Request Module'/><author><name>Waqas Ali</name><uri>http://www.blogger.com/profile/00458603368045512811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi84d3OPcVaH5dEEXYUc09MMM5UWPa5KLFkRFV-BORRBpASebtv4W8YWxVetuXKOwnYBd031-f_HaC5Zc3w-iz2AdWvuf51a0VUGHUxOx_u8xxKeglselSnBik5Sai0wPo/s220/1918953_1058549159885_1783287_n.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4103056068311275815.post-8083492572892956549</id><published>2021-03-10T09:26:00.001+05:00</published><updated>2021-03-11T20:40:13.833+05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Amazon S3"/><category scheme="http://www.blogger.com/atom/ns#" term="AWS"/><category scheme="http://www.blogger.com/atom/ns#" term="python"/><title type='text'>How to Create and Upload an In Memory CSV File to Amazon S3 Bucket using Python</title><content type='html'>&lt;h3 style=&quot;text-align: left;&quot;&gt;Introduction&lt;/h3&gt;&lt;p&gt;In this tutorial we will create an in memory csv file and upload to Amazon S3 bucket using python package boto3. We will cover two scenarios here, 1). create an in memory file from nested lists (list of lists), 2). create in memory file from list of dictionaries, and then upload to Amazon S3.&lt;/p&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;1. Install dependencies&lt;/h3&gt;&lt;p&gt;We need to install required dependencies in order to complete this tutorial. Install following package in your OS directly or first create virtual environment activate it and then install package in that virtual environment.&lt;/p&gt;&lt;h4 style=&quot;text-align: left;&quot;&gt;Run following command to create virtual environment (in windows)&lt;/h4&gt;
&lt;div style=&quot;background: rgb(236, 236, 236); margin-bottom: 15px; margin-top: 15px; padding-bottom: 15px; padding-top: 15px; width: 100%;&quot;&gt;
&lt;div style=&quot;padding-left: 15px;&quot;&gt;virtualenv venv&amp;nbsp; # venv is name of virtual environment&lt;/div&gt;
&lt;/div&gt;
&lt;h4 style=&quot;text-align: left;&quot;&gt;Activate virtual environment:&lt;/h4&gt;
&lt;div style=&quot;background: rgb(236, 236, 236); margin-bottom: 15px; margin-top: 15px; padding-bottom: 15px; padding-top: 15px; width: 100%;&quot;&gt;
  &lt;div style=&quot;padding-left: 15px;&quot;&gt;.\venv\Scripts\activate.bat&lt;/div&gt;
&lt;/div&gt;
&lt;h4 style=&quot;text-align: left;&quot;&gt;Install following package(s) in virtual environment:&lt;/h4&gt;
&lt;div style=&quot;background: rgb(236, 236, 236); margin-bottom: 15px; margin-top: 15px; padding-bottom: 15px; padding-top: 15px; width: 100%;&quot;&gt;
  &lt;div style=&quot;padding-left: 15px;&quot;&gt;pip install boto3&lt;/div&gt;
&lt;/div&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;2. Create In memory File&lt;/h3&gt;&lt;p&gt;Create new file with extension .py and import following module:&lt;/p&gt;
&lt;div style=&quot;background: rgb(236, 236, 236); margin-bottom: 15px; margin-top: 15px; padding-bottom: 15px; padding-top: 15px; width: 100%;&quot;&gt;
	&lt;div style=&quot;padding-left: 15px;&quot;&gt;
      &lt;p&gt;import csv&lt;/p&gt; &lt;p&gt;import boto3&lt;/p&gt; &lt;p&gt;from io import StringIO&lt;/p&gt;
  	&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Create list of lists as following, first nested list will represent header of file, and other nested lists will represent data of file.&lt;/p&gt;
&lt;div style=&quot;background: rgb(236, 236, 236); margin-bottom: 15px; margin-top: 15px; padding-bottom: 15px; padding-top: 15px; width: 100%;&quot;&gt;
&lt;div style=&quot;padding-left: 15px;&quot;&gt;
list_of_lists = [[&#39;name&#39;, &#39;age&#39;], [&#39;name 1&#39;, 25], [&#39;name 2&#39;, 26], [&#39;name 3&#39;, 27]]
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;If we have list of dictionaries, we can first convert that list of dictionaries to list of lists and then proceed with next steps. Use following code to convert list of dictionaries to list of lists.&lt;/p&gt;
&lt;div style=&quot;background: rgb(236, 236, 236); margin-bottom: 15px; margin-top: 15px; padding-bottom: 15px; padding-top: 15px; width: 100%;&quot;&gt;
&lt;div style=&quot;padding-left: 15px;&quot;&gt;
&lt;p&gt;# input list&lt;/p&gt;&lt;p&gt;list_of_dicts = [{&#39;name&#39;: &#39;name 1&#39;, &#39;age&#39;: 25}, {&#39;name&#39;: &#39;name 2&#39;, &#39;age&#39;: 26}, {&#39;name&#39;: &#39;name 3&#39;, &#39;age&#39;: 27}]&lt;/p&gt;&lt;p&gt;# convert list of dictionary to list of lists&lt;/p&gt;&lt;p&gt;file_data = []&lt;/p&gt;&lt;p&gt;header = list(list_of_dicts[0].keys())&lt;/p&gt;&lt;p&gt;file_data = [[d[key] for key in header] for d in list_of_dicts]&lt;/p&gt;&lt;p&gt;file_data = [header] + file_data&lt;/p&gt;
  &lt;/div&gt;
&lt;/div&gt;
  &lt;p&gt;At this point, we have converted list of dictionaries to list of lists, use following code to create in memory file and write data in it.&lt;/p&gt;
&lt;div style=&quot;background: rgb(236, 236, 236); margin-bottom: 15px; margin-top: 15px; padding-bottom: 15px; padding-top: 15px; width: 100%;&quot;&gt;
&lt;div style=&quot;padding-left: 15px;&quot;&gt;
&lt;p&gt;# create in memory file and write data in it.&lt;/p&gt;&lt;p&gt;file_to_save = StringIO()&lt;/p&gt;&lt;p&gt;csv.writer(file_to_save).writerows(file_data)&lt;/p&gt;&lt;p&gt;file_to_save = bytes(file_to_save.getvalue(), encoding=&#39;utf-8&#39;)&lt;/p&gt;&lt;p&gt;file_name_on_s3 = &#39;my_data.csv&#39;&lt;/p&gt;
  &lt;/div&gt;
&lt;/div&gt;
  &lt;h3 style=&quot;text-align: left;&quot;&gt;3. Save In Memory File to Amazon S3&lt;/h3&gt;&lt;div&gt;We have created an in memory file, now use following code to save/upload that in memory file to Amazon S3.&lt;/div&gt;
&lt;div style=&quot;background: rgb(236, 236, 236); margin-bottom: 15px; margin-top: 15px; padding-bottom: 15px; padding-top: 15px; width: 100%;&quot;&gt;
&lt;div style=&quot;padding-left: 15px;&quot;&gt;
&lt;p&gt;# create boto3 client using your AWS access key id and secret access key&lt;/p&gt;&lt;p&gt;client = boto3.client(&#39;s3&#39;,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; aws_access_key_id=&#39;your access key&#39;,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; aws_secret_access_key=&#39;your secret key&#39;)&lt;/p&gt;&lt;p&gt;# save in memory file to S3&lt;/p&gt;&lt;p&gt;response = client.put_object(&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;Body=file_to_save,&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;Bucket=&#39;your bucket name&#39;,&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;Key=file_name_on_s3,&lt;/p&gt;&lt;p&gt;)&lt;/p&gt;
  &lt;/div&gt;
&lt;/div&gt;
  &lt;h3 style=&quot;text-align: left;&quot;&gt;Conclusion&lt;/h3&gt;&lt;p&gt;We have created an in memory file from list of lists and/or list of dictionaries, and uploaded to Amazon S3 bucket. Please let me know in comments if you have any better approach to implement this.&lt;/p&gt;&lt;p&gt;HAPPY CODING!!&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://webdesignpluscode.blogspot.com/feeds/8083492572892956549/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://webdesignpluscode.blogspot.com/2021/03/how-to-create-and-upload-in-memory-csv.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4103056068311275815/posts/default/8083492572892956549'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4103056068311275815/posts/default/8083492572892956549'/><link rel='alternate' type='text/html' href='http://webdesignpluscode.blogspot.com/2021/03/how-to-create-and-upload-in-memory-csv.html' title='How to Create and Upload an In Memory CSV File to Amazon S3 Bucket using Python'/><author><name>Waqas Ali</name><uri>http://www.blogger.com/profile/00458603368045512811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi84d3OPcVaH5dEEXYUc09MMM5UWPa5KLFkRFV-BORRBpASebtv4W8YWxVetuXKOwnYBd031-f_HaC5Zc3w-iz2AdWvuf51a0VUGHUxOx_u8xxKeglselSnBik5Sai0wPo/s220/1918953_1058549159885_1783287_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4103056068311275815.post-419128900855108770</id><published>2020-10-03T14:14:00.012+05:00</published><updated>2020-10-03T14:21:57.704+05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Amazon S3"/><category scheme="http://www.blogger.com/atom/ns#" term="AWS"/><category scheme="http://www.blogger.com/atom/ns#" term="python"/><title type='text'>How to Upload Excel File to Amazon S3 Bucket in Python</title><content type='html'>&lt;p&gt;In this tutorial we will learn how to upload excel file to Amazon S3 bucket in python using Amazon&#39;s SDK Boto3. To complete this tutorial, we need to perform following steps.&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;/p&gt;&lt;ol style=&quot;text-align: left;&quot;&gt;&lt;li&gt;Get you access key and secret key from AWS management console.&lt;/li&gt;&lt;li&gt;Install boto3 module.&lt;/li&gt;&lt;li&gt;Write python code to upload file to Amazon S3 bucket.&lt;/li&gt;&lt;/ol&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;1. Get your access key and secret key from AWS management console.&lt;/h3&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;We assume you already have a Amazon Web Services account. If you don&#39;t have, create new account.&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;ol style=&quot;text-align: left;&quot;&gt;&lt;li&gt;Login to AWS management console.&lt;/li&gt;&lt;li&gt;Click on your username at the top-right of the page to open the drop-down menu.&lt;/li&gt;&lt;li&gt;Click on &lt;b&gt;My Security Credentials&lt;/b&gt;. (Your Security Credential tab will open by default)&lt;/li&gt;&lt;li&gt;Click on the &lt;b&gt;Access keys (access key ID and secret access key)&lt;/b&gt;&lt;/li&gt;&lt;li&gt;To create a new access key and secret, click on the &lt;b&gt;Create New Access Key&lt;/b&gt; button.&lt;/li&gt;&lt;li&gt;Download the .csv file containing your access key and secret.&lt;/li&gt;&lt;/ol&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;2. Install boto3 module&lt;/h3&gt;&lt;div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Use pip as your package installer, run the below command in cmd.&lt;/div&gt;&lt;div&gt;
  &lt;div style=&quot;background: rgb(236, 236, 236); margin-bottom: 15px; margin-top: 15px; padding-bottom: 15px; padding-top: 15px; width: 100%;&quot;&gt;
pip install boto3
&lt;/div&gt;
  &lt;/div&gt;&lt;/div&gt;&lt;div&gt;If you are working in virtual environment then make sure to activate your virtual environment first.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;3. Write python code to upload file to Amazon S3 bucket.&lt;/h3&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background: rgb(236, 236, 236); margin-bottom: 15px; margin-top: 15px; padding-bottom: 15px; padding-top: 15px; width: 100%;&quot;&gt;
&lt;div&gt;&lt;div&gt;# import module&lt;/div&gt;&lt;div&gt;import boto3&lt;/div&gt;&lt;div&gt;from botocore.exceptions import ClientError&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;# declare constants&lt;/div&gt;&lt;div&gt;AWS_ACCESS_KEY =&amp;nbsp; &quot;xxxxxxxxxx&quot;&lt;/div&gt;&lt;div&gt;AWS_SECRET_KEY =&amp;nbsp; &quot;xxxxxxxxxxxxxxxxxxxxxxxx&quot;&lt;/div&gt;&lt;div&gt;S3_BUCKET = &#39;bucket_name&#39;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;def upload_file_to_s3(file_name, bucket, object_name):&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &quot;&quot;&quot;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; :param file_name: file name to upload&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; :param bucket: S3 bucket&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; :param object_name: S3 object name&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; :return: True if successful upload else False&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &quot;&quot;&quot;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; s3 = boto3.client(&quot;s3&quot;, aws_access_key_id=AWS_ACCESS_KEY,&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; aws_secret_access_key=AWS_SECRET_KEY)&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; try:&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; s3.upload_fileobj(&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; file_name,&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; bucket,&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; object_name,&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ExtraArgs={&quot;ContentType&quot;: &quot;application/vnd.openxmlformats-officedocument.spreadsheetml.sheet&quot;,&amp;nbsp;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&quot;ContentDisposition&quot;: &quot;attachment&quot;}&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; )&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; except ClientError as e:&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return False&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; return True&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;upload_file_to_s3(local_file_name, S3_BUCKET, s3_object_name)&lt;/div&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;Please let me know if you have any question, or have some better way to do this. :)&lt;div&gt;&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://webdesignpluscode.blogspot.com/feeds/419128900855108770/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://webdesignpluscode.blogspot.com/2020/10/how-to-upload-excel-file-to-amazon-s3.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4103056068311275815/posts/default/419128900855108770'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4103056068311275815/posts/default/419128900855108770'/><link rel='alternate' type='text/html' href='http://webdesignpluscode.blogspot.com/2020/10/how-to-upload-excel-file-to-amazon-s3.html' title='How to Upload Excel File to Amazon S3 Bucket in Python'/><author><name>Waqas Ali</name><uri>http://www.blogger.com/profile/00458603368045512811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi84d3OPcVaH5dEEXYUc09MMM5UWPa5KLFkRFV-BORRBpASebtv4W8YWxVetuXKOwnYBd031-f_HaC5Zc3w-iz2AdWvuf51a0VUGHUxOx_u8xxKeglselSnBik5Sai0wPo/s220/1918953_1058549159885_1783287_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4103056068311275815.post-7902008101068502660</id><published>2018-01-30T21:26:00.002+05:00</published><updated>2018-01-30T21:29:28.560+05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="python"/><category scheme="http://www.blogger.com/atom/ns#" term="Ubuntu"/><title type='text'>How To: Schedule Cron Job using python-crontab</title><content type='html'>We have already learnt &lt;a href=&quot;http://webdesignpluscode.blogspot.com/2018/01/how-to-schedule-cron-job-in-ubuntu.html&quot; target=&quot;_blank&quot;&gt;how to schedule cron job manually&lt;/a&gt;. Now we will schedule cron job using python code.&lt;br /&gt;
&lt;br /&gt;
Create an empty python file with .py entension.&lt;br /&gt;
&lt;br /&gt;
Paste following code step by step:
&lt;br /&gt;
&lt;div style=&quot;background: #ececec; width: 100%;&quot;&gt;
&lt;code&gt;&lt;br /&gt;&lt;/code&gt;
&lt;code&gt;
# Create CronTab instance.&lt;br /&gt;
cron = CronTab(user=True)&amp;nbsp;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;br /&gt;
# Remove all previous jobs having comment id &#39;My_Job&#39;&lt;br /&gt;
cron.remove_all(comment=&#39;My_Job&#39;)&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;br /&gt;
# Schedule new job having comment id &#39;My_Job&#39;&lt;br /&gt;
job  = cron.new(comment=&#39;My_Job&#39;, command=&#39;/usr/bin/python3 /home/root/Schedular/scheduleCronJob.py &amp;gt;&amp;gt; /home/root/Schedular/Logs.txt&#39;)&lt;br /&gt;
&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;# Set timeslot to run this job&lt;br /&gt;
job.setall(str(timeSlot))&lt;br /&gt;
&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;# Write to file.&lt;br /&gt;
cron.write()        
&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;br /&gt;&lt;/code&gt;&lt;/div&gt;
&lt;br /&gt;
This is all, save file and run/execute this python file.&lt;br /&gt;
&lt;br /&gt;
Install following required packages before execution of file.
&lt;br /&gt;
&lt;div style=&quot;background: #ececec; width: 100%;&quot;&gt;
&lt;br /&gt;
pip3 install python-crontab&lt;br /&gt;
&lt;code&gt;pip3 install schedule
&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;br /&gt;&lt;/code&gt;&lt;/div&gt;
&lt;br /&gt;
If you have also installed crontab package then you may see some errors, to uninstall crontab
use following command:
&lt;br /&gt;
&lt;div style=&quot;background: #ececec; width: 100%;&quot;&gt;
&lt;code&gt;&lt;br /&gt;&lt;/code&gt;
&lt;code&gt;
pip3 uninstall crontab
&lt;/code&gt;
&lt;br /&gt;
&lt;code&gt;&lt;br /&gt;&lt;/code&gt;&lt;/div&gt;
&lt;br /&gt;
Upon successful execution, this will schedule a new cron job in ubuntu.&lt;br /&gt;
&lt;br /&gt;
To list existing cron jobs enter following command in terminal window:
&lt;br /&gt;
&lt;div style=&quot;background: #ececec; width: 100%;&quot;&gt;
&lt;code&gt;&lt;br /&gt;&lt;/code&gt;
&lt;code&gt;
crontab –l
&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;br /&gt;&lt;/code&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;a href=&quot;https://github.com/dragonworrier/webdesignpluscode/blob/master/scheduleCronJob.py&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;Click here&lt;/a&gt; for complete code.</content><link rel='replies' type='application/atom+xml' href='http://webdesignpluscode.blogspot.com/feeds/7902008101068502660/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://webdesignpluscode.blogspot.com/2018/01/how-to-schedule-cron-job-using-python.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4103056068311275815/posts/default/7902008101068502660'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4103056068311275815/posts/default/7902008101068502660'/><link rel='alternate' type='text/html' href='http://webdesignpluscode.blogspot.com/2018/01/how-to-schedule-cron-job-using-python.html' title='How To: Schedule Cron Job using python-crontab'/><author><name>Waqas Ali</name><uri>http://www.blogger.com/profile/00458603368045512811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi84d3OPcVaH5dEEXYUc09MMM5UWPa5KLFkRFV-BORRBpASebtv4W8YWxVetuXKOwnYBd031-f_HaC5Zc3w-iz2AdWvuf51a0VUGHUxOx_u8xxKeglselSnBik5Sai0wPo/s220/1918953_1058549159885_1783287_n.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4103056068311275815.post-7110306725685116811</id><published>2018-01-30T20:59:00.000+05:00</published><updated>2018-02-01T18:14:55.201+05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="cron job"/><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="Ubuntu"/><title type='text'>How To: Schedule Cron Job in Ubuntu</title><content type='html'>Open a Terminal Window (Command Line) in ubuntu.&lt;br /&gt;
Type following command and press Enter.&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background: #ececec; width: 100%;&quot;&gt;
&lt;code&gt;&lt;br /&gt;&lt;/code&gt;&lt;code&gt;&amp;nbsp;crontab -e
&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;br /&gt;&lt;/code&gt;&lt;/div&gt;
&lt;br /&gt;
This will open editor for you.  Write cron command at the end of file.&lt;br /&gt;
&lt;br /&gt;
Use sudo if root privileges required. e.g
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background: #ececec; width: 100%;&quot;&gt;
&lt;code&gt;
&lt;br /&gt;
&amp;nbsp;sudo crontab -e 
&lt;br /&gt;&lt;br /&gt;
&lt;/code&gt;&lt;/div&gt;
&lt;br /&gt;
Use following pattern to create new cron job syntax:&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;The number of minutes after the hour (0 to 59)&amp;nbsp;&lt;/li&gt;
&lt;li&gt;The hour in military time (24 hour) format (0 to 23)&amp;nbsp;&lt;/li&gt;
&lt;li&gt;The day of the month (1 to 31)&amp;nbsp;&lt;/li&gt;
&lt;li&gt;The month (1 to 12)&amp;nbsp;&lt;/li&gt;
&lt;li&gt;The day of the week (0 or 7 is Sun, or use name)&amp;nbsp;&lt;/li&gt;
&lt;li&gt;The command to run&amp;nbsp;&lt;/li&gt;
&lt;/ol&gt;
&lt;br /&gt;
For example&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background: #ececec; width: 100%;&quot;&gt;
&lt;code&gt;&lt;br /&gt;&lt;/code&gt;&lt;code&gt;&amp;nbsp;0 7 * * * /path/to/your/script.sh
&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;br /&gt;&lt;/code&gt;&lt;/div&gt;
&lt;br /&gt;
This syntax will run script.sh at 7:00 AM daily.&lt;br /&gt;
&lt;br /&gt;
File must have executable permissions. Run following command to make file executable.

&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background: #ececec; width: 100%;&quot;&gt;
&lt;code&gt;
&lt;br /&gt;
&amp;nbsp;
chmod +x /path/to/your/script.sh
&lt;br /&gt;&lt;br /&gt;
&lt;/code&gt;&lt;/div&gt;
&lt;br /&gt;
If you want to schedule python file to run via cron, use following command instead.
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background: #ececec; width: 100%;&quot;&gt;
&lt;code&gt;
&lt;br /&gt;
&amp;nbsp;
0 7 * * * /usr/bin/python3 /path/to/your/pythron-file.py
&lt;br /&gt; &lt;br /&gt;
&lt;/code&gt;
&lt;/div&gt;
&lt;br /&gt;
Just make sure you have already installed python3.

&lt;br /&gt;
&lt;br /&gt;
To list existing cron jobs enter following command:&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background: #ececec; width: 100%;&quot;&gt;
&lt;code&gt;&lt;br /&gt;&lt;/code&gt;&lt;code&gt;&amp;nbsp;crontab -l&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;br /&gt;&lt;/code&gt;&lt;/div&gt;
&lt;br /&gt;
To remove an existing cron job enter following command:&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background: #ececec; width: 100%;&quot;&gt;
&lt;code&gt;&lt;br /&gt;&lt;/code&gt;&lt;code&gt;&amp;nbsp;crontab -e&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;br /&gt;&lt;/code&gt;&lt;/div&gt;
&lt;br /&gt;
Delete the line that contains your cron job and save file.
</content><link rel='replies' type='application/atom+xml' href='http://webdesignpluscode.blogspot.com/feeds/7110306725685116811/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://webdesignpluscode.blogspot.com/2018/01/how-to-schedule-cron-job-in-ubuntu.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4103056068311275815/posts/default/7110306725685116811'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4103056068311275815/posts/default/7110306725685116811'/><link rel='alternate' type='text/html' href='http://webdesignpluscode.blogspot.com/2018/01/how-to-schedule-cron-job-in-ubuntu.html' title='How To: Schedule Cron Job in Ubuntu'/><author><name>Waqas Ali</name><uri>http://www.blogger.com/profile/00458603368045512811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi84d3OPcVaH5dEEXYUc09MMM5UWPa5KLFkRFV-BORRBpASebtv4W8YWxVetuXKOwnYBd031-f_HaC5Zc3w-iz2AdWvuf51a0VUGHUxOx_u8xxKeglselSnBik5Sai0wPo/s220/1918953_1058549159885_1783287_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4103056068311275815.post-468723844224069584</id><published>2017-06-28T04:33:00.002+05:00</published><updated>2017-06-28T04:33:58.585+05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="python"/><title type='text'>How To: Create Thumbnail Image From Base64 Encoded String using Python 3</title><content type='html'>In this tutorial we &#39;ll create &lt;b&gt;thumbnail image&lt;/b&gt; from &lt;b&gt;base64 encoded&lt;/b&gt; string received from client/user using &lt;b&gt;python 3&lt;/b&gt;.&lt;br /&gt;
Our purpose is to create a &lt;b&gt;thumbnail image&lt;/b&gt; for each image saved by client/user so that we can send back &lt;b&gt;thumbnail images&lt;/b&gt; instead large size images while sending bulk data over the internet.&lt;br /&gt;
&lt;br /&gt;
We are receiving image in form of &lt;b&gt;base64 encoded&lt;/b&gt; string, We &#39;ll apply following steps on it for complete result.&lt;br /&gt;
&lt;br /&gt;
1). Decode string using &lt;b&gt;base64&lt;/b&gt; technique.&lt;br /&gt;
2). Create temporary image from decoded string.&lt;br /&gt;
3). Create &lt;b&gt;thumbnail&lt;/b&gt; from this temporary image.&lt;br /&gt;
4). Encode thumbnail using &lt;b&gt;base64&lt;/b&gt; technique, so that we can save &lt;b&gt;thumbnail&lt;/b&gt; as well in our database.&lt;br /&gt;
5). Remove both newly created temporary image and its &lt;b&gt;thumbnail&lt;/b&gt; after saving to database.&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;
1). Decode string using base64 technique.&lt;/h2&gt;
&lt;div style=&quot;background: #ececec; width: 100%;&quot;&gt;
&lt;code&gt;
# UserImage holds base64 encoded string.&amp;nbsp;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;TmpUserImage =  UserImage.replace(&quot;data:image/jpeg;base64,&quot;, &quot;&quot;)&amp;nbsp;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;ImgDataDecoded = base64.b64decode(TmpUserImage)
&lt;/code&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;h2&gt;
2). Create temporary image from decoded string.
&lt;/h2&gt;
&lt;div style=&quot;background: #ececec; width: 100%;&quot;&gt;
&lt;code&gt;# Using uuid for unique file name.&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;
TmpUUID = str(uuid.uuid4())&amp;nbsp;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;# File name&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;FileName = TmpUUID + &#39;_image.jpeg&#39;&amp;nbsp;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;# Thumbnail name&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;FileNameThumb = TmpUUID + &#39;_image_80x80.jpeg&#39;&amp;nbsp;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;# Writing to file.&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;with open(FileName, &#39;wb&#39;) as f:&amp;nbsp;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&amp;nbsp; &amp;nbsp;f.write(ImgDataDecoded) 
&lt;/code&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;h2&gt;
3). Create thumbnail from this temporary image.
&lt;/h2&gt;
&lt;div style=&quot;background: #ececec; width: 100%;&quot;&gt;
&lt;code&gt;
image = Image.open(FileName)&amp;nbsp;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;size = (80, 80)&amp;nbsp;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;thumb = ImageOps.fit(image, size, Image.ANTIALIAS)&amp;nbsp;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;thumb.save(FileNameThumb) 
&lt;/code&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;h2&gt;
4). Encode thumbnail using base64 technique, so that we can save thumbnail as well in our database.
&lt;/h2&gt;
&lt;div style=&quot;background: #ececec; width: 100%;&quot;&gt;
&lt;code&gt;
with open(FileNameThumb, &quot;rb&quot;) as thmbn:&amp;nbsp;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&amp;nbsp; &amp;nbsp; TmpStr = base64.b64encode(thmbn.read())&amp;nbsp;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;TmpStr = &quot;data:image/jpeg;base64,&quot; + str(TmpStr)[2:-1]&amp;nbsp;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;# Encode to utf-8 before saving to database&amp;nbsp;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;# (don&#39;t forget to decode after fetching from database).&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;TmpStr = bytes(TmpStr,&quot;utf-8&quot;)
&lt;/code&gt;
&lt;br /&gt;
&lt;code&gt;# Now save TmpStr to database.&lt;/code&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;h2&gt;
5). Remove both newly created temporary image and its thumbnail after saving to database.
&lt;/h2&gt;
&lt;div style=&quot;background: #ececec; width: 100%;&quot;&gt;
&lt;code&gt;
if os.path.isfile(FileName):&amp;nbsp;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&amp;nbsp; &amp;nbsp; os.remove(FileName)&amp;nbsp;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;if os.path.isfile(FileNameThumb):&amp;nbsp;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&amp;nbsp; &amp;nbsp; os.remove(FileNameThumb)
&lt;/code&gt;
&lt;/div&gt;
&lt;br /&gt;
Don&#39;t forget to include following libraries.
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background: #ececec; width: 100%;&quot;&gt;
&lt;code&gt;
# For Thumbnail&amp;nbsp;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;from PIL import Image, ImageOps&amp;nbsp;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;import base64, uuid, os
&lt;/code&gt;
&lt;/div&gt;
&lt;br /&gt;
This is all, you have done it. 

Please ask in comment if there is any confusion. Happy Coding -:)</content><link rel='replies' type='application/atom+xml' href='http://webdesignpluscode.blogspot.com/feeds/468723844224069584/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://webdesignpluscode.blogspot.com/2017/06/how-to-create-thumbnail-image-from.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4103056068311275815/posts/default/468723844224069584'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4103056068311275815/posts/default/468723844224069584'/><link rel='alternate' type='text/html' href='http://webdesignpluscode.blogspot.com/2017/06/how-to-create-thumbnail-image-from.html' title='How To: Create Thumbnail Image From Base64 Encoded String using Python 3'/><author><name>Waqas Ali</name><uri>http://www.blogger.com/profile/00458603368045512811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi84d3OPcVaH5dEEXYUc09MMM5UWPa5KLFkRFV-BORRBpASebtv4W8YWxVetuXKOwnYBd031-f_HaC5Zc3w-iz2AdWvuf51a0VUGHUxOx_u8xxKeglselSnBik5Sai0wPo/s220/1918953_1058549159885_1783287_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4103056068311275815.post-1475371748454525540</id><published>2017-05-28T15:47:00.000+05:00</published><updated>2017-05-28T15:53:30.931+05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="HTML"/><category scheme="http://www.blogger.com/atom/ns#" term="Java Script"/><category scheme="http://www.blogger.com/atom/ns#" term="JQuery"/><category scheme="http://www.blogger.com/atom/ns#" term="XHTML"/><title type='text'>How To: Set and Get Cursor Position in Textbox using JQuery</title><content type='html'>In this tutorial, we &#39;ll learn how to set and get cursor position in text box using jquery.&lt;br /&gt;
1). Open notepad, and paste following html code in it.&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background: #ececec; width: 100%;&quot;&gt;
&lt;code&gt;

&amp;lt;html&amp;gt;&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;lt;title&amp;gt;Home&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;lt;input id=&quot;first_name&quot; type=&quot;text&quot; value=&quot;webdesignpluscode&quot; /&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;lt;input onclick=&quot;SetPosition();&quot; type=&quot;button&quot; value=&quot;Set Position&quot; /&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;lt;input onclick=&quot;GetPosition();&quot; type=&quot;button&quot; value=&quot;Get Position&quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/html&amp;gt;

&lt;/code&gt;&lt;/div&gt;
&lt;br /&gt;
2). Click &lt;b&gt;File&lt;/b&gt; then &lt;b&gt;Save As...&lt;/b&gt; in notepad menu. Save As dialogue will open&lt;br /&gt;
3). Enter &quot;home.html&quot; in &lt;b&gt;File name:&lt;/b&gt;&lt;br /&gt;
4). Select All Files in &lt;b&gt;Save as type:&lt;/b&gt;&lt;br /&gt;
5). Click &lt;b&gt;Save&lt;/b&gt;. Notepad file will be saved as html page.&lt;br /&gt;
6). Now open this html page in edit mode.&lt;br /&gt;
7). Add following online JQuery library reference inside &amp;lt;head&amp;gt; tag.&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background: #ececec; width: 100%;&quot;&gt;
&lt;code&gt;
&amp;lt;script src=&quot;https://code.jquery.com/jquery-1.10.2.js&quot; type=&quot;text/javascript&quot;&amp;gt;&amp;lt;/script&amp;gt;
&lt;/code&gt;&lt;/div&gt;
&lt;br /&gt;
You can download and add to project locally.&lt;br /&gt;
&lt;br /&gt;
8). Now add java script block inside &amp;lt;head&amp;gt; tag and copy following code there.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background: #ececec; width: 100%;&quot;&gt;
&lt;code&gt;

&amp;lt;script type=&quot;text/javascript&quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
// Set Cursor Position&lt;br /&gt;
&amp;nbsp;$.fn.setCursorPosition = function (position)&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp;this.each(function (index, elem) {&lt;br /&gt;
&amp;nbsp;if (elem.setSelectionRange) {&lt;br /&gt;
&amp;nbsp;elem.setSelectionRange(position, position);&lt;br /&gt;
&amp;nbsp;}&lt;br /&gt;
&amp;nbsp;else if (elem.createTextRange) {&lt;br /&gt;
&amp;nbsp;var range = elem.createTextRange();&lt;br /&gt;
&amp;nbsp;range.collapse(true);&lt;br /&gt;
&amp;nbsp;range.moveEnd(&#39;character&#39;, position);&lt;br /&gt;
&amp;nbsp;range.moveStart(&#39;character&#39;, position);&lt;br /&gt;
&amp;nbsp;range.select();&lt;br /&gt;
&amp;nbsp;}&lt;br /&gt;
&amp;nbsp;});&lt;br /&gt;
&amp;nbsp;return this;&lt;br /&gt;
&amp;nbsp;};&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;// Get cursor position&lt;br /&gt;
&amp;nbsp;$.fn.getCursorPosition = function ()&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp;var el = $(this).get(0);&lt;br /&gt;
&amp;nbsp;var position = 0;&lt;br /&gt;
&amp;nbsp;if (&#39;selectionStart&#39; in el) {&lt;br /&gt;
&amp;nbsp;position = el.selectionStart;&lt;br /&gt;
&amp;nbsp;}&lt;br /&gt;
&amp;nbsp;else if (&#39;selection&#39; in document) {&lt;br /&gt;
&amp;nbsp;el.focus();&lt;br /&gt;
&amp;nbsp;var Sel = document.selection.createRange();&lt;br /&gt;
&amp;nbsp;var SelLength = document.selection.createRange().text.length;&lt;br /&gt;
&amp;nbsp;Sel.moveStart(&#39;character&#39;, -el.value.length);&lt;br /&gt;
&amp;nbsp;position = Sel.text.length - SelLength;
            }&lt;br /&gt;
&amp;nbsp;return position;&lt;br /&gt;
&amp;nbsp;};&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;function SetPosition() {&lt;br /&gt;
&amp;nbsp;$(&quot;#first_name&quot;).setCursorPosition(5);&lt;br /&gt;
&amp;nbsp;$(&quot;#first_name&quot;).focus();&lt;br /&gt;
&amp;nbsp;}&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;function GetPosition() {&lt;br /&gt;
&amp;nbsp;alert($(&quot;#first_name&quot;).getCursorPosition());&lt;br /&gt;
&amp;nbsp;$(&quot;#first_name&quot;).focus();&lt;br /&gt;
&amp;nbsp;}&lt;br /&gt;
&amp;nbsp;&amp;lt;/script&amp;gt;

&lt;/code&gt;&lt;/div&gt;
&lt;br /&gt;
Complete code can be downloaded from this &lt;a href=&quot;https://github.com/dragonworrier/webdesignpluscode/blob/master/SetAndGetCursorPositionUsingJQuery.html&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;git repository&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
This is all. You have done. Save file, and view it in any browser.</content><link rel='replies' type='application/atom+xml' href='http://webdesignpluscode.blogspot.com/feeds/1475371748454525540/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://webdesignpluscode.blogspot.com/2017/05/how-to-set-and-get-cursor-position-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4103056068311275815/posts/default/1475371748454525540'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4103056068311275815/posts/default/1475371748454525540'/><link rel='alternate' type='text/html' href='http://webdesignpluscode.blogspot.com/2017/05/how-to-set-and-get-cursor-position-in.html' title='How To: Set and Get Cursor Position in Textbox using JQuery'/><author><name>Waqas Ali</name><uri>http://www.blogger.com/profile/00458603368045512811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi84d3OPcVaH5dEEXYUc09MMM5UWPa5KLFkRFV-BORRBpASebtv4W8YWxVetuXKOwnYBd031-f_HaC5Zc3w-iz2AdWvuf51a0VUGHUxOx_u8xxKeglselSnBik5Sai0wPo/s220/1918953_1058549159885_1783287_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4103056068311275815.post-5110683315268017963</id><published>2017-03-26T01:00:00.001+05:00</published><updated>2017-03-26T01:02:19.587+05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="python"/><title type='text'>Python Part5: Set and exception handling Try except finally</title><content type='html'>&lt;h2&gt;
Set&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Unordered collection of unique, immutable objects.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Literals:&amp;nbsp;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;delimited by { and }&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;Single comma separated items.&amp;nbsp;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;&amp;gt;&amp;gt;&amp;gt; p = {1, 2, 3, 4}&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&amp;gt;&amp;gt;&amp;gt; p&amp;nbsp;&lt;/li&gt;
&lt;li&gt;{1, 2, 3, 4}&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;Empty { } makes a dict, so for empty set use the set() constructor.&amp;nbsp;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;&amp;gt;&amp;gt;&amp;gt; e = set()&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&amp;gt;&amp;gt;&amp;gt; e&amp;nbsp;&lt;/li&gt;
&lt;li&gt;set()&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;
Set() constructor accepts:&amp;nbsp;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;Iterable series of values.&amp;nbsp;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;&amp;gt;&amp;gt;&amp;gt; s = set([1, 2, 3, 4])&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&amp;gt;&amp;gt;&amp;gt; s&amp;nbsp;&lt;/li&gt;
&lt;li&gt;{1, 2, 3, 4}&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;
&lt;li&gt;Duplicates are discarded.&amp;nbsp;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;&amp;gt;&amp;gt;&amp;gt; t = [1, 2, 3, 1, 4]&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&amp;gt;&amp;gt;&amp;gt; set(t)&amp;nbsp;&lt;/li&gt;
&lt;li&gt;{1, 2, 3, 4}&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;Often used specifically to remove duplicates – not order preserving.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Order is arbitrary.&amp;nbsp;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;&amp;gt;&amp;gt;&amp;gt; for x in {1, 2, 4, 8, 32}&amp;nbsp;&lt;/li&gt;
&lt;li&gt;print(x)

&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;
Use in and not in operators.&amp;nbsp;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;&amp;gt;&amp;gt;&amp;gt; q = {2, 9, 6, 4}&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&amp;gt;&amp;gt;&amp;gt; 3 in q&amp;nbsp;&lt;/li&gt;
&lt;li&gt;False&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&amp;gt;&amp;gt;&amp;gt; 3 not in q&amp;nbsp;&lt;/li&gt;
&lt;li&gt;True&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;Add(item) inserts a single element.&amp;nbsp;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;&amp;gt;&amp;gt;&amp;gt; k = {2, 4}&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&amp;gt;&amp;gt;&amp;gt; k&amp;nbsp;&lt;/li&gt;
&lt;li&gt;{2, 4}&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&amp;gt;&amp;gt;&amp;gt; k.add(8)&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&amp;gt;&amp;gt;&amp;gt; k&amp;nbsp;&lt;/li&gt;
&lt;li&gt;{2, 4, 8}

&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;
Duplicates are silently ignored.&amp;nbsp;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;&amp;gt;&amp;gt;&amp;gt; k.add(8)&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&amp;gt;&amp;gt;&amp;gt; k&amp;nbsp;&lt;/li&gt;
&lt;li&gt;{1, 2, 8}&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;For multiple elements use update(items) passing any iterable series.&amp;nbsp;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;&amp;gt;&amp;gt;&amp;gt; k.update([9, 10])&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&amp;gt;&amp;gt;&amp;gt; k&amp;nbsp;&lt;/li&gt;
&lt;li&gt;{1, 2, 8, 9, 10}&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;Remove(item) requires that item is present, otherwise raises KeyError.&amp;nbsp;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;&amp;gt;&amp;gt;&amp;gt; k.remove(9)&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&amp;gt;&amp;gt;&amp;gt; k&amp;nbsp;&lt;/li&gt;
&lt;li&gt;{1, 2, 8, 10}

&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;
Discard(item) always succeeds.&amp;nbsp;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;&amp;gt;&amp;gt;&amp;gt; k.discard(9)&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;Copy set using S.copy() method.&amp;nbsp;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;&amp;gt;&amp;gt;&amp;gt; j = k.copy()&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;Use constructor. Set(s)&amp;nbsp;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;&amp;gt;&amp;gt;&amp;gt; m = set(j)&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;Copies are shallows.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;S1.union(s2) method.&amp;nbsp;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;Union is commutative.

&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;s.intersection(t) method&amp;nbsp;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;Intersection is commutative.&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;s.difference(t) method.&amp;nbsp;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;Difference is non-commutative.&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;s.symmetric_difference(t) method&amp;nbsp;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;Symmetric difference is commutative.&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;s.issubset(t) method&amp;nbsp;&lt;/li&gt;
&lt;li&gt;s.issuperset(t) method.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;s.isdisjoint(t)&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
Handle exceptions. Try … except … finally&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;try:&amp;nbsp;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;x = 5&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;except:&amp;nbsp;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;message = str(sys.exc_info()[1])&amp;nbsp;&lt;/li&gt;
&lt;li&gt;x = -1&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;finally:&amp;nbsp;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;# final-block&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;x = 0&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://webdesignpluscode.blogspot.com/feeds/5110683315268017963/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://webdesignpluscode.blogspot.com/2017/03/python-part5-set-and-exception-handling.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4103056068311275815/posts/default/5110683315268017963'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4103056068311275815/posts/default/5110683315268017963'/><link rel='alternate' type='text/html' href='http://webdesignpluscode.blogspot.com/2017/03/python-part5-set-and-exception-handling.html' title='Python Part5: Set and exception handling Try except finally'/><author><name>Waqas Ali</name><uri>http://www.blogger.com/profile/00458603368045512811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi84d3OPcVaH5dEEXYUc09MMM5UWPa5KLFkRFV-BORRBpASebtv4W8YWxVetuXKOwnYBd031-f_HaC5Zc3w-iz2AdWvuf51a0VUGHUxOx_u8xxKeglselSnBik5Sai0wPo/s220/1918953_1058549159885_1783287_n.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4103056068311275815.post-8915417315238409698</id><published>2017-03-26T00:15:00.001+05:00</published><updated>2017-03-26T00:15:45.563+05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="python"/><title type='text'>Python Part4: For loop, argument passing and Tuple</title><content type='html'>&lt;h2&gt;
For loop&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;items = [a, b, c, d]&amp;nbsp;&lt;/li&gt;
&lt;li&gt;for item in items:&amp;nbsp;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;&amp;nbsp;print(item)&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;&amp;nbsp;for i in range(5)&amp;nbsp;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;&amp;nbsp;print(i)&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;
&lt;h2&gt;
Argument passing&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Function with arguments.&lt;/li&gt;
&lt;li&gt;def modify(k)&amp;nbsp;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;&amp;nbsp;k.append(13)&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;print(k)&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;m = [6, 7, 8, 9]&amp;nbsp;&lt;/li&gt;
&lt;li&gt;modify(m)&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Default arguments.&lt;/li&gt;
&lt;li&gt;def DisplayMessage(m=&#39;nothing&#39;)&amp;nbsp;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;print(m)&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;message = &#39;Welcome to python&#39;&amp;nbsp;&lt;/li&gt;
&lt;li&gt;DisplayMessage(Message)&amp;nbsp;&lt;/li&gt;
&lt;li&gt;DisplayMessage()&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
Tuple&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Heterogeneous immutable collection.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Delimited by parentheses.&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;For example t = (&quot;norway&quot;, 4.953, 3)&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;Items separated by commas.&lt;/li&gt;
&lt;li&gt;Element access with square brackets and zero-based index. T[index]&amp;nbsp;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;&amp;gt;&amp;gt;&amp;gt; t[0]&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&#39;Norway&#39;&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;len(t) for number of elements.&amp;nbsp;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;&amp;gt;&amp;gt;&amp;gt; len(t)&amp;nbsp;&lt;/li&gt;
&lt;li&gt;3&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;
Iteration with for loop.&amp;nbsp;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;for item in t:&amp;nbsp;&lt;/li&gt;
&lt;li&gt;print(item)&amp;nbsp;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;Norway&amp;nbsp;&lt;/li&gt;
&lt;li&gt;4.953&amp;nbsp;&lt;/li&gt;
&lt;li&gt;3&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;
&lt;li&gt;Concatenation with + operator.&amp;nbsp;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;t + (338186.0, 2659)&amp;nbsp;&lt;/li&gt;
&lt;li&gt;(&#39;Norway&#39;, 4.953, 3, 338186.0, 2659)&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;Reputation with * operator.&amp;nbsp;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;t * 3&amp;nbsp;&lt;/li&gt;
&lt;li&gt;(&#39;Norway&#39;, 4.953, 3, &#39;Norway&#39;, 4.953, 3, &#39;Norway&#39;, 4.953, 3)


&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;
Tuple can contain any kind of object.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Nested tuples.&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;A = ((245, 446), (90, 456))&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;Chain square-brackets indexing to access inner elements.&amp;nbsp;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;A[1][0]&amp;nbsp;&lt;/li&gt;
&lt;li&gt;90&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;Can’t use one object in parentheses as a single element tuple.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;For a single element tuple include a trailing comma.&amp;nbsp;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;K = (234, )&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;The empty tuple is simply empty parentheses.&amp;nbsp;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;E = ()&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;
Delimiting parentheses are optional for one or more elements.&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;p = 1, 1, 1, 4, 6, 19&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&amp;gt;&amp;gt;&amp;gt; p&amp;nbsp;&lt;/li&gt;
&lt;li&gt;(1, 1, 1, 4, 6, 19)&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;Tuples are useful for multiple return values.&amp;nbsp;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;def MinMax(items)&amp;nbsp;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;Return Min(items), Max(items)&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;&amp;gt;&amp;gt;&amp;gt; MinMax([33, 30, 9, 82, 87])&amp;nbsp;&lt;/li&gt;
&lt;li&gt;(9, 87)

&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;
Tuple unpacking allow us to destructure directly into named references.&amp;nbsp;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;lower, upper = MinMax([33, 30, 9, 82, 87])&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&amp;gt;&amp;gt;&amp;gt; lower&amp;nbsp;&lt;/li&gt;
&lt;li&gt;9&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&amp;gt;&amp;gt;&amp;gt; upper&amp;nbsp;&lt;/li&gt;
&lt;li&gt;87

&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;Tuple unpacking works with arbitrarily nested tuples (although not with other data structure)&amp;nbsp;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;(a, (b, (c, d))) = (4, (3, (2, 1)))&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&amp;gt;&amp;gt;&amp;gt; a&amp;nbsp;&lt;/li&gt;
&lt;li&gt;4&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&amp;gt;&amp;gt;&amp;gt; b&amp;nbsp;&lt;/li&gt;
&lt;li&gt;3&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&amp;gt;&amp;gt;&amp;gt; c&amp;nbsp;&lt;/li&gt;
&lt;li&gt;2&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&amp;gt;&amp;gt;&amp;gt; d &lt;/li&gt;
&lt;li&gt;&amp;nbsp;1&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;a, b = b, a is the idiomatic python swap.
&lt;/li&gt;
&lt;li&gt;
Use the tuple constructor to create tuples from other iterable series of objects.&amp;nbsp;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;&amp;gt;&amp;gt;&amp;gt; tuple([234, 444, 897])&amp;nbsp;&lt;/li&gt;
&lt;li&gt;(234, 444, 897)&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&amp;gt;&amp;gt;&amp;gt; tuple(&quot;car&quot;)&amp;nbsp;&lt;/li&gt;
&lt;li&gt;(&#39;c&#39;, &#39;a&#39;, &#39;r&#39;)&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;The in and not in operators can be used with tuples - and other collection types – for membership testing.&amp;nbsp;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;&amp;gt;&amp;gt;&amp;gt; 5 in (3, 5, 9, 13)&amp;nbsp;&lt;/li&gt;
&lt;li&gt;True&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&amp;gt;&amp;gt;&amp;gt; 5 not in (3, 5, 9, 13)&amp;nbsp;&lt;/li&gt;
&lt;li&gt;False&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://webdesignpluscode.blogspot.com/feeds/8915417315238409698/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://webdesignpluscode.blogspot.com/2017/03/python-part4-for-loop-argument-passing.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4103056068311275815/posts/default/8915417315238409698'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4103056068311275815/posts/default/8915417315238409698'/><link rel='alternate' type='text/html' href='http://webdesignpluscode.blogspot.com/2017/03/python-part4-for-loop-argument-passing.html' title='Python Part4: For loop, argument passing and Tuple'/><author><name>Waqas Ali</name><uri>http://www.blogger.com/profile/00458603368045512811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi84d3OPcVaH5dEEXYUc09MMM5UWPa5KLFkRFV-BORRBpASebtv4W8YWxVetuXKOwnYBd031-f_HaC5Zc3w-iz2AdWvuf51a0VUGHUxOx_u8xxKeglselSnBik5Sai0wPo/s220/1918953_1058549159885_1783287_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4103056068311275815.post-1031996883673559866</id><published>2017-03-25T17:57:00.000+05:00</published><updated>2017-03-25T17:59:14.734+05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="python"/><title type='text'>Python Part3: Bytes, Lists, Shallow copies and Dictionaries</title><content type='html'>&lt;h2&gt;
Bytes
&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Immutable sequence of bytes.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
Lists
&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Mutable sequences of objects.&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;e.g a = [1, 2, 3 ,4]&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;Get or set value using index &lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;e.g a[1] = 20 and print(a[1])&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;Negative integers index from the end.&lt;/li&gt;
&lt;li&gt;The last element is at index -1&lt;/li&gt;
&lt;li&gt;Slicing extracts part of a list.&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;Slice = seq[start:stop]&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;Slice range is half open-stop not included.&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;&amp;gt;&amp;gt;&amp;gt; s = [1, 2, 3, 4, 5, 6]&lt;/li&gt;
&lt;li&gt;&amp;gt;&amp;gt;&amp;gt; s[1:4]&lt;/li&gt;
&lt;li&gt;2, 3, 4&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;Slicing works with negative indexes.&amp;nbsp;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;&amp;gt;&amp;gt;&amp;gt; s[1:-1]&amp;nbsp;&lt;/li&gt;
&lt;li&gt;2, 3, 4, 5&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;Omitting the stop index slices to the end.&amp;nbsp;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;Slice_to_end = seq[start:]&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;Omitting the start index slices from the beginning.&amp;nbsp;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;Slice_from_beginning = seq[:stop]&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;Half open ranges give complementary.&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;slices
S[:x] + s[x:] == s&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;Omitting the start and stop indexes slices from beginning to the end – a full slice.&amp;nbsp;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;Full_slice = seq[:]
&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;Important idiom for copying lists:&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Copy list using&amp;nbsp;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;Copy() method&amp;nbsp;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;&amp;nbsp;U = seq.copy()&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;List() constructor&amp;nbsp;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;&amp;nbsp;V = list(seq)&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;
&lt;li&gt;All of these techniques create shallow copies, mean create new list containing same object reference to source list.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
Shallow copies: Examples
&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&amp;gt;&amp;gt;&amp;gt; A = [[1, 2], [3, 4]]&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&amp;gt;&amp;gt;&amp;gt; B = A[:] &amp;nbsp; &amp;nbsp; &amp;nbsp;(copy using full slice)&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&amp;gt;&amp;gt;&amp;gt; A is B &amp;nbsp; &amp;nbsp; &amp;nbsp;(both objects have different identities.)&amp;nbsp;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;False&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;&amp;gt;&amp;gt;&amp;gt; A == B&amp;nbsp;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;&amp;nbsp;True&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;&amp;gt;&amp;gt;&amp;gt; A[0]&amp;nbsp;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;[1, 2]&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;&amp;gt;&amp;gt;&amp;gt; B[0]&amp;nbsp;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;[1, 2]&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;A[0] is B[0] &amp;nbsp; &amp;nbsp; &amp;nbsp;(both objects have same identities.)&amp;nbsp;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;True
&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;&amp;gt;&amp;gt;&amp;gt; A[0] = [8, 9] &amp;nbsp; &amp;nbsp; &amp;nbsp;(This create a new list and set reference of A[0] to this.)&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&amp;gt;&amp;gt;&amp;gt; A[0]&amp;nbsp;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;[8, 9]&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;&amp;gt;&amp;gt;&amp;gt; B[0] &amp;nbsp; &amp;nbsp; &amp;nbsp;(B[0] is unchanged because it has reference to old list.)&amp;nbsp;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;[1, 2]&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;&amp;gt;&amp;gt;&amp;gt; A[1].append(5) &amp;nbsp; &amp;nbsp; &amp;nbsp;(A[1] and B[1] still have reference to same list. So changes reflects in both places.)&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&amp;gt;&amp;gt;&amp;gt; A[1]&amp;nbsp;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;[3, 4, 5]&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;&amp;gt;&amp;gt;&amp;gt; B[1]&amp;nbsp;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;[3, 4, 5]&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;&amp;gt;&amp;gt;&amp;gt; A &amp;nbsp; &amp;nbsp; &amp;nbsp;(Now both lists look like this)&amp;nbsp;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;[[8, 9], [3, 4, 5]]&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;&amp;gt;&amp;gt;&amp;gt; B&amp;nbsp;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;[[1, 2], [3, 4, 5]]
&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;Repeat lists using the * operator.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Most often used for initializing a list of known size with a constant.&amp;nbsp;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;S = [constant] * size&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;Multiple references to one instance of the constant in the produced list.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Repetition is shallow.&amp;nbsp;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;&amp;gt;&amp;gt;&amp;gt; S = [[1, 2]] * 5&amp;nbsp;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;[[1, 2], [1, 2], [1, 2], [1, 2], [1, 2]]&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;&amp;gt;&amp;gt;&amp;gt; S[3].append(7)&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&amp;gt;&amp;gt;&amp;gt; S&amp;nbsp;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;[[1, 2, 7], [1, 2, 7], [1, 2, 7], [1, 2, 7], [1, 2, 7]]&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;
&lt;li&gt;Index(item) returns the integer index of the first equivalent element raises value error if not found.&amp;nbsp;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;I = w.index(‘the’)
&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;
Count(item) returns the number of matching elements.&amp;nbsp;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;W.count(‘the’)&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;The in and not in operators test for membership.&amp;nbsp;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;5 in [1, 2, 3]&amp;nbsp;&lt;/li&gt;
&lt;li&gt;5 not in [1, 2, 3]&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;Del seq[index] to remove by index.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Seq.remove(item) to remove by value. Raises value error if not found.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Insert items with seq.insert(index, item)&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Concatenate lists with + operator&amp;nbsp;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;&amp;gt;&amp;gt;&amp;gt; M = [1, 2]&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&amp;gt;&amp;gt;&amp;gt; N = [3, 4]&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&amp;gt;&amp;gt;&amp;gt; K = m + n&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&amp;gt;&amp;gt;&amp;gt; k&amp;nbsp;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;[1, 2, 3, 4]

&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;
&lt;li&gt;
In-place extension with += operator or extend method.&amp;nbsp;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;&amp;nbsp;&amp;gt;&amp;gt;&amp;gt; K += [6, 7]&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;gt;&amp;gt;&amp;gt; K&amp;nbsp;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;&amp;nbsp;[1, 2, 3, 4, 6, 7]&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;&amp;nbsp;&amp;gt;&amp;gt;&amp;gt; K.entend([11, 12])&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;gt;&amp;gt;&amp;gt; K&amp;nbsp;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;&amp;nbsp;[1, 2, 3, 4, 6, 7, 11, 12]&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;
&lt;li&gt;K.reverse() reverses in place.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;K.sort() sorts in place.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;K.sort(reverse=true) gives descending sort.

&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
Dictionaries
&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
Unordered mapping from unique, immutable keys to mutable values.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Recap literals:&amp;nbsp;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;Delimited by { and }&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Key-value pairs comma separated&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Corresponding keys and values joined by colon.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Keys must be unique&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Urls = {&#39;google&#39;:&#39;http://google.com&#39;, &#39;microsoft&#39;:&#39;http://Microsoft.com&#39;&amp;nbsp;}&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&amp;gt;&amp;gt;&amp;gt; url[&#39;google&#39;]&amp;nbsp;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;http://google.com

&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;
&lt;li&gt;Dict() constructor accepts:&amp;nbsp;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;Iterable series of key-value 2-tuples.&amp;nbsp;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;&amp;gt;&amp;gt;&amp;gt; Names_and_ages = [(&#39;Alice&#39;, 32), (&#39;Bob&#39;, 48)]&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&amp;gt;&amp;gt;&amp;gt; d  = dict(Names_and_ages)&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&amp;gt;&amp;gt;&amp;gt; d&amp;nbsp;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;{&#39;Alice&#39;:32, &#39;Bob&#39;:48}&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;
&lt;/ul&gt;
&lt;li&gt;Keyword arguments-requires keys are valid python identifiers.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;A mapping, such as another dict.&amp;nbsp;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;&amp;gt;&amp;gt;&amp;gt; Phonetic = dict(a=&#39;alfa&#39;, b=&#39;bravo&#39;)&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&amp;gt;&amp;gt;&amp;gt; phonetic&amp;nbsp;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;{&#39;a&#39;:&#39;alfa&#39;, &#39;b&#39;:&#39;bravo&#39;}
&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;
&lt;li&gt;
d.copy() for copying dictionaries.&amp;nbsp;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;&amp;gt;&amp;gt;&amp;gt; e = d.copy()&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&amp;gt;&amp;gt;&amp;gt; e&amp;nbsp;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;{&#39;Alice&#39;:32, &#39;Bob&#39;:48}&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;
&lt;li&gt;Or simply dict(d) constructor&amp;nbsp;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;&amp;gt;&amp;gt;&amp;gt; f = dict(e)&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&amp;gt;&amp;gt;&amp;gt; f&amp;nbsp;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;{&#39;Alice&#39;:32, &#39;Bob&#39;:48}

&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;
&lt;li&gt;
Extend a dictionary with update()&amp;nbsp;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;&amp;gt;&amp;gt;&amp;gt; g = dict(&#39;c&#39;:&#39;charle&#39;, &#39;f&#39;:&#39;fort&#39;)&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&amp;gt;&amp;gt;&amp;gt; f.update(g)&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&amp;gt;&amp;gt;&amp;gt; f&amp;nbsp;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;{&#39;a&#39;:&#39;alfa&#39;, &#39;b&#39;:&#39;bravo&#39;, &#39;c&#39;:&#39;charle&#39;, &#39;f&#39;:&#39;fort&#39;}&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;
&lt;li&gt;Update replaces values corresponding to duplicate keys.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Iteration is over keys.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Get corresponding value with d[key] lookup.&amp;nbsp;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;&amp;gt;&amp;gt;&amp;gt; for key in f:&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;print(&quot;{key} =&amp;gt; {value}&quot;.format(key= key, value=f[key]))&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;Use values() for an iterable view onto the series of values&amp;nbsp;&lt;/li&gt;
&lt;li&gt;No efficient way to get the key corresponding to a value.&amp;nbsp;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;&amp;nbsp;&amp;gt;&amp;gt;&amp;gt; for value in f.values():&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;print(value)

&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;
Keys() method gives iterable view onto keys – not often  needed.&amp;nbsp;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;&amp;gt;&amp;gt;&amp;gt; for key in f.keys():&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;print(key)&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;Use items for an iterable view onto the series of key-value tuples.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Use with tuple unpacking.&amp;nbsp;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;&amp;gt;&amp;gt;&amp;gt; for key, value in f.items():&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;print(&quot;{key} =&amp;gt; {value}&quot;.format(key=key, value=value))&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;The in and not in operators work on the keys.&amp;nbsp;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;&amp;gt;&amp;gt;&amp;gt; &#39;a&#39; in f&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&amp;gt;&amp;gt;&amp;gt; &#39;h&#39; in f

&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;
Use del keyword to remove by key. del d[key]&amp;nbsp;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;&amp;gt;&amp;gt;&amp;gt; del f[&#39;a&#39;]&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;Keys must be immutable.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Values may be mutable.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;The dictionary itself is mutable.&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://webdesignpluscode.blogspot.com/feeds/1031996883673559866/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://webdesignpluscode.blogspot.com/2017/03/python-part3-bytes-lists-shallow-copies.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4103056068311275815/posts/default/1031996883673559866'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4103056068311275815/posts/default/1031996883673559866'/><link rel='alternate' type='text/html' href='http://webdesignpluscode.blogspot.com/2017/03/python-part3-bytes-lists-shallow-copies.html' title='Python Part3: Bytes, Lists, Shallow copies and Dictionaries'/><author><name>Waqas Ali</name><uri>http://www.blogger.com/profile/00458603368045512811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi84d3OPcVaH5dEEXYUc09MMM5UWPa5KLFkRFV-BORRBpASebtv4W8YWxVetuXKOwnYBd031-f_HaC5Zc3w-iz2AdWvuf51a0VUGHUxOx_u8xxKeglselSnBik5Sai0wPo/s220/1918953_1058549159885_1783287_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4103056068311275815.post-6684666717814060928</id><published>2017-03-25T16:23:00.001+05:00</published><updated>2017-03-25T16:23:46.746+05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="python"/><title type='text'>Python Part2: Conditional statements, While loops, Strings and Range</title><content type='html'>&lt;h2&gt;
Conditional statements
&lt;/h2&gt;
&lt;div style=&quot;background: #ececec; width: 100%;&quot;&gt;
&lt;code&gt;
If expr:&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;print(&quot;expr is true&quot;)&lt;br /&gt;
&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;If expr:&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;print(&quot;It&#39;s true&quot;)&lt;br /&gt;
else:&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;print(&quot;its’s false&quot;)&lt;br /&gt;
&lt;/code&gt;
&lt;/div&gt;
&lt;br /&gt;
Python provides the elif keyword to eliminate the need for nested if … else structure.&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background: #ececec; width: 100%;&quot;&gt;
&lt;code&gt;
h = 5&lt;br /&gt;
if h &amp;gt; 5:&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; print(&quot;greater than 5&quot;)&lt;br /&gt;
elif h &amp;lt; 2:&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; print(&quot;less than 2&quot;)&lt;br /&gt;
else:&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; print(&quot;between 2 and 5.&quot;)&lt;br /&gt;
&lt;/code&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;h2&gt;
While loops
&lt;/h2&gt;
&lt;div style=&quot;background: #ececec; width: 100%;&quot;&gt;
&lt;code&gt;# While loop&amp;nbsp;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&amp;nbsp;While expr:&amp;nbsp;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;print(&quot;loop while expr is true&quot;)&amp;nbsp;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;br /&gt;&lt;/code&gt;
&lt;code&gt;# Do-while in python&amp;nbsp;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&amp;nbsp;While True:&amp;nbsp;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;If expr:&amp;nbsp;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Break

&lt;/code&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;h2&gt;
Strings&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Immutable sequence of Unicode codepoints.&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;Immutable mean when you construct a string you can&#39;t modify its content.&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;Strings with Newlines&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;Multiline strings&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;&quot;&quot;&quot; this is&lt;/li&gt;
&lt;li&gt;Multiline string&quot;&quot;&quot;&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;Escape sequences&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;This is \nmultiline \nstring.&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;
&lt;li&gt;len(s) gives number of codepoints(characters).&lt;/li&gt;
&lt;li&gt;The + operator can be used for string concatenation.&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;&amp;gt;&amp;gt;&amp;gt; &quot;This&quot; + &quot;is&quot; + &quot;a&quot; + &quot;string&quot;&lt;/li&gt;
&lt;li&gt;Thisisastring&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;
Strings are immutable, so the += operator re-binds the reference to a new object.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Use sparingly, concatenation with + or += can cause performance degradation.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Call the join() method on the separator string.&amp;nbsp;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;&amp;gt;&amp;gt;&amp;gt; Numbers = &#39;;&#39;.join([1, 2, 3, 4])&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&#39;1;2;3;4&#39;&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;Use the split() to divide a string into a list.&amp;nbsp;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;&amp;gt;&amp;gt;&amp;gt; Numbers.split(&#39;;&#39;)&amp;nbsp;&lt;/li&gt;
&lt;li&gt;[1, 2, 3, 4]&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;Without an argument, split() divides on whitespace.&lt;/li&gt;
&lt;li&gt;
Join()-ing on an empty separator is an important and fast way of concatenating a collection of strings.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;The partition() method divides a string into three around a separator: prefix, separator, suffix.&lt;/li&gt;
&lt;li&gt;Tuple unpacking is useful to destructure the result.
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
Range&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Arithmetic progression of integers.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Stop value is one-past-the-end.&amp;nbsp;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;&amp;gt;&amp;gt;&amp;gt; range(5)&amp;nbsp;&lt;/li&gt;
&lt;li&gt;range(0, 5)&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;Ranges are &#39;half open&#39;-start is include but stop is not.&amp;nbsp;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;&amp;gt;&amp;gt;&amp;gt; for I in range(5)&amp;nbsp;&lt;/li&gt;
&lt;li&gt;print(I)&amp;nbsp;&lt;/li&gt;
&lt;li&gt;0&amp;nbsp;&lt;/li&gt;
&lt;li&gt;1&amp;nbsp;&lt;/li&gt;
&lt;li&gt;2&amp;nbsp;&lt;/li&gt;
&lt;li&gt;3&amp;nbsp;&lt;/li&gt;
&lt;li&gt;4&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;
Stop value of a range used as start value of consecutive range.&amp;nbsp;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;&amp;gt;&amp;gt;&amp;gt; list(range(5, 10))&amp;nbsp;&lt;/li&gt;
&lt;li&gt;[5, 6, 7, 8, 9]&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&amp;gt;&amp;gt;&amp;gt; list(range(10, 15))&amp;nbsp;&lt;/li&gt;
&lt;li&gt;[10, 11, 12, 13, 14]&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;Optional third step value.&amp;nbsp;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;&amp;gt;&amp;gt;&amp;gt; List(range(0, 10, 2))&amp;nbsp;&lt;/li&gt;
&lt;li&gt;[0, 2, 4, 6, 8]&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;Range(stop)  range(10)&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Range(start:stop)  range(0, 10)&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Range(start:stop:step)  range(0, 10, 2) 

&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://webdesignpluscode.blogspot.com/feeds/6684666717814060928/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://webdesignpluscode.blogspot.com/2017/03/python-part2-conditional-statements.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4103056068311275815/posts/default/6684666717814060928'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4103056068311275815/posts/default/6684666717814060928'/><link rel='alternate' type='text/html' href='http://webdesignpluscode.blogspot.com/2017/03/python-part2-conditional-statements.html' title='Python Part2: Conditional statements, While loops, Strings and Range'/><author><name>Waqas Ali</name><uri>http://www.blogger.com/profile/00458603368045512811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi84d3OPcVaH5dEEXYUc09MMM5UWPa5KLFkRFV-BORRBpASebtv4W8YWxVetuXKOwnYBd031-f_HaC5Zc3w-iz2AdWvuf51a0VUGHUxOx_u8xxKeglselSnBik5Sai0wPo/s220/1918953_1058549159885_1783287_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4103056068311275815.post-1076727406379875809</id><published>2017-03-25T14:40:00.000+05:00</published><updated>2017-03-25T14:40:18.656+05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="python"/><title type='text'>Python Part1: Introduction, Install on windows, Scalar Types and Relational Operators</title><content type='html'>&lt;h2&gt;
Introduction to python&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;Open source programming language developed in late 1980’s.&lt;/li&gt;
&lt;li&gt;Strongly typed language in the sense that every object in the language has a definite type.&lt;/li&gt;
&lt;li&gt;At the same time, it is dynamically typed means no type checking prior to running it.&lt;/li&gt;
&lt;li&gt;General purpose language.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;There are some areas where it&#39;s less suitable than others, for example, in extremely time sensitive or memory constrained environments.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;
Install python on windows&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://www.python.org/downloads/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;https://www.python.org/downloads/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
Scalar types&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Int&lt;/li&gt;
&lt;li&gt;Float&lt;/li&gt;
&lt;li&gt;None&lt;/li&gt;
&lt;li&gt;bool&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
Relational operators&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;== &amp;nbsp; &amp;nbsp; &amp;nbsp;value equality&lt;/li&gt;
&lt;li&gt;!= &amp;nbsp; &amp;nbsp; &amp;nbsp; value inequality&lt;/li&gt;
&lt;li&gt;&amp;lt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;less-than&lt;/li&gt;
&lt;li&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;greater-than&lt;/li&gt;
&lt;li&gt;&amp;lt;= &amp;nbsp; &amp;nbsp; &amp;nbsp;less-than or equal to&lt;/li&gt;
&lt;li&gt;&amp;gt;= &amp;nbsp; &amp;nbsp; &amp;nbsp;greater-than or equal to&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://webdesignpluscode.blogspot.com/feeds/1076727406379875809/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://webdesignpluscode.blogspot.com/2017/03/python-part1-introduction-install-on.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4103056068311275815/posts/default/1076727406379875809'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4103056068311275815/posts/default/1076727406379875809'/><link rel='alternate' type='text/html' href='http://webdesignpluscode.blogspot.com/2017/03/python-part1-introduction-install-on.html' title='Python Part1: Introduction, Install on windows, Scalar Types and Relational Operators'/><author><name>Waqas Ali</name><uri>http://www.blogger.com/profile/00458603368045512811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi84d3OPcVaH5dEEXYUc09MMM5UWPa5KLFkRFV-BORRBpASebtv4W8YWxVetuXKOwnYBd031-f_HaC5Zc3w-iz2AdWvuf51a0VUGHUxOx_u8xxKeglselSnBik5Sai0wPo/s220/1918953_1058549159885_1783287_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4103056068311275815.post-7191592460205618824</id><published>2016-06-26T13:25:00.000+05:00</published><updated>2016-06-26T13:30:04.451+05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="eclipse"/><category scheme="http://www.blogger.com/atom/ns#" term="python"/><title type='text'>How To:Set python virtual environment as python interpreter in eclipse</title><content type='html'>&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;In this lesson we &#39;ll set virtual env as default interpreter in pydev eclipse project.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;1). In &lt;b&gt;PyDev Package Explorer&lt;/b&gt; panel, right click on project name and select&amp;nbsp;&lt;b&gt;Properties&lt;/b&gt;,&amp;nbsp;a new window will open.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;2). Click &lt;b&gt;PyDev - Interpreter/Grammar&lt;/b&gt; -&amp;gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;&amp;nbsp;&lt;b&gt;Click here to configure an interpreter not listed&lt;/b&gt;, a new window will open.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;3). Click &lt;b&gt;PyDev&lt;/b&gt; -&amp;gt; &lt;b&gt;Interpreters&lt;/b&gt; -&amp;gt; &lt;b&gt;Python Interpreter&lt;/b&gt; on left panel.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;4). In &lt;b&gt;Python Interpreters&lt;/b&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;section click&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;&amp;nbsp;&lt;b&gt;New&lt;/b&gt; -&amp;gt; &lt;b&gt;Browse&lt;/b&gt;.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;5). Open virtual environment folder, move to Scripts folder, select python.exe file and click &lt;b&gt;Open&lt;/b&gt;.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;6). Enter venv in &lt;b&gt;Interpreter Name:&lt;/b&gt; instead of default value and click &lt;b&gt;Ok&lt;/b&gt;. You can choose name of your own choice.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;7). Select newly added python interpreter i&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;n&amp;nbsp;&lt;b&gt;Python Interpreters&lt;/b&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;section&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;&amp;nbsp;and click &lt;b&gt;OK&lt;/b&gt;.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;8). Now select&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;newly added python interpreter under &lt;b&gt;Interpreter&lt;/b&gt; drop down list&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;and click &lt;b&gt;OK&lt;/b&gt;.&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://webdesignpluscode.blogspot.com/feeds/7191592460205618824/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://webdesignpluscode.blogspot.com/2016/06/how-toset-python-virtual-environment-as.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4103056068311275815/posts/default/7191592460205618824'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4103056068311275815/posts/default/7191592460205618824'/><link rel='alternate' type='text/html' href='http://webdesignpluscode.blogspot.com/2016/06/how-toset-python-virtual-environment-as.html' title='How To:Set python virtual environment as python interpreter in eclipse'/><author><name>Waqas Ali</name><uri>http://www.blogger.com/profile/00458603368045512811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi84d3OPcVaH5dEEXYUc09MMM5UWPa5KLFkRFV-BORRBpASebtv4W8YWxVetuXKOwnYBd031-f_HaC5Zc3w-iz2AdWvuf51a0VUGHUxOx_u8xxKeglselSnBik5Sai0wPo/s220/1918953_1058549159885_1783287_n.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4103056068311275815.post-3949329427395463708</id><published>2016-06-26T05:58:00.002+05:00</published><updated>2016-06-26T06:05:15.498+05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="django"/><category scheme="http://www.blogger.com/atom/ns#" term="eclipse"/><category scheme="http://www.blogger.com/atom/ns#" term="python"/><title type='text'>How To:Import python project in eclipse</title><content type='html'>&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;In this lesson we &#39;ll import python django project in pydev eclipse.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;Copy these two files from some existing pydev eclipse project to root folder of new project which you want to import in eclipse.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;.project&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;.pydevproject&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;Open .project file in notepad and change name to your_project_name.&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;If you don&#39;t have these files then you can create them yourself.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;Open notepad, copy following text, click &lt;b&gt;File&lt;/b&gt; -&amp;gt; &lt;b&gt;Save As...&lt;/b&gt; -&amp;gt; Enter &quot;.project&quot; in &lt;b&gt;File name:&lt;/b&gt; -&amp;gt; Select All Files from &lt;b&gt;Save as type:&lt;/b&gt; drop down list.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;

&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;
&lt;/span&gt;
&lt;br /&gt;
&lt;div style=&quot;background: #ececec; width: 100%;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;&lt;code&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;&amp;lt;projectDescription&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;lt;name&amp;gt;your_project_name&amp;lt;/name&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;lt;comment&amp;gt;&amp;lt;/comment&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;lt;projects&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;lt;/projects&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;lt;buildSpec&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&amp;lt;buildCommand&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;&amp;lt;name&amp;gt;org.python.pydev.PyDevBuilder&amp;lt;/name&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;&amp;lt;arguments&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;&amp;lt;/arguments&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&amp;lt;/buildCommand&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;lt;/buildSpec&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;lt;natures&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&amp;lt;nature&amp;gt;org.python.pydev.django.djangoNature&amp;lt;/nature&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&amp;lt;nature&amp;gt;org.python.pydev.pythonNature&amp;lt;/nature&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;lt;/natures&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;&amp;lt;/projectDescription&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;/code&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;Now again open notepad, copy following text, click&amp;nbsp;&lt;b&gt;File&lt;/b&gt;&amp;nbsp;-&amp;gt;&amp;nbsp;&lt;b&gt;Save As...&lt;/b&gt;&amp;nbsp;-&amp;gt; Enter &quot;.pydevproject&quot; in&amp;nbsp;&lt;b&gt;File name:&lt;/b&gt;&amp;nbsp;-&amp;gt; Select All Files from&amp;nbsp;&lt;b&gt;Save as type:&lt;/b&gt;&amp;nbsp;drop down list.&lt;/span&gt;&lt;br /&gt;

&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;
&lt;/span&gt;
&lt;br /&gt;
&lt;div style=&quot;background: #ececec; width: 100%;&quot;&gt;
&lt;code&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;&amp;lt;?eclipse-pydev version=&quot;1.0&quot;?&amp;gt;&amp;lt;pydev_project&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;&amp;lt;pydev_variables_property name=&quot;org.python.pydev.PROJECT_VARIABLE_SUBSTITUTION&quot;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;&amp;lt;key&amp;gt;DJANGO_MANAGE_LOCATION&amp;lt;/key&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;&amp;lt;value&amp;gt;manage.py&amp;lt;/value&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;&amp;lt;/pydev_variables_property&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;&amp;lt;pydev_pathproperty name=&quot;org.python.pydev.PROJECT_SOURCE_PATH&quot;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;&amp;lt;path&amp;gt;/${PROJECT_DIR_NAME}&amp;lt;/path&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;&amp;lt;/pydev_pathproperty&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;&amp;lt;pydev_property name=&quot;org.python.pydev.PYTHON_PROJECT_VERSION&quot;&amp;gt;python 3.0&amp;lt;/pydev_property&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;&amp;lt;pydev_property name=&quot;org.python.pydev.PYTHON_PROJECT_INTERPRETER&quot;&amp;gt;Default&amp;lt;/pydev_property&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;&amp;lt;/pydev_project&amp;gt;&lt;/span&gt;
&lt;/code&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;Open eclipse, click &lt;b&gt;File&lt;/b&gt; -&amp;gt; &lt;b&gt;Import&lt;/b&gt;. New window will open. Now select &#39;&lt;b&gt;Existing Projects into Workspace&lt;/b&gt;&#39; under &#39;&lt;b&gt;General&lt;/b&gt;&#39; and click &lt;b&gt;Next&lt;/b&gt;. On new window browse to project root directory and select root folder. Then click finish.&lt;/span&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://webdesignpluscode.blogspot.com/feeds/3949329427395463708/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://webdesignpluscode.blogspot.com/2016/06/how-toimport-python-project-in-eclipse.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4103056068311275815/posts/default/3949329427395463708'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4103056068311275815/posts/default/3949329427395463708'/><link rel='alternate' type='text/html' href='http://webdesignpluscode.blogspot.com/2016/06/how-toimport-python-project-in-eclipse.html' title='How To:Import python project in eclipse'/><author><name>Waqas Ali</name><uri>http://www.blogger.com/profile/00458603368045512811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi84d3OPcVaH5dEEXYUc09MMM5UWPa5KLFkRFV-BORRBpASebtv4W8YWxVetuXKOwnYBd031-f_HaC5Zc3w-iz2AdWvuf51a0VUGHUxOx_u8xxKeglselSnBik5Sai0wPo/s220/1918953_1058549159885_1783287_n.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4103056068311275815.post-2672856499908152340</id><published>2016-06-25T11:31:00.001+05:00</published><updated>2016-06-25T14:39:04.061+05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="django"/><category scheme="http://www.blogger.com/atom/ns#" term="python"/><title type='text'>How To:Create virtual python environment and Install pypi packages in window env</title><content type='html'>&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;In this lesson we &#39;ll create virtual environment for our python project and install all necessary packages from pypi though cmd, which &#39;ll used in our project.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;1). Open directory where you want to create virtual environment.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;2). Open cmd in same directory by clicking shift + mouse right
key and then select &#39;&lt;b&gt;open command window here&#39;&lt;/b&gt;.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;3). Install virtual environment by running following command in cmd. If&amp;nbsp;virtual environment already installed then skip this step.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background: #ececec; width: 100%;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;&lt;code&gt;&lt;b&gt;
pip install virtualenv
&lt;/b&gt;&lt;/code&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;
&lt;br /&gt;4). Type following command in cmd and press enter. It will create
virtual environment.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background: #ececec; width: 100%;&quot;&gt;
&lt;code&gt;&lt;b&gt;
virtualenv env
&lt;/b&gt;&lt;/code&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;You can see a new folder is added with name &lt;b&gt;env&lt;/b&gt;.&amp;nbsp;You can change name of virtual environment to your own choice, just change the env to Your_Own_Name in later part of command.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;5). Now type this command in cmd and press enter.
Virtual environment will be activated.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background: #ececec; width: 100%;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;&lt;code&gt;&lt;b&gt;
env\scripts\activate&lt;/b&gt;&lt;/code&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;You can see &lt;b&gt;(env)&lt;/b&gt; in start of line in cmd.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;6). Now we &#39;ll install all necessary package from pypi, which &#39;ll be used in our project. Run following commands in cmd.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background: #ececec; width: 100%;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;&lt;code&gt;&lt;b&gt;
pip install django&lt;br /&gt;
pip install djangorestframework&lt;br /&gt;
pip install django-oauth-toolkit&lt;br /&gt;
pip install pymysql&lt;br /&gt;
pip install pythondbhelper&lt;/b&gt;&lt;br /&gt;
&lt;/code&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;line-height: 107%;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;
&lt;span style=&quot;line-height: 107%;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;Now virtual environment is ready with all necessary pypi packages.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://webdesignpluscode.blogspot.com/feeds/2672856499908152340/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://webdesignpluscode.blogspot.com/2016/06/how-tocreate-virtual-python-environment_25.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4103056068311275815/posts/default/2672856499908152340'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4103056068311275815/posts/default/2672856499908152340'/><link rel='alternate' type='text/html' href='http://webdesignpluscode.blogspot.com/2016/06/how-tocreate-virtual-python-environment_25.html' title='How To:Create virtual python environment and Install pypi packages in window env'/><author><name>Waqas Ali</name><uri>http://www.blogger.com/profile/00458603368045512811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi84d3OPcVaH5dEEXYUc09MMM5UWPa5KLFkRFV-BORRBpASebtv4W8YWxVetuXKOwnYBd031-f_HaC5Zc3w-iz2AdWvuf51a0VUGHUxOx_u8xxKeglselSnBik5Sai0wPo/s220/1918953_1058549159885_1783287_n.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4103056068311275815.post-4615512783259427653</id><published>2016-02-29T03:52:00.001+05:00</published><updated>2016-02-29T03:52:44.458+05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CSS"/><category scheme="http://www.blogger.com/atom/ns#" term="Google"/><category scheme="http://www.blogger.com/atom/ns#" term="HTML"/><category scheme="http://www.blogger.com/atom/ns#" term="Java Script"/><title type='text'>How To: Add Marker/Pin on Google Map</title><content type='html'>In this lesson we will learn how to add pin/market on google map at specific point (coordinates: latitude and longitude). Add following code to &lt;a href=&quot;http://webdesignpluscode.blogspot.com/2016/02/how-to-add-google-map-in-html-page.html&quot; target=&quot;_blank&quot;&gt;add google map in html page&lt;/a&gt; with basic map properties.&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background: #ececec; width: 100%;&quot;&gt;
&lt;code&gt;
&amp;lt;html&amp;gt;&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;title&amp;gt;Google Map!&amp;lt;/title&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;script src=&quot;http://maps.google.com/maps/api/js?sensor=false&quot; type=&quot;text/javascript&quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;script type=&quot;text/javascript&quot;&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var map = null;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; function initialize() {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var latlng = new google.maps.LatLng(31.536648, 74.343443);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var myOptions = {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; zoom: 12,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; center: latlng,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; mapTypeId: google.maps.MapTypeId.ROADMAP&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; map = new google.maps.Map(document.getElementById(&quot;map_area&quot;), myOptions);&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body onload=&quot;initialize()&quot; style=&quot;width: 98%; height: 100%;&quot;&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;div id=&quot;map_area&quot; style=&quot;width: 100%; height: 520px;&quot;&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/html&amp;gt;&lt;br /&gt;
&lt;/code&gt;
&lt;/div&gt;
&lt;br /&gt;
Now create another java script function AddMarker() to add pin on google map, in this function we will set basic properties of pin like its position ( coordinate: latitude and longitude) and its title. Add following code in &amp;lt;script&amp;gt; &amp;lt;/script&amp;gt; tag inside head section of web page.&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background: #ececec; width: 100%;&quot;&gt;
&lt;code&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; function AddMarker() { &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var myLatlng = new google.maps.LatLng(31.5136648, 74.343443);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var marker = new google.maps.Marker({&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; position: myLatlng,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; map: map,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; title: &#39;Lahore, Pakistan.&#39;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; });&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&lt;/code&gt;
&lt;/div&gt;
&lt;br /&gt;
Now create a new button in html and call this function on onclick event of button. Add following code immediately before &amp;lt;/bode&amp;gt; tag.&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background: #ececec; width: 100%;&quot;&gt;
&lt;code&gt;
&amp;lt;input type=&quot;submit&quot; onclick=&quot;AddMarker()&quot; name=&quot;button&quot; title=&quot;Add marker&quot; /&amp;gt;&lt;br /&gt;
&lt;/code&gt;
&lt;/div&gt;
&lt;br /&gt;
Complete code of all steps is&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgdJkKo-Q7D6iB0UCATkGX5WzGsdJiO5F6T7Vt2P7ZkdgYIUK3HrruV5i4Qf2tel95gKG41L4MHBdb5r8X7TutB3kaiVtQz01tEjtj_-nK_BogjpC3UwvrNssiIQAUFTag1E2uDFXmuwK_S/s1600/google+pin-716x558.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img alt=&quot;Add Pin on Google Map&quot; border=&quot;0&quot; height=&quot;558&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgdJkKo-Q7D6iB0UCATkGX5WzGsdJiO5F6T7Vt2P7ZkdgYIUK3HrruV5i4Qf2tel95gKG41L4MHBdb5r8X7TutB3kaiVtQz01tEjtj_-nK_BogjpC3UwvrNssiIQAUFTag1E2uDFXmuwK_S/s1600/google+pin-716x558.jpg&quot; title=&quot;Add Pin on Google Map&quot; width=&quot;550&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Add Marker/Pin on Google Map&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
This is all. You have done. Save file and view in browser.</content><link rel='replies' type='application/atom+xml' href='http://webdesignpluscode.blogspot.com/feeds/4615512783259427653/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://webdesignpluscode.blogspot.com/2016/02/how-to-add-markerpin-on-google-map.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4103056068311275815/posts/default/4615512783259427653'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4103056068311275815/posts/default/4615512783259427653'/><link rel='alternate' type='text/html' href='http://webdesignpluscode.blogspot.com/2016/02/how-to-add-markerpin-on-google-map.html' title='How To: Add Marker/Pin on Google Map'/><author><name>Waqas Ali</name><uri>http://www.blogger.com/profile/00458603368045512811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi84d3OPcVaH5dEEXYUc09MMM5UWPa5KLFkRFV-BORRBpASebtv4W8YWxVetuXKOwnYBd031-f_HaC5Zc3w-iz2AdWvuf51a0VUGHUxOx_u8xxKeglselSnBik5Sai0wPo/s220/1918953_1058549159885_1783287_n.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgdJkKo-Q7D6iB0UCATkGX5WzGsdJiO5F6T7Vt2P7ZkdgYIUK3HrruV5i4Qf2tel95gKG41L4MHBdb5r8X7TutB3kaiVtQz01tEjtj_-nK_BogjpC3UwvrNssiIQAUFTag1E2uDFXmuwK_S/s72-c/google+pin-716x558.jpg" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4103056068311275815.post-3163765336854976050</id><published>2016-02-29T02:47:00.000+05:00</published><updated>2016-02-29T03:07:30.617+05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CSS"/><category scheme="http://www.blogger.com/atom/ns#" term="Google"/><category scheme="http://www.blogger.com/atom/ns#" term="HTML"/><category scheme="http://www.blogger.com/atom/ns#" term="Java Script"/><title type='text'>How To: Add Google Map in Html Page</title><content type='html'>Adding google map to html page is very easy and a common practice now a days. In this tutorial we will learn how to add google map in web page step by step.&lt;br /&gt;
First create a basic structure of html page.&lt;br /&gt;
Open any text editor, paste following code there and save it as GoogleMap.html file.&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background: #ececec; width: 100%;&quot;&gt;
&lt;code&gt;
&amp;lt;html&amp;gt;&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;title&amp;gt;Google Map!&amp;lt;/title&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body style=&quot;width: 98%; height: 100%;&quot;&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;div id=&quot;map_area&quot; style=&quot;width: 100%; height: 520px;&quot;&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/html&amp;gt;&lt;br /&gt;
&lt;/code&gt;
&lt;/div&gt;
&lt;br /&gt;
Now add following google api reference in page head section.&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background: #ececec; width: 100%;&quot;&gt;
&lt;code&gt;
&amp;lt;script src=&quot;http://maps.google.com/maps/api/js?sensor=false&quot; type=&quot;text/javascript&quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;/code&gt;
&lt;/div&gt;
&lt;br /&gt;
Now we will create a java script function to initialize google map. &amp;nbsp;We will set basic map properties in this function while initialization. Add following function in page head section inside &amp;lt;script&amp;gt; &amp;lt;/script&amp;gt; tags.&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background: #ececec; width: 100%;&quot;&gt;
&lt;code&gt;
&amp;lt;script type=&quot;text/javascript&quot;&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var map = null;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; function initialize() {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var latlng = new google.maps.LatLng(31.536648, 74.343443);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var myOptions = {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; zoom: 15,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; center: latlng,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; mapTypeId: google.maps.MapTypeId.ROADMAP&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; map = new google.maps.Map(document.getElementById(&quot;map_area&quot;), myOptions);&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;/code&gt;
&lt;/div&gt;
&lt;br /&gt;
Now call this function on onload event of body of web page.&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background: #ececec; width: 100%;&quot;&gt;
&lt;code&gt;
&amp;lt;body onload=&quot;initialize()&quot; style=&quot;width: 98%; height: 100%;&quot;&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;div id=&quot;map_canvas&quot; style=&quot;width: 100%; height: 520px;&quot;&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
&lt;/code&gt;
&lt;/div&gt;
&lt;br /&gt;
Complete code of all setps will look like:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRLEc0s8ZtwuSYOSiu1jClE6Pq2htnANyd5ln9Ft9h7oYDNCbwC2_8e5wm7VjuQBjk6g3hLc79VzIT1kW0nsJlilkJ1r5vTnNjjsv4wLSct7eTsOuIsxdtHFDAdcsWOHwZwJNk0dYTYpoI/s1600/google+map+705x451.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img alt=&quot;Add Google Map in Html Page&quot; border=&quot;0&quot; height=&quot;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRLEc0s8ZtwuSYOSiu1jClE6Pq2htnANyd5ln9Ft9h7oYDNCbwC2_8e5wm7VjuQBjk6g3hLc79VzIT1kW0nsJlilkJ1r5vTnNjjsv4wLSct7eTsOuIsxdtHFDAdcsWOHwZwJNk0dYTYpoI/s1600/google+map+705x451.jpg&quot; title=&quot;Add Google Map in Html Page&quot; width=&quot;550&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Add Google Map in Html Page&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
This is all. You have done. Save file and view in browser.</content><link rel='replies' type='application/atom+xml' href='http://webdesignpluscode.blogspot.com/feeds/3163765336854976050/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://webdesignpluscode.blogspot.com/2016/02/how-to-add-google-map-in-html-page.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4103056068311275815/posts/default/3163765336854976050'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4103056068311275815/posts/default/3163765336854976050'/><link rel='alternate' type='text/html' href='http://webdesignpluscode.blogspot.com/2016/02/how-to-add-google-map-in-html-page.html' title='How To: Add Google Map in Html Page'/><author><name>Waqas Ali</name><uri>http://www.blogger.com/profile/00458603368045512811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi84d3OPcVaH5dEEXYUc09MMM5UWPa5KLFkRFV-BORRBpASebtv4W8YWxVetuXKOwnYBd031-f_HaC5Zc3w-iz2AdWvuf51a0VUGHUxOx_u8xxKeglselSnBik5Sai0wPo/s220/1918953_1058549159885_1783287_n.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRLEc0s8ZtwuSYOSiu1jClE6Pq2htnANyd5ln9Ft9h7oYDNCbwC2_8e5wm7VjuQBjk6g3hLc79VzIT1kW0nsJlilkJ1r5vTnNjjsv4wLSct7eTsOuIsxdtHFDAdcsWOHwZwJNk0dYTYpoI/s72-c/google+map+705x451.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4103056068311275815.post-4056669702537444268</id><published>2016-02-28T03:51:00.000+05:00</published><updated>2016-02-28T03:51:23.600+05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term=".Net"/><category scheme="http://www.blogger.com/atom/ns#" term="c#"/><category scheme="http://www.blogger.com/atom/ns#" term="Java Script"/><title type='text'>How To: Call Java Script Function from Silverlight</title><content type='html'>In this tutorial we will learn, how to call java script function from silver light using C#. HtmlPage.Window.Invoke function is used invoke the java script method from silver light application.&lt;br /&gt;
&lt;br /&gt;
Add following C# code, where you want to call java script function.&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background: #ececec; width: 100%;&quot;&gt;
&lt;code&gt;
HtmlPage.Window.Invoke(&quot;SayHello&quot;);&lt;br /&gt;
&lt;/code&gt;
&lt;/div&gt;
&lt;br /&gt;
Add following java script code in aspx or html page in silver light web project.&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background: #ececec; width: 100%;&quot;&gt;
&lt;code&gt;
function SayHello()&lt;br /&gt;
{&lt;br /&gt;
alert(&#39;Hello! function called from silverlight&#39;);&lt;br /&gt;
}&lt;br /&gt;
&lt;/code&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;h2&gt;
Java script function with parameters:&lt;/h2&gt;
To call java script function with multiple input parameters, add following C# code in .cs file.&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background: #ececec; width: 100%;&quot;&gt;
&lt;code&gt;
HtmlPage.Window.Invoke(&quot;SayHello&quot;, &quot;Waqas&quot;, &quot;A&quot;);&lt;br /&gt;
&lt;/code&gt;&lt;/div&gt;
&lt;br /&gt;
Add following java script function in aspx or html page in silver light web project.&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background: #ececec; width: 100%;&quot;&gt;
&lt;code&gt;
function SayHello(fname, lname)&lt;br /&gt;
{&lt;br /&gt;
alert(&#39;Hello! &#39; + fname + &#39; &#39; + lname +&lt;br /&gt;
&#39; -function called from silverlight&#39;);&lt;br /&gt;
}&lt;br /&gt;
&lt;/code&gt;&lt;/div&gt;
&lt;br /&gt;
This is all. You have done.&lt;br /&gt;
Build project and view in browser.</content><link rel='replies' type='application/atom+xml' href='http://webdesignpluscode.blogspot.com/feeds/4056669702537444268/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://webdesignpluscode.blogspot.com/2016/02/how-to-call-java-script-function-from.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4103056068311275815/posts/default/4056669702537444268'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4103056068311275815/posts/default/4056669702537444268'/><link rel='alternate' type='text/html' href='http://webdesignpluscode.blogspot.com/2016/02/how-to-call-java-script-function-from.html' title='How To: Call Java Script Function from Silverlight'/><author><name>Waqas Ali</name><uri>http://www.blogger.com/profile/00458603368045512811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi84d3OPcVaH5dEEXYUc09MMM5UWPa5KLFkRFV-BORRBpASebtv4W8YWxVetuXKOwnYBd031-f_HaC5Zc3w-iz2AdWvuf51a0VUGHUxOx_u8xxKeglselSnBik5Sai0wPo/s220/1918953_1058549159885_1783287_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4103056068311275815.post-5949876979791164383</id><published>2016-02-27T22:31:00.000+05:00</published><updated>2016-02-28T03:19:26.523+05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term=".Net"/><category scheme="http://www.blogger.com/atom/ns#" term="c#"/><category scheme="http://www.blogger.com/atom/ns#" term="CSS"/><category scheme="http://www.blogger.com/atom/ns#" term="HTML"/><category scheme="http://www.blogger.com/atom/ns#" term="Java Script"/><category scheme="http://www.blogger.com/atom/ns#" term="Silverlight"/><title type='text'>How To: Integrate HTML Page in Silverlight Application</title><content type='html'>Integrating Html page in silver light application is little tricky at first. In this tutorial we will learn how to display html page in silver light application step by step.&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;
Add following code in silver light &amp;nbsp;html page immediate before &amp;lt;/form&amp;gt; tag.&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background: #ececec; width: 100%;&quot;&gt;
&lt;code&gt;
&amp;lt;div id=&quot;BrowserDiv&quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&quot;vertical-align:middle&quot;&amp;gt;&lt;br /&gt;
&amp;lt;img alt=&quot;Close&quot; align=&quot;right&quot; src=&quot;Images/Close.png&quot; onclick=&quot;HideBrowser();&quot; style=&quot;cursor:pointer;&quot; /&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div id=&quot;BrowserDiv_IFrame_Container&quot; style=&quot;height:95%;width:100%;margin-top:37px;&quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;/code&gt;
&lt;/div&gt;
&lt;br /&gt;
Add following css code in page.&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background: #ececec; width: 100%;&quot;&gt;
&lt;code&gt;
&amp;lt;style type=&quot;text/css&quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#BrowserDiv&lt;br /&gt;
{&lt;br /&gt;
position:absolute;&lt;br /&gt;
background-color:#484848;&lt;br /&gt;
overflow:hidden;&lt;br /&gt;
left:0;&lt;br /&gt;
top:0;&lt;br /&gt;
height:100%;&lt;br /&gt;
width:100%;&lt;br /&gt;
display:none;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/style&amp;gt;&lt;br /&gt;
&lt;/code&gt;
&lt;/div&gt;
&lt;br /&gt;
We need following javascript code to show and hide htm page.&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background: #ececec; width: 100%;&quot;&gt;
&lt;code&gt;
&amp;lt;script type=&quot;text/javascript&quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
var slHost = null;&lt;br /&gt;
var BrowserDivContainer = null;&lt;br /&gt;
var BrowserDivIFrameContainer = null;&lt;br /&gt;
var jobPlanIFrameID = &#39;JobPlan_IFrame&#39;;&lt;br /&gt;
&lt;br /&gt;
$(document).ready(function () {&lt;br /&gt;
slHost = $(&#39;#silverlightControlHost&#39;);&lt;br /&gt;
BrowserDivContainer = $(&#39;#BrowserDiv&#39;);&lt;br /&gt;
BrowserDivIFrameContainer = $(&#39;#BrowserDiv_IFrame_Container&#39;);&lt;br /&gt;
});&lt;br /&gt;
&lt;br /&gt;
function ShowBrowserIFrame(url) {&lt;br /&gt;
BrowserDivContainer.css(&#39;display&#39;, &#39;block&#39;);&lt;br /&gt;
$(&#39;&amp;lt;iframe id=&quot;&#39; + jobPlanIFrameID + &#39;&quot; src=&quot;&#39; + url + &#39;&quot; style=&quot;height:100%;width:100%;&quot; /&amp;gt;&#39;)&lt;br /&gt;
.appendTo(BrowserDivIFrameContainer);&lt;br /&gt;
slHost.css(&#39;width&#39;, &#39;0%&#39;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
function HideBrowser() {&lt;br /&gt;
BrowserDivContainer.css(&#39;display&#39;, &#39;none&#39;);&lt;br /&gt;
$(&#39;#&#39; + jobPlanIFrameID).remove();&lt;br /&gt;
slHost.css(&#39;width&#39;, &#39;100%&#39;);&lt;br /&gt;
}
&lt;/code&gt;&lt;br /&gt;
&lt;div&gt;
&lt;code&gt;&amp;lt;/script&amp;gt;&lt;/code&gt;&lt;/div&gt;
&lt;code&gt; &lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
Add reference to following jquery file.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background: #ececec; width: 100%;&quot;&gt;
&lt;code&gt;
&lt;/code&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;code&gt;&amp;lt;script type=&quot;text/javascript&quot; src=&quot;Scripts/jquery-1.4.2.min.js&quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;/code&gt;&lt;/div&gt;
&lt;code&gt;
&lt;/code&gt; &lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
We have done with html page. Now we will move to silver light user control and open html page on button click.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Add following code in user control (main.xaml).&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background: #ececec; width: 100%;&quot;&gt;
&lt;code&gt;
&lt;/code&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;code&gt;&amp;lt;Button Content=&quot;Show Html Page&quot; HorizontalAlignment=&quot;Left&quot; Margin=&quot;164,140,0,0&quot; VerticalAlignment=&quot;Top&quot; Width=&quot;117&quot; Click=&quot;Button_Click&quot;/&amp;gt;&lt;/code&gt;&lt;/div&gt;
&lt;code&gt;
&lt;/code&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Now add following button click handler and a helper function in main.xaml.cs to open html page.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background: #ececec; width: 100%;&quot;&gt;
&lt;code&gt;
&lt;/code&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;div&gt;
&lt;code&gt;private void Button_Click(object sender, RoutedEventArgs e)&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code&gt;{&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code&gt;ShowBrowser();&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code&gt;}&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code&gt;&lt;br /&gt;&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code&gt;public void ShowBrowser()&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code&gt;{&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code&gt;try&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code&gt;{&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code&gt;string url = &quot;http://webdesignpluscode.blogspot.com/&quot;;&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code&gt;HtmlPage.Window.Invoke(&quot;ShowBrowserIFrame&quot;, url);&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code&gt;}&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code&gt;catch (Exception ex)&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code&gt;{&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code&gt;throw ex;&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code&gt;}&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code&gt;}&lt;/code&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;code&gt;
&lt;/code&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
This is all, We have done with code. Now create new folder &#39;Images&#39; and place an image there &#39;Close.png&#39; for close button.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Now build project and view in browser.&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://webdesignpluscode.blogspot.com/feeds/5949876979791164383/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://webdesignpluscode.blogspot.com/2016/02/how-to-integrate-html-page-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4103056068311275815/posts/default/5949876979791164383'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4103056068311275815/posts/default/5949876979791164383'/><link rel='alternate' type='text/html' href='http://webdesignpluscode.blogspot.com/2016/02/how-to-integrate-html-page-in.html' title='How To: Integrate HTML Page in Silverlight Application'/><author><name>Waqas Ali</name><uri>http://www.blogger.com/profile/00458603368045512811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi84d3OPcVaH5dEEXYUc09MMM5UWPa5KLFkRFV-BORRBpASebtv4W8YWxVetuXKOwnYBd031-f_HaC5Zc3w-iz2AdWvuf51a0VUGHUxOx_u8xxKeglselSnBik5Sai0wPo/s220/1918953_1058549159885_1783287_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4103056068311275815.post-5646535417265965976</id><published>2015-04-26T23:24:00.000+05:00</published><updated>2015-04-27T11:21:51.267+05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term=".Net"/><category scheme="http://www.blogger.com/atom/ns#" term="c#"/><category scheme="http://www.blogger.com/atom/ns#" term="Win RT"/><category scheme="http://www.blogger.com/atom/ns#" term="Windows Phone"/><title type='text'>How to Convert BitmapImage  to Storage File in Windows Phone 8.1 Win RT</title><content type='html'>&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;BitmapImage to Storage File conversion requires following steps.&lt;/span&gt;&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;BitmapImage to byte array conversion.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Creation of temporary StorageFile.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Writing byte array data on empty storage file.&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;
BitmapImage to byte array conversion&lt;/b&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;

&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;BitmapImage bitmap = ImageBoxPreview.Source as BitmapImage;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;

&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;RandomAccessStreamReference rasr = RandomAccessStreamReference.CreateFromUri(bitmap.UriSource);&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;

&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;var streamWithContent = await rasr.OpenReadAsync();&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;

&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;byte[] buffer = new byte[streamWithContent.Size];&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;

&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;await streamWithContent.ReadAsync(buffer.AsBuffer(),(uint)streamWithContent.Size, InputStreamOptions.None);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;

&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;
Creation of temporary StorageFile&lt;/b&gt;&lt;/span&gt;
&lt;/div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;
&lt;/span&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;StorageFile file = await ApplicationData.Current.LocalFolder.CreateFileAsync(&quot;temp.jpeg&quot;, CreationCollisionOption.ReplaceExisting);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;
&lt;/span&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;
Writing byte array data on empty storage file&lt;/b&gt;&lt;/span&gt;
&lt;/div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;
&lt;/span&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;using (IRandomAccessStream fileStream = await file.OpenAsync(FileAccessMode.ReadWrite))&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; using (IOutputStream outputStream = fileStream.GetOutputStreamAt(0))&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;using (DataWriter dataWriter = new DataWriter(outputStream))&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; dataWriter.WriteBytes(buffer);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; await dataWriter.StoreAsync(); //&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; dataWriter.DetachStream();&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// write data on the empty file:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;outputStream.FlushAsync();&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; fileStream.FlushAsync();&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;
&lt;/span&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;
&lt;/span&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Complete code will be:&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;figure&gt;
  &lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;img alt=&quot;Convert BitmapImage  to Storage File in Windows Phone 8.1 Win RT&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgvtJpGfN9AMJpPL9CUL64QOE8ETwoPgjZcktd-zwOM3ZZZp8T3Yefl50UMgsDmMvnmgg4lwM6gxCUz1QpWJXBrWCxt5PpFE-B8PeVVerEh0wWPu3HXmjSofzD07wVXAGl8JpCryHFhKvAW/s1600/BitmapImage+-to-Storage-File-in-Windows-Phone-8.1-Win-RT-530x511.jpg&quot; height=&quot;511&quot; title=&quot;Convert BitmapImage  to Storage File in Windows Phone 8.1 Win RT&quot; width=&quot;530&quot; /&gt;
  &lt;/span&gt;&lt;/figure&gt;&lt;br /&gt;
&lt;center&gt;
&lt;figcaption&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Convert BitmapImage  to Storage File in Windows Phone 8.1 Win RT.&lt;/span&gt;&lt;/figcaption&gt;&lt;/center&gt;
</content><link rel='replies' type='application/atom+xml' href='http://webdesignpluscode.blogspot.com/feeds/5646535417265965976/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://webdesignpluscode.blogspot.com/2015/04/how-to-convert-bitmapimage-to-storage.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4103056068311275815/posts/default/5646535417265965976'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4103056068311275815/posts/default/5646535417265965976'/><link rel='alternate' type='text/html' href='http://webdesignpluscode.blogspot.com/2015/04/how-to-convert-bitmapimage-to-storage.html' title='How to Convert BitmapImage  to Storage File in Windows Phone 8.1 Win RT'/><author><name>Waqas Ali</name><uri>http://www.blogger.com/profile/00458603368045512811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi84d3OPcVaH5dEEXYUc09MMM5UWPa5KLFkRFV-BORRBpASebtv4W8YWxVetuXKOwnYBd031-f_HaC5Zc3w-iz2AdWvuf51a0VUGHUxOx_u8xxKeglselSnBik5Sai0wPo/s220/1918953_1058549159885_1783287_n.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgvtJpGfN9AMJpPL9CUL64QOE8ETwoPgjZcktd-zwOM3ZZZp8T3Yefl50UMgsDmMvnmgg4lwM6gxCUz1QpWJXBrWCxt5PpFE-B8PeVVerEh0wWPu3HXmjSofzD07wVXAGl8JpCryHFhKvAW/s72-c/BitmapImage+-to-Storage-File-in-Windows-Phone-8.1-Win-RT-530x511.jpg" height="72" width="72"/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4103056068311275815.post-5778713305402142147</id><published>2014-11-10T00:31:00.001+05:00</published><updated>2014-11-10T00:31:25.065+05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ora-code"/><category scheme="http://www.blogger.com/atom/ns#" term="oracle"/><title type='text'>ORA-00299 Must use file level media recovery on data file string</title><content type='html'>&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Error Code&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;ORA-00299&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Description&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;Must use file-level media recovery on data file string&lt;/b&gt;.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Cause&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Possible cause of this error is, the &lt;b&gt;control file&lt;/b&gt; does not contain an entry for this file, so block &lt;b&gt;media recovery&lt;/b&gt; cannot be done.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Action&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;To fix this issue, restore the data file and perform file-level &lt;b&gt;media recovery&lt;/b&gt;.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: x-small;&quot;&gt;&lt;a href=&quot;http://ora-00299.ora-code.com/&quot; rel=&quot;nofollow&quot; style=&quot;color: #999999;&quot; target=&quot;_blank&quot;&gt;reference&lt;/a&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://webdesignpluscode.blogspot.com/feeds/5778713305402142147/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://webdesignpluscode.blogspot.com/2014/11/ora-00299-must-use-file-level-media.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4103056068311275815/posts/default/5778713305402142147'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4103056068311275815/posts/default/5778713305402142147'/><link rel='alternate' type='text/html' href='http://webdesignpluscode.blogspot.com/2014/11/ora-00299-must-use-file-level-media.html' title='ORA-00299 Must use file level media recovery on data file string'/><author><name>Waqas Ali</name><uri>http://www.blogger.com/profile/00458603368045512811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi84d3OPcVaH5dEEXYUc09MMM5UWPa5KLFkRFV-BORRBpASebtv4W8YWxVetuXKOwnYBd031-f_HaC5Zc3w-iz2AdWvuf51a0VUGHUxOx_u8xxKeglselSnBik5Sai0wPo/s220/1918953_1058549159885_1783287_n.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4103056068311275815.post-8607363343110872385</id><published>2014-11-10T00:23:00.001+05:00</published><updated>2014-11-10T00:23:52.507+05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ora-code"/><category scheme="http://www.blogger.com/atom/ns#" term="oracle"/><title type='text'>ORA-00298 Missing or invalid attribute value</title><content type='html'>&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Error Code&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;ORA-00298&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Description&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;Missing or invalid attribute value&lt;/b&gt;.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Cause&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Possible cause of this error is, a non-zero integer value is required when the following keyword attributes are specified: TIMEOUT, EXPIRE, DELAY, NEXT&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Action&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;To fix this issue, correct the syntax and retry the command.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: x-small;&quot;&gt;&lt;a href=&quot;http://ora-00298.ora-code.com/&quot; rel=&quot;nofollow&quot; style=&quot;color: #999999;&quot; target=&quot;_blank&quot;&gt;reference&lt;/a&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://webdesignpluscode.blogspot.com/feeds/8607363343110872385/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://webdesignpluscode.blogspot.com/2014/11/ora-00298-missing-or-invalid-attribute.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4103056068311275815/posts/default/8607363343110872385'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4103056068311275815/posts/default/8607363343110872385'/><link rel='alternate' type='text/html' href='http://webdesignpluscode.blogspot.com/2014/11/ora-00298-missing-or-invalid-attribute.html' title='ORA-00298 Missing or invalid attribute value'/><author><name>Waqas Ali</name><uri>http://www.blogger.com/profile/00458603368045512811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi84d3OPcVaH5dEEXYUc09MMM5UWPa5KLFkRFV-BORRBpASebtv4W8YWxVetuXKOwnYBd031-f_HaC5Zc3w-iz2AdWvuf51a0VUGHUxOx_u8xxKeglselSnBik5Sai0wPo/s220/1918953_1058549159885_1783287_n.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4103056068311275815.post-1449376308326034268</id><published>2014-11-10T00:17:00.001+05:00</published><updated>2014-11-10T00:17:36.266+05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ora-code"/><category scheme="http://www.blogger.com/atom/ns#" term="oracle"/><title type='text'>ORA-00297 Must specify RECOVER DATAFILE LIST before RECOVER DATAFILE START</title><content type='html'>&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Error Code&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;ORA-00297&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Description&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;Must specify RECOVER DATAFILE LIST before RECOVER DATAFILE START&lt;/b&gt;.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Cause&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Possible cause of this error is, the &lt;b&gt;RECOVER DATAFILE START&lt;/b&gt; command was issued, but no &lt;b&gt;RECOVER DATAFILE LIST&lt;/b&gt; commands had been issued. This only happens when doing recovery with Recovery Manager, and is an internal error in Recovery Manager, because Recovery Manager should always issue &lt;b&gt;RECOVER DATAFILE LIST&lt;/b&gt; before &lt;b&gt;RECOVER DATAFILE START&lt;/b&gt;.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Action&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;To fix this issue, contact customer support&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: x-small;&quot;&gt;&lt;a href=&quot;http://ora-00297.ora-code.com/&quot; rel=&quot;nofollow&quot; style=&quot;color: #999999;&quot; target=&quot;_blank&quot;&gt;reference&lt;/a&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://webdesignpluscode.blogspot.com/feeds/1449376308326034268/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://webdesignpluscode.blogspot.com/2014/11/ora-00297-must-specify-recover-datafile.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4103056068311275815/posts/default/1449376308326034268'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4103056068311275815/posts/default/1449376308326034268'/><link rel='alternate' type='text/html' href='http://webdesignpluscode.blogspot.com/2014/11/ora-00297-must-specify-recover-datafile.html' title='ORA-00297 Must specify RECOVER DATAFILE LIST before RECOVER DATAFILE START'/><author><name>Waqas Ali</name><uri>http://www.blogger.com/profile/00458603368045512811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi84d3OPcVaH5dEEXYUc09MMM5UWPa5KLFkRFV-BORRBpASebtv4W8YWxVetuXKOwnYBd031-f_HaC5Zc3w-iz2AdWvuf51a0VUGHUxOx_u8xxKeglselSnBik5Sai0wPo/s220/1918953_1058549159885_1783287_n.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4103056068311275815.post-3486236851539053380</id><published>2014-11-10T00:11:00.000+05:00</published><updated>2014-11-10T00:11:26.965+05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ora-code"/><category scheme="http://www.blogger.com/atom/ns#" term="oracle"/><title type='text'>ORA-00296 Maximum number of files exceeded for RECOVER DATAFILE LIST</title><content type='html'>&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Error Code&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;ORA-00296&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Description&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;Maximum number of files (string) exceeded for RECOVER DATAFILE LIST&lt;/b&gt;.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Cause&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Possible cause of this error is, the &lt;b&gt;RECOVER DATAFILE LIST&lt;/b&gt; command specified more &lt;b&gt;datafiles&lt;/b&gt; than are allowed by the DB_FILES initialization parameter. This error occurs when doing recovery with Recovery Manager, and the instance has been started with a DB_FILES parameter specifying fewer &lt;b&gt;datafiles&lt;/b&gt; than recovery manager needs to recover to satisfy the user&#39;s RECOVER command.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Action&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;To fix this issue, re-start the instance with a higher value for DB_FILES.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: x-small;&quot;&gt;&lt;a href=&quot;http://ora-00296.ora-code.com/&quot; rel=&quot;nofollow&quot; style=&quot;color: #999999;&quot; target=&quot;_blank&quot;&gt;reference&lt;/a&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://webdesignpluscode.blogspot.com/feeds/3486236851539053380/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://webdesignpluscode.blogspot.com/2014/11/ora-00296-maximum-number-of-files.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4103056068311275815/posts/default/3486236851539053380'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4103056068311275815/posts/default/3486236851539053380'/><link rel='alternate' type='text/html' href='http://webdesignpluscode.blogspot.com/2014/11/ora-00296-maximum-number-of-files.html' title='ORA-00296 Maximum number of files exceeded for RECOVER DATAFILE LIST'/><author><name>Waqas Ali</name><uri>http://www.blogger.com/profile/00458603368045512811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi84d3OPcVaH5dEEXYUc09MMM5UWPa5KLFkRFV-BORRBpASebtv4W8YWxVetuXKOwnYBd031-f_HaC5Zc3w-iz2AdWvuf51a0VUGHUxOx_u8xxKeglselSnBik5Sai0wPo/s220/1918953_1058549159885_1783287_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4103056068311275815.post-9038221308648046746</id><published>2014-11-10T00:01:00.004+05:00</published><updated>2014-11-10T00:01:45.593+05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ora-code"/><category scheme="http://www.blogger.com/atom/ns#" term="oracle"/><title type='text'>ORA-00295 Datafile number string is invalid</title><content type='html'>&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Error Code&lt;/span&gt;&lt;br /&gt;
&lt;h2&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;ORA-00295&lt;/span&gt;&lt;/h2&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Description&lt;/span&gt;&lt;br /&gt;
&lt;h2&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Datafile/tempfile number string is invalid, must be between 1 and string.&lt;/span&gt;&lt;/h2&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Cause&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Possible cause of this error is, an &lt;b&gt;invalid file number&lt;/b&gt; was specified.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Action&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;To fix this issue, specify a valid &lt;b&gt;datafile&lt;/b&gt; or &lt;b&gt;tempfile number&lt;/b&gt; and retry the operation.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: x-small;&quot;&gt;&lt;a href=&quot;http://ora-00295.ora-code.com/&quot; rel=&quot;nofollow&quot; style=&quot;color: #999999;&quot; target=&quot;_blank&quot;&gt;reference&lt;/a&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://webdesignpluscode.blogspot.com/feeds/9038221308648046746/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://webdesignpluscode.blogspot.com/2014/11/ora-00295-datafile-number-string-is.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4103056068311275815/posts/default/9038221308648046746'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4103056068311275815/posts/default/9038221308648046746'/><link rel='alternate' type='text/html' href='http://webdesignpluscode.blogspot.com/2014/11/ora-00295-datafile-number-string-is.html' title='ORA-00295 Datafile number string is invalid'/><author><name>Waqas Ali</name><uri>http://www.blogger.com/profile/00458603368045512811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi84d3OPcVaH5dEEXYUc09MMM5UWPa5KLFkRFV-BORRBpASebtv4W8YWxVetuXKOwnYBd031-f_HaC5Zc3w-iz2AdWvuf51a0VUGHUxOx_u8xxKeglselSnBik5Sai0wPo/s220/1918953_1058549159885_1783287_n.jpg'/></author><thr:total>0</thr:total></entry></feed>