Re: small python questions

2020-09-07 Thread AudioGames . net Forum — Developers room : Ty via Audiogames-reflector


  


Re: small python questions

I personally think for this to even be considered as a sticky topic, it should involve more than Python, which, by the way, most questions are probably just a Google away, and probably would be aside from BGT and PureBasic.

URL: https://forum.audiogames.net/post/568246/#p568246




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


small python questions

2020-09-07 Thread AudioGames . net Forum — Developers room : Simter via Audiogames-reflector


  


small python questions

Hi.I thought i'd create this topic for smaller questions regarding python. I, for my part, was a lot of times in the situation where i had such a little problem that i didn't want to post another topic, so i thought this would be a good idea, also it could be a source for new devs to common problems. Also, if the mods like this idea as well, it may be a good idea to stick this topic.

URL: https://forum.audiogames.net/post/568219/#p568219




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


Re: 2 python questions

2019-12-01 Thread AudioGames . net Forum — Developers room : magurp244 via Audiogames-reflector


  


Re: 2 python questions

Multi-threading is one answer, another solution for a non-blocking console can be found [here] using msvcrt:import msvcrt

num = 0
done = False
while not done:
print(num)
num += 1

if msvcrt.kbhit():
print "you pressed",msvcrt.getch(),"so now i will quit"
done = True

URL: https://forum.audiogames.net/post/481731/#p481731




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


Re: 2 python questions

2019-12-01 Thread AudioGames . net Forum — Developers room : Hijacker via Audiogames-reflector


  


Re: 2 python questions

With the help of Cython it is possible to achieve real multithreading in Python. It is more complicated however. But the simple multithreading Python itself provides should be enough to support data processing while waiting for input just fine.Best Regards.Hijacker

URL: https://forum.audiogames.net/post/481728/#p481728




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


Re: 2 python questions

2019-11-30 Thread AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector


  


Re: 2 python questions

A little side note: Pythons multithreading is not 'multithreading' as it is typically defined as. In a truly multithreaded application, you have multiple threads running concurrently with only locks and other synchronization mechanisms ensuring that data races don't occur. Python has something called the global interpreter lock (GIL). I'm not really sure why it exists, but its ridiculously inconvenient, especially in MT scenarios; it makes true MT impossible with threads. The only way you can acomplish MT is through multiple Python processes, which wastes ridiculous amounts of resources.

URL: https://forum.audiogames.net/post/481663/#p481663




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


Re: 2 python questions

2019-11-30 Thread AudioGames . net Forum — Developers room : simter via Audiogames-reflector


  


Re: 2 python questions

@4 and 5, thanks. I changing title already worked as expected.

URL: https://forum.audiogames.net/post/481509/#p481509




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


Re: 2 python questions

2019-11-30 Thread AudioGames . net Forum — Developers room : Rastislav Kiss via Audiogames-reflector


  


Re: 2 python questions

As to the second question, yes you can. The question isn't how to do it, but how to deal with the simple fact, that two things are going on at once - firstone being tracking stdin, second your script's work.I could give you few examples, how it could be done, but concrete implementation really depends on your script and on what concretely you want to do.I will thus rather refer you to Python's multithreading tutorials and tutorials about asynchronous programming in Python. Just type multithreading Python or asynchronous programming Python to Google and you will get tons of results on this topic. They should give you the knowledge on what is available and what you can do to make a safe, reliable, asynchronous script.Best regardsRastislav

URL: https://forum.audiogames.net/post/481465/#p481465




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


Re: 2 python questions

2019-11-30 Thread AudioGames . net Forum — Developers room : Rastislav Kiss via Audiogames-reflector


  


Re: 2 python questions

As to the second question, yes you can. The question isn't how to do it, but how to deal with the simple fact, that two things are going on at once - firstone being tracking stdin, second your script's work.I could give you a few examples, how it could be done, but concrete implementation really depends on your script and on what concretely you want to do.I will thus rather refer you to Python's multithreading tutorials and tutorials about asynchronous programming in Python. Just type multithreading Python or asynchronous programming Python to Google and you will get tons of results on this topic. They should give you the knowledge on what is available and what you can do to make a safe, reliable, asynchronous script.Best regardsRastislav

URL: https://forum.audiogames.net/post/481465/#p481465




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


Re: 2 python questions

2019-11-30 Thread AudioGames . net Forum — Developers room : Rastislav Kiss via Audiogames-reflector


  


Re: 2 python questions

As to the second question, yes you can. The question isn't how to do it, but how to deal with the simple fact, that two things are going on at once - firstone being tracking stdin, second your script's work.I could give you a few examples, how it could be done, but concrete implementation really depends on your script and on what concretely you want to do.I will thus rather refer you to Python's multithreading tutorials and tutorials about asynchronous programming in Python. Just type multithreading Python or asynchronous programming Python to Google and you will get tons of results on this topic. They should give you the knowledge on what is available and what you can do to make a safe, asynchronous script.Best regardsRastislav

URL: https://forum.audiogames.net/post/481465/#p481465




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


Re: 2 python questions

2019-11-30 Thread AudioGames . net Forum — Developers room : Ty via Audiogames-reflector


  


Re: 2 python questions

@simter here is how you give a console a title in python 3. If you're using two I can convert it to 2 for you.import ctypesctypes.windll.kernel32.SetConsoleTitleW("Console")

URL: https://forum.audiogames.net/post/481453/#p481453




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


Re: 2 python questions

2019-11-30 Thread AudioGames . net Forum — Developers room : Ty via Audiogames-reflector


  


Re: 2 python questions

@1 I think you need a module for changing the console title. I know it's doable, but i'm not sure how. Let me do some searching and get back to you on that.In regards to your second question, I don't believe so.@2 He asked about python, not pb.

URL: https://forum.audiogames.net/post/481447/#p481447




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


Re: 2 python questions

2019-11-30 Thread AudioGames . net Forum — Developers room : rory-games via Audiogames-reflector


  


Re: 2 python questions

as to your second question, I know it's doable in pure basic, but it is slightly tedious.

URL: https://forum.audiogames.net/post/481411/#p481411




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


2 python questions

2019-11-30 Thread AudioGames . net Forum — Developers room : simter via Audiogames-reflector


  


2 python questions

Hi. I was wanting to make a small game in py. It should take place in command line. How ever i have 2 questions.1. How do i change the console title? It's always just the file path and i know that pb has some function to fix that.2. Can i make input without causing the rest of the script to wait for me to make an input?thanks, simter.

URL: https://forum.audiogames.net/post/481406/#p481406




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


Re: Some Python Questions

2017-04-17 Thread AudioGames . net Forum — Developers room : Blademan via Audiogames-reflector


  


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

2017-04-16 Thread AudioGames . net Forum — Developers room : Hektor via Audiogames-reflector


  


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

2017-04-12 Thread AudioGames . net Forum — Developers room : magurp244 via Audiogames-reflector


  


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

2017-04-12 Thread AudioGames . net Forum — Developers room : magurp244 via Audiogames-reflector


  


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

2017-04-12 Thread AudioGames . net Forum — Developers room : Guitarman via Audiogames-reflector


  


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

2017-04-10 Thread AudioGames . net Forum — Developers room : Hrvoje via Audiogames-reflector


  


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

2017-04-08 Thread AudioGames . net Forum — Developers room : Guitarman via Audiogames-reflector


  


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

2017-04-07 Thread AudioGames . net Forum — Developers room : Hijacker via Audiogames-reflector


  


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

2017-04-07 Thread AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector


  


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

2017-04-06 Thread AudioGames . net Forum — Developers room : magurp244 via Audiogames-reflector


  


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

2017-04-06 Thread AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector


  


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

2017-04-05 Thread AudioGames . net Forum — Developers room : Guitarman via Audiogames-reflector


  


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

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


  


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

2017-04-05 Thread AudioGames . net Forum — Developers room : Guitarman via Audiogames-reflector


  


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: Python Questions

2017-03-04 Thread AudioGames . net Forum — Developers room : superb via Audiogames-reflector


  


Re: Python Questions

okay I installed accessible_output2. I get the error that says that %1 is not a valid win32 application. What do I do to fix this?

URL: http://forum.audiogames.net/viewtopic.php?pid=300424#p300424





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

Re: Python Questions

2017-03-03 Thread AudioGames . net Forum — Developers room : magurp244 via Audiogames-reflector


  


Re: Python Questions

To print a list without the brackets you can use this example:shopping = ['green eggs',1234,'ham',5678]
print ', '.join(str(a) for a in shopping)Other than the aforementioned accessible_output2, libaudioverse, and [PyAL] , there's also [Pyglet]. For screen readers there's also [Tolk] and [Pyttsx], although Pyttsx only supports native tts.

URL: http://forum.audiogames.net/viewtopic.php?pid=300343#p300343





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

Re: Python Questions

2017-03-03 Thread AudioGames . net Forum — Developers room : brian . kurosawa via Audiogames-reflector


  


Re: Python Questions

But keep in mind that libaudioverse does have some audio problems, as i noticed on games that used it like the shooter engine and the new death match. I don't know if the developer fixed it successfully, but if not you could use PyAL.

URL: http://forum.audiogames.net/viewtopic.php?pid=300341#p300341





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

Re: Python Questions

2017-03-03 Thread AudioGames . net Forum — Developers room : raven via Audiogames-reflector


  


Re: Python Questions

for i in list:
print(i)For sound, there's libaudioverse at https://github.com/camlorn/libaudioverseIt's just a pip install libaudioverse awayfor speech, there's accessible_output2, but you have to have to use the hg+ prefix, like this:pip install hg+http://hg.q-continuum.net/libloader hg+http://hg.q-continuum.net/platform_utils hg+http://hg.q-continuum.net/accessible_output2That should get you AO2+the dependencies.

URL: http://forum.audiogames.net/viewtopic.php?pid=300337#p300337





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

Re: Python Questions

2017-03-03 Thread AudioGames . net Forum — Developers room : superb via Audiogames-reflector


  


Re: Python Questions

thanks. I have 2 more questions:1. How do you print the items in a list without the brackets that a list usually contains?2. What would be the best libraries for sound and screen reader usage in Python and sound usage, and what would be a good way to install them with dependencies included?Thanks.

URL: http://forum.audiogames.net/viewtopic.php?pid=300315#p300315





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

Re: Python Questions

2017-02-28 Thread AudioGames . net Forum — Developers room : magurp244 via Audiogames-reflector


  


Re: Python Questions

Use can use the pickle module to pack and unpack lists, dictionaries, and other data for writing to a text document. Example:import pickle

#write data
def write(data,name):
tmp = open(name,'w')
pack = pickle.dumps(data)
tmp.write(pack)
tmp.close()

#read data
def read(name):
tmp = open(name,'r')
pack = tmp.read()
data = ""
tmp.close()
return data

shopping = ['green eggs',1234,'ham',5678]
write(shopping,'test.txt')
tmp = read('test.txt')
print tmp

URL: http://forum.audiogames.net/viewtopic.php?pid=299748#p299748





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

Python Questions

2017-02-27 Thread AudioGames . net Forum — Developers room : superb via Audiogames-reflector


  


Python Questions

Hello Guys. This is a topic where users can come and write about anything python-related--if they need help with something, or want to show off their skills--this is the place.So, let me get the ball rolling with a question:How do you write a high score to a file and return it in some way within a program? Here is my code below. I politely ask that you tell me a way I could do it, but don't put code in for me. Code:import randomdef file_question():    filename=raw_input("what is the name of the file you want to open?")    return filename    filename = file_question()def open_file(filename):    try:        infile = open(filename, "rb")    except:        infile = open('C:\\Users\\234265\\Desktop\\'+filename, 'rb')        trivia={}    counter=1    for line in infile:        if counter%2=1:            question=line        elif counter%2=0            answer = line        trivia[question]=answer    infile.close()    return triviatrivia = open_file(filename)def ask_questions()    counter=0    questions=trivia.keys()    random.shuffle(questions)    for question in questions:        guess=input(question)            if guess=trivia[question]                counter+=1        counter=str(counter)        print "You got "+counter +"out of "+len(questions) +&quo
 t;right."ask_questions()def play_again():    asker=raw_input("would you like to play again?")    if asker=="y":        file_question()        ask_questions()    elif asker=="n":        print "have a nice day."        break

URL: http://forum.audiogames.net/viewtopic.php?pid=299545#p299545





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

Re: Some python questions.

2016-07-10 Thread AudioGames . net Forum — Developers room : jawharh via Audiogames-reflector


  


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.

2016-07-08 Thread AudioGames . net Forum — Developers room : cartertemm via Audiogames-reflector


  


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.

2016-07-08 Thread AudioGames . net Forum — Developers room : momo7807 via Audiogames-reflector


  


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

2016-06-23 Thread AudioGames . net Forum — Developers room : superantoha via Audiogames-reflector


  


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

2016-06-22 Thread AudioGames . net Forum — Developers room : magurp244 via Audiogames-reflector


  


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

2016-06-22 Thread AudioGames . net Forum — Developers room : momo7807 via Audiogames-reflector


  


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

2016-06-22 Thread AudioGames . net Forum — Developers room : magurp244 via Audiogames-reflector


  


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

2016-06-22 Thread AudioGames . net Forum — Developers room : momo7807 via Audiogames-reflector


  


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

2016-06-21 Thread AudioGames . net Forum — Developers room : Dino via Audiogames-reflector


  


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

2016-06-21 Thread AudioGames . net Forum — Developers room : momo7807 via Audiogames-reflector


  


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