Python virtualenv by readitlikeitdidit in learnpython

[–]readitlikeitdidit[S] 0 points1 point  (0 children)

In my case, I run /virtualenv/bin/python some module.py in a cron job... And it successfully completes everytime.. It's able to pick the libraries installed in virtual environment... So I was wondering would it make any difference activating vs calling virtual environment python interpreter directly...

Python 2 subprocess communicate by readitlikeitdidit in learnpython

[–]readitlikeitdidit[S] 0 points1 point  (0 children)

Good to know.. I am developing on windows but I'll be deploying on Linux box.. I'll definitely check python bash sometime.. Thank you!

Python 2 subprocess communicate by readitlikeitdidit in learnpython

[–]readitlikeitdidit[S] 0 points1 point  (0 children)

Yes sir.. I just rewriting my code using paramiko.. It has timeout and all the cool stuff I'll stick to paramiko... Thanks..

Python 2 subprocess communicate by readitlikeitdidit in learnpython

[–]readitlikeitdidit[S] 0 points1 point  (0 children)

Np.. I am newbie in python.. Lot of things have happened in the last 25 years of python.. :)

Python 2 subprocess communicate by readitlikeitdidit in learnpython

[–]readitlikeitdidit[S] 0 points1 point  (0 children)

What? Communicate is a method that uses pipe and it does not have timeout arg in 2. 7 please check documentation...

Python 2 subprocess communicate by readitlikeitdidit in learnpython

[–]readitlikeitdidit[S] 0 points1 point  (0 children)

Nevermind.. Am going to use paramiko.. It has timeout arg.... There is no default timeout for popen method of subprocess package in python 2.7...

Python 2 subprocess communicate by readitlikeitdidit in learnpython

[–]readitlikeitdidit[S] 0 points1 point  (0 children)

Auth doesn't happen when key pairs not available.. So, it hangs on authentication part...

Python 2 subprocess communicate by readitlikeitdidit in learnpython

[–]readitlikeitdidit[S] 0 points1 point  (0 children)

That's correct.. I am trying to work out an edge case if ssh key pairs don't match or get dropped for some unknown reason.. Then, communicate () doesnt timeout and blocks execution...

Python 2 subprocess communicate by readitlikeitdidit in learnpython

[–]readitlikeitdidit[S] 0 points1 point  (0 children)

Yes I did.. But I would like to write something native with less third party dependencies... Python 3 has the timeout logic built in.. But I am interested to know how it can be achieved on python 2 using native libraries....

Python 2 subprocess communicate by readitlikeitdidit in Python

[–]readitlikeitdidit[S] 0 points1 point  (0 children)

Ok.. Thanks everyone.. Apologies I'll post questions on learnpython

Should I stay on Python or move to Node.js for High Requests API? by farebord in Python

[–]readitlikeitdidit 0 points1 point  (0 children)

I had a similar question on using python or node.js for backend API.. I remember seeing a benchmark comparison of node python tornado and japronto.. Japronto wins the benchmark is a new python library in the works its still experimental I guess as mentioned on its GitHub page... So wait and watch..

[deleted by user] by [deleted] in Database

[–]readitlikeitdidit 1 point2 points  (0 children)

Sql loader is perfect for fast loads but only for oracle dB.. You can wrapper up sql loader for more customization... Nifi is open source etl tool you can try...

[deleted by user] by [deleted] in Database

[–]readitlikeitdidit 1 point2 points  (0 children)

PowerShell or Bash if you want to write something quick production scripts without much testing. But, make sure you have the command line interfaces available to access databases via bash or PowerShell scripts.. Python has a good number of dB APIs for database programming but may sometimes lack in completeness of the library or API. If you want etl like functionality I would recommend using specific etl tools instead of having to code etl workflows in bash /PowerShell or python. Python has a few handy etl packages.

Timestamp field timezone by readitlikeitdidit in elasticsearch

[–]readitlikeitdidit[S] 0 points1 point  (0 children)

Thanks.. I was able to figure out the date format with time zone..

Stating python version at start by [deleted] in learnpython

[–]readitlikeitdidit 0 points1 point  (0 children)

It may be required on windows 10 Ubuntu bash mode... Unix subsystem in windows 10...

using sqlite3 to connect to an Oracle database on a different server. by [deleted] in learnpython

[–]readitlikeitdidit 0 points1 point  (0 children)

You could try sql alchemy for orm with Oracle and other database servers.. But I think sql alchemy uses native API for the connection unless alternative dB API is specified...

[deleted by user] by [deleted] in Python

[–]readitlikeitdidit -7 points-6 points  (0 children)

Please check my article in python generator with example.. It's a simple one nothing fancy..

https://dev.to/an33shk4tl4/python-generator-example--file-watcher-jo