Something unknown slowing down my internet (possibly a Python module)? - python

I have a really good desktop (Windows 10) that I use for both coding and personal. Recently, in the last few weeks, my internet has been stalling. The speed is perfectly fine, but there will be a lag of a few seconds when I'm -- for example -- making a move in an online chess game.
This does not happen with ethernet or on other devices and I've tried basic troubleshooting.
I'm convinced there's a python module or something I installed recently that, for whatever reason, is interfering with the wifi.
Is there a way to check this? Does anyone know of any packages that can do this? Any tips will be helpful.

Related

Running a Pythong Script/Library in .Net

Id like to run some specific Python scripts in my C# Library. Specifically id like to run AudioOwl (https://github.com/dodiku/AudioOwl) or its underlying library Madmom (https://github.com/CPJKU/madmom) to find BPM of Music and maybe even the position of at least one beat.
I tried making my own Beat detection Algorithm and while it works better than expected, its not reliable enough. I couldn't find any decent C# libraries for it either tho.
I did find the above mentioned Python libraries tho. I tried IronPython but I'm having a hard time with the packages as far as i can tell. I have little experience in python, so i haven't been successful in solving this one myself.
How would i go about Getting a BPM to be returned? Are there .Net versions/alternatives i still haven't found?

Using python to automate external program

Whats the best Python library to automate an external program
We have accounting software where we need to upload many files into for a particular reason. To do this we search for the relevant menu item right click it and then import. This is time consuming. It would be useful to be able to automate this. Ive looked at pyautogui but it needs the screen to be active and the user cant do anything else on their machine while it is running.
Of course ideally I would like to use the accounting software's API (if there is one) or find out if the upload is running a stored procedure at the back end taking the filepath as a parameter and then calling this procedure myself.
In the absence of those would anyone know if there is a way to automate this in Python without the limitations above or if not in Python what other language would be good for this?
Many thanks
I haven't done such thing. So I do not have proof of concept. But
You have at least 2 options, more or less complicated:
install virtualbox/vmware, and create virtual operating system (windows or Linux) on it. Then run your pyautogui script in this virtual operating system. You operating system is available in window-like container - so you can minimize this window with running script, and you system where you can interact as a user. (long tutorial: https://www.virtualbox.org/manual/ch01.html)
If you are Linux user, then you may be familiar with virtual screen. I think many people are using this virtual screen with automating web testing in sellenium (How do I run Selenium in Xvfb?). So probably, I say probably, there is chance to run pyautogui in virtual screen: How to attach pyautogui to the virtual display? - this is similar, but not answered question.

Generate OS-specific command to run Minecraft 1.14 in Python

Hey guys, I'm working on a flexible Minecraft launcher in Python.
I have the code for the authentication all sorted out here to get things like the access token to log into the game and all the other necessary bits for a launcher, apart from the most important bit; I haven't got a method to actually start the game.
This isn't a duplicate of this or this, as they are for the old launcher and system. It could be classed as a duplicate for this, but that hasn't been answered for a long time.
Basically what I'm asking is, does anybody know how I can start Minecraft from a specific version such as 1.14.4? I'm making this on macOS Mojave but most of my friends who will use it are on Windows 10 so I'll need a method that can work on Windows, macOS and Linux if possible.
Thanks for any help! -Sam
Edit: I have it done for the most-part, yet when I start the game I get Error: Unable to initialize main class net.minecraft.client.main.Main
Caused by: java.lang.NoClassDefFoundError: joptsimple/OptionSpec
Is not so easy as you think :))
You try to make a custom launcher, but minecraft is Java (and bedrock edition is C++) so you need to have a little knowledge and from thins programming language.
For java you need to know how to work with files from .jar (what are just some archives)...
Is not impossible but still not easy.

Playing MP3 files with Python

I'm trying to write my own media player (like Foobar), and I'm having trouble tracking down a Python library that'll play MP3s. I know Pymedia does mp3s, but it looks outdated - the latest installer is for Python version 2.4, and I'm using 2.6. I've never had much success with Pygame, and Pyglet doesn't look like it has too much in the way of documentation. Are there any other alternatives?
There is http://pyglet.org/ and also have you tried http://code.google.com/p/mp3play/? It's also available from PyPi (http://pypi.python.org/pypi/mp3play/) However, I think mp3play is Win32 only for now.
Looking at the updates, there were commits within last couple of months.
I've been using PyMedia in Python 2.6.5 on Windows successfully. Caveats: the documentation is bad and wrong -- many of the tutorials have glaring errors or otherwise don't work -- so I had to do some experimentation and Googling to get my code to work right. Also for whatever reason the maintainers seem to have stopped updating the project site 4 years ago, though they seem to be actively doing something.
I found installers here:
http://www.lfd.uci.edu/~gohlke/pythonlibs/
The semi-active forum linked from their website includes some code maintainers who are semi-helpful. I'm jboyd99 if anyone is looking for tips.
For reasons that are beyond me the focus is on car audio systems, despite the fact that it is a fairly fully featured library that does some things no other free Python library does, like read MP3s into raw PCM data. The library has some flaws -- I'll probably use PyAudio or PyAudiere for actual playback for better control of synchrony issues.
Maybe it'd be simpler to write that part of your application in Python 2.4 as a separate "backend". This way you could use PyMedia (http://pymedia.org/) (as you mentioned) for the actual playback. It'd allow you to write your GUI in another Python version (like 2.6), which would also mean more decoupling of program components and parallelism (smoother GUI).
If you target only the Windows platform, then using Media Player via COM might help:
http://www.daniweb.com/code/snippet216465.html

Should I take a Python CS class using Windows or Mac?

I'll be taking a Python-based computer science class next semester using my MacBook Pro. It will be centered around a custom-designed package for this class. The problem is that this package is being sponsored by Microsoft Research, so it was obviously designed with Windows in mind. Supposedly, it runs on Mac OS and Linux too, but they say they don't officially support Snow Leopard whatsoever.
My concern is that there will be some sort of miniscule differences between the Python code on a Mac and on a PC. The homework is submitted online, and is graded for results. Apparently, they don't actually look at the code itself.
Is this a concern? Should I install Windows in a VM/partition and be done with it? Or should I stay where I feel most comfortable? After all, switching back and forth constantly would be a huge hassle. Thanks for your help!
If the class expects the code to run on Windows then I would install a VM with Windows on it since it is possible that some things may not work quite the same way (especially if you are doing system-specific things like file-system access or executing OS commands).
Classwork/homework always goes smoother when you have the exact same environment as the professor and the rest of the class.
Definitely start with Mac. If it turns out that it really does need Windows, you can switch once you're sure. But Python development is definitely more natural on a Unix-based machine.
Most online graders will let you submit multiple times, and the first assignment is usually easy, so you should know pretty quickly if using a Mac is causing you problems. In the meantime though, you'll have a much smoother ride doing Python on a Mac than on Windows.
If they will be testing your code on windows then you really need to be targeting that platform. However if you feel more comfortable on the Mac, do your dev there but also run a virtual win machine so you can test on the target platform. I would suggest the excellent VirtualBox. You can share local folders with the VM, which reduces the pain of switching back and forth, once the VM has python setup you can just hop in and and run the code direct from the directory on the Mac you developed in.
From their site it looks like Mac is fully supported (up to 10.5 -- it's true that 10.6 is different enough to give occasional problems... I haven't upgraded yet even though I did buy a family pack of 10.5 to 10.6 upgrades, as I'm not looking for trouble right now). If you can use a Macbook with 10.5, I'd say to go for it -- the familiarity and extra productivity are worth the miniscule risk that despite all their claims of support something goes wrong (and you can in fact download and start testing right now!). If your Mac options are limited to 10.6, then I'd go for a VMWare or Parallels VM with a Windows (not sure if Windows 7 is fully supported yet, maybe XP is a more prudent option) installation instead.
Develop and test on a Mac. If it works on the Mac, then test it on Windows before submitting. Done this tons of times with my own programming courses, albeit with a different set of languages and technologies.
Go Mac and never go back.
More seriously, a Mac offers UNIX environment, and Windows offers blue screens.

Categories

Resources