Welcome to Code Forum!

Join a community that supports you and your coding journey from day one. We strive to be a friendly, supportive community that empowers everyone to be better developers. By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Search results

  1. cbreemer

    Python calculator works fine but after one operation its result is always 0

    Ha ! I just knew you'd go one better on me, completely rewriting the whole thing with classes, grids and what not 😁
  2. cbreemer

    Python calculator works fine but after one operation its result is always 0

    I could not resist clearing up this rather convoluted code. Key changes: Combine functions labelUpdate and valueAppend into one function enter (since they are always called together) Use only 3 global variables: operation, value1 and value2. There is really no need for more. Use string search...
  3. cbreemer

    Python calculator works fine but after one operation its result is always 0

    I was wondering about all the globals as well. That does like a recipe for trouble. But it's not the issue here. A bit of debugging showed me that if I first do a multiply and then a divide, the first time symbol has the value * but the second time it has the value */ ! And that is why from the...
  4. cbreemer

    Python calculator works fine but after one operation its result is always 0

    I have replicated the problem. It's exactly as you write, first calculation is fine, all next ones give result zero. I'll see if I can spot a flaw in the program logic.
  5. cbreemer

    Python Receive Input on Same Terminal Line?

    Ah, curses. A blast from the past. Probably somewhat old-fashioned, yes 😉 But sorry, I can't help you. Maybe someone else can guess the details of your issue.
  6. cbreemer

    Python Receive Input on Same Terminal Line?

    Of course. But since you mentioned "terminal" I was thinking of old-fashioned line-based tty input. Now it remains unclear (at least to me) what exactly you are doing, what exactly you want, and why.
  7. cbreemer

    Python Receive Input on Same Terminal Line?

    You could try outputting the right number of backspace characters to get the next Enter to appear in the exact same location as the previous. Not sure if it will work though. Regardless, I think it's a bad idea. Put yourself in the role of the user, they've typed something in and your program...
  8. cbreemer

    Playing Audio Using Keystrokes: Is It Possible?

    Why would you want to post the mp3 ? To prove that it exists ? The webserver evidently thinks differently. In situations like this I always run Process Monitor and look for the name of the file it tries to open. Chances are that it's not what you think it is, or it is but it's in another...
  9. cbreemer

    Playing Audio Using Keystrokes: Is It Possible?

    I don't know, I always use the mouse. It would have to be the debugger window that you'd need to make wider. But forget that, it does not look like browsers abbreviate names like that. Looks like it is really looking for a file that isn't there.
  10. cbreemer

    Playing Audio Using Keystrokes: Is It Possible?

    Ah ok. I assumed there was something going on with weird characters, also because the error message mentions this name Ringing%20Tone/Princ_20Bell%20Ring.mp3 but I now think that might be the same name, just abbreviated f0r display with an underscore in the middle. Perhaps when you make that...
  11. cbreemer

    Playing Audio Using Keystrokes: Is It Possible?

    Because all the other names contain only %20 (for a single space). Why does this one have the 702B added to it ? No point in asking me - you wrote (or pasted) that code.
  12. cbreemer

    Playing Audio Using Keystrokes: Is It Possible?

    No. It's exactly the same name with the %20702B in it which looks really suspicious. Actually you'd be wise not to use spaces in filenames. It would just be easier to read and maintain.
  13. cbreemer

    Playing Audio Using Keystrokes: Is It Possible?

    Not sure if this is relevant but in your audio tag for RingingTone you have this filename Call%20Progress%20Tones/Ringing%20Tone/Princess%20702B%20Bell%20Ring.mp3 which seems an odd name with the sequence %20702B in it. By contrast your error message shows...
  14. cbreemer

    JavaScript HTML canvas isnt working properly(I cant draw anything on the screen)

    Well that is nice. But is that enough to make it work, you think ? Have you not noticed you get an error in the console log with every mouse move, and stopped to think why that might be so ? The first problem here is that you have const canvas = document.getElementById("myCanvas"); at the start...
  15. cbreemer

    JavaScript HTML canvas isnt working properly(I cant draw anything on the screen)

    It would be nice to see the code without so many blank lines. Looks like the body and html are not being terminated. Probably not the problem but should be corrected. Not sure what exactly this code is supposed/expected to do but have you checked the Console Log for errors ?
Back
Top Bottom