Discuss Scratch
- Discussion Forums
- » Things I'm Making and Creating
- » Python programming language
- Wei-ern_520
- Scratcher
500+ posts
Python programming language
Does anyone know about “this” module?
All you need to import this module (no pun intended) is to run the following line:
All you need to import this module (no pun intended) is to run the following line:
import this
Last edited by Wei-ern_520 (Sept. 28, 2021 06:24:51)
Please consider checking out my suggestion ->here<-.
Hello, I’m Wei-ern_520, and I will randomly appear in your room! Just kidding, I make rpg engines.
I have no custom pfp, not because I don't know how to make one. I just don't know what suits me best, and I'm just too lazy and prefer sticking to simplicity. Or at least so. I also have the need to trip people with my profile picture. Just wait till it happens.
Fun fact: you don't clean your mess, you move it somewhere else. (Source: somewhere)
Also: Ooh, look at the cheese!
- Chiroyce
- Scratcher
1000+ posts
Python programming language
ninja'd! Does anyone know about “this” module?
https://scratch.mit.edu/discuss/post/5515579/
run this in shellimport this
Import this now! You get 5 perks!
- A variable named this.c with the value 97!
- A variable named this.d containing a dictionary of all letters a-z+A-Z with their rot13 counterparts!
- A variable named this.i with the value 25!
- A variable named this.i which is The Zen of Python encoded using rot13!
- Best of all, when importing this, you get The Zen of Python printed in your console for FREE!!!
April Fools' topics:
— New Buildings in Scratch's headquarters
— Give every Scratcher an M1 MacBook Air
— Scratch should let users edit other Scratchers' projects
— Make a statue for Jeffalo
— Scratch Tech Tips™
— Make a Chiroyce statue emoji
<img src=“x” onerror=“alert('XSS vulnerability discovered')”>
this is a test sentence
- Wei-ern_520
- Scratcher
500+ posts
Python programming language
What about antigravityninja'd! Does anyone know about “this” module?
https://scratch.mit.edu/discuss/post/5515579/run this in shellimport this
Import this now! You get 5 perks!
- A variable named this.c with the value 97!
- A variable named this.d containing a dictionary of all letters a-z+A-Z with their rot13 counterparts!
- A variable named this.i with the value 25!
- A variable named this.i which is The Zen of Python encoded using rot13!
- Best of all, when importing this, you get The Zen of Python printed in your console for FREE!!!
Please consider checking out my suggestion ->here<-.
Hello, I’m Wei-ern_520, and I will randomly appear in your room! Just kidding, I make rpg engines.
I have no custom pfp, not because I don't know how to make one. I just don't know what suits me best, and I'm just too lazy and prefer sticking to simplicity. Or at least so. I also have the need to trip people with my profile picture. Just wait till it happens.
Fun fact: you don't clean your mess, you move it somewhere else. (Source: somewhere)
Also: Ooh, look at the cheese!
- ninjaMAR
- Scratcher
1000+ posts
Python programming language
I'm not sure if it was mentioned but I know that one. What about antigravity
https://github.com/python/cpython/blob/main/Lib/antigravity.py
Last edited by ninjaMAR (Sept. 28, 2021 07:40:18)
- Wei-ern_520
- Scratcher
500+ posts
Python programming language
Does importing that module in your ide take you to a website with a comic?I'm not sure if it was mentioned but I know that one. What about antigravity
https://github.com/python/cpython/blob/main/Lib/antigravity.py
Please consider checking out my suggestion ->here<-.
Hello, I’m Wei-ern_520, and I will randomly appear in your room! Just kidding, I make rpg engines.
I have no custom pfp, not because I don't know how to make one. I just don't know what suits me best, and I'm just too lazy and prefer sticking to simplicity. Or at least so. I also have the need to trip people with my profile picture. Just wait till it happens.
Fun fact: you don't clean your mess, you move it somewhere else. (Source: somewhere)
Also: Ooh, look at the cheese!
- ninjaMAR
- Scratcher
1000+ posts
Python programming language
Yes. It takes me to https://xkcd.com/353/Does importing that module in your ide take you to a website with a comic?I'm not sure if it was mentioned but I know that one. What about antigravity
https://github.com/python/cpython/blob/main/Lib/antigravity.py
- Wei-ern_520
- Scratcher
500+ posts
Python programming language
Then that is it. Also, why does importing ok just print ok? And why are there so many random modules as such?
Such as this, six, ok, antigravity, that I do not understand.
Such as this, six, ok, antigravity, that I do not understand.
Last edited by Wei-ern_520 (Sept. 28, 2021 10:58:43)
Please consider checking out my suggestion ->here<-.
Hello, I’m Wei-ern_520, and I will randomly appear in your room! Just kidding, I make rpg engines.
I have no custom pfp, not because I don't know how to make one. I just don't know what suits me best, and I'm just too lazy and prefer sticking to simplicity. Or at least so. I also have the need to trip people with my profile picture. Just wait till it happens.
Fun fact: you don't clean your mess, you move it somewhere else. (Source: somewhere)
Also: Ooh, look at the cheese!
- Chiroyce
- Scratcher
1000+ posts
Python programming language
for fun reasons I guess? also they're called Easter Eggs - that I do not understand.https://en.wikipedia.org/wiki/Easter_egg_(media)
April Fools' topics:
— New Buildings in Scratch's headquarters
— Give every Scratcher an M1 MacBook Air
— Scratch should let users edit other Scratchers' projects
— Make a statue for Jeffalo
— Scratch Tech Tips™
— Make a Chiroyce statue emoji
<img src=“x” onerror=“alert('XSS vulnerability discovered')”>
this is a test sentence
- Chiroyce
- Scratcher
1000+ posts
Python programming language
def recursion(a): try: recursion(a) except RecursionError: try: recursion(a) except RecursionError: try: recursion(a) except RecursionError: return 'whew im tired after all of this recursion!' recursion(1)
Fatal Python error: _Py_CheckRecursiveCall: Cannot recover from stack overflow.
Python runtime state: initialized
....
zsh: abort /usr/local/bin/python3
Last edited by Chiroyce (Sept. 29, 2021 08:53:00)
April Fools' topics:
— New Buildings in Scratch's headquarters
— Give every Scratcher an M1 MacBook Air
— Scratch should let users edit other Scratchers' projects
— Make a statue for Jeffalo
— Scratch Tech Tips™
— Make a Chiroyce statue emoji
<img src=“x” onerror=“alert('XSS vulnerability discovered')”>
this is a test sentence
- Wei-ern_520
- Scratcher
500+ posts
Python programming language
Throws the same error for me, but who would do this in a program? And by stacking perhaps they meant the number of times it's run, or the fact that calling it after an error and again causes this overflow?throws an error like -def recursion(a): try: recursion(a) except RecursionError: try: recursion(a) except RecursionError: try: recursion(a) except RecursionError: return 'whew im tired after all of this recursion!' recursion(1)what?!Fatal Python error: _Py_CheckRecursiveCall: Cannot recover from stack overflow.
Python runtime state: initialized
....
zsh: abort /usr/local/bin/python3
No matter what, only the real writers of this language will know what it means.
Last edited by Wei-ern_520 (Sept. 29, 2021 09:10:09)
Please consider checking out my suggestion ->here<-.
Hello, I’m Wei-ern_520, and I will randomly appear in your room! Just kidding, I make rpg engines.
I have no custom pfp, not because I don't know how to make one. I just don't know what suits me best, and I'm just too lazy and prefer sticking to simplicity. Or at least so. I also have the need to trip people with my profile picture. Just wait till it happens.
Fun fact: you don't clean your mess, you move it somewhere else. (Source: somewhere)
Also: Ooh, look at the cheese!
- mybearworld
- Scratcher
1000+ posts
Python programming language
throws an error like -def recursion(a): try: recursion(a) except RecursionError: try: recursion(a) except RecursionError: try: recursion(a) except RecursionError: return 'whew im tired after all of this recursion!' recursion(1)what?!Fatal Python error: _Py_CheckRecursiveCall: Cannot recover from stack overflow.
Python runtime state: initialized
....
zsh: abort /usr/local/bin/python3
>>> def _(): _() >>> _() Traceback (most recent call last): File "<pyshell#3>", line 1, in <module> _() File "<pyshell#2>", line 2, in _ _() File "<pyshell#2>", line 2, in _ _() File "<pyshell#2>", line 2, in _ _() [Previous line repeated 1022 more times] RecursionError: maximum recursion depth exceeded >>>
>>> import sys >>> sys.setrecursionlimit(10000) >>> def _(): _() >>> _() ================================ RESTART: Shell ================================ >>>
Last edited by mybearworld (Sept. 29, 2021 12:18:05)
Signatures are the only place where assets links still work.
- Chiroyce
- Scratcher
1000+ posts
Python programming language
Why don't you make a .py file with the same contents as this and run it No idea how you got that message.
def recursion(a): try: recursion(a) except RecursionError: try: recursion(a) except RecursionError: try: recursion(a) except RecursionError: return 'whew im tired after all of this recursion!' recursion(1)
April Fools' topics:
— New Buildings in Scratch's headquarters
— Give every Scratcher an M1 MacBook Air
— Scratch should let users edit other Scratchers' projects
— Make a statue for Jeffalo
— Scratch Tech Tips™
— Make a Chiroyce statue emoji
<img src=“x” onerror=“alert('XSS vulnerability discovered')”>
this is a test sentence
- mybearworld
- Scratcher
1000+ posts
Python programming language
The most useful feature of requests
Signatures are the only place where assets links still work.
- mybearworld
- Scratcher
1000+ posts
Python programming language
because I sometimes don't realize extremely obvious things xDWhy don't you make a .py file with the same contents as this and run it No idea how you got that message.def recursion(a): try: recursion(a) except RecursionError: try: recursion(a) except RecursionError: try: recursion(a) except RecursionError: return 'whew im tired after all of this recursion!' recursion(1)
Anyways…
Signatures are the only place where assets links still work.
- mybearworld
- Scratcher
1000+ posts
Python programming language
Responding to this post just to say that globals does only store variables. I think it stores other stuff tooPython 3.9.5 (default, May 5 2021, 02:58:34) [GCC 7.5.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> a = 1 >>> globals() {'__name__': '__main__', '__doc__': None, '__package__': None, '__loader__': <class '_frozen_importlib.BuiltinImporter'>, '__spec__': None, '__annotations__': {}, '__builtins__': <module 'builtins' (built-in)>, 'a': 1} >>>
Python 3.9.7 (tags/v3.9.7:1016ef3, Aug 30 2021, 20:19:38) [MSC v.1929 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license()" for more information. >>> a = 1 >>> globals() {'__name__': '__main__', '__doc__': None, '__package__': None, '__loader__': <class '_frozen_importlib.BuiltinImporter'>, '__spec__': None, '__annotations__': {}, '__builtins__': <module 'builtins' (built-in)>, 'a': 1} >>> print(__name__) __main__ >>> print(__doc__) None >>> print(__package__) None >>> print(__loader__) <class '_frozen_importlib.BuiltinImporter'> >>> print(__spec__) None >>> print(__annotations__) {} >>> print(__builtins__) <module 'builtins' (built-in)> >>> print(a) 1
Signatures are the only place where assets links still work.
- chandler2010
- Scratcher
25 posts
Python programming language
I made a text editor appender
Full code:
————-
Explanation:
—————–
This creates the file if the file doesn't already exist:
This reads the file and prints it to the screen:
This writes any new input to the file:
If the input is ‘@exit’ it would stop the script.
Full code:
————-
writing = 1
name = str(input('Name of the document: '))
print(f'PyWrite with {name}.txt\n')
with open(f'{name}.txt', 'a') as f:
pass
with open(f'{name}.txt', 'r') as f:
for line in f:
print(line, end='')
with open(f'{name}.txt', 'a') as f:
while writing == 1:
writestring = str(input(''))
if writestring == '@exit':
writing = 0
else:
f.write(f'{writestring}\n')
—————–
This creates the file if the file doesn't already exist:
with open(f'{name}.txt', 'a') as f:
pass
with open(f'{name}.txt', 'r') as f:
for line in f:
print(line, end='')
with open(f'{name}.txt', 'a') as f:
while writing == 1:
writestring = str(input(''))
if writestring == '@exit':
writing = 0
else:
f.write(f'{writestring}\n')
Last edited by chandler2010 (Oct. 3, 2021 14:21:36)
- -EmeraldThunder-
- Scratcher
1000+ posts
Python programming language
It's the best python game library about. What do you think of pygame? Is it slow? It seems to be able to withstand a FPS stress test of 3000 particles(from a video that I seen), but some say it is slow.
Nothing here.
- roketH77
- Scratcher
1000+ posts
Python programming language
I made a text editor appenderSet writing to True at the start, and when @exit is called set it to False (not “True”, just True or False, no quotes) and you can replace while writing == 1: to just while writing:
Full code:
————-Explanation:writing = 1
name = str(input('Name of the document: '))
print(f'PyWrite with {name}.txt\n')
with open(f'{name}.txt', 'a') as f:
pass
with open(f'{name}.txt', 'r') as f:
for line in f:
print(line, end='')
with open(f'{name}.txt', 'a') as f:
while writing == 1:
writestring = str(input(''))
if writestring == '@exit':
writing = 0
else:
f.write(f'{writestring}\n')
—————–
This creates the file if the file doesn't already exist:This reads the file and prints it to the screen:with open(f'{name}.txt', 'a') as f:
passThis writes any new input to the file:with open(f'{name}.txt', 'r') as f:
for line in f:
print(line, end='')If the input is ‘@exit’ it would stop the script.with open(f'{name}.txt', 'a') as f:
while writing == 1:
writestring = str(input(''))
if writestring == '@exit':
writing = 0
else:
f.write(f'{writestring}\n')
Moved to reidling–
- cinnamvn
- Scratcher
3 posts
Python programming language
i work part time as a tutor, and i’m currently teaching computer science to a few of my students ^^ python is the main programming language i use, as well as scratch for the more younger ones. i’m /attempting/ to make a mystery game right now :>
Last edited by cinnamvn (Oct. 3, 2021 20:24:55)
- gosoccerboy5
- Scratcher
1000+ posts
Python programming language
Pretty cool! Good luck! i work part time as a tutor, and i’m currently teaching computer science to a few of my students ^^ python is the main programming language i use, as well as scratch for the more younger ones. i’m /attempting/ to make a mystery game right now :>