I have a script that connects to the TD Ameritrade API (I have a developer account and a margin account).
I created a script to pull some information from there and it works perfectly when I run from Jupyter or Spyder, but when I try to run from command line, I get the below error:
(Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available."))
What is causing this to happen?
Is it possible to automate scripts within Jupyter itself?
I am running from the command line because I would like to put the script on a schedule and as far as I know I would have to test my code from command line before setting it to run automatically.
Related
I am trying to execute a python cgi script which is having a bash script that logs into remote servers to get logs. This log is seen in browser.
I am able to run this script from terminal and get expected result. Whereas trying to run this script over a browser. There is no result a blank page shows up.
After lot of analysis found that When running from browser it runs as apache user who does not have permission to login to remote servers.
I want to make it run as a particular user is that possible ?
I have a strange scenario going on at the moment. When I issue an svn info TXN REPO command on our build server (separate from the SVN server), it works as expected and displays the relevant information to the console.
However when I script it using Python, and specifically, Popen from the subprocess module, it prints a message svn: E230001: Server SSL certificate untrusted to the standard error (console).
What I've tried:
Using --non-interactive and --trust-server-cert flags within the script call.
Passing a username/password within the svn info call via the script.
The above two don't seem to take effect, and the same error as above is spat out. However, manually running the same command from the command prompt succeeds with no problems. I assume it might be something to do with python opening up a new session to the SVN server, and that session isn't a "trusted" connection? But I can't be sure.
Our SVN server is on a windows machine and is version 1.8.0
Our build server is a windows machine running Jenkins version 2.84. Jenkins executes a batch script which kicks off the Python script, performing the above task.
Command: svn_session = Popen("svn info --non-interactive --trust-server-cert --no-auth-cache -r %s %s" % (TXN, REPOS), stdout=PIPE, stderr=PIPE, shell=True)
** Edit **
When I copy and paste the python line from the script into the interactive python shell on the same server, the command works as expected also. So the issue is how the script is executing the command, rather than the command itself or how Python runs that command.
**
Has anyone come across this before?
In case anyone is looking at this in the future. Panda Pajama has given a detailed answer to this..
SVN command line in jenkins fails due to server certificate mismatch
I'm trying to run my selenium scripts via Jenkins on Ubunt server 16.04 without GUI.
And before to open a web page it requires make an windows authentication. I created for Windows with AutoIT and it works good but now I have to execute via Jenkins on Ubunt server, and got the following error:
Using deprecated data structure for setting timeouts
java.io.IOException: Cannot run program "/usr/share/GlobalStagingERP/global.staging.erp/authentification/WindowsAuthenticationFireFoxCodeExample.exe": error=13, Permission denied
And I decided to do it with python and SciTE.
Also I tried 'https://username:password#my_url/' but it didn't work and got a fatal error.
This is an example how I'm using AutoIT script to handle authentication in window:
WinWaitActive("Authentication Required","")
MouseClick("left",331, 288,1)
Send("username")
Send("{TAB}")
Send("password")
Send("{ENTER}")
But how can I do it the same action in SciTE using python?
I have an external API which I want to consume through a Python script. The script runs fine when I execute it directly, but when I try to run the same Python script through HPC it throws an 'Unauthorized' error. I guess it's something to deal with the SSL certificates. Can someone please help me with this?
I'm trying to run a pygame script on a vps server, and I'm receiving an error on the pygame.display.init().
Following the directions found here http://www.pygame.org/docs/ref/display.html#pygame.display.init and in other sources, I used all this configurations before the init():
os.environ["SDL_VIDEODRIVER"]="dummy"
os.environ["SDL_VIDEODRIVER"]="x11"
os.environ["SDL_VIDEODRIVER"]="dga"
os.environ["SDL_VIDEODRIVER"]="fbcon"
os.environ["SDL_VIDEODRIVER"]="directfb"
os.environ["SDL_VIDEODRIVER"]="ggi"
os.environ["SDL_VIDEODRIVER"]="vgl"
os.environ["SDL_VIDEODRIVER"]="svgalib"
os.environ["SDL_VIDEODRIVER"]="aalib"
So, the "dummy" option causes the script to go into a loop. Any other option give me the error:
<class 'pygame.error'>: No available video device
I have x11 installed. I'm calling the python script from a php file, so, I would expect the graphic output to go inside the browser, or, the "video device" to be set automatically as the user browser. Not happening.
Are you ssh'd into the vps server? Have you tried x forwarding, ssh -X user#server.com then when you run the script from the command line it should open on your window