On Tue, Nov 05, 2013 at 03:55:05PM -0800, Johan Martinez wrote:
> I need help in modifying my program. Right now it looks as follows:
[snip code]
> Can someone help me in improving my code?
Yes! The first thing to do is get rid of the unnecessary class. This is
not Java where you have to write cl
On 05/11/13 23:55, Johan Martinez wrote:
I need help in modifying my program. Right now it looks as follows:
class Filedict():
def __init__(self, fname):
self.fname =fname
def parse(self):
with open(self.fname, 'r') as f:
# some file
I need help in modifying my program. Right now it looks as follows:
class Filedict():
def __init__(self, fname):
self.fname =fname
def parse(self):
with open(self.fname, 'r') as f:
# some file search and parsing logic
return parsed_fil
On Tue, Nov 5, 2013 at 2:40 PM, Walter Prins wrote:
> Hi,
>
>
> On 5 November 2013 19:02, Danny Yoo wrote:
>>>
>>> Be extra careful if you're constructing SQL statements from user input.
>>> You have probably heard of the term "SQL Injection" or "Bobby Tables", both
>>> of which are pretty much t
Hi,
On 5 November 2013 19:02, Danny Yoo wrote:
> Be extra careful if you're constructing SQL statements from user input.
>> You have probably heard of the term "SQL Injection" or "Bobby Tables",
>> both of which are pretty much the same thing: your user may, intentionally
>> or not, input valu
>
>
> from a SQLite database I get a value by SELECT s from... which normaly is
> a string, but can be the NULL value, wich means it is not defined. To put
> the value into a form (made by QT) I need a string representation.
>
> str(s) gives either the string itself (which is good) or "None" (which
On Mon, Nov 4, 2013 at 11:26 AM, Amal Thomas wrote:
> @Dave: thanks.. By the way I am running my codes on a server with about
> 100GB ram but I cant afford my code to use 4-5 times the size of the text
> file. Now I am using read() / readlines() , these seems to be more
> efficient in memory usag
On Nov 5, 2013, at 11:12 AM, Alan Gauld wrote:
> On 05/11/13 02:02, Danny Yoo wrote:
>
>> To visualize the sheer scale of the problem, see:
>>
>> http://i.imgur.com/X1Hi1.gif
>>
>> which would normally be funny, except that it's not quite a joke. :P
>
> I think I'm missing something. All I s
Ulrich Goebel wrote:
> Hallo,
>
> from a SQLite database I get a value by SELECT s from... which normaly
> is a string, but can be the NULL value, wich means it is not defined. To
> put the value into a form (made by QT) I need a string representation.
>
> str(s) gives either the string itself (
On Mon, Nov 04, 2013 at 11:34:01AM +0100, Ulrich Goebel wrote:
> Hallo,
>
> from a SQLite database I get a value by SELECT s from... which normaly
> is a string, but can be the NULL value, wich means it is not defined. To
> put the value into a form (made by QT) I need a string representation.
>
On Tue, Nov 05, 2013 at 04:12:51PM +, Alan Gauld wrote:
> On 05/11/13 02:02, Danny Yoo wrote:
>
> >To visualize the sheer scale of the problem, see:
> >
> >http://i.imgur.com/X1Hi1.gif
> >
> >which would normally be funny, except that it's not quite a joke. :P
>
> I think I'm missing somethi
On Mon, Nov 4, 2013 at 5:34 AM, Ulrich Goebel wrote:
> Hallo,
>
> from a SQLite database I get a value by SELECT s from... which normaly is a
> string, but can be the NULL value, wich means it is not defined. To put the
> value into a form (made by QT) I need a string representation.
>
> str(s) gi
Hallo,
from a SQLite database I get a value by SELECT s from... which normaly
is a string, but can be the NULL value, wich means it is not defined. To
put the value into a form (made by QT) I need a string representation.
str(s) gives either the string itself (which is good) or "None" (which
Hi,
here is the new code ... just leave a space behind every word.
import random
def wordList():
adj1 = ["Big ", "Small ", "Early ", "Late ", "Red ", "Tall ", "Short "]
subj = ["politician ", "man ", "woman ", "whale ", "company ", "child ",
"soldier "]
obj = ["budget ", "money ", "box ", "gift
On 05/11/13 02:02, Danny Yoo wrote:
To visualize the sheer scale of the problem, see:
http://i.imgur.com/X1Hi1.gif
which would normally be funny, except that it's not quite a joke. :P
I think I'm missing something. All I see in Firefox is
a vertical red bar. And in Chrome I don't even get t
On 5 November 2013 13:20, Amal Thomas wrote:
> On Mon, Nov 4, 2013 at 10:00 PM, Steven D'Aprano
> wrote:
>>
>
>>
>> import os
>> filename = "YOUR FILE NAME HERE"
>> print("File size:", os.stat(filename).st_size)
>> f = open(filename)
>> content = f.read()
>> print("Length of content actually read
On 4 November 2013 17:41, Amal Thomas wrote:
> @Steven: Thank you...My input data is basically AUGC and newlines... I would
> like to know about bytearray technique. Please suggest me some links or
> reference.. I will go through the profiler and check whether the code
> maintains linearity with t
On Mon, Nov 4, 2013 at 10:00 PM, Steven D'Aprano
wrote:
>
>
> import os
> filename = "YOUR FILE NAME HERE"
> print("File size:", os.stat(filename).st_size)
> f = open(filename)
> content = f.read()
> print("Length of content actually read:", len(content))
> print("Current file position:", f.tell(
18 matches
Mail list logo