• RSS
  • Twitter
  • FaceBook

Security Forums

Log in

FAQ | Search | Usergroups | Profile | Register | RSS | Posting Guidelines | Recent Posts

Real applications to python

Users browsing this topic:0 Security Fans, 0 Stealth Security Fans
Registered Security Fans: None
Post new topic   Reply to topic   Printer-friendly version    Networking/Security Forums Index -> Programming and More

View previous topic :: View next topic  
Author Message
Grubbish
Just Arrived
Just Arrived


Joined: 23 Nov 2005
Posts: 0
Location: wouldn't you like to know;-)

Offline

PostPosted: Wed Dec 07, 2005 10:55 pm    Post subject: Real applications to python Reply with quote

Are there any real applications to learning python? I'm just curious because what i've read thus far, though not alot, doesn't seem at all helpful....
Back to top
View user's profile Send private message Visit poster's website AIM Address
Stormhawk
Trusted SF Member
Trusted SF Member


Joined: 26 Aug 2003
Posts: 31
Location: Warwickshire, England, UK

Offline

PostPosted: Wed Dec 07, 2005 11:23 pm    Post subject: Reply with quote

Python is an incredibly useful language.

For a start, its similarity to languages such as C++ (and Java) allow rapid prototyping of complex class hierarchies, which can be changed and tested rapidly in Python, whereas in C++ or Java, you'd have to recompile the hierarchy every time you wanted to test it.

Python also has modules which support web scripting, making it as versatile as PHP in that department.

Python has arbitrary precision mathematical operations, allowing scientific computation to be performed easily.

Python's syntax is closer to the English language than many programming languages, making it easy to learn, and even easier to read and understand if you are not already a competent Python programmer.

With the vast quantity of modules included in the standard library, and available on the web, Python can do just about anything, and automates most programming tasks. The Twisted framework provides excellent networking capability, and Python itself is reasonably fast for an interpreted language.

In conclusion, I've listed just a few of Python's benefits. Many large companies (Google included) use Python. It is, I would say, one of the fastest growing languages, with an ever increasing userbase, and jumping on the bandwagon can only be a good thing!
Back to top
View user's profile Send private message Visit poster's website
Grubbish
Just Arrived
Just Arrived


Joined: 23 Nov 2005
Posts: 0
Location: wouldn't you like to know;-)

Offline

PostPosted: Fri Dec 09, 2005 6:29 am    Post subject: Reply with quote

Do you know of any sites that have pre-made code that I could look at? All the tutorials I've found only show commands and don't show sample programs.....
Back to top
View user's profile Send private message Visit poster's website AIM Address
comrade
Just Arrived
Just Arrived


Joined: 15 Feb 2005
Posts: 0


Offline

PostPosted: Fri Dec 09, 2005 8:45 am    Post subject: Reply with quote

If you want documentation:
http://www.python.org/doc/Intros.html
http://docs.python.org/
http://diveintopython.org/toc/index.html

If you want actual programs rather than sample ones found in tutorials go google/download random python open source apps. Theres plenty around.
Back to top
View user's profile Send private message
Stormhawk
Trusted SF Member
Trusted SF Member


Joined: 26 Aug 2003
Posts: 31
Location: Warwickshire, England, UK

Offline

PostPosted: Fri Dec 09, 2005 3:18 pm    Post subject: Reply with quote

As it happens, I'm writing one right now. Its basically a frontend to SCP, the secure copy program which is part of OpenSSH, allowing me to synchronise local and remote versions of a directory structure. I wrote it mainly because I update my website HTML and PHP code by writing it locally and using scp to transfer it to the server, but with large sites it can take some time to transfer the entire site, so I automated the process of finding out which files have been locally modified since the last sync, and uploading only those using scp.

I created two new modules in order to help with this. One which uses pexpect (http://pexpect.sourceforge.net) to interface with SSH and SCP, and one which extends tkSimpleDialog's Dialog class and askstring() function to prompt for a password (basically the same as prompting for a string, except it is displayed as '*'s instead of the actual characters).

Note that the upload all option currently works, but the Synchronise option does not yet; I need to add code to stat the local and remote files and check their modification times, and also to cache the remote stat results after an upload so that subsequent uploads do not necessarily always incur the overhead of remote stats...

Anyway, the code as it is so far is available at
http://www.coldblue.net/sitesync-0.9a.tar.gz
and a screenshot at
http://www.coldblue.net/sitesync.png

Hope this helps with your endeavour to learn Python!
Back to top
View user's profile Send private message Visit poster's website
comrade
Just Arrived
Just Arrived


Joined: 15 Feb 2005
Posts: 0


Offline

PostPosted: Fri Dec 09, 2005 4:19 pm    Post subject: Reply with quote

Out of curiosity why didn't you leverage the already existing (python) code of rsync/rdiff-backup?


(Ahh..speaking of a app to look at. rdiff-backup is great Smile
Back to top
View user's profile Send private message
Stormhawk
Trusted SF Member
Trusted SF Member


Joined: 26 Aug 2003
Posts: 31
Location: Warwickshire, England, UK

Offline

PostPosted: Fri Dec 09, 2005 5:18 pm    Post subject: Reply with quote

I wanted to use SSH, basically. I don't allow FTP or rsync or other unencrypted transfer protocols on my server, except HTTP of course!

Also, I'm sure there are already modules which interface with SSH, but I didn't need full generality, just the ability to run a remote command (stat) and use scp, so I wrote a module to do just that.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   

Post new topic   Reply to topic   Printer-friendly version    Networking/Security Forums Index -> Programming and More All times are GMT + 2 Hours
Page 1 of 1


 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Community Area

Log in | Register