Problem: I’m a nurse, and part of my job is to pull up a list of “unsigned services”. Then of course, take these charts, and send them to the right person.
The person before me did not do this, leaving me THOUSANDS of charts to pull up by patient name and DOB, select the right document, and send to the right person.
I have figured out how to use selenium with python to automate logging in, using input to send keys to search the correct patient, and even to pull up the correct document that needs signed.
How do I have the program do this, for every chart? How do I have python work down the list of names and DOB’s without my having to manually put them in?
Anything I look for on my own is just examples of applying a basic function to a list of numbers and that isn’t my goal.
Thanks for your help!
Related
I feel like the title of this problem just made this whole thing even more confusing. But here is the long of it:
I have a bot that uses .JSON files to store information a user puts into it upon creation. However, to ensure that they are creating one, and only one, file, I have tied it to their unique ID. This ensures that even if a user changes nicknames, he can only create one file for himself. Of course, the .JSON file in the background, will be named '123456789.txt'.
This has been done successfully, but I want to add in bot commands that will allow OTHER users to obtain information stored in that user's file. So, for example: If Joe wants to see what Ned's favorite color is, he could use a simple command like:
!favcolor Ned
And the bot will fine Ned's .JSON file (123456789.txt), look for what value is stored under the key "color", and print out the results.
The problem isn't that I can't find people's user ID (ctx.message.author.id). The problem is that I don't know how to let someone else do such, as, as far as I can find out, there is no way to ensure that when someone precedes '!favcolor' with 'Ned', the bot will find 123456789.txt.
The only solution I can think of at the moment is to maintain a .JSON file at the moment of creation of a file that grabs the user's unique ID, and then pairs it with the name of the user. Something like:
{
"Ned": "123456789"
"Joe": "234567891"
"Sam": "345678912"
}
And so on. Then it just looks at that JSON, and grabs the correct ID. Is this a good approach? Or am I missing something much easier that is already built into discord.py?
Discord users are only uniquely identifiable by ID or username#discriminator.
You can easily get the ID from a User object, given that you're able to identify it from the user input in question.
A .JSON file with a .txt extension is contradictory, and you should be storing JSON data in JSON files rather than text files.
Also, I'd recommend using a database rather than JSON files, as there are lot of advantages to doing so and a lot of disadvantages to continuing to use JSON files.
After one month of learning and toying around with python and doing tons and tons of exercieses and samples I am still not really able to answer one important question to myself. If I generate data, for example with loading them from a xml or from scraping. How do I work with them? Right now I put each and every entrie directly into a sqlite db.
For exmaple:
I read a news feed, I put id, title, description, link, tags into one row in my sqlite db. I do some categorizing according to keywords within the the title or description. Each news entry goes into one row. After that I can read them row by row or at once.
I can filter them, sort them... But somehow I feel like there is a better way. Put them all with a dictionary into one big list and somehow work with this list. And then after I worked thru them sorted them or got even more infos with that data. Put them into the sqlite db. But none of my books or tutorial talk about this topic!? I try to make an example is a news article more important if a certain keyword comes up multiple times or in with an other keyword. Compare the news from that page with the news from another page with same keywords.
I guess u will be laughing and say. He is talking about ..... how can he not know that. But I am new to all of that. Sooorrry.
Thank you for your help guiding me in the right direction.
I'm trying to right a piece of code that allows me to automatically categorize certain transactions on Mint.com. I want to alter the right-most dropdown fields. I went through the source code on the site, but I'm not sure what to look for, or how these types of menus work and how to change them. Could someone please point me in the right direction: (What should I research? what should I be looking for in the source code etc.) Any help would be appreciated.
Thanks!
I think you want to change its value upon submitting. So you need to see the form action method (it will be probably POST) then you have to think how to send the data to the site from your code. There is some info :
How to send POST request?
You can probably send the data in the dictionary as is explained there.
I'm trying to send mails from Odoo. What I want to do is create a button, which will create a different QWeb Report for every res.partner society in my database and will send them to it. (e.g. I have 70 Society, i'd like each of them to get a personnal email sent, with a personnal report.)
I'm not asking someone to give me the solution since their is a lot of work to do if we go into the details, but I can't find any documentation about sending e-mail from Odoo. Is their at least one with the simpliest exemple of what you could do, or a better one that shows the option we have with it? (I mean from the python and xml side).
I found some people giving good answers to specifics question on forums, but none explain what each option does and I couldn't find any documentation. If you have some to give, I'm thankful.
EDIT: I'm currently looking into the source code of the basic addon "email_template" and find some interresting options but I don't really know how to trigger it, what function should be redefined, how to call it..
I'm doing a bit of an experiment in Python. I'm making a script which checks a rss-feed for new items, and then sends the title and link of the items via email. I've got the script to work to a certain level: when it runs it will take the link+title of the newest item and email it, regardless of wether it emailed that file already or not. I'd need to add 2 things: a way to get multiple items at once (and email those, one by one), and a way to check wether they have been sent already. How would I do this? I'm using feedparser, this is what I've got so far:
d = feedparser.parse('http://feedparser.org/docs/examples/rss20.xml')
link = d.entries[0].link
title = d.entries[0].title
And then a couple of lines which send an email with "link" and "title" in there. I know I'd need to use the Etag, but haven't been able to work out how, and how would I send the emails 1 by 1?
for the feed parsing part, you could consider following the advise given in this question regarding How to detect changed and new items in an RSS feed?. Basically, you could hash the contents of each entry and use that as an id.
For instance, on the first run of your program it will calculate the hash of each entry, store that hash, and send these new entries by mail. On it's next run, it will rehash each entry's content and compare those hashes with the ones found before (you should use some sort of database for this, or at least an on memory dictionary/list when developing with the entries already parsed and sent). If your program finds hashes that where not generated on the previous runs, it will assemble a new email and send it with the "new" entries.
As for your email assembling part, the question Sending HTML email in Python could help. Just make sure to send a text only and a html version.
For the simplest method see the python smtplib documentation example. (I won't repeat the code here.) It's all you need for basic email sending.
For nicer/more complicated email content also look into python's email module, of course.