Skip to content

Commit

Permalink
Move output comments to new line
Browse files Browse the repository at this point in the history
(cherry picked from commit 3f32d105cb35c05f362dfc1869df0a824bae54c0)
  • Loading branch information
LilSpazJoekp committed Feb 25, 2021
1 parent 07b8111 commit f92f86b
Showing 1 changed file with 24 additions and 13 deletions.
37 changes: 24 additions & 13 deletions docs/getting_started/quick_start.rst
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ Just like that, you now have a read-only :class:`.Reddit` instance.

.. code-block:: python
print(reddit.read_only) # Output: True
print(reddit.read_only)
# Output: True
With a read-only instance, you can do something like obtaining 10 "hot"
submissions from ``r/learnpython``:
Expand Down Expand Up @@ -144,7 +145,8 @@ like the following:
username="my username",
password="my password")
print(reddit.read_only) # Output: False
print(reddit.read_only)
# Output: False
Now you can do whatever your Reddit account is authorized to do. And you can
switch back to read-only mode whenever you want:
Expand All @@ -169,9 +171,12 @@ calling ``subreddit`` on your :class:`.Reddit` instance. For example:
# assume you have a Reddit instance bound to variable `reddit`
subreddit = await reddit.subreddit("redditdev", fetch=True)
print(subreddit.display_name) # Output: redditdev
print(subreddit.title) # Output: reddit Development
print(subreddit.description) # Output: A subreddit for discussion of ...
print(subreddit.display_name)
# Output: redditdev
print(subreddit.title)
# Output: reddit development
print(subreddit.description)
# Output: a subreddit for discussion of ...
Obtain :class:`.Submission` Instances from a :class:`.Subreddit`
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand All @@ -197,11 +202,14 @@ submissions based on the ``hot`` sort for a given subreddit try:
# assume you have a Subreddit instance bound to variable `subreddit`
async for submission in subreddit.hot(limit=10):
print(submission.title) # Output: the submission's title
print(submission.score) # Output: the submission's score
print(submission.id) # Output: the submission's ID
print(submission.url) # Output: the URL the submission points to
# or the submission's URL if it's a self post
print(submission.title)
# Output: the submission's title
print(submission.score)
# Output: the submission's score
print(submission.id)
# Output: the submission's ID
print(submission.url)
# Output: the URL the submission points to or the submission's URL if it's a self post
.. note:: The act of calling a method that returns a :class:`.ListingGenerator`
does not result in any network requests until you begin to iterate
Expand All @@ -213,7 +221,8 @@ You can create :class:`.Submission` instances in other ways too:
# assume you have a Reddit instance bound to variable `reddit`
submission = await reddit.submission(id="39zje0")
print(submission.title) # Output: reddit will soon only be available ...
print(submission.title)
# Output: reddit will soon only be available ...
# or
submission =await reddit.submission(url='https://www.reddit.com/...')
Expand All @@ -235,11 +244,13 @@ For example:
# assume you have a Submission instance bound to variable `submission`
redditor1 = submission.author
print(redditor1.name) # Output: name of the redditor
print(redditor1.name)
# Output: name of the redditor
# assume you have a Reddit instance bound to variable `reddit`
redditor2 = await reddit.redditor("bboe", fetch=True)
print(redditor2.link_karma) # Output: u/bboe's karma
print(redditor2.link_karma)
# Output: u/bboe's karma
Obtain :class:`.Comment` Instances
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down

0 comments on commit f92f86b

Please sign in to comment.