What's on my mind

File Sorting in Python

I want to get sorted file array with python.

I have a array like following

  • Testing1.txt
  • Testing2.txt
  • Testing3.txt
  • Testing10.txt
  • Testing11.txt
  • Testing20.txt
  • Testing30.txt

When I use subDir = os.listdir(dirname) , it didn’t sort.

It will return like following order

  • Testing1.txt
  • Testin10.txt
  • Testin11.txt
  • Testing 2.txt
  • Testing 20.txt
  • Testing 3.txt
  • Testing 30.txt

We need to use sorted function to sort and we need to tell between Testing and .txt is a integer value.

Here is my code

[gist id=”3848050”]

Python is very faster than PHP

Today, I am reverse python code to PHP. I run php code in command line. Oh!!! python is very faster than PHP. I waited 30 seconds for convert file. When I used Python,it’s just 1 second for convert file. Same Algorithm, same idea and same file size. However, python is very faster than PHP. We shall not use PHP for search engine, crawling program and Giga bytes file converting.Imm.. I need to learn Python.

Spring Werk XSS Scanner

Today, I found XSS Scanner that written by python. It’s nice a easy to use. We need to install python and we just run in cmd like that





C:springenwerk>python –output=result.html

After that you will see result in result.html.