# Write() in python

we learnt previously in c that write() takes 3 arguments

```python
#include <unistd.h>
ssize_t write(int fd, const void *buf, size_t count);
```

* `fd` is the file descriptor of the file or socket where the data will be written.
    
* `buf` is a pointer to the buffer containing the data to be written.
    
* `count` is the number of bytes to be written from the buffer.
    

that's not the case in python  
in python write takes just two arguments and this time we don't include &lt;unistd.h&gt; we import the `os` module(operating system).

```python
import os
os.write(fd, data)
```

The `os.write()` function takes two arguments:

1. `fd` (file descriptor): It represents the file descriptor where the data will be written. In the case of standard output, it is typically represented by the value `1`.
    
2. `data` (bytes-like object): It is the data that you want to write to the file descriptor. It should be a bytes-like object, such as a byte string (`b"..."`) or a bytes object (`bytes(...)`).
    

So, you need to provide both the file descriptor and the data to be written when calling the `os.write()` function.
