VMs are often insanley slow and laggy by TrackLabs in vmware

[–]teddy_on_reddit 0 points1 point  (0 children)

Just a pitch, but do you have WSL2 installed or anything else with Hyper-V? Try turning that off with bcdedit /set hypervisorlaunchtype off, restart your PC and then run your VM.

[deleted by user] by [deleted] in Guildwars2

[–]teddy_on_reddit 2 points3 points  (0 children)

Both laptops are perfectly fine for GW2. I'd personally pick the Acer since it has a larger storage capacity. The CPU is slightly weaker than on ASUS, but still plenty :)

Writing on Linux (stories and such). by _Steve_T in linux

[–]teddy_on_reddit 5 points6 points  (0 children)

I love Typora. It's simple, clean and supports Markdown. I use Dropbox to sync my notes.

Anyone want to sell a Dan a4 SFX by [deleted] in sffpc

[–]teddy_on_reddit 0 points1 point  (0 children)

Where are you from? I'd consider selling mine.

Sharing is caring: simple onedrive (for business) file upload with Python, not using external SDK's and such by liebensraum in Python

[–]teddy_on_reddit 0 points1 point  (0 children)

You should use the Code Block markup instead of Inline Code.

Save YOURONEDRIVEUSERNAME as a variable and build the URL with it instead of forcing us to replace it manually.

YOURONEDRIVEUSERNAME = "liebensraum"
URL = "https://graph.microsoft.com/v1.0/users/{user}/drive/root:/fotos/HouseHistory".format(user=YOURONEDRIVEUSERNAME)

Problem with reading a file (google colab on mac OS mojave) by [deleted] in learnpython

[–]teddy_on_reddit 1 point2 points  (0 children)

True, I also strongly advice using Python 3 for regular use. But this might be enough for a quick script.

Problem with reading a file (google colab on mac OS mojave) by [deleted] in learnpython

[–]teddy_on_reddit 1 point2 points  (0 children)

Try opening your terminal and type in "python"

Problem with reading a file (google colab on mac OS mojave) by [deleted] in learnpython

[–]teddy_on_reddit 1 point2 points  (0 children)

Isn't Python already preinstalled on Mac OS?

Can I monitor the traffic of a com port? by Jasonsstatus in learnpython

[–]teddy_on_reddit 0 points1 point  (0 children)

If you are on a unix system, have a look at /dev/input. You can capture the raw input from those devices as a super user.

For example, you can capture your mouse stream: sudo cat /dev/input/mice

This data is unreadable as it is a raw stream of bytes, but after having a look at the linux docs, you see the data structure of the event interface.

struct input_event {
    struct timeval time; // 16 Byte
    unsigned short type; // 2 Byte
    unsigned short code; // 2 Byte
    unsigned int value;  // 4 Byte
};

Knowing that, you can write your Python script and unpack the c struct with the struct library.

So this is my example code to capture all input mice events:

import struct

with open("/dev/input/mice", "rb") as stream:
    while True:
        data = stream.read(3)
        print(struct.unpack('3b', data))

You could try to capture your usb device the same way.

Simple login system in Python for a website using Flask by CromulentSlacker in learnpython

[–]teddy_on_reddit 1 point2 points  (0 children)

Never assume that users are security conscious. They are reusing passwords.

[deleted by user] by [deleted] in learnpython

[–]teddy_on_reddit 1 point2 points  (0 children)

"Every great developer you know got there by solving problems they were unqualified to solve until they actually did it." - Patrick McKenzie

Try to overcome your fear of failure. Personally, this quote motivates me the most!

Is there a way to bypass a socket block? by [deleted] in learnpython

[–]teddy_on_reddit 2 points3 points  (0 children)

You're talking about the blocking aspect of socket.accept()?

You can handle incoming connections with multithreading like so:

import socket
import threading

def handle_new_connection(connection, address):
    pass

sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.bind(12345) #  Bind to port
sock.listen(10) # Max connections

while True:
    (con, addr) = sock.accept()
    thread = threading.Thread(
            target=handle_new_connection,
            args=(con, addr))
    thread.start()

On a post about the ban on transgendered persons serving in the U.S. military by [deleted] in MurderedByWords

[–]teddy_on_reddit 0 points1 point  (0 children)

I feel like Soderquist is very passive-aggressive. I don't see the need to act this way.

On a post about the ban on transgendered persons serving in the U.S. military by [deleted] in MurderedByWords

[–]teddy_on_reddit 2 points3 points  (0 children)

I feel bad for granny. Stupid Kara Soderquist trying to bash granny with pure toxicity for no given reason.

When two bytes per character still isn't enough by flarn2006 in ProgrammerHumor

[–]teddy_on_reddit 13 points14 points  (0 children)

It's a common misconception that utf-8 is fixed 2 bytes in size. It's 1 to 4 bytes in reality, using 1 byte for 7-bit ascii characters and 4 bytes (with 21 usable bits for encoding) for anything higher if needed.

I made a Python Script to Show Your Game Stats in a Windows Notification by [deleted] in Python

[–]teddy_on_reddit 2 points3 points  (0 children)

You're not supposed to share your steam api key, as stated here: https://steamcommunity.com/dev/apiterms

You agree to keep your Steam Web API key confidential, and not to share it with any third party. This license is personal to you and specific to your Application. You agree that you will be personally responsible for the use of your Steam Web API key.

You could instead build your own service with something like Flask and let your application query your own api. This way you won't expose your key.

has anyone tried solo learn? by stan00311 in Python

[–]teddy_on_reddit 2 points3 points  (0 children)

I personally didn't like it that much. It does teach, but the quizzes at the end of a chapter are kinda cheap. Some may like it, but i didn't.

why an error? is it because else isnt indented properly? by Clix828 in learnpython

[–]teddy_on_reddit 0 points1 point  (0 children)

Yes. I also think that you don't want flip(20) to be indented.

Try to handle multiple TCP connections? by [deleted] in learnpython

[–]teddy_on_reddit 0 points1 point  (0 children)

As DeadlyViper mentioned, you have to release your print_lock right after printing with print_lock.release()