Where did Nathan go?
posted to Ask by BenOfWillis

@Water_Wizard ahhhhh you guys don't remember those glorious days when we used to get weekly emails from our lord Timmy from Repl.it

Export Files
posted to Ask by HarveyH

You can already do this:

  • Next to the Add file and Add folder buttons, there's a little menu button
  • Click that and click Download as zip

I hope you found this comment helpful
Upvote for vee freebucks!

What does fork do?
posted to Ask

Hey,
Forking someone else's repl creates a copy of the repl in your account, which you can edit. Although this is very good if you want to, for example, improve someone else's code, you musn't fork someone else's repl and claim it as your own, and it's always good to put in the repl's description that it's a fork of someone else's.

Hope you found this comment helpful
Upvote for vee freebucks!

Chat on the terminal
posted to Learn by jajoosam

Hey! Nice tutorial but a few issues:
Firstly, it doesn't work, in that messages you send aren't actually posted. Easy fix: replace

rl.question("» ", (answer) => {
    // "» " Gives a prompt for the user
    socket.emit("message", buffer);
    chat();
});

with

rl.question("» ", (answer) => {
    // "» " Gives a prompt for the user
    socket.emit("message", answer); // <-- There - replace buffer with answer!
    chat();
});

and it should work fine!

Also, if you want it to display who posted the message, change socket.emit("message", answer); to socket.emit("message", id+": "+answer);

Awesome tutorial though, I'm no good with JS so I would never have been able to create something like this without a tutorial!

Repl
My chatroom

Discord Bot Competition
posted to Share by timmy_i_chen

@freddyamarsden you already can, the python tutorial linked on this page (i don't know about the js and ruby ones) includes a bit about creating a server

24/7
posted to Ask by StrawBester

@VFDan @TheDrone7 has made a nice tutorial on it - on his profile page, select the posts tab and it's one of his most recent ones

BrainF - A Complete Guide
posted to Learn by minx28

@larryk thx for that correction, I'll fix it right away.
BrainF has exactly zero practical use - that's one of the reasons that I personally like it so much!

24/7
posted to Ask by StrawBester

Python: use a Flask keepalive
JS: make an express server
For both of them, you also need to set up uptimerobot to ping the webpage that is created

Noob here: How do I call a python script from another python script?
posted to Ask

No @gbafana25, it does work - you just need to create another file my_module.py (or whatever you want to call it) and do import my_module wherever you want to use it.

If you have my_function in my_module.py which is inside the folder my_folder, you can do

import my_folder.my_module
my_folder.my_module.my_function()

or you can do

from my_folder.my_module import my_function
my_function()

Hope you found this helpful!
Upvote for vee freebucks

Use a web site as a console for a code, without showing the code
posted to Ask by afsalazar

Hi afsalazar,
The easiest way to do what I think you mean is probably to use repl.run. To do this, enable explorer mode in your account (account > roles > explorer) and then whenever you use a python repl, a repl.run page will display instead of the normal terminal. You can then share the link to this page, and the repl.run automatically runs the code whenever anyone visits it, without showing people the actual code.

Upvote for vee freebucks

24/7
posted to Ask by StrawBester

@Patu

from flask import Flask
from threading import Thread

app=Flask("")

@app.route("/")
def index():
    return "<h1>Bot is running</h1>"

Thread(target=app.run,args=("0.0.0.0",8080)).start()
🎶Let's Brainstorm: MUSIC CHALLENGE EDITION🎶
posted to Share by katyadee

anyone here heard of newgrounds? it's a lit platform for audio sharing and i am considering making some sort of website that allows you to create playlists using songs from it and stuff like that

👀 Domain Hack Finder 👀
posted to Share by mat1

@mat1 oNLy $240

Upvoted btw

Noob here: How do I call a python script from another python script?
posted to Ask

@Woloszin if you have module.py in folder.py you can do import folder.module i think

Rock Paper Scissors with Smart AI player
posted to Share by OrionLee

you know you can just do

import replit
replit.clear()

to clear console

Content Creator?
posted to Ask by HarperframeInc

Hey,
This means you have contributed to Repl Talk. I don't know what the threshold for number of posts/comments is to become a Content Creator, although I seem to have become one too recently. I don't think it actually does anything or gives you any special permissions.

Hope you found this comment helpful
Upvote for vee freebucks!

How do you clear the output screen off all text(python 3)
posted to Ask

Hey,
The way I usually do it only works on Repl.it, but is very easy:

import replit
do_stuff()
replit.clear()

Hope you found this comment helpful
Upvote for vee freebucks!

Has anyone else been banned from Discord for no reason?
posted to Ask by freddyamarsden

Very sorry to hear this, but there isn't really anything Repl.it can do about it. As @fullern000 said, try to communicate further with Discord and find out what actually happened, or try to prove that you haven't raided any servers.

Hope you found this helpful
Upvote for vee freebucks!

Python looking for an error
posted to Ask by Ezmodar

@Ezmodar thanks - I'm on my phone so I'm not going to look it now, but I'll take a look tomorrow and let you know

I need help!
posted to Ask by User_007

Hey,
As far as I know, a double forward slash (//) doesn't do anything special.
You may be thinking of a double backslash (\\): normally, backslash signifies some sort of code to follow, e.g. \u2B50 in a string will, when printed, show the ⭐ emoji, and \n signifies a new line. \\ is a way of actually having the \ character in a string, because any other character after a \ will make the code do something.

Hope you found this helpful
Upvote for vee freebucks!

Also, check out that super-fast response 🙃

How can I fix my console?
posted to Ask by chengary88

Hey,
Sorry about this. It was a change that was made recently, that all users (instead of just those who have opted for the Explorer role) now have a terminal instead of what we had before. I know, too, that not being able to copy/paste is very annoying, but this update has so many benefits, like repl.run, that I'm just about managing with this small annoyance.

Hope you found this helpful
Upvote for vee freebucks!

what is wrong with this python? trying to make function which converts inch to centimeter
posted to Ask by YvngBashit

Hey,
Your function is much too complicated. Converting inches to centimetres is very easy:

def inch_to_cm(inch,conversion=2.54):
  return inch*conversion

print(inch_to_cm(12))
# 30.44

print(inch_to_cm(12,conversion=4))
# 48

The conversion parameter defaults to 2.54, but if specified in the function call, you can change how many centimetres per inch.
An even easier way of doing it but without the optional conversion:

inch_to_cm_1=lambda inches:inches*2.54
inch_to_cm_2=lambda inches,conversion:inches*conversion

print(inch_to_cm_1(12))
# 30.44

print(inch_to_cm_2(12,2.54))
# 30.44

The first one doesn't have a changeable conversion parameter, whereas the second one has a conversion parameter which you have to supply. If you don't know what a lambda function does, read this.

Hope you found this helpful
Upvote for vee freebucks!

Python looking for an error
posted to Ask by Ezmodar

@Ezmodar no problem - upvote perhaps? hehe

Python looking for an error
posted to Ask by Ezmodar

Hey,
Try putting the line in a try-except loop:

try:
  if wk2 in ["INVESTIGATE",'Investigate','i','I']:
    do_some_stuff()
except:
  print("An error ocurred!")

The try will test the code for errors. If none occur, the code will be run; if there is an error, the code under except will be run. The benefit of using try-except is that although it means the error isn't shown at all, it also means the code won't be aborted if an error is thrown.

Hope you found this comment helpful
Upvote for vee freebucks!

Brute Force Password Cracker
posted to Share by CyanCoding

Hi! This is a cool project and I really like the use of colour. However, in places, there are major issues with the code: in under 10 minutes, I cut your 323 lines of code down to 259, with several lines becoming much shorter and easier.
The key to this is the string module:

import string

This module has several highly useful constants:

print(string.ascii_lowercase)
print(string.ascii_uppercase)
print(string.digits)
print(string.punctuation)
print(string.printable)
abcdefghijklmnopqrstuvwxyz
ABCDEFGHIJKLMNOPQRSTUVWXYZ
0123456789
!"#$%&\'()*+,-./:;<=>[email protected][\\]^_`{|}~
0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!"#$%&\'()*+,-./:;<=>[email protected][\\]^_`{|}~

I went through your code and replaced instances of "abcdefghijklmnopqrstuvwxyz" with string.ascii_lowercase for example.
The other thing I did was the section where you detect if certain groups of characters are in the password. You did

if "A" in password or "B" in password...

I changed this to

if any([char in password for char in string.acii_uppercase]):

The any function requires a list and if any of the items in the list are True, it returns True. The [char in password for char in string.acii_uppercase] creates a list: each item is True of False, depending on whether each character in string.ascii_uppercase is in the password. This means that if any of the upper case letters are in the password, our any() returns True. I did the same thing with the lowercase, digits and punctuation bits, the punctuation one being particularly satsisfying because previously you had individual if statements for each separate character.
Hope you found this comment useful, please upvote!
-minx

how to learn code effectively?
posted to Ask by YvngBashit

Hey! I know what you mean about finding it difficult to learn things, but I've got a solution. All you need to do is set yourself a project, something to aim for. If, whilst coding that project, there's something you don't know - just Google it. Personally, I find that if I actually use a function or method that I didn't know in my own code, it tends to stick in my memory. Hope you find this helpful - pls upvote 🙃

coment cré t'on des module python sur repl.it
posted to Ask by brieucpy

merci beaucoup