• 数组 Array处理(用于打印或其它处理):

foreach ($array as $key => $value)
{
if ($value == $match)
{
$count++;
}
}

  • 字串截取(截出delimeter之后的字串)

$arr = explode('delimeter', $initialString);
$important = $arr[1];

$important = explode("delimeter",$initialString)[1];

 

  • 字串截取(截出dd/和/之间的字串)
  • 可多次截取 

$re = "~(?<=dd/).*?(?=/)~";
$str = "aa/bb/cc/dd/55/44/dd/66/";

preg_match_all($re, $str, $matches);
print_r($matches[0]);

 

 

---觉得文章有用!马上分享此链接给你的朋友---

---关注我们---

- 关注我们的微信公众号: swedenpyq
- 扫描二维码,关注“瑞典朋友圈”.

swedenpyq

- 加我们的Facebook为好友:“Pyq Sweden”.
- 加入我们的Facebook小组:“瑞典朋友圈”.
- 关注我们的Facebook主页https://www.facebook.com/pyqsweden

---如果您有进一步的问题或建议?---

- 请在文章下面的“我有话说”留言
- “点评瑞典朋友圈”
- 给我们发电子邮件:该Email地址已收到反垃圾邮件插件保护。要显示它您需要在浏览器中启用JavaScript。

如何为Emacs安装Jedi Python 自动补行包

(Jedi的主要功能:Auto-completion and popup help)

1. install virtualenv package

sudo pip install virtualenv

2. set Emacs inititing configuration as following

touch ~/.emacs.d/init.el

past in file following lines:

(require 'package) ;; You might already have this line
(add-to-list 'package-archives
'("melpa" . "https://melpa.org/packages/" ))
(when (< emacs-major-version 24)
;; For important compatibility libraries like cl-lib
(add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/" )))
(package-initialize) ;; You might already have this line

(add-hook 'python-mode-hook 'jedi:setup)
(setq jedi:complete-on-dot t) ; optiona

3. start Emacs, and install the Jide

M-x package-install RET jedi RET

or

M-x list-packages

Then select and install

jedi-core
jedi-direx

4. Finally, install Python-EPC server in Emacs 

M-x jedi:install-server  

 


如何在Python解释器里激活自动补行功能

1. Put following lines into file ~/.pythonrc

import rlcompleter, readline
readline.parse_and_bind('tab:complete')

2. append following line into ~/.bashrc

export PYTHONSTARTUP="${HOME}/.pythonrc"

3. run following command

source ~/.bashrc

4. enter python interpreter

5. test

type

import io

type

io.

then type twich TAB key, you now can see the methods in IO module

 

SVG动画效果图 | 软件开发

 

阅读后续更多文章,请点击此处,注册“瑞典朋友圈” http://www.pyq.se

详细阅读:点击链接。

 

如果您有进一步的问题或建议,请在下面留言或发电子邮件(该Email地址已收到反垃圾邮件插件保护。要显示它您需要在浏览器中启用JavaScript。)给我们。
欢迎关注我们的微信公众号: swedenpyq

You can fetch one branch from all remotes like this:

git fetch --all

 

 

 

阅读后续更多文章,请点击此处,注册“瑞典朋友圈” http://www.pyq.se

 

如果您有进一步的问题或建议,请在下面留言或发电子邮件(该Email地址已收到反垃圾邮件插件保护。要显示它您需要在浏览器中启用JavaScript。)给我们。
欢迎关注我们的微信公众号: swedenpyq

注册用户拥有更多权限,包括查看更多信息,在七嘴八舌论坛发帖。如用户愿意丰富其他版块,注册并激活账号24小时后即获得发布信息的权利。(注册完,别忘了查你的电子邮箱,激活账号后,再尝试登录。)