xolyon
@xolyon
Just a person trying to code
Just enter the binary number and your good to go (0s and 1s only)
trying to reverse this so normal numbers become binary
--notes--
this was made by
Python
I tried doing it but subsequently got an error
by the error message I mean, somebody either didn't have permissions to do a command or entered the wr
PattanAhmed @xolyon Hi,
If you want to handle an error without its default red lines.
Then, probably you can use Try/ except functions.
Check this website to know more about Try/Except.
Click here
But now, I will give the code:-
try:
Now here, you write something that gives an error.
Any sentence with error
The sentence that you type here in except if you have an error it will give this sentence.
except:
Now, if any type of error comes, it will show this sentence instead of those red lines.
print('An err2 years ago
CodingCactus i think what you are looking for is the oncommanderror event
here is some sample code
@client.event
async def oncommanderror(ctx, error):
embed = discord.Embed(color=0xff0000,title='ERROR', description=str(error)
msg = await ctx.send(embed=embed)
await asyncio.sleep(5)
await msg.delete()
`2 years ago
sorry to my umm fans that I haven't posted recently i got carried away with a project to big for my boots and have almost quit really so yeah ill try
HTML, CSS, JS
I've seen posts and video about making a bot on Reddit which reposts to your subreddit or twitter, whatever but I haven't seen a tutorial on how to ma
input("> ") requires the user to enter for input
how can I just make them type something and then for it to instantly process?
Roar123 Getkey is the best and easiest solution for this specific problem. Here's an example from their PyPI description.
from getkey import getkey, keys
key = getkey()
if key == keys.UP:
... # Handle the UP key
elif key == keys.DOWN:
... # Handle the DOWN key
elif key == 'a':
... # Handle the a key
elif key == 'Y':
... # Handle shift-y
else:
Handle other text characters
buffer += key
print(buffer)
`3 years ago
V1.2
_ The bigger the display , the better! _
_ WASD for controls , get to the green squares to get to the next level! _
Boi, I just spent 4 hours st
Python
AmazingMech2418 This is great! How did you add in colored squares to a command line-based game? Also, I would recommend using a variable to collect the entire map in with newline characters of course to speed it up. If I spam one of the buttons, it will glitch, but using a variable should fix that at least some...3 years ago
really bad title, I know *
Are you tired of making those text and decision-based RPG games? but feel like your game in PyGame just wouldn't suit?
Wel
Python
a template for python console games with maps and scenes in which you can move around
tutorial: https://repl.it/talk/learn/2D-console-games-tutorial/
Python
One which can read and printed to output something
and also like move x-y coordinates
SixBeeps You can make a 2D array of binary digits to represent if there is either a free space or a wall. From there, you can make a movement script that only lets the player move if there is a free space in the direction that they want to go in.3 years ago
I saw tons of cool utility and advanced stuff on python here so I decided to make something I see a lot on here...
This is a basic skeleton for an RP
Python
How can I run for example func1 and func2 at the exact same time?
a friend told me to try the python program you see but it doesn't work for me.
and
Python
Roar123 Look into threading/multiprocessing. Resources - Python Docs, Geeks for Geeks. I'm using multiprocessing in a game right now to terminate a function if it runs for too long and it was a pain to figure out but it works well. I think that the Geeks for Geeks tutorial should cover what you need.3 years ago
as the Replit community slowly expands and the current threads/categories will become flooded with posts will replit introduce communities like in cre
Can someone quickly explain SQL to me, how to use it and why or if its better than external files, thanks
IK its database but that's it, I need this
Codejira Well, there is no quick way, I guess.
But here are some thoughts:
For many projects SQLite should do the trick. It's even in Python's Standard Libraries (sqlite3)
One advantage: SQLite doesn't require an SQL server.
Disadvantage: It lacks some advanced functionality.
It is in fact a single external file, but you don't need to manage it by yourself.
When you feel the urge to put your data into spreadsheets, SQLite might be the solution.
Very quick intro:
Start with import sqlite3
Create a da3 years ago
What are you trying to actually achieve here / finish with
and what did you base the website, of my guess, is:
A mix of Stack overflow (like a lot)
xxpertHacker Here's an ancient post that might be of help in answering your question: https://repl.it/talk/ask/Do-you-actually-plan-to-take-over-the-world/10.
@amasad commented on that post:
> ... Repl.it ... good chance ... that [it will be] world-conquering...3 years ago
Ok so its quite simple with python
to open a file you do this
file_example = open("[filename]", "operation")
here are the operations:
r - read conte
Python
Disclaimer: Python 3 only and console only
Using Colorama
one of the simplest ways I've found of colouring and styling my text in python is by using
Python
NoelB33 This is so useful! I never really knew how to use ANSI colors, but this made is so much easier. Thanks!3 years ago
Sup replitors you've come upon this post and I really recommend you check this out, and give it the upvote it deserves, thanks
credit to @Jakman for s
Python
Jakman Also include my name in credits since i did print out made by @Jakman and @xolyon in one night at the top of the terminal.3 years ago
Jakman @xolyon you wanna help me with this lil thing?
import os
if name == 'main':
name = os.getcwd()
while True:
inpus = input(f'{os.getcwd()}type>')
inp = inpus.split(" ")
if inp[0] == "open" and inp[1]:
d = open(inp[1],'r')
print(d.read())
d.close()
elif inp[0] == 'write' and inp[1]:
d = open(inp[1],'w')
inputs = input("type into the file")
print(d.write(inputs))
d.close()
3 years ago
Limitless fun! , every scenario NEW!
¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬
#Intro
Yeah this took a long while to make, so give me the upvote for the effor
Python
I have an external file with the number 0
to convert this I write:
number = int(file1)
file1.close()however when I run this code I get an error sayi
Python
Codemonkey51 You are trying to convert a file object to an int what you want to do is convert the contents of the file, todo that just make it:
file1 = open("example.txt", "r")
number = int(file1.read())
file1.close()
adding the .read() makes it return what's inside the file3 years ago
I kinda am already going into JS but I am kinda interested in NodeJS so anyone got any tutorials/starting points or ways to learn
AmazingMech2418 https://www.w3schools.com/nodejs/default.asp is what I used to learn Node (along with the Node.JS documentation and StackOverflow).3 years ago