TD ameritrade access token [closed] - python

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 7 days ago.
Improve this question
Good morning all, I am struggling with TD ameritrade’s authentication process, specifically the 30 min life span of the bearer key.
I have written a Python script to run the authentication process (https://developer.tdameritrade.com/content/simple-auth-local-apps). It’s partially automated, except for the pause to deal with the two step verification (which I can’t work around).
The trouble I have is that if the bearer key needs to be updated every 30 minutes, and the process script isn’t fully automated, it defeats the purpose of having a bot that can run and execute trades.
I see references to a refresh key, but not sure how to implement.
so far I have tried forums, YouTube , and reaching out to others within my network.
Any help is appreciated

Related

can linux handle multiple requests at same time using multiple python? [closed]

Closed. This question is not about programming or software development. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 days ago.
Improve this question
Let's say I run multiple Python scripts in one shell, each at the same time or using cron in the same hour, and let's assume each script makes a different HTTP request. Can the OS do the HTTP in an asynchronous way or the computer will wait until one request is finished to start another?
I tried this and apparently worked, but I want to know how.

How / can I controll my python code inputs through a webserver? [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 1 year ago.
Improve this question
I am making a project that is suposed to be some sort of smarthome solution. My code is written in python and I wish to controll the inputs of for example a timer to switch of the lights and set a wakeup alarm through a website on my lokal network. I plan on using a raspberry pi (3B+) for the hosting.
Is there a way that lets me give inputs and se the outputs on the webpage?
You could use a html form and have the user (you) submit it when you make changes, this is the method I would recommend.
You could also use JavaScript on the webpage to automatically send a request to the server on value changes (in an HTML form) for it to configure the server.

Could Python3 script (requests) used to get data from a website seem 'suspicious'? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
Improve this question
Might be a silly question... I want to use a python script to get some data from a website every 10 or 20min.
I'm using:
requests.get("http://somewebsite.php")
data = response.text
to get the data, and the rest is basically extraction of values from the string etc.
I would like to loop it and make a new request to the website every 10 or 20min to get data.
Assuming I'm running this script for few hours:
Would it look suspicious to the owner of the website?
Would it in any way 'hurt' the website or is it just equivalent to refreshing the website in the browser?
I just don't want someone, somewhere think something malicious is happening when I'm just playing around learning python. The data is not even important, I just want to see if the script that I wrote works. I just figured I might ask here before running it.
Thanks for any replies in advance.
Although you don't want to do any harm, you can misconfigure the script by accident (we are just humans), generate suspicious activity and a real person might spend some time investigating your activity (I'm not kidding, these things really happen).
My suggestion is to use a testing service like https://httpbin.org/ to play with the requests library. HttpBin is actually created by the same person who started the requests library (Kenneth Reitz).

Sporadic long response time for OpenShift gear [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 7 years ago.
Improve this question
I have two Flask apps in OpenShift. Each one in a free small gear. Each one uses an own PostgreSQL cartridge. The code is quite simple: REST apps that do a query in the DB and return a JSON. The DB is almost empty and, in this test phase, they are accessed only by me and a response time recorder.
Most of the time, for both apps, the response time is ~300ms, what is great.
But sometimes the response takes much longer: 4s, 7s, 12s or even 15s. The same request taking 50X more time to return.
If these slow response requests were spaced 24h/48h I would say it's some kind of OpenShift idle policy. But they aren't. It's more like any request has a 5% chance of being a slow one, even if they are spaced only a few seconds. And if the requests are spaced a few minutes the "chance of being slow" raises for more than 50%.
Any ideas?
Thanks for the attention!

Recognising # symbol within Python Code as Code Not Comment [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 8 years ago.
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Improve this question
I am currently putting some code together to create a TCP/IP client which will have to communicate with an existing network server (Local not Internet). The server code is out of my control as it is already in place. I seem to have test code that works, at least the server recognises that a client with the relevant IP address is making a connection, however, on first connection the server sends out an Identify command to confirm the client is valid:
IDENTIFY_#
This is my problem. The client code has to be written in Python and obviously #'s seem to create an issue. My understanding (being new to Python) is that they are only used for comments and all of the posts and books I have read seem to say the same. Unfortunately I have to respond with strings that also possess #'s as termination characters for data sets so it makes things twice as problematic. Is it possible to get Python to recognise a # for what it is and not throw a wobbly because it assumes it is a comment?
If the # symbol is within a string literal, it shouldn't be interpreted as a comment.

Categories

Resources