# Sharing

Publishing is about sharing, so let's have a look at how to publish something other than by printing.

```python
import os
import datetime
import pyblish.api

class CollectUserDir(pyblish.api.ContextPlugin):
  order = 0

  def process(self, context):
    context.data["userDir"] = os.path.expanduser("~")

class WriteTime(pyblish.api.ContextPlugin):
  order = 1

  def process(self, context):
    user_dir = context.data["userDir"]
    destination_path = os.path.join(user_dir, "time.txt")

    print("Writing time to %s" % destination_path)
    with open(destination_path, "w") as f:
      f.write("The time is %s" % datetime.datetime.today().ctime())

pyblish.api.register_plugin(CollectUserDir)
pyblish.api.register_plugin(WriteTime)

import pyblish.util
pyblish.util.publish()
# Writing time to C:\Users\marcus\Documents\time.txt
```

And here's what `time.txt` looks like.

```bash
The time is Thu Jan 21 16:34:58 2016
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://learn.pyblish.com/09-sharing.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
