• Skip to main content
  • Skip to primary sidebar

CodeBlogMoney

Make Money using Coding and Blogging

How to start a Blog in Five Steps (2018)

June 11, 2018 by Jimmy

How to start a blog? A question, you ask Google and I am going to explain in 5 simple steps. But before we jump into the process I just wanted to inform you about the importance of the blog. To learn, share, earn, market, be famous, make an impression, get a good job. Reasons are unlimited.

No Programming skills, don’t worry. You don’t need to be a computer scientist to start a blog.  Just follow these five steps process:-

Five Simple Steps: How to Start a Blog:

  1. Decide what are you going to write about.
  2. Select Domain Name.
  3. Choose a Web Hosting for the blog.
  4. Choose a Simple theme to start with. (I can help you provide free Premium Theme).
  5. Start Writing and Publish your First Blog.

Looks Difficult? Confusing?.

I am here to help you with. I will provide help to get you started and solve your all doubts.  So,let’s get started.

Step 1: Decide what are you going to write about.

You are here because you have thought about starting a blog or someone might have told you to start your own blog because your friend has it.

  • To become a Writer – In this timeline, it’s very easy to be a writer and publish your content online. Blogging helps to create a fanbase, readers, and friends which will follow your content.
  • Market your Brand or Product –Blogs really helps to reach a community or individuals or Brand users.
  • Money, Money, and Money -Blogs a way to generate Passive income. There are many top bloggers make living out of writing blogs.
  • To Get Famous – Successful blog makes you famous and people will start following you ask for your opinions. The big brand will start asking you to promote their brand.

So, to become a successful blogger you need to have a passion for your topic, content and need to gain more and more knowledge about it.

Blogging is all about putting your thoughts and research on the topic you love and sharing that knowledge with others which help the reader to improve their lives and save their time.

Blog Costs only 5$ to 10$ a month

Step 2: Select Domain Name

Is Domain name really important? Yes, it is. It’s the first point of contact that your blog readers will have on your blog.  Your audience will make a judgment based on your domain name.

Here are some tips to select a domain name which is:

  • Easy to spell
  • Easy to remember
  • Easy to Understand (This will help readers to know what the blog is about).

If you are going to create a blog about Interview Questions. It’s better to have a domain name for CrackingInterview.com, AllInterviewQuestions.com , IWillHelpYouCrackInterview.com, BestInterviewQuestions.com.

For Domain Extension, I would prefer to go with.COM and if .COM is not available, go for .ORG or .NET. If you are creating content for the specific country, you can go for .US for the United States, .CO.UK for the United Kingdom.

Step 3: Choose a Web Hosting for the blog

If you want to play tennis, you need a tennis court, if you want to blog you need a platform to host. Hosting Provider provides Space, Domain Name, a place to host a WordPress blog.

What is WordPress?

WordPress is a blogging platform which is by far the most popular blogging platform, very easy to use.

Now you need a hosting provides which support WordPress. Are we going into details? Nope. No need to worry about it. All Hosting platform provide inbuilt WordPress supports.

Which Host should we use to Hosting your Blog?

I have been using BlueHost Hosting provider for 12 years and It’s the first choice for all famous bloggers.

Click here to go to Bluehost

In next 5 minutes, Bluehost will create your blog after following few simple steps.

  • Select a blogging plan (Go for Prime).
  • Pick a Domain name.
  • Enter account information.
  • Provide billing information
  • Skips the updates and other offers.
  • Create a password and now you have your own blog.

Congratulations!! You are a blog owner now. It’s so simple!!.

4. Choose a Simple theme to start with.

Bluehost also provide free themes options but you can skip it for now. WordPress comes with predefine simple to use themes.

As of now, it may take few hours 1 to 24 for your selected domain to get fully register. Meanwhile, you can start working on your newly created WordPress Blog.

5. Start Writing and Publish your First Blog.

This is all you have been waiting to write and publish your first blog and tell the world that I am here to make my presence.

Click on New Post and start working content. WordPress dashboard is very easy to use. I will write more about using the WordPress dashboard.

 

Next Steps:

Just keep writing good content and start publishing.

 

Filed Under: Blogging Tagged With: Blog

XML Pretty Print using Python – with Examples

May 30, 2018 by Jimmy

XML Pretty Print using Python is required frequently for testing, analyzing and debugging XML data. Python and XML both are treading in programming fields. Python generates dynamic XML string and received by the client. To save memory or bandwidth it’s better to send the minified version of XML text.

Some time for debugging purposes, we need to see beautified XML data to understand and to Debug. This article will help to pretty-print XML data.

There are two examples in the post.

  1. Pretty Print XML String
  2. Pretty Print XML File

1. XML Pretty Print using Python

Here is an example:

import xml.dom.minidom

uglyxml = '<?xml version="1.0" encoding="UTF-8" ?><employees><employee><Name>Leonardo DiCaprio</Name></employee></employees>'

xml = xml.dom.minidom.parseString(uglyxml)

xml_pretty_str = xml.toprettyxml()

print xml_pretty_str

Result :

<?xml version="1.0" ?>
<employees>
  <employee>
    <Name>Leonardo DiCaprio</Name>
  </employee>
</employees>

Here is the explanation for the code.

  1. import xml.dom.minidom

This is an XML library available in python to convert the DOM object from XML string or from the XML file.

  1. xml.dom.minidom.parseString

parseString is a method which converts XML string to objectxml.dom.minidom.Document.

  1. xml.toprettyxml

toprettyxml This method will indent the XML data and return as Pretty XML string.

2. XML Print Print from File using Python

Here is the Example:

import xml.dom.minidom

with open('xmlfile.xml') as xmldata:
    xml = xml.dom.minidom.parseString(xmldata.read())  # or xml.dom.minidom.parseString(xml_string)
    xml_pretty_str = xml.toprettyxml()

print xml_pretty_str

This program reads from file and load and create XML Document objects and print the XML data in beautiful XML String.

I have used these tools for creating this blog post.

XML Formatter

XML Viewer

Related articles:

JSON Pretty Print using Python

Filed Under: Python, XML Tagged With: pretty print, python, XML

Read JSON File using Python Code and Prompt

May 30, 2018 by Jimmy

Read JSON File using Python requires importing the JSON library of Python. Before we deep dive in code let me brief you about the JSON.

JSON (Javascript Object Notation) is easy to read, write, analyze and flexible string-based format which can be used to serialized (store) and transfer between multiple application, products and between the multiple layers (Client/Server).

I have been playing around with JSON from the last 5 years in Python, Javascript, NodeJS, and JAVA.

Program to Read JSON file using Python:

import json

with open('jsonfile.txt') as jsonfile:
    parsed = json.load(jsonfile)

print json.dumps(parsed, indent=2, sort_keys=True)

Create a jsonfile.txt using this JSON data. a parsed variable will become a dictionary object out of parsing JSON file. Please check in the image, how the parsed object looks like in debug mode. to understand more about “json.dump”, please visit JSON Pretty Print using Python.

Read JSON File using Python
JSON Object in Python IDE Debug
{
  "employees": {
    "employee": [
      {
        "id": "1",
        "firstName": "Tom",
        "lastName": "Cruise"
      },
      {
        "id": "2",
        "firstName": "Maria",
        "lastName": "Sharapova"
      },
      {
        "id": "3",
        "firstName": "James",
        "lastName": "Bond"
      }
    ]
  }
}

Read a Python File on Python Prompt.

>>> import json
>>> jsondata = json.loads(open('jsonfile.txt').read())
>>> jsondata
{u'employees': {u'employee': [{u'lastName': u'Cruise', u'id': u'1', u'firstName': u'Tom'}, {u'lastName': u'Sharapova', u'id': u'2', u'firstName': u'Maria'}, {u'lastName': u'Bon
d', u'id': u'3', u'firstName': u'James'}]}}

If you don’t have python setup and still want to open a JSON file to read. Please visit https://jsonformatter.org and click on an open file, select file from your system and it will open in JSON Editor.

I hope this article will help to read a JSON File using Python. Please share your views on this article.

Filed Under: JSON, Python Tagged With: File, json, python

Generate Random Number using Python

May 26, 2018 by Jimmy

Need some random numbers in your program? This article will help you to know different techniques to generate a random number in python. While developing small, large or enterprise applications, It requires generating random numbers. Let’s deep dive to Generate Random number using Python.

Python provides a ” random ” library to generate a random number using built un methods. Just “import random” and start generating a number which will be random.

Here is the example to generate a random integer number.

Generate Random number using Python

Using randint(a,b)

# Program to print 5 random integer numbers between 1 to 10000
import random
for x in range(5):
    print random.randint(1, 10000)

This program prints 5 random integer numbers between 1 to 10000. randint is an inbuilt function in python random library. It has two parameters.randint(a,b) It generates the random integer number N such that.a <= N <= b

Using random()

# Program to print 5 random numbers between 0.0 to 1.0
for x in range(5):
    print random.random()

This random function returns the random floating-point number in the range (0.0, 1.0).

For more information to generate random numbers, please visit the official python document for random.

https://docs.python.org/3/library/random.html

To learn more about Python, Please visit the Python category.

 

Filed Under: Python Tagged With: python, random number

JSON Pretty Print using Python- with Examples

May 25, 2018 by Jimmy

JSON Pretty Print using Python is required frequently for testing, analyzing and debugging JSON data. Python and JSON both are treading in programming fields. Python generates dynamic JSON string and received by the client. To save memory or bandwidth it’s better to send the minified version of JSON text.

Some time for debugging purpose, we need to see beautified JSON data to understand and to Debug. This article will help to pretty print JSON data.

There are two examples in the post.

  1. Pretty Print JSON String
  2. Pretty Print JSON File

1. JSON Pretty Print using Python

Here is an Example:

import json

uglyjson = '{"firstnam":"James","surname":"Bond","mobile":["007-700-007","001-007-007-0007"]}'

#json.load method converts JSON string to Python Object
parsed = json.loads(uglyjson)

print json.dumps(parsed, indent=2, sort_keys=True)

Result :

{
  "firstnam": "James", 
  "mobile": [
    "007-700-007", 
    "001-007-007-0007"
  ], 
  "surname": "Bond"
}

Here is the explanation for the code.

  1. import json

This is a JSON library available in python to convert Python object from JSON string or from JSON file.

  1. json.load

json.load is a method which converts JSON string to Python object. Here is the conversion table form JSON data type to Python data types.

JSON Python
object dict
array list
string unicode
number (int) int,long
number (real) float
true True
false False
null None
  1. json.dumps

json.dums is the opposite of json.load. It creates a JSON string from Python object. It takes parameters indent parameter which formats the JSON string.

2. JSON Print Print from File using Python

Here is the Example:

import json

with open('jsonfile.txt') as jsonfile:
    parsed = json.load(jsonfile)

print json.dumps(parsed, indent=2, sort_keys=True)

This program reads from file and load and create Python objects and dumps the JSON data in beautiful JSON String. Read JSON File using Python for more details

I have used these tools for creating this blog post.

JSON Editor

JSON Viewer

 

Filed Under: JSON, Python Tagged With: json, pretty print, python

  • « Go to Previous Page
  • Go to page 1
  • Go to page 2
  • Go to page 3
  • Go to page 4
  • Go to page 5
  • Go to page 6
  • Go to Next Page »

Primary Sidebar

Categories

  • Blogging
  • HTML
  • Java
  • JavaScript
  • jQuery
  • JSON
  • MySql
  • Performance
  • PHP
  • Problem Solving
  • Python
  • Testing
  • XML

Copyright © 2021 · Metro Pro on Genesis Framework · WordPress · Log in