Theory and Practice
About Archives Categories Tags Authors 中文 ไทย
  1. Categories
  2. Python

[Pelican] Remove Prefix in PATH_METADATA Using Named Regex Group

January 01, 2023

Remove prefix of Pelican PATH_METADATA using Python named regular expression group.

 read more »

[Pelican] Add Build Timestamp to Pelican Site Automatically

November 30, 2020

Add build timestamp to Pelican site automatically during generating the site.

 read more »

[Pelican] Create URL Based on File Path

October 17, 2018

Pelican static site generator - Create URL of page or article based on the full path relative to the content source directory.

 read more »

[Python] Set Difference of Two Arrays

March 21, 2018

Find set differecne of two arrays, i.e., the elements in one array but not in the other, in Python.

 read more »

[Python] Union of Two Arrays

March 20, 2018

Find the set of all elements (union) in two arrays in Python.

 read more »

[Python] Intersection of Two Arrays

March 17, 2018

Find common elements (matches, intersection) of two arrays in Python.

 read more »

reStructuredText “Back to Top” Link

April 02, 2017

reStructuredText - “Back to Top” Link

 read more »

Python Generate Random String From [a-z0-9]

February 12, 2017

Generate a random string from [a-z0-9] in Python

 read more »

[Pelican] Localize Theme via Jinja2 Custom Filter

January 12, 2017

Pelican static site generator - Localize theme with i18n_subsites plugin via custom Jinja2 filter. Implementation of gettext-like filter.

 read more »

[Pelican] Get Partial Pages or Articles in Theme

January 10, 2017

Pelican static site generator - Get partial pages or articles with specific metadata by Jinja2 built-in selectattr filter in theme.

 read more »

[Pelican] Get Single Page or Article by slug Metadata in Theme

January 08, 2017

Pelican static site generator - Get a single page or article by slug metadata in theme.

 read more »

[Pelican] Translate String According to Default Language in Theme

January 07, 2017

Pelican static site generator - Support multilingual in Pelican theme. Translate strings according to default language of settings in the theme. (implement macro gettext)

 read more »

Python try except Translated to Golang Synonyms

May 30, 2016

Synonyms - Python try-except translated to Go programming language.

 read more »

Pelican reStructuredText Link to Section in Another Page

April 16, 2016

Pelican static site generator - Link to section in another page via reStructuredText.

 read more »

[Python] Find Redundant Files Saved by Chrome

March 03, 2016

Find redundant files saved by Chrome browser via Python.

 read more »

[Python] Insert Line With Matched Pattern

March 01, 2016

Extract URL from reStructuredText link and insert the URL in the file as metadata via Python.

 read more »

[Python] Convert HTML Table to reStructuredText list-table

February 28, 2016

Python script to convert HTML table to reStructuredText list-table via Beautiful Soup 4.

 read more »

[Python] Online Concatenate and Compress JavaScript Files

February 26, 2016

Online concatenate and compress JavaScript files via Python script.

 read more »

[Python] Concatenate JavaScript Files

February 25, 2016

Concatenate JavaScript files via Python script.

 read more »

[Python] Beautiful Soup 4 Synonyms with JavaScript

February 24, 2016

Synonyms - Python Beautiful Soup 4 translated to JavaScript.

 read more »

Pelican Add Buddhist Calendar

February 23, 2016

Pelican static site generator - add Buddhist calendar in your theme.

 read more »

[Python] mkdir -p

February 21, 2016

mkdir -p command in Python

 read more »

Pelican Generate index.html by reStructuredText or Markdown

February 19, 2016

Pelican static site generator - Generate index.html by writing reStructuredText or Markdown.

 read more »

[Python] Export PIXNET Blog to reStructuredText Files

February 17, 2016

Python scripts to export PIXNET blog posts to files of reStructuredText format.

 read more »

[Python] Convert Footnote to reStructuredText Format

February 15, 2016

Python Regular Expression to convert footnotes in file to reStructuredText format.

 read more »

[Python] Convert PO file to JSON Format

January 26, 2016

Convert PO files to JSON format via Python. The data of JSON format can be passed to front-end by web servers to translate a text string into the user's native language. You can use the JSON data to implement gettext function in browsers.

 read more »

i18n Python Web Application by gettext and Jinja2

January 17, 2016

i18n (Internationalization) Python web applications by GNU gettext tools and Jinja2. Use PO and MO files generated by gettext in Python web application to render HTML of specific languages by Jinja2 template engine.

 read more »

[Python] Internationalization (i18n) of Python Application by GNU gettext Tools

January 14, 2016

Internationalization (i18n) of Python applications by GNU gettext tools. This post shows how to use PO and MO files in Python.

 read more »

[Python] Automatically Convert Traditional Chinese PO file to Simplified Chinese

January 08, 2016

Automatically convert Traditional Chinese (zh_TW) PO file to Simplified Chinese (zh_CN) by OpenCC and Python programming language.

 read more »

[Python] Web Scrape JavaScript Webpage by dryscrape

January 06, 2016

Web scrape JavaScript rendered webpages by dryscrape, a lightweight web scraping library for Python.

 read more »

[Python] Conversion of Traditional and Simplified Chinese

January 04, 2016

Conversion of Traditional and Simplified Chinese by OpenCC and Python programming language.

 read more »

[Python] Use Regular Expression to Find Strings Marked For Internationalization (i18n)

January 01, 2016

Use regular expression in Python to search and find strings marked for i18n (Internationalization)

 read more »

Internationalization and Localization of Google App Engine Python Webapp Using webapp2 and Jinja2

April 12, 2015

i18n and L10n of Google App Engine Python web application, with webapp2, Jinja2, Babel, and pytz.

 read more »

[web.py] Multiple Application with Same Context

March 09, 2015

Multiple web.py applications with the same context (web.ctx)

 read more »

[web.py] Web Application on Both Google App Engine and Apache

March 04, 2015 (Updated: March 05, 2015)

Web application (web.py framework) template runs on both Google App Engine Python and Apache with mod_wsgi.

 read more »

[Python] Pretty Print Variable (Dictionary, List, Object, Array)

March 09, 2013

Pretty print variable in Python

 read more »

Detect User Language (Locale) on Google App Engine Python

October 12, 2012 (Updated: February 21, 2015)

Detect user locale/language from HTTP request header on Google App Engine for Python.

 read more »

[Python] Parse Accept-Language in HTTP Request Header

October 11, 2012 (Updated: February 21, 2015)

Parse Accept-Language in HTTP Request Header in Python.

 read more »

[Python] Use XSL to Transform XML (XSLT)

September 27, 2012 (Updated: February 18, 2015)

XSLT (Extensible Stylesheet Language Transformations) in Python.

 read more »

Python Create HTML Element Dynamically on Server Side

September 26, 2012 (Updated: February 20, 2015)

Serve DOM elements to clients dynamically on Google App Engine Python

 read more »

Python Library xml.dom.minidom Howto (7)

May 27, 2012 (Updated: February 01, 2017)

Python XML/HTML manipulation primer of xml.dom.minidom

 read more »

Special Format Conversion in Python

May 27, 2012

%2c%e3%80%90%e5%bd%a2%e3%80%91%e6%97%a0%e7%a2%8d%e7%9a%84%e3%80%82 <=> ,【形】无碍的。

 read more »

Python Library xml.dom.minidom Howto (1)

May 24, 2012 (Updated: February 01, 2017)

Python XML/HTML manipulation primer of xml.dom.minidom

 read more »

Python Library xml.dom.minidom Howto (2)

May 24, 2012 (Updated: February 01, 2017)

Python XML/HTML manipulation primer of xml.dom.minidom

 read more »

Python Library xml.dom.minidom Howto (3)

May 24, 2012 (Updated: February 01, 2017)

Python XML/HTML manipulation primer of xml.dom.minidom

 read more »

Python Library xml.dom.minidom Howto (4)

May 24, 2012 (Updated: February 01, 2017)

Python XML/HTML manipulation primer of xml.dom.minidom

 read more »

Python Library xml.dom.minidom Howto (5)

May 24, 2012 (Updated: February 01, 2017)

Python XML/HTML manipulation primer of xml.dom.minidom

 read more »

Python Library xml.dom.minidom Howto (6)

May 24, 2012 (Updated: February 01, 2017)

Python XML/HTML manipulation primer of xml.dom.minidom

 read more »
Powered by Github Pages, Pelican, pyScss.