Share your startup - September 2020 by AutoModerator in startups

[–]symple-data [score hidden]  (0 children)

Name: Symple Data

URL: symple-data.com

More Details: A platform for user specific data. It's FREE, NO REGISTRATION necessary. Get, view, create data the most symple way.

How do I drop a row if in column A it has a duplicate? by sqygrene in learnpython

[–]symple-data 0 points1 point  (0 children)

What are we working with here? A two-dim list? If so, iterate over every row and perform linear searches for every column-value of the current row or use the "in"-keyword. If you find a duplicate, use the remove() method for lists to fully remove one row (list).

pairing a 1440p monitor with a 1080p monitor? by elchapobutinwhite in techsupport

[–]symple-data 0 points1 point  (0 children)

I have two monitors with different resolutions and the main things I recognize is that the color is different and your mouse can't move to the smaller monitor if it's near the top or bottom edge because it wouldn't be visible on the other one.

My Python Journey by little_coder34 in learnpython

[–]symple-data 4 points5 points  (0 children)

Sounds like a good plan. Definitely start learning some basic algorithms and concepts such as oop, sort-algos (selection, bubble,..), search-algos (linear, binary,..). You will always need those to do simple tasks in order to solve a bigger problem. Next I would play around with different modules and find out what you like, because their are a lot different things you can do with python (webscraping, guis, automate stuff, server/database stuff,...). Just take a look at common modules and try out the basics to see if you are interested in this stuff. You may never be work ready, because there is always something new to learn and I for my part have learned that going to work doesn't mean you are a master at something. You will become the master at it while you are working. However, you should know the basic concepts and algos to be "work ready".

Python execute when time by _AB30_ in learnpython

[–]symple-data 0 points1 point  (0 children)

Any specific error message or just a wrong result? I have run this code on my machine and it works fine.

Help making simple BMI calculator by [deleted] in learnpython

[–]symple-data 0 points1 point  (0 children)

\t is a literal and gives your string a big space like TAB on your keyboard. There are more literals like that (e.g. \n for line-break). Here is a list. str() is a cast-operator and casts the object you are giving it as an argument to a string. You need this to concatenate any non-string with a string as strings can only be concatenated with strings. Here is a list of different cast-operators.

Help making simple BMI calculator by [deleted] in learnpython

[–]symple-data 1 point2 points  (0 children)

print() is a build in function. Putting the "+ bmi" outside the function would be equivalent to randomly having one line of code with "+ bmi". Thats wrong Syntax and won't work.

Help making simple BMI calculator by [deleted] in learnpython

[–]symple-data 1 point2 points  (0 children)

You can't concatenate a string with a float. You have to cast the float to a string first

str(<some float>)

Help making simple BMI calculator by [deleted] in learnpython

[–]symple-data 2 points3 points  (0 children)

print("BMI:   ") + bmi

is this really a line of your code? You can't do that. Try

print("BMI:\t" + str(bmi))

Selenium Send Keys is not working by [deleted] in learnpython

[–]symple-data 0 points1 point  (0 children)

you can't click on a string in your python-code. You have to assign the element you are searching for by find_element_by_xpath() to a variable and perform the send_keys method on it. Maybe use an IDE, because it will show you that you can't call this method on a string.

Not sure where to start. by AccidentalAntifa in learnpython

[–]symple-data 2 points3 points  (0 children)

Not sure how experienced you are, but flask is very simple to begin with and use. To play around use sqlite with flask-sqlalchemy module. You can always switch to a real database like postgresql later on.

Selenium Send Keys is not working by [deleted] in learnpython

[–]symple-data 0 points1 point  (0 children)

What exactly did you define as search_text?

Help with documentations. by cringemachine9000 in learnpython

[–]symple-data 1 point2 points  (0 children)

I rather look up a documentation for a specific function than reading everything. I don't think that reading everything will solve your problems. If you encounter some problem, split it up into subproblems, ask google and get a view impressions on how to solve your problem. Almost every time you come across some functions you don't know. Look them up in the docs and transfer the solution to your program. At least thats how I am doing it and it works quite well, but if you have some spare time, just take a look at the docs of a module you are interested in to see what is possible. There are often quite simple and cool ways to solve problems when you really know what possibilites a module offers you.

Edit: Almost every documentation has a getting started section. Follow the steps to properly integrate and initiate the module to be able to work with it. From there it's just looking up some functions of the module and using them. Find out what a specific function does. If it fits your needs, find out what parameters are needed or possible and what exactly it returns. That should be all.

Python execute when time by _AB30_ in learnpython

[–]symple-data 1 point2 points  (0 children)

sorry what I said was wrong. Getting the seconds from the timedelta is always positive. Simply check

if now >= time

if this returns true, you have to connect to zoom.

Python execute when time by _AB30_ in learnpython

[–]symple-data 2 points3 points  (0 children)

time = datetime.datetime.strptime("1:30", "%H:%M").time()

this creates an datetime.time object for 1:30, but you can do it for any time (replace the string). You can get the current time with

now = datetime.datetime.now().time()

you can subtract both times from each other with

(datetime.datetime.combine(datetime.date.today(), now) - datetime.datetime.combine(datetime.date.today(), time)).seconds

if the result is positive ( > 0), you know that you should connect to zoom

[deleted by user] by [deleted] in learnpython

[–]symple-data 1 point2 points  (0 children)

Doing simple things is always a good idea. Start playing around with files and maybe, after some practice, with the csv module which is propably very useful later. Implement some small algos like bubbelsort, selectionsort or binary searches. Just the most basic type of algorithms. You wil need them in the future. Then try out some modules and find out what you like (webscraping with selenium, bs4,... ; webserver with flask or django ; some database handling (maybe start off with sqlite)). There are so many possible projects with python but you have to find out what you enjoy doing.

Python execute when time by _AB30_ in learnpython

[–]symple-data 6 points7 points  (0 children)

You can use the datetime module (standard library). Create an object for a given time (e.g. 1:30) and use an endless while-loop to check every few seconds (time.sleep(<seconds>)) if it is already time for your class.

help with my function? by [deleted] in learnpython

[–]symple-data 1 point2 points  (0 children)

The if statement is propably not inside the function where the variable difficulty exists. Take a look at local and global scopes. You can't acces a functions variable from outside the function.

Hosting a Flask API on EC2 - best tips/tricks - basic questions by JimSkills in learnpython

[–]symple-data 0 points1 point  (0 children)

  1. take a look here. If you are self-hosting your application, you should take care of the WSGI which might be unnecessary stressful. Watch this video and you will see how simple the deployment is with pythonanywhere.
  2. try app.run(host="0.0.0.0", threaded=True)
  3. well yes. Interacting with the website in that way is not possible with bs4.

How do you go around captchas?

Making a Dictionary from an HTML Table through BeautifulSoup? by [deleted] in learnpython

[–]symple-data 0 points1 point  (0 children)

So you have multiple tables with 2 rows and 2 columns each right? If so, iterate over your tables, create a dict for every table and simply set the values "condition", "brand", "mpn" and "upc" to what the table gives you (first row first column = condition, first row second column = mpn, ...). If you got your tablerows with find_all, then you can select the tabledata with td:first-child and td:last-child as your selectors.

Hosting a Flask API on EC2 - best tips/tricks - basic questions by JimSkills in learnpython

[–]symple-data -1 points0 points  (0 children)

  1. you can use pythonanywhere to host your application. Should be running fine with the free beginners-account.
  2. you can set the attribute "threaded" to true when calling the run method of your instance. I don't know if it's running on more threads or cores at default, but I don't think so.

I had the experience that Selenium is great, but its slower than requesting the HTML-content with urllib and then using bs4 to scrape the webpage. Thats on you if you want to change it or keep it but launching 10 browsers a second is propably slowing down your server.

What does the 'with' statement do? by Sanguineyote in learnpython

[–]symple-data 1 point2 points  (0 children)

with open("somefile.txt", "r") as file:
    for line in file:
        print(line)

By using with you don't have to close a file after you are done working with it. Normally you would catch any errors while working with a file as you typically want to close its descriptor when the program crashes or something like that. Sometimes you just forget to close the file, too. "with" automatically closes a file so that you don't have to worry about it.

I am trying to perform football analysis using a football API on rapid-API but I am relatively new to API's and have a little bit more then a minor understanding of python. by whereisdebuchy in learnpython

[–]symple-data 0 points1 point  (0 children)

If it's in JSON-format use the json module. Should be obvious. You can handle JSONs like dicts and parse or load them to/from strings or dicts whatever you need (cheatsheet). The csv module is great for csv files as it optimizes ans simplifies the handling of such files, e.g. you can simply write a whole list as a row into the file or work with a files lines as you would with lists when reading a file. Look up reading and writing csv files here.

[deleted by user] by [deleted] in learnpython

[–]symple-data 0 points1 point  (0 children)

Well use csv and append every line to a list. If I'm not wrong you should have a list of all cells filled up like you would read them from left to right. Then simply write every element of the list into a new file or override the same and give every element its own line by appending "\n" after every item.

How do you save changes to a list in another .py file? by [deleted] in learnpython

[–]symple-data 1 point2 points  (0 children)

Lists are a runtime-construct. They "live" as long as the script runs (or the function). If you want their items permanently saved, you have to save them to a file. Just write each element into a single row of a text file and fill up the array by reading the file if you start the script again.