Hi,
I have the same result even with:
sqlite3.connect(r'...')
Any other alternatives?
Thank you.
On Sun, Dec 15, 2013 at 4:58 PM, MRAB wrote:
> On 15/12/2013 22:46, Igor Korot wrote:
>>
>> Tim,
>>
>> On Sun, Dec 15, 2013 at 4:29 AM, Tim Chase
>> wrote:
>>>
>>> On 2013-12-15 06:17, Tim Chase
On Mon, Dec 16, 2013 at 1:43 PM, Igor Korot wrote:
> So, how do I convert my string to one of those?
> I realized I can just do replace '/' to '\', but is there a better
> alternative?
The path is exactly the same, whether you use forward slashes or
backslashes, on Windows. Most of the world use
On Sun, 15 Dec 2013 18:43:53 -0800, Igor Korot
wrote:
On Sun, Dec 15, 2013 at 4:58 PM, MRAB
wrote:
> When writing paths on Windows, it's a good idea to use raw string
> literals or slashes instead of backslashes:
>
> conn = sqlite3.connect(r'c:\Documents and
> Settings\Igor.FORDANWORK
Hi,
On Sun, Dec 15, 2013 at 4:58 PM, MRAB wrote:
> On 15/12/2013 22:46, Igor Korot wrote:
>>
>> Tim,
>>
>> On Sun, Dec 15, 2013 at 4:29 AM, Tim Chase
>> wrote:
>>>
>>> On 2013-12-15 06:17, Tim Chase wrote:
>
> conn = sqlite3.connect('x.sqlite',
>>
>> ... detect_types=sqli
On 15/12/2013 22:46, Igor Korot wrote:
Tim,
On Sun, Dec 15, 2013 at 4:29 AM, Tim Chase
wrote:
On 2013-12-15 06:17, Tim Chase wrote:
conn = sqlite3.connect('x.sqlite',
... detect_types=sqlite3.PARSE_DECLTYPES|sqlite3.PARSE_COLNAMES)
Your example code omitted this one crucial line. Do you s
Tim,
On Sun, Dec 15, 2013 at 4:29 AM, Tim Chase
wrote:
> On 2013-12-15 06:17, Tim Chase wrote:
>>> conn = sqlite3.connect('x.sqlite',
... detect_types=sqlite3.PARSE_DECLTYPES|sqlite3.PARSE_COLNAMES)
>>
>> Your example code omitted this one crucial line. Do you specify the
>> detect_types
On 2013-12-15 06:17, Tim Chase wrote:
>> conn = sqlite3.connect('x.sqlite',
>>>... detect_types=sqlite3.PARSE_DECLTYPES|sqlite3.PARSE_COLNAMES)
>
> Your example code omitted this one crucial line. Do you specify the
> detect_types parameter to connect()?
It's really the PARSE_DECLTYPES that
On 2013-12-14 23:49, Igor Korot wrote:
> Tim,
>
> On Sun, Dec 8, 2013 at 2:18 PM, Tim Chase wrote:
> conn = sqlite3.connect('x.sqlite',
>>... detect_types=sqlite3.PARSE_DECLTYPES|sqlite3.PARSE_COLNAMES)
Your example code omitted this one crucial line. Do you specify the
detect_types paramete
Tim,
On Sun, Dec 8, 2013 at 2:18 PM, Tim Chase wrote:
> On 2013-12-08 12:58, Igor Korot wrote:
>> Also, the data comes from either SQLite or mySQL and so to eliminate
>> the difference between those engines dates are processed as strings
>> and converted to dates for the calculation purposes only
On Sun, 8 Dec 2013 12:58:18 -0800, Igor Korot
wrote:
It's input is the query result, so there is no looping when the
function is called. It is called only once.
Then why save part of the result in an instance attribute? Just
return all of the results as a tuple.
--
DaveA
--
https://mail.py
On 2013-12-08 12:58, Igor Korot wrote:
> Also, the data comes from either SQLite or mySQL and so to eliminate
> the difference between those engines dates are processed as strings
> and converted to dates for the calculation purposes only.
> Maybe I will need to refactor SQLite processing to get th
-- Forwarded message --
From: Igor Korot
Date: Sun, Dec 8, 2013 at 12:57 PM
Subject: Re: Eliminate "extra" variable
To: Roy Smith
Hi, guys,
Thank you for all those valuable suggestions.
2Tim Chase:
I guess you missed this: "My originalData comes from the databas
In article ,
Mark Lawrence wrote:
> On 08/12/2013 18:58, Tim Chase wrote:
> > On 2013-12-07 23:14, Igor Korot wrote:
>
> [big snip]
>
> >
>
> Whenever I need date manipulations I always reach out to this
> http://labix.org/python-dateutil
The problem with dateutil is it's dog slow. Sure, I
On 08/12/2013 19:23, Tim Chase wrote:
On 2013-12-08 19:10, Mark Lawrence wrote:
On 08/12/2013 18:58, Tim Chase wrote:
On 2013-12-07 23:14, Igor Korot wrote:
[big snip]
Whenever I need date manipulations I always reach out to this
http://labix.org/python-dateutil
But based on the OP's repea
On 2013-12-08 19:10, Mark Lawrence wrote:
> On 08/12/2013 18:58, Tim Chase wrote:
> > On 2013-12-07 23:14, Igor Korot wrote:
>
> [big snip]
>
> Whenever I need date manipulations I always reach out to this
> http://labix.org/python-dateutil
But based on the OP's repeated transformations from
On 08/12/2013 18:58, Tim Chase wrote:
On 2013-12-07 23:14, Igor Korot wrote:
[big snip]
Whenever I need date manipulations I always reach out to this
http://labix.org/python-dateutil
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our languag
On 2013-12-07 23:14, Igor Korot wrote:
> def MyFunc(self, originalData):
> self.dates = []
> data = {}
> dateStrs = []
> for i in xrange(0, len(originalData)):
> dateStr, freq, source = originalData[i]
> data[str(dateStr)] = {source: freq}
>
On 2013-12-08 15:04, Peter Otten wrote:
> > data = dict(
> > (str(date), {source: freq})
> > for date, freq, source in original_data
> > )
>
> or even just
>
> data = {str(date): {source: freq}
> for date, freq, source in original_data}
I maintain enough pre-2.7 c
Tim Chase wrote:
> On 2013-12-06 11:37, Igor Korot wrote:
>> def MyFunc(self, originalData):
>> data = {}
>> for i in xrange(0, len(originalData)):
>>dateStr, freq, source = originalData[i]
>>data[str(dateStr)] = {source: freq}
>
> this can be more cleanly/pytho
OK, here is the complete function code that I'm trying to improve.
def MyFunc(self, originalData):
self.dates = []
data = {}
dateStrs = []
for i in xrange(0, len(originalData)):
dateStr, freq, source = originalData[i]
data[str(dateStr)] = {source: fr
On 12/06/2013 03:38 PM, Joel Goldstick wrote:
On Fri, Dec 6, 2013 at 2:37 PM, Igor Korot wrote:
def MyFunc(self, originalData):
data = {}
dateStrs = []
for i in xrange(0, len(originalData)):
dateStr, freq, source = originalData[i]
On 2013-12-06 11:37, Igor Korot wrote:
> def MyFunc(self, originalData):
> data = {}
> for i in xrange(0, len(originalData)):
>dateStr, freq, source = originalData[i]
>data[str(dateStr)] = {source: freq}
this can be more cleanly/pythonically written as
def my_
On Fri, Dec 6, 2013 at 7:16 PM, Roy Smith wrote:
> In article ,
> Joel Goldstick wrote:
>
> > Python lets you iterate over a list directly, so :
> >
> > for d in originalData:
> > dateStr, freq, source = d
> > data[source] = freq
>
> I would make it even simpler:
>
> > f
In article ,
Joel Goldstick wrote:
> Python lets you iterate over a list directly, so :
>
> for d in originalData:
> dateStr, freq, source = d
> data[source] = freq
I would make it even simpler:
> for dateStr, freq, source in originalData:
> data[source] = freq
On Fri, Dec 6, 2013 at 2:37 PM, Igor Korot wrote:
> Hi, ALL,
> I have following code:
>
> def MyFunc(self, originalData):
> data = {}
> dateStrs = []
> for i in xrange(0, len(originalData)):
>dateStr, freq, source = originalData[i]
>data[str(dateStr)] = {so
On 12/06/2013 11:37 AM, Igor Korot wrote:
Hi, ALL,
I have following code:
def MyFunc(self, originalData):
data = {}
dateStrs = []
for i in xrange(0, len(originalData)):
dateStr, freq, source = originalData[i]
data[str(dateStr)] = {source: freq}
Hi, ALL,
I have following code:
def MyFunc(self, originalData):
data = {}
dateStrs = []
for i in xrange(0, len(originalData)):
dateStr, freq, source = originalData[i]
data[str(dateStr)] = {source: freq}
dateStrs.append(dateStr)
for i in xrange(0
27 matches
Mail list logo