Cerca

Heus ací els resultats de la cerca.

4.2 Serialization of Python objects using the pickle module
36 Resultats, Darrera modificació:
ay to persist outcomes is to generate a flat text file and to write your outcomes. It’s a very simple th... e into a stream of bytes to store the object in a file or database, or to transmit it via a network. Thi... u run the code presented in the right pane, a new file should be created. Remember to run the code local... 100, 1000]] with open('multidata.pckl', 'wb') as file_out: pickle.dump(a_dict, file_out) pickle
3.1 Advanced techniques of creating and serving exceptions
9 Resultats, Darrera modificació:
re you get data from an external source (console, file, etc.) you should not trust the data types, so it... e imported; * path – represents the path to any file which triggered the exception, respectively. Coul... de ; output> Traceback (most recent call last): File "exceptions#030.py", line 6, in <module> prin... n occurred: Traceback (most recent call last): File "exceptions#030.py", line 8, in <module> prin
4.3 Making Python objects persistent using the shelve module
6 Resultats, Darrera modificació:
de by the order of all the elements placed into a file or database, or sent via a network. There is ano... rings. Therefore, you can open your shelved data file and access your pickled objects via the keys the ... priate module and create an object representing a file-based database: <code python> import shelve my_sh... shelve.close() </code> Now let's open the shelve file to demonstrate direct access to the elements (con
2.6 Abstract classes
3 Resultats, Darrera modificació:
player application, intended to support multiple file formats. Some of the formats are known now, but s... l just have to deliver a class supporting the new file format, fulfilling the contract imposed by the ab... le containing the ABC class instead of your local file. This could cause some confusion – why does such
2.1 Python core syntax
1 Resultats, Darrera modificació:
ode ; output>Traceback (most recent call last): File "core#010.py", line 11, in print(p1 + p2) Ty
2.2 Inheritance and polymorphism — Inheritance as a pillar of OOP
1 Resultats, Darrera modificació:
ode ; output>Traceback (most recent call last): File "diamond.py", line 13, in class D(A, C): Typ
2.3 Extended function argument syntax
1 Resultats, Darrera modificació:
python> def print(self, *args, sep=' ', end='\n', file=None): </code> == Extended function argument s