Cerca

Heus ací els resultats de la cerca.

1.4 Talking to JSON in Python
23 Resultats, Darrera modificació:
The trap is here: <code python> import json class Who: def __init__(self, name, age): ... ting: <code ; output> TypeError: Object of type 'Class' is not JSON serializable </code> Yes, that's t... but we expect more. <code python> import json class Who: def __init__(self, name, age): ... w.__dict__ else: raise TypeError(w.__class__.__name__ + ' is not JSON serializable') some
1.2 How to use sockets in Python
9 Resultats, Darrera modificació:
er of our courses. The socket module provides a class named ''socket'' (what a coincidence!) which enc... t the first step is to **create an object of the class** - this is how we carry out the creation: <code... eive; the root document is specified as a single slash (i.e., /); the line must also include the HTTP p... **. We don't need anything more. This is why the last line of our code look as follows: ''print(repr(a
1.1 Python Professional Course Series: RESTful APIs
4 Resultats, Darrera modificació:
ld be used for. We think that your knowledge of classes and objects can be very helpful here. We want ... show you very soon. Let's now take a look at the last part of the acronym. === Transfer **T** stands ... rkeley Software Distribution, the name of a Unix-class operating system, where the sockets were deploye... dopted by POSIX (a standard of contemporary Unix-class operating systems) as **POSIX sockets**. We can
2.1 Python Professional Course Series: Lab & Assessment
4 Resultats, Darrera modificació:
e conversation with the user and: - defines a class named **Vehicle**, whose objects can carry the vehicle data shown above (the structure of the class should be deducted from the above dialog — call ... "reverse engineering" if you want) - defines a class able to encode the Vehicle object into an equivalent JSON string; - defines a class able to decode the JSON string into the newly cr
1.3 JSON – our new friend
1 Resultats, Darrera modificació:
the string – you have to use our old friend backslash (\) followed by a quote instead. Nothing exciti
1.5 What is XML and why do we prefer to use JSON?
1 Resultats, Darrera modificació:
e’re being honest – JSON is more convenient and – last but most important – most currently implemented
1.6 Making life easier with the requests module
1 Resultats, Darrera modificació:
: 'bytes', 'Cache-Control': 'public, max-age=0', 'Last-Modified': 'Thu, 02 May 2019 12:38:41 GMT', 'ETa
1.7 Four magic letters: CRUD
1 Resultats, Darrera modificació:
r's status code – it's ''201'' ("created"). The last remaining letter is U, so now we'll update one o