Tornado 6.5 DocumentationlinksCHAPTER TWO HELLO, WORLD Here is a simple “Hello, world” example web app for Tornado: import asyncio import tornado class MainHandler(tornado.web.RequestHandler): def get(self): self.write("Hello await or yield keywords. Examples Here is a sample synchronous function: from tornado.httpclient import HTTPClient def synchronous_fetch(url): http_client = HTTPClient() response = http_client.fetch(url) here is the same function rewritten asynchronously as a native coroutine: from tornado.httpclient import AsyncHTTPClient async def asynchronous_fetch(url): http_client = AsyncHTTPClient() response = await0 码力 | 272 页 | 1.12 MB | 3 月前3
Tornado 6.5 Documentationwiki/Links] Hello, world Here is a simple “Hello, world” example web app for Tornado: import asyncio import tornado class MainHandler(tornado.web.RequestHandler): def get(self): self await or yield keywords. Examples Here is a sample synchronous function: from tornado.httpclient import HTTPClient def synchronous_fetch(url): http_client = HTTPClient() response = http_client here is the same function rewritten asynchronously as a native coroutine: from tornado.httpclient import AsyncHTTPClient async def asynchronous_fetch(url): http_client = AsyncHTTPClient() response0 码力 | 437 页 | 405.14 KB | 3 月前3
julia 1.13.0 DEVstruct redefinitions . . . . . . . . . . . . . . . . . . . . . . . . 547 42.4 World age and using/import . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 548 42.5 World age capture . . . . 113 julia> module Bar x = 1 foo() = x end; and not a x in the scope where foo is used: julia> import .Bar julia> x = -1; julia> Bar.foo() 1 Thus lexical scope means that what a variable in a particular global scope. Modules can introduce variables of other modules into their scope through the using or import statements or through qualified access using the dot-notation, i.e. each module is a so-called namespace0 码力 | 2058 页 | 7.45 MB | 3 月前3
Julia 1.12.0 RC1struct redefinitions . . . . . . . . . . . . . . . . . . . . . . . . 548 42.4 World age and using/import . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 549 42.5 World age capture . . . . 113 julia> module Bar x = 1 foo() = x end; and not a x in the scope where foo is used: julia> import .Bar julia> x = -1; julia> Bar.foo() 1 Thus lexical scope means that what a variable in a particular global scope. Modules can introduce variables of other modules into their scope through the using or import statements or through qualified access using the dot-notation, i.e. each module is a so-called namespace0 码力 | 2057 页 | 7.44 MB | 3 月前3
Julia 1.12.0 Beta4struct redefinitions . . . . . . . . . . . . . . . . . . . . . . . . 547 42.4 World age and using/import . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 548 42.5 World age capture . . . . 113 julia> module Bar x = 1 foo() = x end; and not a x in the scope where foo is used: julia> import .Bar julia> x = -1; julia> Bar.foo() 1 Thus lexical scope means that what a variable in a particular global scope. Modules can introduce variables of other modules into their scope through the using or import statements or through qualified access using the dot-notation, i.e. each module is a so-called namespace0 码力 | 2057 页 | 7.44 MB | 3 月前3
Julia 1.12.0 Beta3struct redefinitions . . . . . . . . . . . . . . . . . . . . . . . . 547 42.4 World age and using/import . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 548 42.5 World age capture . . . . 113 julia> module Bar x = 1 foo() = x end; and not a x in the scope where foo is used: julia> import .Bar julia> x = -1; julia> Bar.foo() 1 Thus lexical scope means that what a variable in a particular global scope. Modules can introduce variables of other modules into their scope through the using or import statements or through qualified access using the dot-notation, i.e. each module is a so-called namespace0 码力 | 2057 页 | 7.44 MB | 3 月前3
julia 1.10.10end; 105CHAPTER 10. SCOPE OF VARIABLES 106 and not a x in the scope where foo is used: julia> import .Bar julia> x = -1; julia> Bar.foo() 1 Thus lexical scope means that what a variable in a particular global scope. Modules can introduce variables of other modules into their scope through the using or import statements or through qualified access using the dot-notation, i.e. each module is a so-called namespace function in the same module. If you want to add methods to a function in another module, you have to import it or use the name qualified with module names. See the section on namespace management. 12.1 Defining0 码力 | 1692 页 | 6.34 MB | 3 月前3
Julia 1.10.9end; 105CHAPTER 10. SCOPE OF VARIABLES 106 and not a x in the scope where foo is used: julia> import .Bar julia> x = -1; julia> Bar.foo() 1 Thus lexical scope means that what a variable in a particular global scope. Modules can introduce variables of other modules into their scope through the using or import statements or through qualified access using the dot-notation, i.e. each module is a so-called namespace function in the same module. If you want to add methods to a function in another module, you have to import it or use the name qualified with module names. See the section on namespace management. 12.1 Defining0 码力 | 1692 页 | 6.34 MB | 3 月前3
Julia 1.11.4end; 111CHAPTER 11. SCOPE OF VARIABLES 112 and not a x in the scope where foo is used: julia> import .Bar julia> x = -1; julia> Bar.foo() 1 Thus lexical scope means that what a variable in a particular global scope. Modules can introduce variables of other modules into their scope through the using or import statements or through qualified access using the dot-notation, i.e. each module is a so-called namespace function in the same module. If you want to add methods to a function in another module, you have to import it or use the name qualified with module names. See the section on namespace management. 13.1 Defining0 码力 | 2007 页 | 6.73 MB | 3 月前3
Julia 1.11.5 Documentationend; 111CHAPTER 11. SCOPE OF VARIABLES 112 and not a x in the scope where foo is used: julia> import .Bar julia> x = -1; julia> Bar.foo() 1 Thus lexical scope means that what a variable in a particular global scope. Modules can introduce variables of other modules into their scope through the using or import statements or through qualified access using the dot-notation, i.e. each module is a so-called namespace function in the same module. If you want to add methods to a function in another module, you have to import it or use the name qualified with module names. See the section on namespace management. 13.1 Defining0 码力 | 2007 页 | 6.73 MB | 3 月前3
共 15 条
- 1
- 2













