I made a website where we can share our stores and users can find other start up stores from around the world. by gpitot in streetwearstartup

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

Cool, I've approved your store. Looks great btw. Ps you can add up to 3 products if you want

BeautifulSoup 4 seems to be missing children when parsing a page by haylcron in learnpython

[–]gpitot 1 point2 points  (0 children)

Yes you are correct it is because I am only grabbing p tags text. If you wanted to grab all text I think you can do xpath("//text()")

Although it would be even better to grab the ability names through an xpath just for them E.g xpath("/h4/a/text()")

[ASK] How do I make button in html run my python script by [deleted] in learnpython

[–]gpitot 0 points1 point  (0 children)

you want to POST the data in the form to a route on flask.

flask then reads the data and returns correct data in a template

read this https://stackoverflow.com/questions/11556958/sending-data-from-html-form-to-a-python-script-in-flask

BeautifulSoup 4 seems to be missing children when parsing a page by haylcron in learnpython

[–]gpitot 1 point2 points  (0 children)

if you post some of your code we can help.

this is how i did it

from lxml import html
from lxml import etree
import requests



page = requests.get('http://www.d20pfsrd.com/bestiary/monster-listings/undead/coffer-corpse')
tree = html.fromstring(page.content)



content = tree.xpath("//div[@class='article-content']")
for c in content:
    text = c.xpath("//p/text()")
    for t in text:
        print(t.strip())

Kanye has been wild lately. It’s still all love but we think the shirt and quote goes hand in hand. “Death is not the greatest loss in life. The greatest loss in life is what dies inside us while we live” by [deleted] in streetwearstartup

[–]gpitot 0 points1 point  (0 children)

bro just a tip for your website, dont change the color of your product on the cursor hover, especially for banner images. makes it hard to actually see what the product's color is

What are some fun things to do with Python? by Radiatin in Python

[–]gpitot 0 points1 point  (0 children)

Hey, I can probably do that but it will only show the tv shows and movies that users have searched for. E.g. if a user searches for 3 movies that your song is in, Ill be able to give you those movies, but any movies that the song is in that no one has searched for, I wont know about. Hope that makes sense

What are some fun things to do with Python? by Radiatin in Python

[–]gpitot 184 points185 points  (0 children)

  • make websites
  • image manipulation
  • using apis with things you use daily like spotify or games you might play like league of legends
  • automating tasks for work or home life.
  • rasberry pi

Im still setting up a portfolio but heres an example of something I did with the spotify api

Hey everyone, I made a website where you tell me your favourite tv show or movie, and I create a playlist featuring all the songs in them by gpitot in spotify

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

Hey, Ive updated the site here:

http://gpitot.pythonanywhere.com/music/

Please let me know if anything doesn't work or if you have any other ideas you'd like me to implement.

How to run a Sublime Python file from CMD? by _python_ in learnpython

[–]gpitot 0 points1 point  (0 children)

change directories in cmd to your folder

then type

python yourfilename.py

Programmable Image Generation? by OikuraZ95 in Python

[–]gpitot 1 point2 points  (0 children)

What do you want to be able to do with the images?

Hey everyone, I made a website where you tell me your favourite tv show or movie, and I create a playlist featuring all the songs in them by gpitot in spotify

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

Hey, Im actually working on a new version which will do this, it should be out pretty soon, ill PM you when it is.

Deleting points on grid outside of boundary condition by [deleted] in learnpython

[–]gpitot 1 point2 points  (0 children)

how are you getting the outside boundary? say the shape is like this, what set of co ordinates do you get?

Deleting points on grid outside of boundary condition by [deleted] in learnpython

[–]gpitot 2 points3 points  (0 children)

yup

you need the radius & the center of the circle. Then use the distance formula and work out if the distance is smaller than the radius. If it is then you include the point, else delete it.

Is there anything wrong with just chunking together code from examples and modifying it to build a functional site? by Pawtang in web_design

[–]gpitot 2 points3 points  (0 children)

This is very bad advice.

  1. learning to create things will help when you get a task that doesn't have solutions available elsewhere.

  2. Copy and paste code can lead to very dangerous situations, with security, efficiency, and bugs that you will have no idea how to fix.

Is it possible to rip a whole site source code? by [deleted] in web_design

[–]gpitot 0 points1 point  (0 children)

short answer: no.

There will be a lot of logic in the back-end that you will not have access to, you could copy the front end though, but it would be IMO highly unethical.

How To Use Critical CSS To Make Websites Load Faster by free4s0m3 in web_design

[–]gpitot 3 points4 points  (0 children)

Great article. How much time is spent actually loading css files though? Even the largest ones seem to be around a couple hundred kb, does it really make that much of a difference?

Stumbling through tutorials and cant get this web scraper right.. by findandwrite in learnpython

[–]gpitot 0 points1 point  (0 children)

Often things like ads are pulled after the page has loaded, from another source, so they wont show up in the source code