PYquestions

i have py questions

for i in range(1,5) :
print i

want to make them 1234 not
1
2
3
4
how

what is the difference between == and =

or i in range (1,12):
print i
if i == 6 :
break
if i == 9 :
continue

why it won’t continue from 9

for i in range (1,12):
print i
if i == 6 :
break
if i == 9 :
continue
print i


why it didn’t repeate the 6 two times ?
1
1
2
2
3
3
4
4
5
5
6

i have somthing like 100 questions , i will post them here

and one last question

how can i fade the sound like in saluk file … i want explanation not a solvant …

new questions are comming … a lot of qestions … maybe advanced not like these

question

can someone explain the blendenzo marquee and scrolling text file
http://www.blendenzo.com/Files/Demos/ScrollAndTypeText.blend

i want someone to explain it line by line … lol ! i can understand a lot of things but not all the python script

  1. That would output 1,2,3,4
  2. = sets the value of a variable, == checks to see if a variable is equal to something
  3. cause break quits the loop so it would never reach the 9 which is also why it never reaches the second print statement
  4. and to fade the sound you have to like mabye you can reduce the volume of a sound actuator or mabye you have to use pygame and you can set the volume on that mabye like

if own.timer > ,2:
   own.timer = 0
   # Mabye this can work ?
   actuator.setVolume(actuator.getVolume()-.1)
   # OR in pygame it would be something similar

and scrolling text
i dunno and im too lazy to read through so heres some other code that will do it


text = own.Text.replace("","|$|").split("|$|")[1:-1]
# This inserts a random thing "|$|" between every letter then we split it at the symbol "|$|" so then we have a list of the
# letters in the string but with an extra empty letter at the beginning and the end so that [1:-1] gets only the letters
# between those
text.append(text.pop(0))
# This removes the beginning letter and appends it to the end
own.Text = "".join(text)
# This joins the text letters and sets it to the display text

and blendenzos probably does way more than mine and mabye ill look through it later
it’s a very nice demo though

Well I’ll answer what I can.

m = []
for i in range(1,5):
    m.append(i)
print m

Turning the results of " i " into a list format, for more on lists see Here

" == " is equal too, and " = " is change too. So to use in an argument.

if value == 2:
    string = 'blarg'

why it won’t continue from 9
Because you’ve broken the range at 6, so it never gets to 9.

why it didn’t repeate the 6 two times
Because you broke the first print at 6, thus only the second printed.

how can i fade the sound like in saluk file … i want explanation not a solvant …
Why is everybody so touchy about having examples posted to answer a question?
Anywho, have a timer start when you request the fade, and a 1.0 floating value, then use something like this…

volume=own.floating-(own.time/3.5)

Assuming you know the code for changing the volume, that means the volume is the same as your 1.0 float, minus own.time/3.5.

I can’t answer your last question, as I’ve never used the blend I’d be the wrong person to do so.

Hope I’ve helped.

Edit: Failed to refresh the page before posting, so didn’t see Scaboots’ explainations.

yooo , sweet answers … i want more of these answers , thanks too much …

In the argument he’s used it’d print em per value. To print it in it’s natural form you’d need to use

i = range(1,5)

thanks …