Python Forum
Need help looping this program - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: Need help looping this program (/thread-18461.html)



Need help looping this program - JakobeTheKid - May-18-2019

So im using instapy and running a bot that likes and comments on peoples profiles but it'll only run once and i needed some help since im REALLY new to python, i didn't write the code that's why im here but is still changed things like my login and tags etc. but i want to have the program run infinitely on my laptop so it'll bring in continuous people, thanks

Here's the code
"""
This template is written by @Edhim
What does this quickstart script aim to do?
- I am using simple settings for my personal account with a crontab each 3H,
it's been working since 5 months with no problem.
"""

from instapy import InstaPy
from instapy import smart_run

# get a session!
session = InstaPy(username='', password='')

# let's go! :>
with smart_run(session):
    # settings
    session.set_relationship_bounds(enabled=False,
                                    potency_ratio=-1.21,
                                    delimit_by_numbers=True,
                                    max_followers=4590,
                                    max_following=5555,
                                    min_followers=45,
                                    min_following=77)
    session.set_do_comment(True, percentage=50)
    session.set_comments(['aMazing!', 'So cool!!', 'Nice!', 'wow looks nice!',
                        'Just incredible :open_mouth:',
                        'What camera did you use @{}?',
                        'Love your posts @{}',
                        'Looks awesome @{}',
                        'Getting inspired by you @{}',
                          'this is awesome!'])

    # activity
    session.like_by_tags(
        ['xxx', 'xxx', 'xxx', 'xxx', 'xxx', 'xxx', 'xxx', 'xxx', 'xxx', 'xxx',
         'xxx', 'xxx', 'xxx'],
        amount=8, skip_top_posts=True)

    """ Joining Engagement Pods...
    """
    session.join_pods()



RE: Need help looping this program - SheeppOSU - May-19-2019

Do look at while loops. You should just learn it rather than me write the code