John Machin wrote:
> On Nov 22, 11:04 am, r0g <[EMAIL PROTECTED]> wrote:
On Nov 21, 10:18 am, Chuck Connors <[EMAIL PROTECTED]> wrote:
> Any help, pseudo code, or whatever push in the right direction would
> be most appreciated. I am a novice Python programmer but I do hav
Firstly, I would like to thank those that offered help. I was able to
get my data into the database and also have connectivity with the
mysql and can pull the data in/out at will. Hooray and thanks again.
Secondly, perhaps I overstated my abilities. I have written a couple
of websites from scr
* Chuck Connors (Fri, 21 Nov 2008 08:10:09 -0800 (PST))
> Wow! What a change in direction from the previous post. Thank you
> both for the help and the explanations. This will work great!
No, it will not. For manipulating CSV data in Python you use the
(*tada*) CSV module ("import csv"). The P
John Machin wrote:
> On Nov 22, 11:04 am, r0g <[EMAIL PROTECTED]> wrote:
[...]>> If you can't muster even that level of enthusiasm or courtesy
towards
>> the noobs then you always have the option of not responding.
>
> Your "if X then Y" logic is somewhat cockeyed -- Y is true independent
> of X.
On Nov 22, 11:04 am, r0g <[EMAIL PROTECTED]> wrote:
> >> On Nov 21, 10:18 am, Chuck Connors <[EMAIL PROTECTED]> wrote:
> >>> Any help, pseudo code, or whatever push in the right direction would
> >>> be most appreciated. I am a novice Python programmer but I do have a
> >>> good bi
On Nov 22, 2:28 am, Joe Strout <[EMAIL PROTECTED]> wrote:
> A follow-up question here... is it really necessary to close things
> like files in Python?
Not if you use a context manager (2.6+, available in 2.5 from
__future__):
with open('data.csv', 'wb') as csvfile:
writer = csv.writer(csvfil
>> On Nov 21, 10:18 am, Chuck Connors <[EMAIL PROTECTED]> wrote:
>>> Any help, pseudo code, or whatever push in the right direction would
>>> be most appreciated. I am a novice Python programmer but I do have a
>>> good bit of PHP programming experience.
John Machin wrote:
> If
On Nov 22, 7:38 am, George Sakkis <[EMAIL PROTECTED]> wrote:
> On Nov 21, 2:01 pm, Richard Riley <[EMAIL PROTECTED]> wrote:
>
>
>
> > George Sakkis <[EMAIL PROTECTED]> writes:
> > > On Nov 21, 11:05 am, Steve Holden <[EMAIL PROTECTED]> wrote:
> > >> George Sakkis wrote:
> > >> > On Nov 21, 10:18 am
On Nov 21, 2:01 pm, Richard Riley <[EMAIL PROTECTED]> wrote:
> George Sakkis <[EMAIL PROTECTED]> writes:
> > On Nov 21, 11:05 am, Steve Holden <[EMAIL PROTECTED]> wrote:
> >> George Sakkis wrote:
> >> > On Nov 21, 10:18 am, Chuck Connors <[EMAIL PROTECTED]> wrote:
>
> >> >> Any help, pseudo code,
Chuck Connors wrote:
> Hey guys. I'm working on a little program to help my wife catalog her/
> our coupons. I found a good resource but need help formatting the
> text data so that I can import it into a mysql database. Here's the
> data format:
>
> 40922003 Life Fitness Products $1 (12-13-
George Sakkis <[EMAIL PROTECTED]> writes:
> On Nov 21, 11:05 am, Steve Holden <[EMAIL PROTECTED]> wrote:
>> George Sakkis wrote:
>> > On Nov 21, 10:18 am, Chuck Connors <[EMAIL PROTECTED]> wrote:
>>
>> >> Any help, pseudo code, or whatever push in the right direction would
>> >> be most appreciate
On Nov 21, 11:05 am, Steve Holden <[EMAIL PROTECTED]> wrote:
> George Sakkis wrote:
> > On Nov 21, 10:18 am, Chuck Connors <[EMAIL PROTECTED]> wrote:
>
> >> Any help, pseudo code, or whatever push in the right direction would
> >> be most appreciated. I am a novice Python programmer but I do have
On Nov 21, 2008, at 10:26 AM, MRAB wrote:
The file will be closed automatically when the file object is
garbage-collected.
CPython uses reference-counting, so the file object is garbage-
collected as soon as there are no references to it.
Jython (and IronPython?) are garbage-collected in t
On 2008-11-21 16:18, Chuck Connors wrote:
> Hey guys. I'm working on a little program to help my wife catalog her/
> our coupons. I found a good resource but need help formatting the
> text data so that I can import it into a mysql database. Here's the
> data format:
>
> 40922003 Life Fitnes
Tim Golden wrote:
Joe Strout wrote:
A follow-up question here... is it really necessary to close things
like files in Python? I've been slumming it in the REALbasic
community for the last decade, where you generally don't worry about
such things, as any object that represents something "open"
Tim Chase wrote:
yes, the CSV module has some wonderful stuff in it, and I regularly use
it for *reading* CSV files. But for writing them, it's often just as
fast (for my purposes) to simply code my 1st post's quickie as it is to
scrounge in the docs/docstrings to remember how to let the CSV d
Tim Golden wrote:
Tim Chase wrote:
>>> qfields = ['"' + fld.strip() + '"' for fld in (num,desc,date)]
>>> out = qfields.join(',')
Just a quick note here to prevent the confusion of the OP...this should be
','.join(qfields)
To be honest, it's so easy to use the stdlib csv module
that I'd
Joe Strout wrote:
A follow-up question here... is it really necessary to close things like
files in Python? I've been slumming it in the REALbasic community for
the last decade, where you generally don't worry about such things, as
any object that represents something "open" will automatically
On Nov 21, 2008, at 9:22 AM, Tim Golden wrote:
Tim Chase wrote:
>>> qfields = ['"' + fld.strip() + '"' for fld in (num,desc,date)]
>>> out = qfields.join(',')
Just a quick note here to prevent the confusion of the OP...this
should be
','.join(qfields)
Thanks Tim #1, for pointing out my er
Tim Chase wrote:
>>> qfields = ['"' + fld.strip() + '"' for fld in (num,desc,date)]
>>> out = qfields.join(',')
Just a quick note here to prevent the confusion of the OP...this should be
','.join(qfields)
To be honest, it's so easy to use the stdlib csv module
that I'd always recommend t
Wow! What a change in direction from the previous post. Thank you
both for the help and the explanations. This will work great!
--
http://mail.python.org/mailman/listinfo/python-list
>>> qfields = ['"' + fld.strip() + '"' for fld in (num,desc,date)]
>>> out = qfields.join(',')
Just a quick note here to prevent the confusion of the OP...this
should be
','.join(qfields)
-tkc
--
http://mail.python.org/mailman/listinfo/python-list
George Sakkis wrote:
> On Nov 21, 10:18 am, Chuck Connors <[EMAIL PROTECTED]> wrote:
>
>> Any help, pseudo code, or whatever push in the right direction would
>> be most appreciated. I am a novice Python programmer but I do have a
>> good bit of PHP programming experience.
>
> I'm wondering if P
On Nov 21, 2008, at 8:18 AM, Chuck Connors wrote:
The first value (large number) is the UPC, the next element is the
coupon description, followed by a date in parenthesis. Those are the
only three elements I am concerned with. Can someone help me in
reformatting this:
40922003 Life Fitnes
40922003 Life Fitness Products $1 (12-13-08) (CVS)
546500181141 Oust Air Sanitizer, any B1G1F up to $3.49 (1-17-09) .35
each
518000159258 Pillsbury Crescent Dinner Rolls, any .25 (2-14-09)
518000550406 Pillsbury Frozen Grands Biscuits, Cinnamon Rolls, Mini
Cinnamon Rolls, etc. .40 (2-14-09)
i
> I'm wondering if PHP experience precludes the ability to use a search
> engine before asking for help...
Thanks for the push in the right direction, friend.
--
http://mail.python.org/mailman/listinfo/python-list
On Nov 21, 10:18 am, Chuck Connors <[EMAIL PROTECTED]> wrote:
> Any help, pseudo code, or whatever push in the right direction would
> be most appreciated. I am a novice Python programmer but I do have a
> good bit of PHP programming experience.
I'm wondering if PHP experience precludes the abil
27 matches
Mail list logo