Python help

Soldato
Joined
6 Mar 2008
Posts
10,079
Location
Stoke area
Hey,

I've a little python program I have written that pulls an xml feed and pulls the few pieces of info I need ou t of it....problem is, that's all I know how to do so far.

I need it running from 08:03 until 00:33, every 30 mins and to record the data.

I've been looking and it appears that datetime and schedule are the best ways of doing this and I am more than willing to play around until I get something that works.

However, my issue is, how to run it. As its for a little work project I don't want to fork out for a webserver that runs python as it'll cost me money I don't have spare. I've only ever run things via IDLE.

So, what choices do I have?

Run it on my work PC but we desk share and there is always the chance some muppet will restart it.

Free webspace? any that allow python?

maybe look at a home server option?


Would you advise saving to a file/txt doc to start or going straight for a database issue. text file would probably do for now but if I expand to other sites or the data range I am tracking then a database option might help. plus, it needs putting into a excel format for managers. Shame I couldn't write it to google docs and just copy paste.

Any advice is gratefully received :)
 
Soldato
OP
Joined
6 Mar 2008
Posts
10,079
Location
Stoke area
nice one, i'll check sqlite out and the links.

I could leave my home machine on, but have such issues with the internet dropping out constantly that I wouldn't trust it. Might invest in a RasPi and have it set up at work, no one will touch it then :D
 
Associate
Joined
23 Mar 2006
Posts
1,739
nice one, i'll check sqlite out and the links.

I could leave my home machine on, but have such issues with the internet dropping out constantly that I wouldn't trust it. Might invest in a RasPi and have it set up at work, no one will touch it then :D

I Raspberry Pi would be a good idea.

Don't write your program to run continuously and get the data at the times you need. Instead write the program to run, get the data once and then exit. Then use cron on your new Raspberry Pi to start the program at the times and time intervals you require.
 
Soldato
Joined
28 Oct 2006
Posts
12,456
Location
Sufferlandria
Don't write your program to run continuously and get the data at the times you need. Instead write the program to run, get the data once and then exit. Then use cron on your new Raspberry Pi to start the program at the times and time intervals you require.

This.
You'd be able to run it on your shared work PC. It wouldnt matter if the computer was restarted (as long as it isnt turned off)
 
Soldato
Joined
6 Nov 2005
Posts
8,066
Location
MK45
You just need a Pi or something that will run a script on a schedule (as a cron job), so that you don't have to keep the script running. Far simpler. A windows machine can also schedule things just as effectively, so whatever you have available to you.
 
Soldato
OP
Joined
6 Mar 2008
Posts
10,079
Location
Stoke area
tried a few online resources and had some trouble with the code no working as it should.

Instead, i've shortened the code down, saved it to my dropbox folder and am, running it via scheduler on Win7 and saving the results to a text doc in my dropbox folder meaning I can share the results. Starts at 08:02 this morning for it's first 12 hour run, lets see how it goes so I can tweak the scheduler to do what I want :D

Thanks for the advice, more to come no doubt as I try new things and tweak this :D
 
Back
Top Bottom