Re: Moving away from BGT and learning python

2018-04-05 Thread AudioGames . net Forum — Developers room : magurp244 via Audiogames-reflector


  


Re: Moving away from BGT and learning python

Another term for it is namespace, any variables declared in a function stay in a function, unless explicitly returned to the caller to prevent conflicts with other variables outside the given space. Other than using globals, what you can also do is set it up so X is filled with a returned value the function gives back that updates it with a new value, for example:def my_fun(a):
a = a + 1
x = a
print(a)
print(x)
return x

x = 3
x = my_fun(x)
print xKeep in mind that if you use a return call in a function, the function will end and anything beyond the return call will be ignored, so be sure to put it at the end or in places where you want the function to end.

URL: http://forum.audiogames.net/viewtopic.php?pid=358431#p358431




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: Moving away from BGT and learning python

2018-04-05 Thread AudioGames . net Forum — Developers room : thggamer via Audiogames-reflector


  


Re: Moving away from BGT and learning python

In Python, when you run the "my_fun" function, the variables are createdinside the function.When the function returns or when it ends, Python removes thevariables that are inside the function and restores thevariables that are declared outside it.This is called a namescope (the function has a namescope which theirvariables are declared, and the script has another).When you tipe x in the interpreter, you are referencing the x of thescript namescope because the function has already ended.Edit: to modify a variable inside a function, declare it as global so itcan be seen on the script namescope. See the example:>>> def set_x_and_print_it():...     global x...     x = 3...     print(x)...>>> set_x_and_print_it()3>>> x3

URL: http://forum.audiogames.net/viewtopic.php?pid=358426#p358426




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: Moving away from BGT and learning python

2018-04-05 Thread AudioGames . net Forum — Developers room : thggamer via Audiogames-reflector


  


Re: Moving away from BGT and learning python

In Python, when you run the "my_fun" function, the variables are createdinside the function.When the function returns or when it ends, Python removes thevariables that are inside the function and restores thevariables that are declared outside it.This is called a namescope (the function has a namescope which theirvariables are declared, and the script has another).When you tipe x in the interpreter, you are referencing the x of thescript namescope because the function has already ended.

URL: http://forum.audiogames.net/viewtopic.php?pid=358426#p358426




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: Moving away from BGT and learning python

2018-04-05 Thread AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector


  


Re: Moving away from BGT and learning python

so, consider the following code: Note: indentation is a greater than sign:def my_fun(a):>a = a + 1>x = a>print(a)>print(x)x = 3my_fun(x)So I now have a question. If you run this, you will be printed a value of 4 4. Now, here's the fun part. If you type in x in the interpreter it will say, clearly, 3, but wait. I had a statement in the my_fun function that should have set x to 4, so why is it 3? Ferther more, if you type in a, the following will appear:Traceback (most recent call last):                                                File "", line 1, in                                            NameError: name 'a' is not defined                                              but but but... I clearly set a to 4! So why, why in the world does the stupid thing reset and acts as though I have never defined a variable called a? After all, I did do it. So my question is how? How can I change the variable outside of a function instead of declaring a variable that lasts only till a function finishes running? Is it something to do with the return statement? I'd be really grateful for any help and would also appreciate if you provided a code snippid or some such.

URL: http://forum.audiogames.net/viewtopic.php?pid=358424#p358424




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: Moving away from BGT and learning python

2018-02-26 Thread AudioGames . net Forum — Developers room : pauliyobo via Audiogames-reflector


  


Re: Moving away from BGT and learning python

or you can run it from the CMD open the command prompt in the path in which your file is, and run python filename.pypost 42:This may not work, but you can try thisimport turtleI'll use the greater sighn for indentationwn = turtle.screenwhile 1:>title=str(input("enter the screen title"))>wn.title(title)>breakif the script should keep asking you the title, remove the break statement.REGARDS

URL: http://forum.audiogames.net/viewtopic.php?pid=353976#p353976





___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Moving away from BGT and learning python

2018-02-26 Thread AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector


  


Re: Moving away from BGT and learning python

No. Anywhere will do.

URL: http://forum.audiogames.net/viewtopic.php?pid=353967#p353967





___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Moving away from BGT and learning python

2018-02-26 Thread AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector


  


Re: Moving away from BGT and learning python

Does the file have to be in a certain location?

URL: http://forum.audiogames.net/viewtopic.php?pid=353960#p353960





___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Moving away from BGT and learning python

2018-02-26 Thread AudioGames . net Forum — Developers room : CAE_Jones via Audiogames-reflector


  


Re: Moving away from BGT and learning python

From the Python interpreter, you import it. If the file is HelloWorld.py, you would type>import HelloWorldAnd that would do it. I'm not sure that there's an easy way to repeat this without restarting the interpreter, though, if you make changes afterward.

URL: http://forum.audiogames.net/viewtopic.php?pid=353946#p353946





___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Moving away from BGT and learning python

2018-02-26 Thread AudioGames . net Forum — Developers room : magurp244 via Audiogames-reflector


  


Re: Moving away from BGT and learning python

Assuming your using IDLE that comes with python, the default configuration opens the python shell interpreter. If you open the File menu and select New File it will create a script window where you can write, save, load, and run scripts more directly, such as opening the Run menu and selecting Run Module. You can reconfigure IDLE to load with the script window by default instead of the shell in the Options menu under the General tab.

URL: http://forum.audiogames.net/viewtopic.php?pid=353945#p353945





___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Moving away from BGT and learning python

2018-02-26 Thread AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector


  


Re: Moving away from BGT and learning python

This might be a bit silly, but how do you run a file from an interpreter? Do you just paste in the file path?

URL: http://forum.audiogames.net/viewtopic.php?pid=353933#p353933





___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Moving away from BGT and learning python

2018-02-26 Thread AudioGames . net Forum — Developers room : CAE_Jones via Audiogames-reflector


  


Re: Moving away from BGT and learning python

Try saving it to a file, and run that. If the results are the same, something odd is happening (maybe spaces are showing up as the wrong character or something like that?). If it works from a file, then the interpreter is having trouble with pasting some things.

URL: http://forum.audiogames.net/viewtopic.php?pid=353926#p353926





___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Moving away from BGT and learning python

2018-02-26 Thread AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector


  


Re: Moving away from BGT and learning python

I am using a book called how to think like a computer scientist found at the following linkhttp://openbookproject.net/thinkcs/python/english3e/If you go to chapter 3, you'll see that the book suggests you to enhance the turtle program by allowing the user to set the title of the window and such. Trouble is, the input statement doesn't work. I'll post the code below, or at least the important part. import turtlewn = turtle.Screentitle = input("enter something")wn.title(title)If I run this, it would make the title thewn.title(title)Line instead of asking for input. I tried getting input before initializing the screen but, no luck.

URL: http://forum.audiogames.net/viewtopic.php?pid=353923#p353923





___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Moving away from BGT and learning python

2018-02-25 Thread AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector


  


Re: Moving away from BGT and learning python

alright: more problems. Yea! Who loves problems?When I pasted in the following, the python prompt returned me a big fat nothing.I will post the code below, using > again to represent a single space.>user_input = input("enter something")>if user_input == "hi":>>print("hello") #this causes an error with the indentationThat script does nothing at all besides the error.It also should be noted that I have tried something like this:>user_input = input("enter something.")>if user_input == "hi":>print("hello") #the script returns another error about the indentation.Finally, I have tried something like this:>user_input = input("enter something")>if user_input == "hi":print("hello") #this is the only part that works. The input and the if statement get skipped.

URL: http://forum.audiogames.net/viewtopic.php?pid=353775#p353775





___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Moving away from BGT and learning python

2018-02-25 Thread AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector


  


Re: Moving away from BGT and learning python

alright: more problems. Yea! Who loves problems?When I pasted in the following, the python prompt returned me a big fat nothing.I will post the code below, using > again to represent a single space.>user_input = input("enter something")>if user_input == "hi":>>print("hello")That script does nothing at all.It also should be noted that I have tried something like this:>user_input = input("enter something.")>if user_input == "hi":>print("hello") #this script doesn't do anything besides just sitting there. the python returns nothing.

URL: http://forum.audiogames.net/viewtopic.php?pid=353775#p353775





___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Moving away from BGT and learning python

2018-02-25 Thread AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector


  


Re: Moving away from BGT and learning python

alright: more problems. Yea! Who loves problems?so when I paste in the script it says invalid indentation on line that says print("hello"). I will post the code below, using > again to represent a single space.>user_input = input("enter something")>if user_input == "hi":>>print("hello") #this line causes an error with the indentation.It also should be noted that I have tried something like this:>user_input = input("enter something.")>if user_input == "hi":>print("hello") #this script doesn't do anything besides just sitting there. the python returns nothing.

URL: http://forum.audiogames.net/viewtopic.php?pid=353775#p353775





___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Moving away from BGT and learning python

2018-02-25 Thread AudioGames . net Forum — Developers room : pauliyobo via Audiogames-reflector


  


Re: Moving away from BGT and learning python

you are missing the colons after the condition iftry putting this>user_input = input("enter something")>if user_input == "hi":>>print("hello")

URL: http://forum.audiogames.net/viewtopic.php?pid=353767#p353767





___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Moving away from BGT and learning python

2018-02-25 Thread AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector


  


Re: Moving away from BGT and learning python

so this is what i'm trying to paste into my python prompt. I think if someone can point out what am I doing wrong it would clear it up for me: (Note, I'll use a > symbol to represent a single space as AG forum doesn't like python's indentation.)>user_input = input("enter something")>if user_input == "hi">>print("hello")I'm sorry for so many questions guys, I'm trying to understand this.

URL: http://forum.audiogames.net/viewtopic.php?pid=353766#p353766





___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Moving away from BGT and learning python

2018-02-25 Thread AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector


  


Re: Moving away from BGT and learning python

so this is what i'm trying to paste into my python prompt. I think if someone can point out what am I doing wrong it would clear it up for me: user_input = input("enter something") if user_input == "hi"  print("hello")I'm sorry for so many questions guys, I'm trying to understand this.

URL: http://forum.audiogames.net/viewtopic.php?pid=353766#p353766





___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Moving away from BGT and learning python

2018-02-25 Thread AudioGames . net Forum — Developers room : pauliyobo via Audiogames-reflector


  


Re: Moving away from BGT and learning python

for example you do thisthink this is the interpreter>>> input = raw_input("enter something")>>> if input == 'hi':...  print "hello"... this means after you write the code you'll have to press enter one more time and the interpreter will execute your code.note: I'm using indentations with 1 space only

URL: http://forum.audiogames.net/viewtopic.php?pid=353709#p353709





___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Moving away from BGT and learning python

2018-02-24 Thread AudioGames . net Forum — Developers room : CAE_Jones via Audiogames-reflector


  


Re: Moving away from BGT and learning python

You need to press enter so that Python knows you're done with the indented part.

URL: http://forum.audiogames.net/viewtopic.php?pid=353683#p353683





___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Moving away from BGT and learning python

2018-02-24 Thread AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector


  


Re: Moving away from BGT and learning python

I'm not sure I understand? When do I paste in a blank line?  If you're talking  about me having code after the if statement, yes, I do.

URL: http://forum.audiogames.net/viewtopic.php?pid=353681#p353681





___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Moving away from BGT and learning python

2018-02-24 Thread AudioGames . net Forum — Developers room : magurp244 via Audiogames-reflector


  


Re: Moving away from BGT and learning python

Another way to do it would be to save your script in notepad or similar text editor and run it from a command prompt, as python files are just plain text files with a renamed extension. For example: "python yourscript.txt", though to avoid confusion between file types you should probably save your scripts with a *.py extension instead of *.txt.

URL: http://forum.audiogames.net/viewtopic.php?pid=353676#p353676





___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Moving away from BGT and learning python

2018-02-24 Thread AudioGames . net Forum — Developers room : magurp244 via Audiogames-reflector


  


Re: Moving away from BGT and learning python

Another way to do it would be to save your script in notepad or similar text editor with a *.py extension and run it from a command prompt, as python files are just text files with a renamed extension. For example: "python yourscript.py".

URL: http://forum.audiogames.net/viewtopic.php?pid=353676#p353676





___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Moving away from BGT and learning python

2018-02-24 Thread AudioGames . net Forum — Developers room : CAE_Jones via Audiogames-reflector


  


Re: Moving away from BGT and learning python

When you start something like an if, while, class, or function, Python expects an indented block to follow. The editor therefore waits until you enter an unindented line, or leave a blank line, before it tries to execute the code.If you're pasting an if with a block attached, I'm not really sure what's going on.

URL: http://forum.audiogames.net/viewtopic.php?pid=353672#p353672





___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Moving away from BGT and learning python

2018-02-24 Thread AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector


  


Re: Moving away from BGT and learning python

so now I'm getting into if statements, and just pasting the contense of the file doesn't work. I want to get input from the user then use if statements to print out different messages depending on what was entered, however, when I paste it into the python prompt it just sits there. no errors, no anything. what am I missing here?

URL: http://forum.audiogames.net/viewtopic.php?pid=353670#p353670





___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Moving away from BGT and learning python

2018-02-24 Thread AudioGames . net Forum — Developers room : CAE_Jones via Audiogames-reflector


  


Re: Moving away from BGT and learning python

I usually just save to a file with notepad, then run it in python by importing . IIRC, this doesn't work so well if you want to test changes, since I don't think python will update the module if you try to import it again, unless it failed to import via an error or something. Could have that backward, though.

URL: http://forum.audiogames.net/viewtopic.php?pid=353667#p353667





___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Moving away from BGT and learning python

2018-02-24 Thread AudioGames . net Forum — Developers room : pauliyobo via Audiogames-reflector


  


Re: Moving away from BGT and learning python

you can do by pressing alt plus space, edit, paste

URL: http://forum.audiogames.net/viewtopic.php?pid=353658#p353658





___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Moving away from BGT and learning python

2018-02-24 Thread AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector


  


Re: Moving away from BGT and learning python

I have a slight issue. when ever trying to type a script in a notepad and pasting it into the python the ctrl v doesn't work. anyway I can paste?

URL: http://forum.audiogames.net/viewtopic.php?pid=353650#p353650





___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Moving away from BGT and learning python

2018-02-24 Thread AudioGames . net Forum — Developers room : Hrvoje via Audiogames-reflector


  


Re: Moving away from BGT and learning python

Let me add something:I personally prefere to enclose strings in quotes, unless I have the following situation, for example, if I wanna have a message box that displays the user to click a button. I want the name of that button to be quoted, so I will enclose this in apostrophes like this:'Please click "OK" to continue'That way, I don't need to escape quotes to force displaying them inside a string by using escape sequence \" (backslash quote).

URL: http://forum.audiogames.net/viewtopic.php?pid=353640#p353640





___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Moving away from BGT and learning python

2018-02-24 Thread AudioGames . net Forum — Developers room : Hrvoje via Audiogames-reflector


  


Re: Moving away from BGT and learning python

You basically use triple quotes or triple ticks when you want to write multiline strings. This does not mean that string needs to be necessarily multiline, but writing single-line strings in tripple quotes makes no sense, although it's not an error.Of course, instead of using multiline strings, you can just use escape sequences such as \n or \r, but it makes things less readable for code writer. For example:"I'm a good boy.\nI'm the best guy in school.\nMy friends really like me."Compare with this:"""I'm a good boy.I'm the best guy in school.My friends really like me."""You see, the second version as multiline string is much more readable.

URL: http://forum.audiogames.net/viewtopic.php?pid=353637#p353637





___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Moving away from BGT and learning python

2018-02-24 Thread AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector


  


Re: Moving away from BGT and learning python

so one of my first many questions to come.when creating strings, why cant I just use tripple quotes or ticks all the time? is there a disadvantige in doing so?

URL: http://forum.audiogames.net/viewtopic.php?pid=353618#p353618





___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Moving away from BGT and learning python

2018-02-20 Thread AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector


  


Re: Moving away from BGT and learning python

True. What makes .NET so nice is that you can mix managed and unmanaged code. Also, about pointers, pointers in C++ are not as scary as some people make them out to be. In fact, they're very easy to work with. You usually never have to do manual pointer cleanup because C++ usually handles that for you either upon program exit or upon scope exit. And with C++11, 14 and 17's new STL components, you now have std::smart_ptr and std::shared_ptr to use too, which both free themselves when no longer used.

URL: http://forum.audiogames.net/viewtopic.php?pid=353153#p353153





___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Moving away from BGT and learning python

2018-02-20 Thread AudioGames . net Forum — Developers room : Kyleman123 via Audiogames-reflector


  


Re: Moving away from BGT and learning python

There still are pointers in c++. While it is encouraged to pass things as reference or const reference, pointers are still okay to use and perfectly acceptable in the language.

URL: http://forum.audiogames.net/viewtopic.php?pid=353106#p353106





___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Moving away from BGT and learning python

2018-02-20 Thread AudioGames . net Forum — Developers room : gjp1311 via Audiogames-reflector


  


Re: Moving away from BGT and learning python

Personally I'm very found of C# and the whole .NET environment. The language has the same learning curve as Java, though I think the ecosystem in .NET is easier to get around.With this language you are able to use lambdas and functional programming concepts that Python has, without any trouble. And for what I'm seeing, this BGT seems like C and C++. I think the advantage of working with C# (And Java for that matter) is using managed code.You won't be needing to worry about memory and pointers too much. You don't have pointers as in c and c++, but objects are references. It's easier for sure, but can be tricky sometimes.I learned a bit of Python, but as I have worked my entire life with C-like languages, I found it very annoying to have to structure the code using only tabs and spaces. But I like very much the functional aspect of the language.And as a plus, Visual Studio Community is very accessible.https://www.reddit.com/r/programming/co … o_2017_to/https://youtu.be/iWXebEeGwn0

URL: http://forum.audiogames.net/viewtopic.php?pid=353050#p353050





___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Moving away from BGT and learning python

2018-02-20 Thread AudioGames . net Forum — Developers room : gjp1311 via Audiogames-reflector


  


Re: Moving away from BGT and learning python

Personally I'm very found of C# and the whole .NET environment. The language has the same learning curve as Java, though I think the ecosystem in .NET is easier to get around.With this language you are able to use lambdas and functional programming concepts that Python has, without any trouble. And for what I'm seeing, this BGT seems like C and C++. I think the advantage of working with C# (And Java for that matter) is using managed code.You won't be needing to worry about memory and pointers too much. You don't have pointers as in c and c++, but objects are references. It's easier for sure, but can be tricky sometimes.I learned a bit of Python, but as I have worked my entire life with C-like languages, I found it very annoying to have to structure the code using only tabs and spaces. But I like very much the functional aspect of the language.And as a plus, Visual Studio Community is very accessible.https://www.reddit.com/r/programming/co … o_2017_to/

URL: http://forum.audiogames.net/viewtopic.php?pid=353050#p353050





___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Moving away from BGT and learning python

2018-02-20 Thread AudioGames . net Forum — Developers room : gjp1311 via Audiogames-reflector


  


Re: Moving away from BGT and learning python

Personally I'm very found of C# and the whole .NET environment. The language has the same learning curve as Java, though I think the ecosystem in .NET is easier to get around.With this language you are able to use lambdas and functional programming concepts that Python has, without any trouble. And for what I'm seeing, this BGT seems like C and C++. I think the advantage of working with C# (And Java for that matter) is using managed code.You won't be needing to worry about memory and pointers too much. You don't have pointers as in c and c++, but objects are references. It's easier for sure, but can be tricky sometimes.I learned a bit of Python, but as I have worked my entire life with C-like languages, I found it very annoying to have to structure the code using only tabs and spaces. But I like very much the functional aspect of the language.

URL: http://forum.audiogames.net/viewtopic.php?pid=353050#p353050





___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Moving away from BGT and learning python

2018-02-19 Thread AudioGames . net Forum — Developers room : CAE_Jones via Audiogames-reflector


  


Re: Moving away from BGT and learning python

You can get an equivalent to NPEs in Python, can't you? I mean, doesn't the exact same principal apply to trying to call a.f() if a is null or if a is None?Basically, you can't expect that a function or method will never be called with invalid arguments, so the very first thing you should do is to confirm that the arguments are valid. A simple "if a is None : return False", or whatever the appropriate default is, or throwing an error, works well enough in most cases I encounter Is it a style thing? Java has ludicrous style conventions, like making absolutely everything into classes, making new classes for extremely specific exceptions, overly verbose class names, package conventions that amount to a lot of wasted space... But those are just style conventions, and unless you're working with a package that has already gone too far down that rabit hole to be salvageable, you can basically treat Java like most C-style languages, just without a global context, right?I basically gave up on Java when BGT and Python proved all around better for my purposes, so if some updates in the past 5 or so years have enforced the tedious clutter, then I missed it.

URL: http://forum.audiogames.net/viewtopic.php?pid=353012#p353012





___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Moving away from BGT and learning python

2018-02-19 Thread AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector


  


Re: Moving away from BGT and learning python

@Hrvoje, most of the issues you pointed out, like null pointer exceptions, can be gotten around easily. For example, in C++, you'd either use a library that *doesn't* use NULL or nullptr, or you'd do checks for them.

URL: http://forum.audiogames.net/viewtopic.php?pid=353010#p353010





___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Moving away from BGT and learning python

2018-02-19 Thread AudioGames . net Forum — Developers room : Hrvoje via Audiogames-reflector


  


Re: Moving away from BGT and learning python

Well, honestly. Python's indentation is may be the only thing that may frustrate beginner users. However, Python is a piece of heaven comparing to some other languages where you get frustrated with null pointer exceptions, data conversions, not to mention that it's quite easy to forget to enclose braces when you have lots of nested blocks. I'm using Java at work, and I've realised how I miss Python, although I'm still using it for writing NVDA addons and some other private stuff. Python is far from perfect, because nothing in this world is perfect, but Python is very popular and saves your time a lot, at least from my experience. For me it's more important to get things done as soon as possible, than spending weeks of work on something that I can get in a single day. Life is too short for that.

URL: http://forum.audiogames.net/viewtopic.php?pid=352973#p352973





___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Moving away from BGT and learning python

2018-02-18 Thread AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector


  


Re: Moving away from BGT and learning python

I'm currently writing a large application and have written everything in notepad. I haven't used an IDE at all, unless you count the VC++ command-line developer tools as an 'IDE'. Also, the smart string concatenation that people are referring to is either of the following, if I'm following your wavelengths:1. Printf-style formatting, i.e.:printf ("%s %.3f\n", "Pi is equal to", 3.14159); // prints pi is equal to 3.141.2. Boost.format-style syntax:#include #include std::string s2 = boost::str(boost::format::format("%2% %1%") % 36 % 77 );(Taken from http://www.boost.org/doc/libs/1_66_0/li … rmat.html; lots more examples there.)(I admit, this method is a bit more clunky.)There is, of course, the optional third way of doing things:3. IOStreams-style formatting (setf/setw). Example at http://en.cppreference.com/w/cpp/io/ios_base/setfThere are probably a lot more ways of string concatenation. One other way is through stringstreams:#include using namespace std;stringstream ss;ss << data;ss << data << data << ...;// Repeat until you've got all your data in the stringstream Or you can make a set of <// ss << data << data << ... << data;// Get final stringstring data = "">

URL: http://forum.audiogames.net/viewtopic.php?pid=352843#p352843





___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Moving away from BGT and learning python

2018-02-18 Thread AudioGames . net Forum — Developers room : CAE_Jones via Audiogames-reflector


  


Re: Moving away from BGT and learning python

Yeah. I find that, while IDEs reduce some of the work, they make up for it with clutter and navigation and gah just let me write the code in a text editor, read the compilation results, and test the thing. Notepad + the command prompt is generally sufficient, but Python.exe launches a useful terminal, also.

URL: http://forum.audiogames.net/viewtopic.php?pid=352834#p352834





___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Moving away from BGT and learning python

2018-02-18 Thread AudioGames . net Forum — Developers room : Guitarman via Audiogames-reflector


  


Re: Moving away from BGT and learning python

Hi Amerikranian.Goodness, I am tired of hearing stupid stuff like this! Yes you can use notepad to write python programs no problem. I've seen this in many python tutorials, "Don't use notepad, it's very bad!" If it's easier for you to use notepad then go ahead. You can still run scripts with the command prompt if you really want to later. Just keep in mind that the books are wrong about things sometimes.Hth.

URL: http://forum.audiogames.net/viewtopic.php?pid=352811#p352811





___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Moving away from BGT and learning python

2018-02-18 Thread AudioGames . net Forum — Developers room : Jaseoffire via Audiogames-reflector


  


Re: Moving away from BGT and learning python

Yeah, I was mainly talking about the conditional stuff like switch case statements and the ternary operator. Python's constant if/elif/else blocks feel repetative to type. In C/C++ (Which admittedly is beginning to put this language back in my good graces over Java) is the preprocessor which allows for macros and that sort of thing. Plus, more as a personal preference, I prefer the braces to the forced tabbing system. In C/C++/Java, if I forget a tab somewhere, the compiler and or program is not going to yell at me about it. Not to say anyone that I might be working with on a project won't mind you, but I'd rather have them angry at me when it would be a simple correction requiring little trouble of retesting stuff. I can write the program as I wish and if it works, I know it isn't a blocking issue because I forgot a tab somewhere. If it's a nice enough IDE, a lot of the brace stuff is handled for me as well. Celebrating your existence, Eclipse.

URL: http://forum.audiogames.net/viewtopic.php?pid=352800#p352800





___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Moving away from BGT and learning python

2018-02-18 Thread AudioGames . net Forum — Developers room : Jaseoffire via Audiogames-reflector


  


Re: Moving away from BGT and learning python

Yeah, I was mainly talking about the conditional stuff like switch case statements and the ternary operator. Python's constant if/elif/else blocks feel repetative to type. In C/C++ (Which admittedly is beginning to put this language back in my good graces over Java) is the preprocessor which allows for macros and that sort of thing. Plus, more as a personal preference, I prefer the braces to the forced tabbing system. In C/C++/Java, if I forget a tab somewhere, the compiler and or program is not going to yell at me about it.

URL: http://forum.audiogames.net/viewtopic.php?pid=352800#p352800





___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Moving away from BGT and learning python

2018-02-18 Thread AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector


  


Re: Moving away from BGT and learning python

so the book says not to use notepad. Is there any other edetors that you'd suggest? I don't want to go try a random one in case of it not being accessible.

URL: http://forum.audiogames.net/viewtopic.php?pid=352787#p352787





___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Moving away from BGT and learning python

2018-02-18 Thread AudioGames . net Forum — Developers room : Amit via Audiogames-reflector


  


Re: Moving away from BGT and learning python

Hi,Actually the %s thing is still valid in python 3 as I just checked it out. IF you don't want to use it then you can use the power feature introduced in python, called f strings or formated strings. like this: name="amit"print(f"hi {name{!")As you can see this is much more simpler than that %S or other methods to do this.Regards,Amit

URL: http://forum.audiogames.net/viewtopic.php?pid=352770#p352770





___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Moving away from BGT and learning python

2018-02-18 Thread AudioGames . net Forum — Developers room : Orin via Audiogames-reflector


  


Re: Moving away from BGT and learning python

What's the V3 way of doing things?

URL: http://forum.audiogames.net/viewtopic.php?pid=352764#p352764





___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Moving away from BGT and learning python

2018-02-18 Thread AudioGames . net Forum — Developers room : pauliyobo via Audiogames-reflector


  


Re: Moving away from BGT and learning python

oh I see

URL: http://forum.audiogames.net/viewtopic.php?pid=352734#p352734





___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Moving away from BGT and learning python

2018-02-18 Thread AudioGames . net Forum — Developers room : ironcross32 via Audiogames-reflector


  


Re: Moving away from BGT and learning python

that %s stuff is the old way of doing things, you don't do that in python 3

URL: http://forum.audiogames.net/viewtopic.php?pid=352727#p352727





___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Moving away from BGT and learning python

2018-02-18 Thread AudioGames . net Forum — Developers room : pauliyobo via Audiogames-reflector


  


Re: Moving away from BGT and learning python

@post 10:smart string concatenation? I think this is pretty smart name = "paul"surname = "iyobo"print "hi %s, %s" % (name, surname)or maybe I totally missunderstood what you were saying

URL: http://forum.audiogames.net/viewtopic.php?pid=352710#p352710





___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Moving away from BGT and learning python

2018-02-17 Thread AudioGames . net Forum — Developers room : CAE_Jones via Audiogames-reflector


  


Re: Moving away from BGT and learning python

a= (b) ? c : d; switch (e) {case f : g(); break;case h : i(); break;}And then there are c-style macros.Python is supremely simpler overall, but I do need the terniary operation far more often than swapping.Yeah, Python eventually added its own version (which is annoying to port, since it puts the arguments in a different order), but it's not as quick as a=(b)?c:d; But that's all I can think of that python does less conveniently. ... Well, that and the lack of smart string concatenation.

URL: http://forum.audiogames.net/viewtopic.php?pid=352692#p352692





___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Moving away from BGT and learning python

2018-02-17 Thread AudioGames . net Forum — Developers room : Amit via Audiogames-reflector


  


Re: Moving away from BGT and learning python

Hi,At post number 7,, excuse me please, but what kind of c/c++ syntax are you talking about? I know some c++ and what I've always seen that a c++ programmer is always bigger compared to a python program. And python is so simple too. To support this, look some python below.a=5b=10a,b=b,awhat the above code did is that it swapped the values those two variables, a and b contained. Imagine doing this in c/c++ or BGT. To do this you will need a third variable.Regards,Amit

URL: http://forum.audiogames.net/viewtopic.php?pid=352689#p352689





___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Moving away from BGT and learning python

2018-02-17 Thread AudioGames . net Forum — Developers room : Guitarman via Audiogames-reflector


  


Re: Moving away from BGT and learning python

Hi.Both python 2 and 3 both have pip now, you just need to edit the systems variables. Pip won't respond in command prompt unless you do this. Python's syntax is very simple, especially for making small utilities and things like that.You should take a look at the documentation, then read something like dive into python or one of those.Hth.

URL: http://forum.audiogames.net/viewtopic.php?pid=352664#p352664





___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Moving away from BGT and learning python

2018-02-17 Thread AudioGames . net Forum — Developers room : Jaseoffire via Audiogames-reflector


  


Re: Moving away from BGT and learning python

Oh. Thank goodness. I'm getting really tired of BGT and my antivirus having a civil war on my computer, so hopefully seeing more developers migrating away from it might solve most of those issues. Probably not all of them because antivirus software is...well...odd, but still. I'd also add don't neglect the documentation on the website, and poking around Stack Overflow and google. While python is not my favorite language as it lacks several of the nice time saving syntax found in C family languages, I won't deny that it is not too difficult to learn.

URL: http://forum.audiogames.net/viewtopic.php?pid=352658#p352658





___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Moving away from BGT and learning python

2018-02-17 Thread AudioGames . net Forum — Developers room : cartertemm via Audiogames-reflector


  


Re: Moving away from BGT and learning python

make sure pip is in your path, and if its not, add it.go to the run dialog, type SystemPropertiesAdvanced, click environment variables, tab down to the system variables list, find path, click edit.Go to the end of this text. Now you'll have to add the path of pip, assuming your using py3 this is c:\Python36\scripts\pip.exenote: ; (semicolon) is used as the delimiter here, so the end should look like c:\some\random\thing;c:\Python36\scripts\pip.exeHTH

URL: http://forum.audiogames.net/viewtopic.php?pid=352615#p352615





___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Moving away from BGT and learning python

2018-02-17 Thread AudioGames . net Forum — Developers room : Amit via Audiogames-reflector


  


Re: Moving away from BGT and learning python

Hi,Open command prompt by typing cmd in the run dialogue box and pressing enter. Now type pip install pygame pyinstaller libaudioverse. That was an example... This way you can install your libraries automatically. If this is not working, use the cd command to navigate to the scripts folder of where your python is installed (for example, cd c:\python36\scripts) and run the pip command as shown above.Regards,Amit

URL: http://forum.audiogames.net/viewtopic.php?pid=352601#p352601





___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Moving away from BGT and learning python

2018-02-17 Thread AudioGames . net Forum — Developers room : blink_wizard via Audiogames-reflector


  


Re: Moving away from BGT and learning python

I'm confused on that. I tryed entiring the pip command but nothing happens. Where do I type this? Very confused on where this goes...

URL: http://forum.audiogames.net/viewtopic.php?pid=352599#p352599





___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Moving away from BGT and learning python

2018-02-16 Thread AudioGames . net Forum — Developers room : Hrvoje via Audiogames-reflector


  


Re: Moving away from BGT and learning python

Python is a good choice because it's syntax is even easier than BGT. Everything is an object and everything is dynamic, so it's not required to declare data types.When I've started learning Python, which was somewhere in late 2009., I found a book called "A byte of Python". That introduced me to the Python world. Later on if you wish to expand your Python knowledge, read the book called "Dive into Python".My suggestion is go with Python 3, it's the future. Python2 has unicode issues that I faced many times while developing software with Python, and you will sooner or later have to deal with these issues. Python3 is unicode by default, which is something to expect from a programming language nowadays, since almost nobody now is using Windows 9X or ME where ANSI was a standard.You can use wxPython for making GUIs. Sighted developers on the Internet constantly recommend PyQT saying that it's the best, and may be it really is, however it has accessibility issues. BTW, I don't like to use the term The Best too much, .For communicating with screen readers, you have two options, the one is called Tolk and another one is called Accessible Output. However, the repository where accessible output is hosted seams to be currently down, so Tolk is the only good option right now. I'm combining Tolk with Pyttsx3, which is another python library for SAPI support.For 3D audio, you can use libaudioverse. For making games you have Pygame or Pyglet as a choice.For networking, you can use Twisted.And, for converting your Python script into executable, you have Py2Exe, CXFreeze or PyInstaller. I like PyInstaller, because generating exe is simple as writing pyinstaller with additional commandline options. I was using Py2Exe before, but it wasn't updated since 2014.And, most of Python libraries can be easily installed, updated or removed by using pip on command line e.g., pip install wxpython, pip install libaudioverse, pip install pygame, pip install pyinstaller.

URL: http://forum.audiogames.net/viewtopic.php?pid=352572#p352572





___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Moving away from BGT and learning python

2018-02-16 Thread AudioGames . net Forum — Developers room : magurp244 via Audiogames-reflector


  


Re: Moving away from BGT and learning python

Well the first step would be to download Python [here]. Some good books to start off with would be [A Byte of Python] and [How to Think Like a Computer Scientist], although you can find a bunch more [here].

URL: http://forum.audiogames.net/viewtopic.php?pid=352568#p352568





___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Moving away from BGT and learning python

2018-02-16 Thread AudioGames . net Forum — Developers room : blink_wizard via Audiogames-reflector


  


Moving away from BGT and learning python

Hi there,so very recently I decided to just finally move on and try something new. I want to do other things besides games etc, and I need to learn a better programming language than BGT. So...from a bgt user, what are some tips or resources to learn python. BGT is so simple that its hard to move away from, but it needs to be done. It is clear that it's done and it probably won't ever be updated again.

URL: http://forum.audiogames.net/viewtopic.php?pid=352554#p352554





___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector