Re: Some Python Questions
Re: Some Python Questions I agree with Hektor.If you intend to write code and don't feel like rewriting, trying to recover deleted files and otherwise dealing with code that you didn't back up, then you need a version control system. I recommend git. As mentioned above you probably have a while to go before this will mean anything to you, but when it does I think you'll be glad of the advice.Also, deleting or otherwise messing up your code probably sounds like something you would never do and that you could easily recover from if you had backups, but there will come a time (whether a month or a year) when it will happen to you.The backup will be out-of-date or won't exist at all, the file will accidentally get deleted when you selected one-two-many directories when cleaning up your disk, someone will delete files in a shared dropbox folder and you don't want to / can't use the web interface to pull out an old version... Something will happen. Something versi on control could've saved you from.Hope the small rant will be helpful in the future . URL: http://forum.audiogames.net/viewtopic.php?pid=307449#p307449 ___ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: Some Python Questions
Re: Some Python Questions You probably can just install over the previous version since you are just talking about installing a minor release update. Pip is typically installed when you install Python. To access PIP from the command line, one method is to press Windows Key+R. This will bring up the run dialog. In that dialog type cmd and press enter. This will put you on a command line prompt. You can type PIP commands from there. In Windows 10, you can bring up a folder and select the File menu item. Under that is an option for opening a command line propmpt and make the current folder the working directory.When you get to the point where you want to start writing software you want to share, I would suggest checking into virtualenv. You also may want to look at using GIT at that point. However, it sounds like you are still learning the foundations of Python so you might want to wait a while before you get into those aspects of development. URL: http://forum.audiogames.net/viewtopic.php?pid=307329#p307329 ___ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: Some Python Questions
Re: Some Python Questions Formatting characters like those are more for inserting variables into strings, this can be useful if you want to input changing numbers or text into a static string. For example:import random number = random.randint(0,100) print "%i is a random number"%numberIn the above example, the random number will appear at the beginning of the string when printed because of the format symbol instead of at the end. Different formatting symbols are used for integrating different types of data into strings.Floating point is another word for Decimals, with things past the period representing a sub value. So 0.5 would be half of 1, 2.50 would be half of 5, etc. These have a wide variety of uses in programming such as physics, collision, and animation. URL: http://forum.audiogames.net/viewtopic.php?pid=306839#p306839 ___ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: Some Python Questions
Re: Some Python Questions Formatting characters like those are more for inserting variables into strings, this can be useful if you want to input changing numbers or text into a static string. For example:import random number = random.randint(0,100) print "%i is a random number"%numberIn the above example, the random number will appear at the beginning of the string when printed because of the format symbol instead of at the end. Different formatting symbols are used for integrating different types of data into strings.Floating point is another word for Decimals, with things past the period representing a sub value. So 0.5 would be half of 1, 2.50 would be half of 5, etc. These have a wide variety of uses in programming, though can at times cause headaches in some networking applications. URL: http://forum.audiogames.net/viewtopic.php?pid=306839#p306839 ___ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: Some Python Questions
Re: Some Python Questions HelloWell I'm doing well with learning python but I ran into a couple more questions.I was writing code, learning how to use variables. I got into strings, and the book said something about using python formatting characters. The ones I used were %s, %r, and %d. What do these do? He didn't explain at all. I googled this, but I didn't understand it when I read the python reference. I also checked out stack overflow, but it just said that these are old string characters. I've looked at the script I've written but I can't make sense of what these do. Like I said I'm reading learn python the hard way, and using python 2.7.My other question is what do floating point variables do? I had a variable, passengers = 4.0 and I erased the . to see what it did but I couldn't figure the calculation that it made with and without the period. Why would I use a floating point variable in a program? URL: http://forum.audiogames.net/viewtopic.php?pid=306836#p306836 ___ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: Some Python Questions
Re: Some Python Questions There's Python 2 to 3 convert script if you really need to feel the difference. However, once you get enough Python coding experience, you'll be able to transition to Python3 easily.Yep, the bad fact is that many libraries are still incompatible with Python3, and that's why many devs stick with 2. For example, NVDA is stil maintained in Python2, because wxPython Phoenix for Py3 is still under development, there's no Scons for Python3 (I believe), and they wanna keep XP compatibility for some time. I think Chicken Nugget and TWBlue are also written in 2 due to wxPython and some other that currently work better with Py2. URL: http://forum.audiogames.net/viewtopic.php?pid=306614#p306614 ___ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: Some Python Questions
Re: Some Python Questions Hello.Thanks for all the posts! I appreciate hearing your thoughts and opinions. Yes Ethin I am using python 2, because learn python the hard way is written for python 2 and I want my code to match up with the book's examples to understand what I'm doing. I have no problem using python 3 in the future, but I think for now I'll learn python 2 until I get the hang of things. The book might have been rewritten to talk about python 3, but I'm reading the free online version, which is about python 2 exclusively.@Ethin, I'm assuming from your posts that you use python. I'm curious what kinds of things do you use it for? This is actually off-topic it's not a programming question I just wondered what you use it for URL: http://forum.audiogames.net/viewtopic.php?pid=306350#p306350 ___ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: Some Python QUestions
Re: Some Python QUestions Ethin wrote:@magurp244, you have a point. However, I do not see any reasons why we should still use it. The only reason I can think of is that there are still more libraries available for Python 2. The rift created by the two versions is quite good for us. If you have read the changelog for Python 3 you will find quite a bit of new things. Python2 is worse than Python3: it has multiple string types and is generally harder to use. If people would just use the tools the PSF has provided than this wouldn't be a problem.Python 2 is not actually harder to learn, nor to use than Python 3. The syntax is nearly the same, some classes were renamed and some new features added, but nearly nothing removed. Always thought that more string types could somehow be positive? The string-decision Python 3 now includes internally, which reduces the string types to just one type at all, produces some significant overhead whi ch can be kind of time-consuming on some time-efficient algorithms, just to name one case where Python 3 can be less efficient than Python 2. Yeah, you can reduce this overhead with some intelligent casting, but as soon as you understand this way of coding, you should also not have any problem learning Python 2.I think it's cool that he looks into Python, no matter which version, and I also guess it's the wrong way to tell him anything about "use this, don't use that", since this will just cause confusion on his side of the line. Could we just stop discussing this stuff? Python 2 is absolutely alright for some beginners, and if he knows Python 2 well, thanks to the python 2to3 utility provided by Python itself, there shouldn't be any problem switching to Python 3 afterwards.For now we should just concentrate on answering his questions as best as possible.Best regards.Hijacker URL: http://forum.audiogames.net/viewtopic.php?pid=306180#p306180 ___ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: Some Python QUestions
Re: Some Python QUestions @magurp244, you have a point. However, I do not see any reasons why we should still use it. The only reason I can think of is that there are still more libraries available for Python 2. The rift created by the two versions is quite good for us. If you have read the changelog for Python 3 you will find quite a bit of new things. Python2 is worse than Python3: it has multiple string types and is generally harder to use. If people would just use the tools the PSF has provided than this wouldn't be a problem. URL: http://forum.audiogames.net/viewtopic.php?pid=306161#p306161 ___ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: Some Python QUestions
Re: Some Python QUestions Attempting to force people to switch won't make v3 more popular, and its not up to you or I to decide what version a person chooses to use given their current needs. The practical differences between the two versions are negligible so transitioning isn't that difficult, and there are still some reasons for using it. Even if Python 2 were dropped tomorrow it wouldn't stop people from using it anymore than depreciating QBasic stopped people from using QBasic, or Pascal, etc.If you want to blame someone for the current situation, then blame Guido van Rossum. Breaking reverse compatibility in v3 and creating a rift between the versions was his choice, and created this problem in the first place. URL: http://forum.audiogames.net/viewtopic.php?pid=306065#p306065 ___ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: Some Python QUestions
Re: Some Python QUestions I sincerely hope you are not learning Python 2... because if you are, it's going to be a difficult transition for you when Python 2 is officially declared unsupported and deprecated (and, if I get my way, that will be soon). I say that because developers have become too reliant on Python 2 and the only way to get Python3 more popular is to force the change on them since it seems like they are unwilling to do it themselves, despite the Python foundation supplying them with all the tools necessary to help with the transition. URL: http://forum.audiogames.net/viewtopic.php?pid=306032#p306032 ___ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: Some Python QUestions
Re: Some Python QUestions Thanks. The way it was written in the book it seemed like I missed something somewhere. URL: http://forum.audiogames.net/viewtopic.php?pid=305923#p305923 ___ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: Some Python QUestions
Re: Some Python QUestions Well you could delete the lines, but yes your idea is fine. Its fairly common for programmers to comment out code they don't want to necessarily delete in order to test segments or what have you. URL: http://forum.audiogames.net/viewtopic.php?pid=305909#p305909 ___ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Some Python QUestions
Some Python QUestions Hi.I'm making this topic because I am trying hard to learn python, and I am determined to succeed this time. So I don't have to create a new topic every time I have a question, I'm creating this so that whenever I have a programming question I can just post here to make it easy for me and for anyone who is willing to help me.Right now I'm reading learn python the hard way, I did exercise zero and one and the study drills in exercise one. Exercise one is just printing text to the screen which I did. It said to put a # character at the beginning of one of the lines which I did, I know you use the # character to write a comment in python. My question is- one of the study drills says to make my script only print one of the lines of my script to the screen. So how do I do that? The only thing I can think to do is put a # character at the beginning of each line to make them comments and just leave one line without a # character so it only prints that line . Is this the correct way to do this? I can't think of any other way to make the script print only one line of text. If there is another way could you please tell me? URL: http://forum.audiogames.net/viewtopic.php?pid=305892#p305892 ___ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: Some python questions.
Re: Some python questions. Typ at the end of the script a = raw_input() URL: http://forum.audiogames.net/viewtopic.php?pid=267634#p267634 ___ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: Some python questions.
Re: Some python questions. in reply to your first question, I think your dealing with a script that doesn't have any user interaction. If you press enter, the program will run, but will stay active only until all the system operations have been completed. I recommend browsing to the directory and manually typing python script.py from the commandline URL: http://forum.audiogames.net/viewtopic.php?pid=267310#p267310 ___ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Some python questions.
Some python questions. Hi everyone.I need your help in python.1. Whenever I write a program, my window just disappears instantly. It means that, if I run my program, a program window appears and disappears after 3 seconds, even before I test the program. How can I solv this?When I did autoit, I had to run a sleep loop that pauses my program every time but I think it is bad. Any ideas on how to solv this?2. I'm wondering about the soundhandler module that was presented above. Where do I download it?Thanks for your help. URL: http://forum.audiogames.net/viewtopic.php?pid=267296#p267296 ___ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: Some python questions
Re: Some python questions Hi.How are you trying to install the packages?I never had any problems installing them from pypi using pip. URL: http://forum.audiogames.net/viewtopic.php?pid=265533#p265533 ___ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: Some python questions
Re: Some python questions According to this bug report filed almost a month ago, it seems pefile's Python 3.x support was recently added and is still a bit buggy, which may be related to your issue. One of the posters linked to a possible fix:stephenrauch commented 23 days agopefile recently added py3 support, and it still has a few challenges. It appears that pefile has a utf-8 encoded character at that position (208687), and pefile's setup.py is choking with your default encoding (cp950). I will submit a bug and fix to the pefile repo, but that will not help you in the short term as you need to get a working copy of pefile (that supports python 3.5) installed.I recently checked in a slightly modified copy of pefile to this repo. If you copy it into site-packages and edit the err ant character (which is in a comment in line 5326) you might then be able to get pyinstaller going. URL: http://forum.audiogames.net/viewtopic.php?pid=265515#p265515 ___ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: Some python questions
Re: Some python questions Thanks very much I figured that out. But I got another question. I've ried install pefile because pefile is required for pyinstaller. But I had an error message telling that the code can't decode position 208000 bla bla bla bla. How can I solv this problem?Thanks URL: http://forum.audiogames.net/viewtopic.php?pid=265489#p265489 ___ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: Some python questions
Re: Some python questions You can download an installer for pywin32 off source forge, here's the download for the 32 bit and 64 bit version for Python 3.5:Pywin32x32Pywin32x64 URL: http://forum.audiogames.net/viewtopic.php?pid=265476#p265476 ___ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: Some python questions
Re: Some python questions I can't install cx_freeze I've encountered an error that a .tat file is missing and I don't know how to find the file.And, what is the easiest way to install pywin32 on python 3.5.1, without visual studio?When I tried that, I got an error telling that join argument shouldn't be a non type, and I think this error is related to a built-in python library.Can anyone help me?Thanks URL: http://forum.audiogames.net/viewtopic.php?pid=265436#p265436 ___ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: Some python questions
Re: Some python questions I was just trying to do this yesterday. What I worked out was that using cx_Freeze, an alternate program to Pyinstaller, worked without modification. Maybe try this and see if it works any better.Link to downloadLink to documentation URL: http://forum.audiogames.net/viewtopic.php?pid=265357#p265357 ___ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Some python questions
Some python questions Hello.I'm using python 3.5.1, and there are many modules that you can't install on python 3 environment, especially if you have the latest version. I wanna try pyinstaller, and it doesn't work without modification so I'm making some modifications to make pyinstaller setup.py work.Here's some questions.1. Is anyone using pyinstaller 3.2 with python 3.5.1? If so, how did you figured it out?2. I've fixt 2 small filenotfounderrors. Now there's really simple error that I can actually fix in 10 seconds. The problem is that the error is caused in a temperary file. So my question is, when a program generates a temperary file, is there any way for me to know what program is generating the temperary file? If I know that program, I could actually go into that program and edit it, fixing the error.Please let me know, if there is a way to do this.Thanks URL: http://forum.audiogames.net/viewtopic.php?pid=265354#p265354 ___ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector