detechn logo

惪特博客

  • 文章

    1.7W+
  • 评论

    3.8W+
  • 浏览

    926W+
  • 标签

    7.3K+
如何在function里面设置一个全局变量

如何在function里面设置一个全局变量

```python globals() # 返回包含当前作用余全局变量的字典。 global #变量 设置使用全局变量 ```

747
Python中如何动态获取和设置对象的属性?

Python中如何动态获取和设置对象的属性?

```python if hasattr(Parent, 'x'): print(getattr(Parent, 'x')) setattr(Parent, 'x',3) ...

694
PHP的header函数之设置content-type

PHP的header函数之设置content-type

```php //定义编码 header( 'Content-Type:text/html;charset=utf-8 '); //Atom header('Content-type...

769
thinkphp5模型时间戳设置

thinkphp5模型时间戳设置

> 单独在模型里面设置:(推荐) ```php protected $autoWriteTimestamp = true; // int 型 protected $autoWr...

1641