Skip to main content

米斯特周

Category: Python

一个简单的flask框架博客

首先,我从bootstrap网站找了一个简单的博客模板,然后将html文件作为模板文件放入templates目录,将index.html引用的CSS,JS,IMG等静态资源放入static目录,修改index.html文件,将页面上半部分和页面下半部分分为header和footer模板,然后index,post,newpost模板引入。

*args and **kwargs in python explained

Hi there folks. I have come to see that most new python programmers have a hard time figuring out the *args and **kwargs magic variables. So what are they ? First of all let me tell you that it is not necessary to write *args or **kwargs. Only the * (aesteric) is necessary. You could have also written *var and **vars. Writing *args and **kwargs is just a convention. So now lets take a look at *args first.

Python的函数参数传递:传值?引用?

我想,这个标题或许是很多初学者的问题。尤其是像我这样的对C/C++比较熟悉,刚刚进入python殿堂的朋友们。C/C++的函数参数的传递方式根深蒂固的影响这我们的思维–引用?传值?究竟是那种呢。语言的特性决定了是使用的方法,那么,现在我们来探究一下python的函数参数传递方式。