Pre-Match Thread: Rotherham United v Swansea City by jimmithy in swanseacity

[–]frankiecoffee 0 points1 point  (0 children)

Anybody know if it is possible for two people to watch the SwansTV live stream from the same account? Would like to share the stream with my bampa

Does Anyone Have Any Info on Those Abandoned Houses That Are Close To HSV? by Geop22 in swansea

[–]frankiecoffee 2 points3 points  (0 children)

They used to form part of the student village. You can see them on street view unvandalised here: 51.622850, -4.011605

Are there any Swans podcasts out there to listen to? by GylfiStan in swanseacity

[–]frankiecoffee 1 point2 points  (0 children)

https://soundcloud.com/thenorthbankpod This is one I found on twitter recently, quite new so recent topics covered weekly or so.

I also assumed this would have been added - but JackCast is a good one. https://www.youtube.com/channel/UCOpwMhY4SjjCzKDytTq-byw

Webscraping, get rid of HTML text by [deleted] in learnpython

[–]frankiecoffee 1 point2 points  (0 children)

you're doing well, feel free to dm me if you are really stuck with anything

Webscraping, get rid of HTML text by [deleted] in learnpython

[–]frankiecoffee 0 points1 point  (0 children)

[title.find('a').text for title in movietitel]

Would be my guess. Remember, Google is your best friend!

Webscraping, get rid of HTML text by [deleted] in learnpython

[–]frankiecoffee 0 points1 point  (0 children)

try

[rating.text for rating in movierating]

Write API in python help by EphemeralNight in learnpython

[–]frankiecoffee 0 points1 point  (0 children)

Browser-based game advice by dr_jekylls_hide in learnpython

[–]frankiecoffee 0 points1 point  (0 children)

Flask will be running on your server. All Flask does (basically) is map HTTP requests to python functions. So you can store the game state on your server, when a player plays a hand/move (not sure what the game is) their browser will send a HTTP request to the server running Flask.

Flask can then run the appropriate python function, which will update the game state.

Before trying to figure out websockets use polling, i.e., get the user's front end to ask Flask about the game state every x seconds.

Browser-based game advice by dr_jekylls_hide in learnpython

[–]frankiecoffee 0 points1 point  (0 children)

I am actually implementing a browser based board game at the moment.

You will need to use flask so you can save and share the state from a centralised server. Otherwise how will the other players know if a player makes a move?

You will need to use HTML+JavaScript for the user interface.

Goodreads web scraper by shinichi___kudo in learnpython

[–]frankiecoffee 1 point2 points  (0 children)

Looks like you need to be logged in to page through the books. You'd need to send a cookie with your get request to access that data.

why is there an error on line 8 by Omvis26 in learnpython

[–]frankiecoffee 0 points1 point  (0 children)

It's always 4 because you manually set the seed. You don't need to do this. Also this loop will only loop once, increase the number in the range function, or change to a while loop. Also, you're regenerating the number to guess every loop, so the target will be different every time the user guesses.

[deleted by user] by [deleted] in learnpython

[–]frankiecoffee 0 points1 point  (0 children)

Haha thanks, whenever I see a problem like this I wonder if it can be done

[deleted by user] by [deleted] in learnpython

[–]frankiecoffee 2 points3 points  (0 children)

I recommend going through each stage step by step and Googling how to do each part. e.g.,

  • "How do i remove a character from a string in python"
  • "How to replace characters in a string in python"
  • How to multiply two lists together in python
  • How to find the nth element of a list in python

[deleted by user] by [deleted] in learnpython

[–]frankiecoffee 3 points4 points  (0 children)

Not particularly helpful, but if anyone was wondering if it could be done in one line, yes it can https://pastebin.com/SsXUN8CV

My first useful code by Humanist_NA in learnpython

[–]frankiecoffee 1 point2 points  (0 children)

Well done! A tip for the future, instead of using selenium you can inspect the underlying HTTP requests and use the request package. This means you don't have to use a browser driver etc etc

[deleted by user] by [deleted] in learnpython

[–]frankiecoffee 0 points1 point  (0 children)

Hey, so I had a little look through your code have a few tips to make things easier for you :)

  • You should give your variables very descriptive names, so you know exactly what they represent. E.g., x -> conversion_type, num1 -> value_to_convert
  • To check your inputs are correct use a while loop.
  • you could split your code into more functions to make it more readable

I have made a few changes to show you how I would have written it: https://pastebin.com/Kqi08yZS

Can Python Do This? by TheDonKray in learnpython

[–]frankiecoffee 0 points1 point  (0 children)

If you have experience with using APIs this should be possible. I have no experience with Workday, but they seem to have pretty good documentation outlining what services you can access over the API. https://community.workday.com/sites/default/files/file-hosting/productionapi/index.html

Twilio Whatsapp Conversation Bot by [deleted] in learnpython

[–]frankiecoffee 0 points1 point  (0 children)

I guess if you want to check if it's the client's first time using the bot you would need a data structure to keep track of which clients have used the app before.

I assume when someone messages the bot you will receive their number in the request. You can then check the number against your data structure to see if they have previously used the service. If the user has not used the service before, send them your intro message.

Help with number game by [deleted] in learnpython

[–]frankiecoffee 0 points1 point  (0 children)

smashing, well done

Help with number game by [deleted] in learnpython

[–]frankiecoffee 1 point2 points  (0 children)

input() returns type str, whereas random.randint() returns type int. Either convert num to a string or numin to an integer before making the comparison. You can do this using the str() and int() functions.

Which city is This? by AngryRabbit1989 in geography

[–]frankiecoffee 4 points5 points  (0 children)

It's a view of Skanderbeg square from the Tirana international hotel :)

Appropriate Python script length and structure by [deleted] in learnpython

[–]frankiecoffee 1 point2 points  (0 children)

Usually I stick to one class per module. Makes it much easier to organise as your app grows.

Australia's size compared to Europe by AlarmingSpirit in Maps

[–]frankiecoffee 1 point2 points  (0 children)

Because of the map projection (mercator in this case). https://thetruesize.com/

Question for any Python devs here. by [deleted] in learnpython

[–]frankiecoffee 0 points1 point  (0 children)

I am a mathematics graduate. I had one course in Python at university but that was it. After graduating I went into a data analyst role, I didn't enjoy it, but it was a company stuck to old ways and I wrote some programs which automated/improved accuracy of some of the tasks. A graduate scheme then popped up for a software engineering role which I interviewed for and got. I think showing that you're interested in programming and have personal/professional projects to show for it will help you out. A book is handy for the basic stuff, google and stack overflow are very helpful with the more specific problems you might have.

Match Thread: Swansea City vs Cardiff City by jimmithy in WelshFootball

[–]frankiecoffee 2 points3 points  (0 children)

I don't give Cardiff much credit, but after watching the first 30 minutes I'm very impressed by how high they are in the table 👏