Discuss Scratch

ThEStAr-
Scratcher
24 posts

Python Programing

Hi,

I was just wondering if anyone in the scratch community was learning Python. I just started to learn it and its pretty fun and is very different from Scratch but they are both programing languages. If anyone is learning Python, I was wondering If you would like to share things we have learned and learn from each other. I have learned while loops, for loops, random randint and I am working on strings.


Thanks

ThEStAr-

Last edited by ThEStAr- (April 17, 2015 23:25:20)

LimitedImagination
Scratcher
100+ posts

Python Programing

“but they are both programing languages” I think that's a bit obvious, really

I've just started learning it using Codecademy.

Just wondering, can you make viruses in Python? I don't want to do anything really bad, just change my friend's desktop background to my nose.
Rumanti
Scratcher
1000+ posts

Python Programing

I have learned Python for a few some months. I'm learning from this awesome course, Programming For Everybody, which teaches you Python. (btw, everyone = EVERYONE. No algebra whatever needed) It also includes and optional-yet-very-useful-in-and-outside-the-course Open Source and LEGALLY FREE Python textbook. I didn't remember much from the course, but it includes good (not-boring) videos, discussion forums, installation tutorial, more tutorials, and quizzes. The textbook teaches you basic stuff (print etc), randomness, strings, numbers, types of data (and converting them) lists, and awesomely, files.
You can also learn Python from Learn Python The Hard Way.

LimitedImagination wrote:

Just wondering, can you make viruses in Python? I don't want to do anything really bad, just change my friend's desktop background to my nose.
I don't really know about changing computer properties and that stuff, but you can use Python to change/make files. I have an idea: Maybe you can make a Python program to backup the data file and then change the real data file to something epic.

Last edited by Rumanti (April 19, 2015 13:11:11)

ThEStAr-
Scratcher
24 posts

Python Programing


Yes, I'm using Learn Python The Hard Way book to learn.

Last edited by ThEStAr- (May 1, 2015 21:42:35)

IronBit_Studios
Scratcher
1000+ posts

Python Programing

Yeah, I'm expanding on it via Hello World v2, Codecademy, stackoverflow, and my brain.
MrSherlockHolmes
Scratcher
500+ posts

Python Programing

I think I'm at about the same stage as you, if you want you could help me out with my programming language
import time
vars = {}
punc = ["%", "(", ")", "_", "[", "]", "{", "}", "\'", "|", "\\"]
ent = """
x = "wow!? Any punctuation is possible :)"
print x
"""
lines = ent[1:len(ent)-1].split("\n")
for line in lines:
words = [""]
extra = []
length = []
for i in line:
if i == " ":
words.append("")
elif i in punc:
extra.append(i)
else:
words[len(words)-1] = words[len(words)-1] + i
for word in words:
length.append(len(word))
if words[1] == "=":
if words[2] in vars:
vars[words[0]] = vars[words[2]]
elif words[2][0] == "\"":
vars[words[0]] = line[(length[0] + length[1] + 3):len(line)-1]
else:
vars[words[0]] = words[2]
elif words[0] == "print":
if words[1] in vars:
print (vars[words[1]])
elif words[1][0] == "\"":
print (line[7:len(line)-1])
else:
print (line[6:len(line)])
else:
print ("Error: Command not recognised.")
time.sleep(2)
ThEStAr-
Scratcher
24 posts

Python Programing

MrSherlockHolmes wrote:

I think I'm at about the same stage as you, if you want you could help me out with my programming language
import time
vars = {}
punc = ["%", "(", ")", "_", "[", "]", "{", "}", "\'", "|", "\\"]
ent = """
x = "wow!? Any punctuation is possible :)"
print x
"""
lines = ent[1:len(ent)-1].split("\n")
for line in lines:
words = [""]
extra = []
length = []
for i in line:
if i == " ":
words.append("")
elif i in punc:
extra.append(i)
else:
words[len(words)-1] = words[len(words)-1] + i
for word in words:
length.append(len(word))
if words[1] == "=":
if words[2] in vars:
vars[words[0]] = vars[words[2]]
elif words[2][0] == "\"":
vars[words[0]] = line[(length[0] + length[1] + 3):len(line)-1]
else:
vars[words[0]] = words[2]
elif words[0] == "print":
if words[1] in vars:
print (vars[words[1]])
elif words[1][0] == "\"":
print (line[7:len(line)-1])
else:
print (line[6:len(line)])
else:
print ("Error: Command not recognised.")
time.sleep(2)
I have not gotten that far yet. I am trying to learn from a book so it might take a bit of time.
PaddlerGames
Scratcher
1000+ posts

Python Programing

Scratch is basically python, but with blocks.
Rumanti
Scratcher
1000+ posts

Python Programing

PaddlerGames wrote:

Scratch is basically python, but with blocks.
How? If it is true, you can say “JavaScript is basically Python, but with rather different commands.” It's not.
DrummerCat
Scratcher
8 posts

Python Programing

exec("print(chr((1<<6)+(2<<2))+'!bdcldreofwg hoiljlke')")
DrummerCat
Scratcher
8 posts

Python Programing

DrummerCat wrote:

exec("print(chr((1<<6)+(2<<2))+'!bdcldreofwg hoiljlke')")
I meant:
exec("print(chr((1<<6)+(2<<2))+'!bdcldreofwg hoiljlke')")
or
print(chr((1<<6)+(2<<2))+'!bdcldreofwg hoiljlke')
It's not working!

Last edited by DrummerCat (July 13, 2015 18:08:03)

navysmeagol_175
Scratcher
100+ posts

Python Programing

DrummerCat wrote:

DrummerCat wrote:

exec("print(chr((1<<6)+(2<<2))+'!bdcldreofwg hoiljlke')")
I meant:
exec("print(chr((1<<6)+(2<<2))+'!bdcldreofwg hoiljlke')")
or
print(chr((1<<6)+(2<<2))+'!bdcldreofwg hoiljlke')
It's not working!
what version are you using
TheMinecraftX1
Scratcher
16 posts

Python Programing

I started learning Python on Christmas 2014 and now I am looking at the source code.
mariokartman6
Scratcher
28 posts

Python Programing

LimitedImagination wrote:

I don't want to do anything really bad, just change my friend's desktop background to my nose.



XD
jossel1
Scratcher
100+ posts

Python Programing

You learned how ???
  I'm looking for a site to learn quite easily
stevenwatson011
Scratcher
100+ posts

Python Programing

I had taken the classes to learn python. It's very easy. It takes three months to grasp the whole code.
navysmeagol_175
Scratcher
100+ posts

Python Programing

does python have threads?
__init__
Scratcher
1000+ posts

Python Programing

navysmeagol_175 wrote:

does python have threads?
Yes, of course. Everything has threads.

Even Scratch has threads. (kinda)
navysmeagol_175
Scratcher
100+ posts

Python Programing

__init__ wrote:

navysmeagol_175 wrote:

does python have threads?
Yes, of course. Everything has threads.

Even Scratch has threads. (kinda)
how do you use python threads?

Last edited by navysmeagol_175 (Aug. 12, 2015 19:16:34)

Powered by DjangoBB