`

Python,how do you work (end)

 
阅读更多

这篇文章应该是Python的有关知识的最后一篇文章来。

 

大家看过以前的文章应该大概了解了,python的基本知识

 

这里我在补充几点

 

关于os的操作问题

 

 

import os
print os.name
print os.getcwd()
#print os.getenv()
#print os.listdir()
#os.system('cmd')
os.linesep
print os.path

 

 关于lambda形式问题

 

 

def make_repeater(n):
    return lambda s: s*n

twice = make_repeater(2)

print twice('word')
print twice(5)

 

 以上lambda的形式,其实是创建函数模板的主要方法了

 

关于exec和eval的问题

 

exec 用来执行字符串里面的python语句

 

eval很像javascript中的eval,就是执行字符串,用python的解释器来解释成最佳的答案

 

关于assert的问题

 

很简单的语句就可以达到想要的效果,一般用这个来测试python文件

 

repr的问题

 

repr获得规范字符串的表示

eval(repr(object)) = object

 

 

好了,其实也没什么了

这个是我大概2天的时间总结的笔记式的文章,我对python的了解,基本也很肤浅,主要是因为看到的程序比较少。

 

希望这几篇文章对大家python的技术有很大的提高。如果明白的话,就当复习笔记也不错哦

 

python还是很强大的。我对python很是喜欢。我下面还是会提供python的小例子,嘿嘿期待下篇哦

 

 

0
3
分享到:
评论

相关推荐

    Python: End-to-end Data Analysis.azw3电子书下载

    Finally, you will delve into advanced techniques such as performing regression, quantifying cause and effect using Bayesian methods, and discovering how to use Python's tools for supervised machine ...

    Mastering Python [2016]

    It also introduces you to functools.wraps and coroutines and how they work. Later on you will learn to use asyncio module for asynchronous clients and servers. You will also get familiar with ...

    Modern Python Standard Library Cookbook

    Build optimized applications in Python by smartly ...By the end of the book, you will have acquired the skills needed to write clean code in Python and develop applications that meet your needs.

    Automate.the.Boring.Stuff.with.Python.Practical.Programming

    In Automate the Boring Stuff with Python, you'll learn how to use Python to write programs that do in minutes what would take you hours to do by hand—no prior programming experience required....

    Programming Python 第四版 核对勘误至18年1月

    You'll also explore how Python is used in databases, networking, front-end scripting layers, text processing, and more. This book focuses on commonly used tools and libraries to give you a ...

    Programming+Python,+4th+Edition(2/2)

    You’ll also explore how Python is used in databases, networking, front-end scripting layers, text processing, and more. This book focuses on commonly used tools and libraries to give you a ...

    Spark for Python Developers 无水印pdf 0分

    Are you a Python developer inclined to work with Spark engine? If so, this book will be your companion as you create data-intensive app using Spark as a processing engine, Python visualization ...

    Hands_On_Python_for_Finance.epub

    Learn and implement quantitative finance using popular Python libraries...By the end of this book, you will be equipped with the skills you need to perform different financial analysis tasks using Python

    OpenCV 3.x with Python By Example, 2nd Edition-Packt Publishing(2018).pdf

    Computer vision is found everywhere in ... By the end of this chapter, you will be able to understand how neural networks work and how to apply them to machine learning to build advance images tools.

    Geoprocessing-with-Python.pdf

    made me realize how much I enjoyed working with Python, so naturally I had to start using GDAL with it as well. More importantly for this book, my coworker John Lowry suggested that we team- teach a ...

    Mastering Python(PACKT,2016)

    It also introduces you to functools.wraps and coroutines and how they work. Later on you will learn to use asyncio module for asynchronous clients and servers. You will also get familiar with ...

    Programming+Python,+4th+Edition(1/2)

    You’ll also explore how Python is used in databases, networking, front-end scripting layers, text processing, and more. This book focuses on commonly used tools and libraries to give you a ...

    Python安装包version 3.1.5

    especially how built-in objects like dictionaries and strings work, have changed considerably, and a lot of deprecated features have finally been removed. Build Instructions ------------------ On ...

    Packt.Hands-On.GPU.Computing.with.Python.1789341078.epub

    You will learn, by example, how to perform GPU programming with Python, and you'll look at using integrations such as PyCUDA, PyOpenCL, CuPy and Numba with Anaconda for various tasks such as machine ...

    Pro Machine Learning Algorithms Implementing Algorithms in Python epub

    You are expected to have minimal knowledge of statistics/software programming and by the end of this book you should be able to work on a machine learning project with confidence. What You Will Learn ...

Global site tag (gtag.js) - Google Analytics