how can i make a database for pycord? - python

I'm currently programming a Discord Bot. I'm pretty new to pycord and I wanted to make a command that saves a str in a databasel
if anyone could show an example for it i`ll be so happy
i tried using SQlite but i couldnt find any good tutorials on it

Py-cord is pretty irrelevant in this question, as you can use pretty much any database that you want.
A good alternative to SQlite would be pymongo. It's very simple, and you can learn it pretty quickly. It's also free.
If you want something locally stored, just use JSON. It's the quickest way to develop a storage system.

Related

Converting a javascript folder to python

So I know js2py is a thing but I'm not entirely sure if you can convert an entire folder? I only know how to use python and being able to convert the language would be extremely helpful for me, I'm trying to make a twitch chat bot however moderation commands and configuration is difficult for me and the destinygg chat bot is insanely good and being able to use it would be amazing. https://github.com/destinygg/chat-bot
If this is not possible I understand however its worth a shot to ask how/if I guess :)
No, it supports translating a file but not a folder.
But you can enumerate the files in your folder and translate them one-by-one, using:
js2py.translate_file('example.js', 'example.py')

How to properly set up this Sage Cell Server?

I have a question regarding the Sage Cell Server. It is a relatively general question, I don't have any code that I need fixed.
I am trying to set up a server but I am finding the world of servers confusing. I've worked plenty with Java and JavaScript, HTML and CSS on frontend stuff, but for the backend Sage server I decided to develop I figured Python was a good choice. Some basic Lynda tutorials and a book later, I have a pretty good idea how python works... But am still lost. My question is basically this:
-I am trying to design a very simple server running an instance of Sage. I want to be able to SEND Sage code to it (NOT PYTHON) and have it evaluated and the result sent back, as if I were running sage on my own computer. Example: Sending "integrate(x,x)" to the server would return 1/2*x^2
-What is the best way to go about doing this? Should I download the Sage Cell Server?
-Will I need to even write Python code for this? How long would this task take in hours?
-Would it be easier for me to design the server to receive and execute Python code instead of Sage code? How would I go about doing this?
If you are wondering why I want to do this, I want to design a website where people can type in their math problems and have them evaluated by sage. I know there are simpler ways to do this but I've wanted to do server-side work and get people talking with a server for a while now and this seems like a good introduction to it.
Any and all advice is appreciated, resources, help, etc.
There are certainly a number of people who have successfully set up their own Sage cell server, and as such things go I hear it is definitely doable. The previous "simple server" API is pretty much defunct and the Sage cell is a pretty reasonable way to do this. I don't see why you would need to have reinvent the wheel here, and asking on sage-support#googlegroups.com is a logical next step for you.

flask-login alternative for beginner

I will do project with my class, so they are a bit new with python. In our web application we will need registration/authentication. I used flask-login for this stuff, but I didn't enjoy this. I think it is difficult to understand and this is not obvious. I want to display that python is very simple to the class. I want to avoid duplications with log in stuff, what can you suggest to use instead?
From what i know, there are no popular alternatives to Flask-Login, except writing your own one. If you plan to do this, flask.session is highly relevant, as is a part of the tutorial.
There's also Flask-Security, but that builds on top Flask-Login. I used neither of them.

has anyone used the Cork library for authentication?

I'm looking for a good authentication/authorization framework for Bottle. I would love something that is fast and easy to use.
I've seen recommendations for repoze.what and repoze.who, but their documentation looks scary (I'm not sure what to even make of the repoze.who documentation).
There seems to be a new framework in play called Cork. It looks super easy to use. Has anyone here actually used it in a project? Also, what do you guys think of the saving of user credentials in a file (as opposed to a db table)?

python web parser

I would like to parse a particular database on the web. I would also like to store elements of that database in an online MySQL db.
Why this isn't obvious to me: not sure what language to use, should I be looking at Rails instead of command line python
This is probably the first step in several question, but I suspect you all will provide me insight to links and tutorials
I would suggest learning to program and find a language that you are comfortable in. Then after you know some general principals or Ruby, Python or any other language you should be comfortable tackling this on your own. It just seems to me that you are trying to run before you know how to walk so to speak and if you try to jump too far ahead without understanding the basics you can get yourself into a tricky position.
Here are some tutorials to get you started:
Chris Pine's - Learn to Program
Zed Shaw's - Learn Python the Hard Way

Categories