Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,150,693 members, 7,809,618 topics. Date: Friday, 26 April 2024 at 12:01 PM

Making A Bot In Python And Django - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / Making A Bot In Python And Django (1719 Views)

See My Awesome Python And Django Website, Pls Review It / What Is The Best IDE For Programming Python And Django In 2019 / Looking For Someone Who Can Create A Bot That Can Auto Post To Offerup And FB (2) (3) (4)

(1) (Reply) (Go Down)

Making A Bot In Python And Django by mechtronics(m): 10:26am On Oct 18, 2017
i will be doing a tutorial on bot making with django bt before i start i need atleast 20 turn up grin
Re: Making A Bot In Python And Django by LordeCalifornia: 11:53am On Oct 18, 2017
mechtronics:
i will be doing a tutorial on bot making with django bt before i start i need atleast 20 turn up grin
Sorry for derailing. Please what does this mean in python language?






from sys import argv



Re: Making A Bot In Python And Django by supervillain52(m): 12:25pm On Oct 18, 2017
mechtronics:
i will be doing a tutorial on bot making with django bt before i start i need atleast 20 turn up grin
cmon start already
Re: Making A Bot In Python And Django by Nobody: 12:26pm On Oct 18, 2017
mechtronics:
i will be doing a tutorial on bot making with django bt before i start i need atleast 20 turn up grin


Man post it now
Re: Making A Bot In Python And Django by Folarinibrahim1(m): 3:32pm On Oct 18, 2017
We are waiting
Re: Making A Bot In Python And Django by Folarinibrahim1(m): 3:35pm On Oct 18, 2017
LordeCalifornia:

Sorry for derailing. Please what does this mean in python language?






from sys import argv




you are importing arguments variable from system module. One of the functions that I knw of is passing a variable to a python script which will be use while interpreting the script..

Maybe the ogas at the top have better explanation
Re: Making A Bot In Python And Django by Capnd143(m): 4:32pm On Oct 18, 2017
We are waiting
Re: Making A Bot In Python And Django by mechtronics(m): 4:54pm On Oct 18, 2017
LordeCalifornia:

Sorry for derailing. Please what does this mean in python language?






from sys import argv






sys.argv is a list in Python, which contains the command-line arguments passed to the script

so If you are gonna work with command line arguments, you probably want to
use sys.argv
for example

import sys

print sys.argv

it will bring the directory of your py file
Re: Making A Bot In Python And Django by mechtronics(m): 5:13pm On Oct 18, 2017
what we will be doing is a bot that will use speech recognition and google map for location and also will scrap data from wikipedia

requirement
-django
-jquery
- aiml


first of all install the requirement
linux- use sudo pip install django aiml
then download the jquery from it website www.jquery.com
on windows
python -m pip install django aiml

so after the installations
go to your command line cmd or bash if on linux


django-admin.py startproject bot

it will generate a folder structure containing


manage.py and another bot folder which will contain

1 settings
2 urls
3 wsgi
Re: Making A Bot In Python And Django by mechtronics(m): 5:32pm On Oct 18, 2017
then we type on cd(change directory ) + the path where the folder was created
cd bot

when done again type django-admin.py startapp mybot

these will generate inside the bot folder
a mybot folder containing
1 views
2 apps
3 tests
4 models
5 admin
Re: Making A Bot In Python And Django by mechtronics(m): 5:44pm On Oct 18, 2017
then with the directory of the bot type python manage.py runserver on your cmd
it will serve a page showing it work blaaaaa
that means you good to go to get more of the installation if you are a beginner
go to the trend created by olami django blog for more


--------------------------------------------------------------------------------------------
let configure our settings.py
first register your app


then put these at the top
from os.path import join,abspath,dirname
root = lambda *dirs: join(abspath(BASE_DIR), *dirs)




then configure your templates
with the second picture




then next static file and media





then next let create a folder or directory inside our project folder called bot
folder[templates]

Re: Making A Bot In Python And Django by mechtronics(m): 5:49pm On Oct 18, 2017
for template these is where we will be storing our html page



inside the mybot folder create a folder name static

then inside static we create a folder to store our css
js and image

also pls download bootstrap and w3 css

Re: Making A Bot In Python And Django by mechtronics(m): 5:53pm On Oct 18, 2017
the next tutorial is working with aiml AIML (Artificial Intelligence Markup Language) is an XML-compliant language that's easy to learn, and makes it possible for you to begin customizing an Alicebot


so we will stimulate with aiml before implementing with django

create a a folder what ever name you want to give create a py file
and a with extension .xml file and .aiml
Re: Making A Bot In Python And Django by mechtronics(m): 5:54pm On Oct 18, 2017
need your response and let see how far you are following if having any error dnt hesitate to tell
Re: Making A Bot In Python And Django by mechtronics(m): 5:55pm On Oct 18, 2017
tonight or tomorrow for the next one
Re: Making A Bot In Python And Django by LordeCalifornia: 6:37pm On Oct 18, 2017
mechtronics:



sys.argv is a list in Python, which contains the command-line arguments passed to the script

so If you are gonna work with command line arguments, you probably want to
use sys.argv
for example

import sys

print sys.argv

it will bring the directory of your py file
Thanks, more like it's used for importing data or transferring data in python. I get it now.
Thanks once again.
Re: Making A Bot In Python And Django by LordeCalifornia: 6:38pm On Oct 18, 2017
Folarinibrahim1:
you are importing arguments variable from system module. One of the functions that I knw of is passing a variable to a python script which will be use while interpreting the script..

Maybe the ogas at the top have better explanation
Thanks
Re: Making A Bot In Python And Django by Niyi21: 5:36pm On Nov 09, 2018
Still ongoing?

(1) (Reply)

Creative Programmer Needed / Pls I Want Someone To Give Me The Differences Between High & Low Level Language / Microsoft Exams

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 20
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.