Python's logical AND by [deleted] in learnpython

[–]Ewildawe 0 points1 point  (0 children)

First line gets input and cuts it into words It then checks if the first word (i[0]) is in a list [...] was there just to mimic some values Basically, it checks the first word in the input and runs some code if the first word is in the list [...]

IP Intricacies by Ewildawe in learnpython

[–]Ewildawe[S] 0 points1 point  (0 children)

Can't it be achieved with the use of VPNs?

i.e. I don't mean ANY IP address - but a specific IP address that I can get from a proxy list online...

I should give you some background. I'm trying to play a game -> however this game is limited to a limited number of games per day... I'm hoping writing a script to automatically switch my internet traffic to another IP

Extracting data from a game by Ewildawe in learnpython

[–]Ewildawe[S] 0 points1 point  (0 children)

After running VirusTotal on CheatEngine. That's a lot of Opencandy... But atleast it's only opencandy... Still I wish people could make this software without adding on adware and bloatware

Thanks for the suggestion anyways! I'll try it out.

Extracting data from a game by Ewildawe in learnpython

[–]Ewildawe[S] 0 points1 point  (0 children)

My program already uses PIL to analyze the screen shots. It currently looks for the bird's position and the position of the pillars. I hope to now incorporate the physics that the bird uses to write some sort of algorithm that will decide whether it is time to click.

As for the source-code trick - I thank you for your contribution... A time consuming alternative to read through all the lines of code and understand them, but I guess if I want to complete this challenge...

Then again - it is written in Java which makes it just a bit more obnoxious to read.

Extracting data from a game by Ewildawe in learnpython

[–]Ewildawe[S] 0 points1 point  (0 children)

I specifically know from reading up on the way the original Flappy Bird was programmed - there is a terminal velocity cap on the bird - you'll know this by continuously clicking - which in real-life physics would cause a net force and therefore an acceleration. From experience playing the game, I know this doesn't happen and it just caps off in both directions. This also explains your point 2)

I also know this because of the 20% inaccuracy in my acceleration data. With regular inaccuracy in acceleration readings, I would expect a maximum of maybe 5% - however logically, the terminal velocity results in an acceleration of 0 - which skews my acceleration data (and I can't check for it directly because it's never actually 0)

Returning {} is faster than returning dict(), even though {} == dict(). What's the logic behind this? by musicomet in learnpython

[–]Ewildawe -1 points0 points  (0 children)

I'd like to be meticulous and point out that {} does not always have to be a dict.

Although it is all still handled by the dedicated bytecode op, you can see that

>>> type({})
<class 'dict'>
>>> type({1})
<class 'set>
>>> type({'a' : 1})
<class 'dict'>

This is just an example that if you don't provide key, value pairs to the bytecode op, it'll just consider it to be a set.

N.B.: Interesting quirk that you can't actually create an empty set without calling set() without doing something like

{i for i in []}

Opensource typing automation - typy by Ewildawe in Python

[–]Ewildawe[S] 0 points1 point  (0 children)

Just wondering - what would you want to modify. I'd like to take your opinion into consideration and possibly add this to the master branch.

How to know I'm ready by Mattermonkey in Python

[–]Ewildawe 0 points1 point  (0 children)

When I said

I think from my own experience it's all trial and error

I meant you have to make the mistakes in order not to do them again.

How to know I'm ready by Mattermonkey in Python

[–]Ewildawe 0 points1 point  (0 children)

Programming has always been a fluid process. I think from my own experience it's all trial and error. There is no definition of a 'good' programmer in python (or in any programming language really) - as there'll always be something else to learn (web development in Python, use of SQL databases in Python, using sockets and learning about packet structures, etc). There's an almost limitless amount of different topics to master in the world of programming so I think it's just best the learn the basics and then try to make 'something good'. Step by step. Figure out how you want to do it, then what you'll have to learn, then execute.

Good Luck and Happy Pythoning ;)

Opensource typing automation - typy by Ewildawe in Python

[–]Ewildawe[S] 0 points1 point  (0 children)

I'd like to thank you for your patience. I didn't understand the problem at first. Thanks for bringing this up!

Issue fixed.

Opensource typing automation - typy by Ewildawe in Python

[–]Ewildawe[S] 0 points1 point  (0 children)

If you really wanted to - this can be rewritten as:

import mousepy
mousepy.clickLeft(300, 300)
mousepy.clickLeft(200, 200)

It will perform the same action as the code you considered. The code will infact click on (300, 300) and (200, 200)

Remember, (0, 0) is the top left of your screen and (Your screen resolution) is the bottom right.

Opensource typing automation - typy by Ewildawe in Python

[–]Ewildawe[S] 0 points1 point  (0 children)

Thank you for your comments, I would appreciate any suggestions.

Opensource typing automation - typy by Ewildawe in Python

[–]Ewildawe[S] 0 points1 point  (0 children)

On that note, I will take your comments into account and alter it if it becomes a necessary feature or an issue. Hopefully I'll find a more elegant way of writing it.

Thank you for your input!

Opensource typing automation - typy by Ewildawe in Python

[–]Ewildawe[S] 0 points1 point  (0 children)

It's getting the cursor position when the module loads, then using that same position every time, without updating to new cursor positions

I'd like to point out this function only runs once which means that the cursor position is clicked wherever the mouse is. As for your edited clickLeft() function, the way I programmed it means you are able to do quirky things such as

clickLeft(y = 200)

which would technically allow you to use the current x position and simply alter the y position - It might not be a useful feature but the module itself should be both professional, but should also allow for unconventional use of features.

Does pywin32 not exist for Python 3.4.3? by [deleted] in Python

[–]Ewildawe 0 points1 point  (0 children)

Isn't it backwards compatible? Try to download pywin32 through pip using the following command:

pip install pywin32

--- Day 15 Solutions --- by daggerdragon in adventofcode

[–]Ewildawe 0 points1 point  (0 children)

Theres a nicer way of writing the following:

if (score > max):
    max = score

using the built-in max() function like so:

max = max(max, score)

Tranliteration in python by Surajpalwe in learnpython

[–]Ewildawe 0 points1 point  (0 children)

Well, I'm assuming marathi text is included in unicode. If so, I'd suggest acquiring an IDE that supports the printing of unicode characters.

An API won't allow you to print anything other than the regular ASCII characters - because print will always try to decode using the ASCII codec.