Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #45512 > unrolled thread

Fwd: Re: python script is not running

Started byVincent Vande Vyvre <vincent.vandevyvre@swing.be>
First post2013-05-18 16:09 +0200
Last post2013-05-18 16:09 +0200
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Fwd: Re: python script is not running Vincent Vande Vyvre <vincent.vandevyvre@swing.be> - 2013-05-18 16:09 +0200

#45512 — Fwd: Re: python script is not running

FromVincent Vande Vyvre <vincent.vandevyvre@swing.be>
Date2013-05-18 16:09 +0200
SubjectFwd: Re: python script is not running
Message-ID<mailman.1804.1368886641.3114.python-list@python.org>


-------- Message original --------
Sujet: 	Re: python script is not running
Date : 	Sat, 18 May 2013 12:36:55 +0200
De : 	Vincent Vande Vyvre <vincent.vandevyvre@swing.be>
Pour : 	Avnesh Shakya <avnesh.nitk@gmail.com>



Le 18/05/2013 12:12, Avnesh Shakya a écrit :
> hi,
>      i want to run python script which generating data into json fromat, I am using crontab, but it's not executing...
> my python code--
> try.py --
>
> import json
> import simplejson as json
> import sys
>
> def tryJson():
>      saved = sys.stdout
>      correctFile = file('data.json', 'a+')
>      sys.stdout = correctFile
>      result = []
>      i = 1
>      for i in range(5):
>          info = {
>                  'a': i+1,
>                  'b': i+2,
>                  'c': i+3,
>                 }
>          result.append(info)
>
>      if result:
>          print json.dumps(result, indent=6)
>          sys.stdout = saved
>          correctFile.close()
> tryJson()
>
> now i m doing ion terminal-
> avin@hp:~$ crontab -e
> then type -
> */2 * * * * python /home/avin/data/try.py
>
> and save
>
> but it's not executing.
Have a look at /var/mail/yourname, this is a log created by crontab.

-- 
Vincent V.V.
Oqapy <https://launchpad.net/oqapy> . Qarte
<https://launchpad.net/qarte> . PaQager <https://launchpad.net/paqager>


[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web