Re: i build a music player and got some questions

2020-05-02 Thread AudioGames . net Forum — Developers room : Turkce_Rap via Audiogames-reflector


  


Re: i build a music player and got some questions

@Rastislaw and rest of the forum. to in order to get back on topic, i want to ask something simple.for iterating over all files and sub foulders, should i use make recursive = True or false? because from the artical i get it suppose to be false. m i wrong?

URL: https://forum.audiogames.net/post/525230/#p525230




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


Re: i build a music player and got some questions

2020-04-28 Thread AudioGames . net Forum — Developers room : ambro86 via Audiogames-reflector


  


Re: i build a music player and got some questions

Hi Rastislav Kiss, I understand your opinion. I too had to force myself to use Eclipse at the beginning, and currently in Python I mostly don't use it. But Eclipse can be really useful for a complex project. Consider that in addition to the dibag you also have autocompletion, and I have used this several times also in Python to easily find out what are all the functions that I can use in a certain context. For example, in Eclipse just create a variablemyString = "hello"At this point, if you write myString followed by the dot, a curtain will open with all the functions you can do with that string. Just two days ago I played with Eclipse to discover different functions that I didn't know in Wxpython. Let's say this too. This tool is used by blind people who program for work. The person with whom I am taking the Java course works with this language, and therefore has different needs from us, that maybe we make amateur programs. As for Python, he told me that he uses Eclipse for projects where he needs the dibag, and that exceed 2,000 lines.One last note. Having tried Java and Python, I can say that the dibag, perhaps, is more useful in Java, because in this language errors sometimes appear in which it is not easy to understand what they depend on. For example, errors can be nested in for loops, where you have not initialized a variable. Java often doesn't help you that much, so you need the dibag to understand the variables that values have. In Python, so far, I have to say that when there is an error, very often the interpreter helps you already, making you better understand how to solve it.

URL: https://forum.audiogames.net/post/524042/#p524042




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


Re: i build a music player and got some questions

2020-04-28 Thread AudioGames . net Forum — Developers room : Rastislav Kiss via Audiogames-reflector


  


Re: i build a music player and got some questions

Hi,@13: well, may be I am somewhat outdated at this, but... Although I have tried some debuggers, I still think, that the bestone is simply right in my head.As I code, I have a mental image of the code in my head, which not just shows me code's hierarchy and various ways to expand / simplify / optimize it, but I also remember, which places are definitely safe, and where the code got complicated enough, that while tracking various running scenarios I could miss some detail, causing the error.No software debugger is able to do this yet. When I need to find out some values to check, if they're right, I simply use print functions or messageboxes.Although the same thing could be achieved using a debugger, I don't find it as confortable as writing down things directly, where debugging commands and code are on one place, so I can see both in the same time.Of course this doesn't apply to reverse engineering, that is a completely different chapter, where you'll need to get familiar with a debugger, as there is no code to make assumptions.If you want to look for a debugger, I know about GDB for example, and you'll probably find many other.Also as for ide, I personally don't like Eclipse much. It is one of the programs which simply aren't able to run smoothly, or at least in my case. Just launching it starts my fan quite a lot, and it won't stop, until I close it. It is similar to AndroidStudio, which has the same problem, I can't imagine how someone is able to code with editor, which drains cpu like... you know what.VisualStudio is much better in this. It can be quite heavy too, when it has its bad moments, but most of the time, performance is very good.Although I don't use it much either. Just as a projects generation and building tool from command line, even after creating Ride plugin for VisualStudio, I still stick to its app version, which is much lighter than the whole ide.Those are some subjective observations on this topic.Best regardsRastislav

URL: https://forum.audiogames.net/post/524017/#p524017




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


Re: i build a music player and got some questions

2020-04-28 Thread AudioGames . net Forum — Developers room : Turkce_Rap via Audiogames-reflector


  


Re: i build a music player and got some questions

@ambro86The Link seems to be outdated. so, get the latest version from https://github.com/albzan/eclipse-nvda/releases/tag/0.6

URL: https://forum.audiogames.net/post/523981/#p523981




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


Re: i build a music player and got some questions

2020-04-28 Thread AudioGames . net Forum — Developers room : ambro86 via Audiogames-reflector


  


Re: i build a music player and got some questions

Hi, fine. I will probably write an article in the future. In any case, here are some indications.Download Eclipse from: https://www.eclipse.org/downloads/Install it.Eclipse was born by default for Java, however it can be used to program in Python, c ++, c # and other languages.Open Eclipse, go to the help menu and to Market. Look for Pydev. This is the module for programming in Python. Install it. Once installed we will have to set up our Python interpreter, which is the same that we have already installed.At this point you can go to the file menu and make a new pydev project. We choose a name for the project, such as Python Course.With control f6 we move in different views. Let's go into project explorer view and see our project. From here we can press shift f10, or application key, and choose new pydev class. We choose a name for our class.At this point, before I go on I have to say this. The strength of Eclipse is that it is an accessible editor, but above all it is because there is an addon for nvda which makes it even more beautiful to use. This addon is called Eclipse Enhance. You can find it at https://github.com/albzan/eclipse-nvdaDownload and install it. Follow the guide to set up Eclipse so that the addon intercepts all the elements. You can find the guide in the link I gave previously, searking in the web page "Eclipse Configuration".At this point to do the dibag we will have to set a breackpoint (combination keys control shift b). For those who have never done dibag, the breackpoint is a point where we want our program to stop. Instead of putting print here and there you can use the dibag, which also allows us to inspect the variables (control shift i) and see in realtime what value our variable has.Then. Let's write some test lines. We go down with the arrows and set the breackpoint with control shift b. Now we press f11. Control f11 sends the running program without dibag. F11 instead performs with the dibag. At this point, when the execution has arrived at our breackpoint, the program will stop. To continue it we will have to press f6. Caution. If the instructions require user input we should enter it. With control f6 we go to the view console, and type in our string. Then with f6 we continue the program.Moreover. If we have set up a breackpoint, but program execution does not arrive at that breackpoint, execution will end normally. So we must be sure that the execution passes through that breackpoint we set. As mentioned, with control shift i, once focused in the view editor, and brought the cursor on a variable, we will be able to see its value at that moment.

URL: https://forum.audiogames.net/post/523974/#p523974




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


Re: i build a music player and got some questions

2020-04-28 Thread AudioGames . net Forum — Developers room : ashleygrobler04 via Audiogames-reflector


  


Re: i build a music player and got some questions

the debugging post could be helpfull

URL: https://forum.audiogames.net/post/523751/#p523751




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


Re: i build a music player and got some questions

2020-04-28 Thread AudioGames . net Forum — Developers room : Turkce_Rap via Audiogames-reflector


  


Re: i build a music player and got some questions

@ambro86Yea, i would love to know about those.qamerikranianSometimes even a missing quote could be hard to detect and it's easier for sighted people to find out eventually while you have to digg thru lines.

URL: https://forum.audiogames.net/post/523745/#p523745




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


Re: i build a music player and got some questions

2020-04-28 Thread AudioGames . net Forum — Developers room : Turkce_Rap via Audiogames-reflector


  


Re: i build a music player and got some questions

@ambro86Yea, i would love to know about those.

URL: https://forum.audiogames.net/post/523745/#p523745




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


Re: i build a music player and got some questions

2020-04-27 Thread AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector


  


Re: i build a music player and got some questions

Huh. Good to know. I typically debug by printing.  99% of the time something wouldn’t work correctly because the variable your checking for has an incorrect value somehow.  I hate editors, primarily because I feel like they are slowing me down.  Matter of preference, though.

URL: https://forum.audiogames.net/post/523629/#p523629




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


Re: i build a music player and got some questions

2020-04-27 Thread AudioGames . net Forum — Developers room : ambro86 via Audiogames-reflector


  


Re: i build a music player and got some questions

Hi Turkce_Rap, in my opinion a very accessible ide, which can also be used for Python is Eclipse. I started using Eclipse with the Java language, but then I discovered that there is a module, Pydev, which allows you to program in Python. It is accessible, you can debug, and there is also an add-on for Nvda that allows you to jump from one error to another with a combination of keys. Also when you save your file it makes an error sound if there are problems.Debugging is easily managed. If you are interested I can write more information.

URL: https://forum.audiogames.net/post/523600/#p523600




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


Re: i build a music player and got some questions

2020-04-27 Thread AudioGames . net Forum — Developers room : ambro86 via Audiogames-reflector


  


Re: i build a music player and got some questions

Hi Turkce_Rap, in my opinion a very accessible editor, which can also be used for Python is Eclipse. I started using Eclipse with the Java language, but then I discovered that there is a module, Pydev, which allows you to program in Python. It is accessible, you can debug, and there is also an add-on for Nvda that allows you to jump from one error to another with a combination of keys. Also when you save your file it makes an error sound if there are problems.Debugging is easily managed. If you are interested I can write more information.

URL: https://forum.audiogames.net/post/523600/#p523600




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


Re: i build a music player and got some questions

2020-04-27 Thread AudioGames . net Forum — Developers room : Turkce_Rap via Audiogames-reflector


  


Re: i build a music player and got some questions

So would You suggest me any accessible debugger that can show me exactly  the incorrect coded  part? i m not talking about this code but, for commen use? for example: sighted coders can see that by pycharm alike softwares. so how do you handle that?Thank you for your kind answer Rastislav btw.

URL: https://forum.audiogames.net/post/523573/#p523573




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


Re: i build a music player and got some questions

2020-04-27 Thread AudioGames . net Forum — Developers room : Turkce_Rap via Audiogames-reflector


  


Re: i build a music player and got some questions

So would You suggest me any accessible debugger that can show me exactly  the incorrect coded  part? i m not talking about this code but, for commen use? for example: sighted coders can see that by pycharm alike softwares. so how do you handle that?

URL: https://forum.audiogames.net/post/523573/#p523573




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


Re: i build a music player and got some questions

2020-04-26 Thread AudioGames . net Forum — Developers room : Rastislav Kiss via Audiogames-reflector


  


Re: i build a music player and got some questions

Hi,@10: I have just replied to your pm. Although I'll repeat it here as well, so others can see, use "*.mp3" instead of ".mp3". Now you're basically selecting everything named .mp3, but you most likely want everything ending with .mp3, therefore *.mp3, the ** operator as middle argument will cause searching in all subdirectories, as described in the article I post earlier.If you get any errors, it'd be helpful if you posted them as well. Line 11 looks syntactically correct at first look to me, but I don't know pygame's functions, so may be there are some missing arguments etc.Also, this pm system definitely needs a mail announcement system. If there weren't the pms sending spambot, I would perhaps discover your message few years later. Best regardsRastislav

URL: https://forum.audiogames.net/post/523031/#p523031




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


Re: i build a music player and got some questions

2020-04-26 Thread AudioGames . net Forum — Developers room : Rastislav Kiss via Audiogames-reflector


  


Re: i build a music player and got some questions

Hi,@10: I have just replied to your pm. Although I'll repeat it here as well, so others can see, use "*.mp3" instead of ".mp3". Now you're basically selecting everything named .mp3, but you most likely want everything ending with .mp3, therefore *.mp3, the ** operator as middle argument will cause searching in all subdirectories, as described in the article I post earlier.If you get any errors, it'd be helpful if you posted them as well. Line 11 looks syntactically correct at first look to me, but I don't know pygame's functions, so may be there are some missing arguments etc.Also, this pm system definitely needs an mail announcement system. If there weren't the pms sending spambot, I would perhaps discover your message few years later. Best regardsRastislav

URL: https://forum.audiogames.net/post/523031/#p523031




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


Re: i build a music player and got some questions

2020-04-13 Thread AudioGames . net Forum — Developers room : Turkce_Rap via Audiogames-reflector


  


Re: i build a music player and got some questions

Guys, how can i solve the error on post 8?

URL: https://forum.audiogames.net/post/519151/#p519151




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


Re: i build a music player and got some questions

2020-04-12 Thread AudioGames . net Forum — Developers room : Turkce_Rap via Audiogames-reflector


  


Re: i build a music player and got some questions

@Rastislav    kisi've sent you a pm.

URL: https://forum.audiogames.net/post/518807/#p518807




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


Re: i build a music player and got some questions

2020-04-11 Thread AudioGames . net Forum — Developers room : Turkce_Rap via Audiogames-reflector


  


Re: i build a music player and got some questions

Variables corrected, you may check the post above.

URL: https://forum.audiogames.net/post/518397/#p518397




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


Re: i build a music player and got some questions

2020-04-11 Thread AudioGames . net Forum — Developers room : Turkce_Rap via Audiogames-reflector


  


Re: i build a music player and got some questions

Now i based  my code to Yours and the code is below, btw. i get an error on line 11:import os.pathimport globimport pygamepygame.init()pygame.mixer.init()path = input("Where are your files located? ")path = os.path.join(path, "**", ".mp3")for file in glob.glob(path, recursive=True):            pygame.mixer.music.load(file)pygame.mixer.music.play(0)

URL: https://forum.audiogames.net/post/518380/#p518380




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


Re: i build a music player and got some questions

2020-04-11 Thread AudioGames . net Forum — Developers room : Turkce_Rap via Audiogames-reflector


  


Re: i build a music player and got some questions

Now i based  my code to Yours and the code is below, btw. i get an error on line 11:import os.pathimport globimport pygamepygame.init()pygame.mixer.init()yol = input("Müzik klasörünüz nerede? ")yol = os.path.join(yol, "**", ".mp3")for dosya in glob.glob(yol, recursive=True):            pygame.mixer.music.load(dosya)pygame.mixer.music.play(0)

URL: https://forum.audiogames.net/post/518380/#p518380




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


Re: i build a music player and got some questions

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


  


Re: i build a music player and got some questions

Hi there,@6: the problem is, that he wanted to catch subdirectories as well. Thus just *.mp3 won't work, but the join function could be used to improve my code from yesterday.Something like this would be an ideal solution:import os.path
import glob

path=input("Enter the path to your music folder.")
path=os.path.join(path, "**", "*.mp3")

#Now we can iterate over paths quite swiftly
for file in glob.glob(path, recursive=True):
#Do what is necessary hereAlso, the absolute paths, which are generated automatically with this solution, are necessary here. How otherwise would you handle the situation, when entered directory is completely different from the program's working directory?They're fine of course when working with program's resources, which are at suitable places, in that case relative paths really are a better option, but when loading files specified by user, an absolute path is necessary sooner or later.There would be one solution, for example, if working directory is set to:C:\users\SomeUser\Development\Windows\Python\ProgramAnd an user specifies:C:\users\SomeUser\MusicThen the relative path with glob would be:..\..\..\..\Music\**\*.mp3Although I doubt that even Python's path library can generate a path like that. Best regardsRastislav

URL: https://forum.audiogames.net/post/518180/#p518180




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


Re: i build a music player and got some questions

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


  


Re: i build a music player and got some questions

Hi there,@6: the problem is, that he wanted to catch subdirectories as well. Thus just *.mp3 won't work, but the join function could be used to improve my code from yesterday.Something like this would be an ideal solution:import os.path
import glob

path=input("Enter the path to your music folder.")
path=os.path.join(path, "**", "*.mp3")

#Now we can iterate over paths quite swiftly
for file in glob.glob(path):
#Do what is necessary hereAlso, the absolute paths, which are generated automatically with this solution, are necessary here. How otherwise would you handle the situation, when entered directory is completely different from the program's working directory?They're fine of course when working with program's resources, which are at suitable places, in that case relative paths really are a better option, but when loading files specified by user, an absolute path is necessary sooner or later.There would be one solution, for example, if working directory is set to:C:\users\SomeUser\Development\Windows\Python\ProgramAnd an user specifies:C:\users\SomeUser\MusicThen the relative path with glob would be:..\..\..\..\Music\**\*.mp3Although I doubt that even Python's path library can generate a path like that. Best regardsRastislav

URL: https://forum.audiogames.net/post/518180/#p518180




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


Re: i build a music player and got some questions

2020-04-10 Thread AudioGames . net Forum — Developers room : camlorn via Audiogames-reflector


  


Re: i build a music player and got some questions

The better solution is:import os.path

os.path.join("a", "directory", "*.mp3")Which will either use / or \ depending on your platform.You don't need (and probably don't want) absolute paths. If you do, there is also os.path.abspath, which will convert relative paths to absolute paths and a whole bunch of other os.path functions that are useful in that module for whatever you might want to do.

URL: https://forum.audiogames.net/post/518106/#p518106




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


Re: i build a music player and got some questions

2020-04-10 Thread AudioGames . net Forum — Developers room : Rastislav Kiss via Audiogames-reflector


  


Re: i build a music player and got some questions

Sorry for doubleposting, but I found this page, which could be quite helpful:https://www.geeksforgeeks.org/how-to-us … in-python/With this, you can simply do:import glob

#...

path=input("Enter the path with files")
if path[-1]!="/" and path[-1]!=["\\": path+="\\" # A wiser solution should be used here, but it's just a detail.

for file in glob.glob(path+"**\\*.mp3", recursive=True):
#Do whatever you want, now you have the absolute path in file)Best regardsRastislav

URL: https://forum.audiogames.net/post/518090/#p518090




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


Re: i build a music player and got some questions

2020-04-10 Thread AudioGames . net Forum — Developers room : Rastislav Kiss via Audiogames-reflector


  


Re: i build a music player and got some questions

Sorry for doubleposting, but I found this page, which could be quite helpful:https://www.geeksforgeeks.org/how-to-us … in-python/With this, you can simply do:import glob

#...

path=input("Enter the path with files")
if path[-1]!="/" and path[-1]!=["\\": path+="\\" # A wiser solution should be used here, but it's just a detail.

for file in glob.glob(path+"**\\*:mp3", recursive=True):
#Do whatever you want, now you have the absolute path in file)Best regardsRastislav

URL: https://forum.audiogames.net/post/518090/#p518090




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


Re: i build a music player and got some questions

2020-04-10 Thread AudioGames . net Forum — Developers room : Rastislav Kiss via Audiogames-reflector


  


Re: i build a music player and got some questions

Sorry for doubleposting, but I found this page, which could be quite helpful:https://www.geeksforgeeks.org/how-to-us … in-python/With this, you can simply do:import glob

#...

path=input("Enter the path with files")
if path[-1]!="/" or path[-1]!=["\\": path+="\\" # A wiser solution should be used here, but it's just a detail.

for file in glob.glob(path+"**\\*:mp3", recursive=True):
#Do whatever you want, now you have the absolute path in file)Best regardsRastislav

URL: https://forum.audiogames.net/post/518090/#p518090




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


Re: i build a music player and got some questions

2020-04-10 Thread AudioGames . net Forum — Developers room : Rastislav Kiss via Audiogames-reflector


  


Re: i build a music player and got some questions

Sorry for doubleposting, but I found this page, which could be quite helpful:https://www.geeksforgeeks.org/how-to-us … in-python/With this, you can simply do:import glob

#...

path=input("Enter the path with files")
if path[-1]!="/" or path[-1]!=["\\": path+="\\" # A wiser solution should be used here, but it's just a detail.

for file in glob.glob(path+"**\\*:mp3"):
#Do whatever you want, now you have the absolute path in file)Best regardsRastislav

URL: https://forum.audiogames.net/post/518090/#p518090




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


Re: i build a music player and got some questions

2020-04-10 Thread AudioGames . net Forum — Developers room : Rastislav Kiss via Audiogames-reflector


  


Re: i build a music player and got some questions

Hi there,@1: You have somewhat mixed the syntax, this:[i for i in os.walk(path): if i.endswith(".mp3")]:is not possible, you can't open a block on list. Plus the : symbol before if is also problematic.Correctly, perhaps the shortest possible version is:for i in [j for j in os.walk(path) if j.endswith(".mp3")]:Of course this is quite messy. I would use somewhat more meaningful name for the loop variable. That of course isn't necessary for the array selection, as its scope is very small and quite obvious, although this is rather subjective, so don't take it as a rule.Depending on how you're planning to use the list of found files, you may also consider saving it to a separate variable, it would not only higher readability, but also use of the selection, as you'd be able to make functions to jump to previous and next file without a big magic.Also, are you sure, that you know, how does the walk method of os module work? Or better said, how is it supposed to be used?It returns results in a quite specific structure consisting of mix of absolute and relative paths, stored in a nested array. I don't see any code here to deal with that, and even if I believed that the pygame's mixer could handle it, there is still the if i.endswith condition, which will perhaps crash when it gets a list in i, and even if it didn't, you'll filtrate out the absolute paths of directories, and just have names of files, what isn't very usable, when your user has entered a path completely different than the program's location. You'll need absolute paths in that case.The same goes for Masonian's code.It isn't a hard problem, although there are some quite complex solutions on net. All you need to do is to prepare your loop to concatenate the path to usable format, that's all about it.Best regardsRastislav

URL: https://forum.audiogames.net/post/518088/#p518088




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


Re: i build a music player and got some questions

2020-04-10 Thread AudioGames . net Forum — Developers room : Turkce_Rap via Audiogames-reflector


  


Re: i build a music player and got some questions

@2i get this error: "SyntaxError: invalid character in identifier"i've examine the code though couldn't find  the character  that prevents from working.

URL: https://forum.audiogames.net/post/518087/#p518087




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


Re: i build a music player and got some questions

2020-04-10 Thread AudioGames . net Forum — Developers room : masonian via Audiogames-reflector


  


Re: i build a music player and got some questions

Hi,Try something like this. Note that I didn't test this code so I probably broke it.import osimport pygamepygame.init()pygame.mixer.init()formats=[".mp3",".ogg",".flac"]path = input("Where are your audio files located? ")for i in os.walk(path):  for i2 in formats:    if i.endswith(i2):      pygame.mixer.music.load(i)      pygame.mixer.music.play(0)

URL: https://forum.audiogames.net/post/518076/#p518076




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