<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>python Archives - Codeplaners</title>
	<atom:link href="https://codeplaners.com/tag/python/feed/" rel="self" type="application/rss+xml" />
	<link>https://codeplaners.com/tag/python/</link>
	<description>Code Solution</description>
	<lastBuildDate>Tue, 05 Oct 2021 00:58:06 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.1.7</generator>

<image>
	<url>https://codeplaners.com/wp-content/uploads/2020/09/cropped-favicon-social-32x32.png</url>
	<title>python Archives - Codeplaners</title>
	<link>https://codeplaners.com/tag/python/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Get Current Time In Hours Minutes Seconds In Python</title>
		<link>https://codeplaners.com/get-current-time-in-hours-minutes-seconds-in-python/</link>
					<comments>https://codeplaners.com/get-current-time-in-hours-minutes-seconds-in-python/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Tue, 05 Oct 2021 00:58:06 +0000</pubDate>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[get current time]]></category>
		<category><![CDATA[python]]></category>
		<guid isPermaLink="false">https://codeplaners.com/?p=1319</guid>

					<description><![CDATA[<p>Hi Dev, Today, i we will show you get current time in hours minutes seconds in python. This article will give you simple example of get current time in hours minutes seconds in python. you will get current time in hours minutes seconds in python. So let’s follow few step to create example of get &#8230; <a href="https://codeplaners.com/get-current-time-in-hours-minutes-seconds-in-python/" class="more-link">Continue reading<span class="screen-reader-text"> "Get Current Time In Hours Minutes Seconds In Python"</span></a></p>
<p>The post <a rel="nofollow" href="https://codeplaners.com/get-current-time-in-hours-minutes-seconds-in-python/">Get Current Time In Hours Minutes Seconds In Python</a> appeared first on <a rel="nofollow" href="https://codeplaners.com">Codeplaners</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Hi Dev,</p>
<p>Today, i we will show you get current time in hours minutes seconds in python. This article will give you simple example of get current time in hours minutes seconds in python. you will get current time in hours minutes seconds in python. So let’s follow few step to create example of get current time in hours minutes seconds in python.</p>
<h3 class="step_code">Example 1</h3>
<pre class="brush: python; title: ; notranslate">
import time

// get current time in hour, minute, seconds
currentTime = time.strftime(&quot;%H:%M:%S&quot;)
print(currentTime)
</pre>
<p><strong>Output:</strong></p>
<pre class="brush: python; title: ; notranslate">
16:06:41
</pre>
<h3 class="step_code">Example 2</h3>
<pre class="brush: python; title: ; notranslate">
# from datetime import datetime

// get current date and time
currentTimeDate = datetime.now()

// get only time
currentTime = currentTimeDate.strftime('%H:%M:%S')
print(currentTime)
</pre>
<p><strong>Output:</strong></p>
<pre class="brush: python; title: ; notranslate">
16:06:41
</pre>
<p>I hope it will assist you…</p>
<p>The post <a rel="nofollow" href="https://codeplaners.com/get-current-time-in-hours-minutes-seconds-in-python/">Get Current Time In Hours Minutes Seconds In Python</a> appeared first on <a rel="nofollow" href="https://codeplaners.com">Codeplaners</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://codeplaners.com/get-current-time-in-hours-minutes-seconds-in-python/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Python Split String Method Example</title>
		<link>https://codeplaners.com/python-split-string-method-example/</link>
					<comments>https://codeplaners.com/python-split-string-method-example/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Wed, 01 Sep 2021 22:32:16 +0000</pubDate>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[split()]]></category>
		<guid isPermaLink="false">https://codeplaners.com/?p=1295</guid>

					<description><![CDATA[<p>Hi Dev, Today, i we will show you python split() string method example. This article will give you simple example of python split() string method example. you will split string character in python. syntax : str.split(separator, maxsplit) Parameters : separator : This is a delimiter. The string splits at this specified separator. If is not &#8230; <a href="https://codeplaners.com/python-split-string-method-example/" class="more-link">Continue reading<span class="screen-reader-text"> "Python Split String Method Example"</span></a></p>
<p>The post <a rel="nofollow" href="https://codeplaners.com/python-split-string-method-example/">Python Split String Method Example</a> appeared first on <a rel="nofollow" href="https://codeplaners.com">Codeplaners</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Hi Dev,</p>
<p>Today, i we will show you python split() string method example. This article will give you simple example of python split() string method example. you will split string character in python.</p>
<p>syntax : str.split(separator, maxsplit)</p>
<p>Parameters :<br />
separator : This is a delimiter. The string splits at this specified separator. If is not provided then any white space is a separator.</p>
<p>maxsplit : It is a number, which tells us to split the string into maximum of provided number of times. If it is not provided then the default is -1 that means there is no limit.</p>
<p>Returns : Returns a list of strings after breaking the given string by the specified separator.</p>
<p>So let’s follow few step to create example of python split() string method example.</p>
<h3 class="step_code">Example 1:</h3>
<pre class="brush: python; title: ; notranslate">
text = 'a b c'

# Splits at space
print(text.split())

word = 'd, e, f'

# Splits at ','
print(word.split(','))
</pre>
<p><strong>Output:</strong></p>
<pre class="brush: python; title: ; notranslate">
&#x5B;'a', 'b', 'c']

&#x5B;'d', 'e', 'f']
</pre>
<h3 class="step_code">Example 2:</h3>
<pre class="brush: python; title: ; notranslate">
word = 'This, is, python, example'

# maxsplit: 0
print(word.split(', ', 0))
  
# maxsplit: 4
print(word.split(', ', 4))
  
# maxsplit: 1
print(word.split(', ', 2))
</pre>
<p><strong>Output:</strong></p>
<pre class="brush: python; title: ; notranslate">
&#x5B;'This, is, python, example']

&#x5B;'This', 'is', 'python', 'example']

&#x5B;'This', 'is', 'python, example']
</pre>
<p>I hope it will assist you…</p>
<p>The post <a rel="nofollow" href="https://codeplaners.com/python-split-string-method-example/">Python Split String Method Example</a> appeared first on <a rel="nofollow" href="https://codeplaners.com">Codeplaners</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://codeplaners.com/python-split-string-method-example/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Python Change Date Format Example</title>
		<link>https://codeplaners.com/python-change-date-format-example/</link>
					<comments>https://codeplaners.com/python-change-date-format-example/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Thu, 29 Jul 2021 23:45:58 +0000</pubDate>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[Source Code]]></category>
		<guid isPermaLink="false">https://codeplaners.com/?p=1126</guid>

					<description><![CDATA[<p>This post was last updated on July 31st, 2021 at 04:23 amHi Dev, Today, i we will show you python change date format example. This article will give you simple example of python change date format example. you will learn python change date format example. So let’s follow few step to create example of python &#8230; <a href="https://codeplaners.com/python-change-date-format-example/" class="more-link">Continue reading<span class="screen-reader-text"> "Python Change Date Format Example"</span></a></p>
<p>The post <a rel="nofollow" href="https://codeplaners.com/python-change-date-format-example/">Python Change Date Format Example</a> appeared first on <a rel="nofollow" href="https://codeplaners.com">Codeplaners</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p class="last-modified">This post was last updated on July 31st, 2021 at 04:23 am</p><p>Hi Dev,</p>
<p>Today, i we will show you python change date format example. This article will give you simple example of python change date format example. you will learn python change date format example. So let’s follow few step to create example of python change date format example.</p>
<h3>Example 1</h3>
<pre class="brush: python; title: ; notranslate">
import datetime

def try_parsing_date(text):
    for fmt in ('%H:%M %p','%d-%b-%y','%y-%m-%d','%Y-%m-%d','%d-%m-%y %H:%M:%S','%d-%m-%Y %H:%M:%S','%d/%m/%y','%d/%m/%Y','%y/%m/%d %H:%M:%S','%Y/%m/%d %H:%M:%S','%H:%M:%S %p','%H:%M:%S %p','%d/%m/%Y %H:%M %p','%d/%m/%Y %H:%M %p','%y-%m-%d %H:%M:%S','%Y-%m-%d %H:%M:%S'):
        try:
            return datetime.datetime.strptime(text, fmt)
        except ValueError:
            pass
    raise ValueError(text+' no valid date format found')

myDate = '2021-07-02 11:12:13'
myDate = try_parsing_date(myDate)
myDate = myDate.strftime('%Y-%m-%d')
print(myDate)
</pre>
<h3>Output:</h3>
<pre class="brush: python; title: ; notranslate">
02-07-2021
</pre>
<h3>Example 2</h3>
<pre class="brush: python; title: ; notranslate">
import datetime

def try_parsing_date(text):
    for fmt in ('%H:%M %p','%d-%b-%y','%y-%m-%d','%Y-%m-%d','%d-%m-%y %H:%M:%S','%d-%m-%Y %H:%M:%S','%d/%m/%y','%d/%m/%Y','%y/%m/%d %H:%M:%S','%Y/%m/%d %H:%M:%S','%H:%M:%S %p','%H:%M:%S %p','%d/%m/%Y %H:%M %p','%d/%m/%Y %H:%M %p','%y-%m-%d %H:%M:%S','%Y-%m-%d %H:%M:%S'):
        try:
            return datetime.datetime.strptime(text, fmt)
        except ValueError:
            pass
    raise ValueError(text+' no valid date format found')

myDate = '2021-07-02 11:12:13'
myDate = try_parsing_date(myDate)
myDate = myDate.strftime('%H:%M:%S')
print(myDate)
</pre>
<h3>Output:</h3>
<pre class="brush: python; title: ; notranslate">
11:12:13
</pre>
<h3>Example 3</h3>
<pre class="brush: python; title: ; notranslate">
import datetime

def try_parsing_date(text):
    for fmt in ('%H:%M %p','%d-%b-%y','%Y-%m-%d','%d-%m-%y %H:%M:%S','%d-%m-%Y %H:%M:%S','%d/%m/%y','%d/%m/%Y','%y/%m/%d %H:%M:%S','%Y/%m/%d %H:%M:%S','%H:%M:%S %p','%H:%M:%S %p','%d/%m/%Y %H:%M %p','%d/%m/%Y %H:%M %p','%Y-%m-%d %H:%M:%S'):
        try:
            return datetime.datetime.strptime(text, fmt)
        except ValueError:
            pass
    raise ValueError(text+' no valid date format found')

myDate = '2021-07-02 11:12:13'
myDate = try_parsing_date(myDate)
myDate = myDate.strftime('%d %b %y')
print(myDate)
</pre>
<h3>Output:</h3>
<pre class="brush: python; title: ; notranslate">
02 Jul 21
</pre>
<h3>Example 4</h3>
<pre class="brush: python; title: ; notranslate">
import datetime

def try_parsing_date(text):
    for fmt in ('%H:%M %p','%d-%b-%y','%Y-%m-%d','%d-%m-%y %H:%M:%S','%d-%m-%Y %H:%M:%S','%d/%m/%y','%d/%m/%Y','%y/%m/%d %H:%M:%S','%Y/%m/%d %H:%M:%S','%H:%M:%S %p','%H:%M:%S %p','%d/%m/%Y %H:%M %p','%d/%m/%Y %H:%M %p','%Y-%m-%d %H:%M:%S'):
        try:
            return datetime.datetime.strptime(text, fmt)
        except ValueError:
            pass
    raise ValueError(text+' no valid date format found')

myDate = '2021-07-02 11:12:13'
myDate = try_parsing_date(myDate)
myDate = myDate.strftime('%d %B %Y')
print(myDate)
</pre>
<h3>Output:</h3>
<pre class="brush: python; title: ; notranslate">
02 July 2021
</pre>
<h3>Example 5</h3>
<pre class="brush: python; title: ; notranslate">
import datetime

def try_parsing_date(text):
    for fmt in ('%H:%M %p','%d-%b-%y','%y-%m-%d','%Y-%m-%d','%d-%m-%y %H:%M:%S','%d-%m-%Y %H:%M:%S','%d/%m/%y','%d/%m/%Y','%y/%m/%d %H:%M:%S','%Y/%m/%d %H:%M:%S','%H:%M:%S %p','%H:%M:%S %p','%d/%m/%Y %H:%M %p','%d/%m/%Y %H:%M %p','%y-%m-%d %H:%M:%S','%Y-%m-%d %H:%M:%S'):
        try:
            return datetime.datetime.strptime(text, fmt)
        except ValueError:
            pass
    raise ValueError(text+' no valid date format found')

myDate = '2021-07-02 11:12:13'
myDate = try_parsing_date(myDate)
myDate = myDate.strftime('%H:%M:%S %p')
print(myDate)
</pre>
<h3>Output:</h3>
<pre class="brush: python; title: ; notranslate">
11:12:13 AM
</pre>
<p>The post <a rel="nofollow" href="https://codeplaners.com/python-change-date-format-example/">Python Change Date Format Example</a> appeared first on <a rel="nofollow" href="https://codeplaners.com">Codeplaners</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://codeplaners.com/python-change-date-format-example/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to Install Django on Windows</title>
		<link>https://codeplaners.com/how-to-install-django-on-windows/</link>
					<comments>https://codeplaners.com/how-to-install-django-on-windows/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Sun, 23 May 2021 05:27:45 +0000</pubDate>
				<category><![CDATA[Django]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[install django]]></category>
		<category><![CDATA[python]]></category>
		<guid isPermaLink="false">https://codeplaners.com/?p=822</guid>

					<description><![CDATA[<p>Hi Dev, Today, i we will show you how to install django on windows. This article will give you simple example of how to install django on windows. you will learn how to install django on windows. Django is one of the most popular web frameworks in Python. It is secure. It is free and &#8230; <a href="https://codeplaners.com/how-to-install-django-on-windows/" class="more-link">Continue reading<span class="screen-reader-text"> "How to Install Django on Windows"</span></a></p>
<p>The post <a rel="nofollow" href="https://codeplaners.com/how-to-install-django-on-windows/">How to Install Django on Windows</a> appeared first on <a rel="nofollow" href="https://codeplaners.com">Codeplaners</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Hi Dev,</p>
<p>Today, i we will show you how to install django on windows. This article will give you simple example of how to install django on windows. you will learn how to install django on windows. </p>
<p>Django is one of the most popular web frameworks in Python. It is secure. It is free and open-source.</p>
<p>So let&#8217;s follow few step to create example of how to install Django on Windows.</p>
<p><img decoding="async" style="border: 3px solid #ff5722;" src="https://codeplaners.com/wp-content/uploads/2021/05/djangoview.png" alt="How to Install Django" ></p>
<h3>Step 1:- Install Python</h3>
<p>Before installing Django, install Python. You can check out this guide I written, <a href="https://codeplaners.com/how-to-install-python-on-windows/" target="_blank" style="color:red;" rel="noopener noreferrer">how to install python on windows</a></p>
<h3>Step 2:- Open Command Prompt</h3>
<p>Windows logo key and R(Win+R) and type cmd and then click ok.</p>
<p><img decoding="async" style="border: 3px solid #ff5722;" src="https://codeplaners.com/wp-content/uploads/2021/05/cmd.png" alt="How to Install Django" ></p>
<h3>Step 3:- Check Python Installation</h3>
<pre class="brush: python; title: ; notranslate">
python --version
</pre>
<pre class="brush: python; title: ; notranslate">
C:\Users\dell&gt;python --version
Python 3.9.5
</pre>
<h3>Step 4:- Create Project Directory</h3>
<p>let’s create a project directory. We will name it <strong>django_project</strong> since this article is just a example. If you want to give some other name, then you can give </p>
<p>create the directory:-</p>
<pre class="brush: python; title: ; notranslate">
mkdir django_project
</pre>
<pre class="brush: python; title: ; notranslate">
cd django_project
</pre>
<h3>Step 5:- Create Virtual Environment</h3>
<p>You can learn more about virtualenv <a href="https://realpython.com/python-virtual-environments-a-primer/" target="_blank" style="color:red;" rel="noopener noreferrer">here.</a></p>
<p>create virtual environment, type <strong>python -m venv venv</strong> type and wait</p>
<pre class="brush: python; title: ; notranslate">
python -m venv venv
</pre>
<h3>Step 6:- Activate Virtual EnvironmentPermalink</h3>
<p>Run the following command</p>
<pre class="brush: python; title: ; notranslate">
venv\Scripts\activate
</pre>
<p>virtualenv is activated, you will see (venv) at the beginning of the prompt.</p>
<pre class="brush: python; title: ; notranslate">
(venv) PS C:\Users\Stanley\django_project&gt;
</pre>
<h3>Step 7:- Install Django</h3>
<p>run the following command to start the installation</p>
<pre class="brush: python; title: ; notranslate">
pip install django
</pre>
<h3>Step 8:- Start a New Project</h3>
<p>django-admin startproject to create our Django project structure called “testsite”.</p>
<p>Run the following command:</p>
<pre class="brush: python; title: ; notranslate">
django-admin startproject testsite
</pre>
<pre class="brush: python; title: ; notranslate">
cd testsite
</pre>
<h3>Step 9:- Run the Server</h3>
<p>run the development server using the <strong>manage.py runserver</strong>.</p>
<pre class="brush: python; title: ; notranslate">
python manage.py runserver
</pre>
<pre class="brush: python; title: ; notranslate">
http://127.0.0.1:8000/
</pre>
<p><img decoding="async" style="border: 3px solid #ff5722;" src="https://codeplaners.com/wp-content/uploads/2021/05/djangoview.png" alt="How to Install Django" ></p>
<p>The post <a rel="nofollow" href="https://codeplaners.com/how-to-install-django-on-windows/">How to Install Django on Windows</a> appeared first on <a rel="nofollow" href="https://codeplaners.com">Codeplaners</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://codeplaners.com/how-to-install-django-on-windows/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
