Launching Dash app with Batch file fails with Double click - batch-file

I'm learning Dash and I'm trying to set up a small batch file to launch the app.
I'm using as an example the first app on this plotly page. The app is very simple, and I included the code in a file called smallapp.py.
I use Anaconda as Python distribution, so I wrote a batch file called launch_smallapp.bat like this:
call C:\Users\Roberto\Anaconda3\Scripts\activate.bat
python C:\rob\Python\battest\smallapp.py
If I open a Command Prompt and type launch_smallapp.bat, the app starts correctly and I can visualise it at the url http://127.0.0.1:8050/
However, if I double-click the file launch_smallapp.bat the app doesn't work.
The Command Prompt shows the normal messages of the app being started, but if I visit the url the browser just says that the site can't be reached.
The other thing is, the Command Prompt appears with a green frame.
Does anybody have any idea?
Thanks.

Related

loading image using anglularjs and ibm bluemix

I developed an application using nodes and angularjs.
I have an html file that I should display an image.
when running the application on localhost, everything work perfectly and the application displays the image.
I used this code for displaying image:
<img ng-src="./app/images/{{idimage}}.jpeg" ></img>
when I do a push for this application to ibmbluemix, the console told me that there are a 404 not found error.
Any idea please for how displaying image using angulars in ibm bluemix.
Thanks for helps
A possible reason for this issue is if you are pushing the app from outside of the app folder by using the manifest path parameter, and when you run your app locally, you also run it from outside the app folder.
After pushing your app, use cf ssh (docs) to get inside your deployed app. You can then take a look around using linux tools like ls to see what folders have been deployed.

Logging onto a site using a .batch file

So I'm wondering if there is a way to log onto a site automatically using a batch file, so i can just click on the file and it will open the browser, site and just log me on, without having to manually log on. For example if i wanted to automatically log on to my Bing.com account, i could just click on the batch file and it would open the browser and log me on. I have no clue where to start on trying to figure this out so i could really use some help.
There could be an indirect way in Google Chrome:
Find the login page of the website where you put your login and password.
Try to get the id or html tag of the login and password elements of the page.
Create a chrome extension file or simply a sample.user.js file to run some Javascript commands on the page.
Here is a sample to put your credentials in the fields of the page:
document.getElementById('login').value="*[login]*"
document.getElementById('password').value="*[password]*"
document.getElementsByTagName('input')[3].click()
In the manifest of extension file or in the #include of user.js file, define the login page of website to let the extension work just in that page.
Install the extension, here is a help how to install chrome extension manually
Now you can run chrome from terminal or .batch file to open the login page in chrome browser. take a look at how to open chrome from command line
Done!
There is a way that works in IE :
write a .vbs script to login to your website, like this link
execute your vbs script from command line or .bat file, look at this

My images inside the images subfolder wont show in heroku but works ok in local

I have a Node.Js App using express and Angular. While developing and running a local server everything worked perfectly.
But once deployed in Heroku, images (vewed in the gallery page) inside sub folders (images/*) just wont load while in Heroku.
When I try to go directly to the image URL the ones directly in the images folder work well:
servicentrov2.herokuapp.com/images/Fondo1.jpg
But the ones in subfolders wont, and show part of the page:
servicentrov2.herokuapp.com/images/galerias/2014Hallel/2014-Hallel-01.jpg
I think it might be that:
1. the sub folders are not available in server
2. some routing problem
The code is in https://github.com/blogcraft/Servicentro2.0
The Heroku app is in https://servicentrov2.herokuapp.com
Any help will be appreciated :)
You have the text case wrong in the link:
servicentrov2.herokuapp.com/images/galerias/2014Hallel/2014-Hallel-01.jpg
should be:
servicentrov2.herokuapp.com/images/galerias/2014hallel/2014-Hallel-01.jpg
(Note: lowercase '2014hallel').
You should be able to login to your Heroku terminal via SSH. Poke around in there and see if the images are actually located where your app is looking for them as a first step.

Run executive dashboard example in EXT-Js

I am trying to run EXT-JS 5 executive dashboard example on my local machine. I could see the code for executive dashboard in the folder "build/examples/executive-dashboard" . However this code is compressed and could not read.
The other location where I could locate the code for executive dashboard is in the examples folder. However I could not run this uncompressed code. At the same time I could see that there are no css files in examples/executive-dashboard folder.
Do I need to run any sencha command to get the code in examples folder running on server ? If so is there any way that I can run it without using sencha command ?
Please advise.
Thanks
Samir
Is your HTTP server running? You cannot run this, neither many of other, example using file:// protocol but you have to use http:// protocol.
So your url should look similar to: http://localhost/ext-5.1.0/examples/executive-dashboard/

Autoit script for file upload does not work with selenium script

I have below autoIT script to upload file in firefox. It works fine when I run autoit script manually. But it does not work when I use it in my automation selenum script.
Autoit Script
$title = WinGetTitle("File Upload") ; retrives whole window title
WinWait("[CLASS:#32770]")``
WinActive($title)
WinActivate($title)
WinWaitActive($title)
Sleep(700)
send("!n")
Sleep(800)
Send("F:\Projects\MergeServerProject\File\OfflineAgreemntDocuments\DOC\File-1.docx")
Sleep(800)
Send("!o")
Selenium Script
clickBrowserBtn(); //This function click on browse button in file upload control on FF
String[]templatenamenew=new String[] {"F:\\Projects\\f1\\scripts\\AutoIt\\FileUpload.exe"};
Runtime.getRuntime().exec(templatenamenew);
HTML File Upload Control
Note:
I also try with sendkey function but it does not work
I noticed this wasn't answered but this should work in C# (not sure about Java, but you didn't specify the language). This line comes after your selenium script has clicked the button/field that opens the window.
Process.Start(#"C:\<source>\upload_something.exe", #"C:\<source>\myfile.jpg");
Hope it helps!

Resources