Re: [Tutor] How to break long lines?

2013-02-23 Thread Steven D'Aprano
On 23/02/13 13:03, Dave Angel wrote: On 02/22/2013 08:22 PM, Jim Byrnes wrote: Thanks for giving me so many options to use in the future. When reading I completely blew by the single quote on a single line part. The db is sqlite3 and it seems happy with ''' strings. FWIW, there is a

Re: [Tutor] Trying to avoid using eval..

2013-02-23 Thread Peter Otten
Rohit Mediratta wrote: >I want to reload my Module after I fix bugs and want to instantiate an >object of a class contained in this module. Just a warning about reload(), as your question was already answered: Reloading modules may seem convenient at first, but can lead to strange error

Re: [Tutor] Unit test case

2013-02-23 Thread Alan Gauld
On 23/02/13 06:14, jitendra gupta wrote: I am working one tool, which will do compile/run the workspace (that code is written on c/c++). on that my requirment is i need to compile subfolder also, i have wrote code for that also. Just to clarify. You are writing a tool in Python that will compi

[Tutor] getting and using information dict objects

2013-02-23 Thread Matthew Johnson
Hi, I am trying to make a move from excel to python. My main need is economic data -- to do economic analysis. I have found the FRED package, and appear to have connected to the St Louis Fed's FRED and downloaded some data, but i'm not sure what to do with the objects that are returned. _ >

Re: [Tutor] getting and using information dict objects

2013-02-23 Thread Albert-Jan Roskam
> I am trying to make a move from excel to python. My main need is > economic data -- to do economic analysis. If you say Python and Excel the first thing that comes to mind is the xlrd package > The end game for me is making plots of variables, combining them, and > doing regressions -- i

Re: [Tutor] getting and using information dict objects

2013-02-23 Thread Mitya Sirenef
On 02/23/2013 04:56 PM, Matthew Johnson wrote: Hi, I am trying to make a move from excel to python. My main need is economic data -- to do economic analysis. I have found the FRED package, and appear to have connected to the St Louis Fed's FRED and downloaded some data, but i'm not sure what to

Re: [Tutor] getting and using information dict objects

2013-02-23 Thread Alan Gauld
On 23/02/13 21:56, Matthew Johnson wrote: I am trying to make a move from excel to python. My main need is economic data -- to do economic analysis. Any particular reason for moving to Python? I know this is a Python list and we are all Python fans but, frankly, it sounds like your needs might

Re: [Tutor] getting and using information dict objects

2013-02-23 Thread Matthew Johnson
I can see i was being unclear: i wish to replace my analysis in excel with analysis in python. I am fairly sure i am querying the FRED API, but i am unsure how to _access and use_ the dict objects that it is returning. For example, how would i just print out values? Thanks for your help On 24/02

Re: [Tutor] getting and using information dict objects

2013-02-23 Thread Robert Sjoblom
> I am fairly sure i am querying the FRED API, but i am unsure how to > _access and use_ the dict objects that it is returning. For example, > how would i just print out values? If it's a dict object, the standard dictionary behavior and methods should work. I've not looked closely at the FRED API

Re: [Tutor] getting and using information dict objects

2013-02-23 Thread Matthew Johnson
Thanks very much; hopefully that's the boost i need to get rolling. Best regards matt On 24/02/2013, at 10:40 AM, Robert Sjoblom wrote: >> I am fairly sure i am querying the FRED API, but i am unsure how to >> _access and use_ the dict objects that it is returning. For example, >> how would i

Re: [Tutor] getting and using information dict objects

2013-02-23 Thread Matthew Johnson
For the sake of those who finds this thread -- the date / value pairs can be printed by the following: import fred fred.key(fredKey) gnpObvs = fred.observations('GNPCA') for i in range(1, len(gnpObvs['observations']['observation'])): print gnpObvs['observations']['observation'][i]['date'],

Re: [Tutor] getting and using information dict objects

2013-02-23 Thread Mitya Sirenef
On 02/23/2013 09:40 PM, Matthew Johnson wrote: For the sake of those who finds this thread -- the date / value pairs > can be printed by the following: > > import fred > > fred.key(fredKey) > > gnpObvs = fred.observations('GNPCA') > > for i in range(1, len(gnpObvs['observations']['observation']

Re: [Tutor] getting and using information dict objects

2013-02-23 Thread Dave Angel
On 02/23/2013 09:40 PM, Matthew Johnson wrote: For the sake of those who finds this thread -- the date / value pairs can be printed by the following: import fred fred.key(fredKey) gnpObvs = fred.observations('GNPCA') for i in range(1, len(gnpObvs['observations']['observation'])): print g