Sean B

@Geocube101 (585) • Cross Creek Early College
Just here to code stuff sometimes
Can't seem to run multiple python files in one project
posted to Ask by sodalover

The replit editor only runs the main file. In order to run the second file, you will have to import it import [file_name]. When importing another python file, do not include the .py extension.
Note: The file runs immediately after import meaning that as soon as the file imports, it runs. If you need the file to only run at a specified line, that is where you put the import command.

unindent error
posted to Ask by marksimon2

This is because your indents are tabs up until line 20, in which they become spaces.
Either change all indents to tabs or all to spaces

Multi Page Website
posted to Ask by K1NGBOSS

Just add a link to the website
Links: <a href="url">Link Text</a>

Javascript doesn't work
posted to Ask by semjapink

try placing

<script src="resources/scripts/theme.js"></script>

at the end of your body element

font family
posted to Ask by EsraaSamir

[ResourceLoadError]: Failed to load resource "styles.css"
When you linked your css file to your html document, you specified "styles.css" when it should be "style.css" (You could also rename "style.css" to "styles.css")

[HTML] How to add elements with absolute position relative to their parent?
posted to Ask by mwilki7

You might be able to use relative positioning, which positions an element relative to where it would've been
Also, to add a scrollbar only when a container overflows, use auto along with overflow (overflow: auto;)

How to set innerHTML to a vairble.
posted to Ask by lightningrock

Should be getElementById not getelementyid

var header = document.getElementById("header");
How can I gather variables from another file in Python?
posted to Ask by aflacc

You can import variables from other files
this_string = "Hello World"
from File_1 import this_string
print(this_string) #Prints "Hello World"

Made a simple random string generator (no sure if this is what you meant)

from random import choice

def randomString(chars, length):
	out = ''
	for a in range(length):
		out += choice(chars)
	return out
I need help with python
posted to Ask by maxgallione

So if you need to install a module, you can either do it with code or from the package manager (I recommend the latter)

Using Code

from os import system
system('pip install module') #"module" is the name of the python library

Using Package Manager

Click the package manager tab on the left bar.
Type the library name into the search bar
Select your library from the list and then press the plus button to add it

How do I make them run simultaneously but also independently
posted to Ask by xolyon

If you would like the functions to start running at exactly the same time (in other words the functions are non-blocking/asynchronous), then you can use the "threading" module

from threading import Thread
import time

class bruh:
  def b(self):

instance = bruh()

t1 = Thread(target=instance.b)
t2 = Thread(target=instance.b)
t3 = Thread(target=instance.b)

How to make a reliable database?
posted to Ask by ironblockhd

The code for this repl is so... difficult to read
The reason for the reset may be's fault. I use a 3rd party database to store my information. Try MySQL or MongoDB

How do I make links in buttons?
posted to Ask by mmichalski115

You're Welcome @mmichalski115

How do I make links in buttons?
posted to Ask by mmichalski115

Do you have the repl?

Listening if a button was clicked:

var button = document.getElementById('id_of_button');
button.addEventListener('click', function(event)
  //Code to execute

Listening if a button was clicked (using html onclick):


<button onclick="buttonClicked()">button text</button>

JS Code

function buttonClicked()
  //Code to Execute

Putting a link element in a button:

<button><a href="target.url">button text</a></button>
why wont it work
posted to Ask by TheChronics

This repl type is for pure python. For turtle, copy this code into a python with turtle repl

How do I change font/colour in HTML?
posted to Ask by JamesThornbury

You can use the font-family and the color attributes in your css file or <style> tag

I need help with a python program.
posted to Ask by randyjgarcia

Use the built in method count, it returns the number of substring occurrences in a string
Syntax: string.count(substring[, start, end])

  • string - The string to search
  • substring - The substring to search for
  • start - Index of where to begin search (Optional)
  • end - Index of where to end search (Optional)

Then you can test if the count is greater than 1

substr_count = string.count(subtring)
if substr_count > 1:
Custom Language Compiler
posted to Share by Geocube101

@billehb I know, I'm currently trying to implement a new function

How to clear screen in C++
posted to Ask by SpartanDoge


void clear()
  std::cout << "\033[2J\033[1;1H";
Persisting Snapshot/Snapshot done message
posted to Ask by lyonsstephen

Do you have the repl?

posted to Ask by DuarteFERREIRA1

Can you be a little more specific
Testing if variable is a decimal

if type(var) is float:
  print('This is a decimal')
  print('This is not a decimal')

Testing if variable is a non-whole number

if var != int(var):
  print('This is a decimal')
  print('This is not a decimal')

In all instances, "var" is a numerical value of type "float" or type "int"

How to return to another line of code in c++
posted to Ask by BFDMod

It is possible to place all of the code you need to rerun inside of an infinite while loop (with a specific condition to break the loop when necessary)

//Setup code here
while (true)
  //Looped Code Here
What can I do for code?
posted to Ask

Well, start with what language you want
The large, blue + new repl button opens the new repl gui where you select your programming language, name and description (optional)
From there, you can click on the left hand side pane to code and see it in the console (right hand side pane)

I would like help in java
posted to Ask by studentTylerTy1

Instead of recreating Minecraft, you could just create a mod to alter world generation
Minecraft 1.15 plans to release the game code to help mod makers out

Deleting a account!
posted to Ask by PDanielY

If you can still login to your old account, you can request account deletion by viewing your account and clicking the account option. At the bottom is a button to request deletion
posted to Ask by CHANDLERCLINE

This code looks built for python 3 not 2.
If your going to use python 2, you need to replace 'input' with 'raw_input', otherwise you should use python 3

html url error
posted to Ask by Dante_Morrison

Can you link the repl?

Need guidance
posted to Ask by chrisb469

Having trouble getting the what?
I'm confused at what you're trying to do
Are you trying to get rid of the quotation marks, in that case just remove them from the <p> element

I need help with threading on this programme
posted to Ask by DylanCrawford3

Line 81: args parameter must be a tuple not a function
In order to make it a tuple, just add a comma after direction

psnakelocation = threading.Thread(target=snakelocation,args = (direction,)) #Note the comma after "direction"
Can't seem to run multiple python files in one project
posted to Ask by sodalover

@sodalover I do not know the reason.