Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder2.hal-mli.net!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'example:': 0.03; 'subject:not': 0.03; 'debugging': 0.07; 'level,': 0.07; "subject:' ": 0.07; '*is*': 0.09; 'append': 0.09; 'data:': 0.09; 'expected.': 0.09; 'pretend': 0.09; 'question?': 0.09; 'run,': 0.09; 'subject:Why': 0.09; 'subject:into': 0.09; 'try:': 0.09; 'utilizing': 0.09; 'cc:addr:python-list': 0.11; 'bug': 0.12; 'random': 0.14; '"for"': 0.16; 'fine;': 0.16; 'henry': 0.16; 'idea:': 0.16; 'log.': 0.16; 'nick': 0.16; 'raised.': 0.16; 'stringio': 0.16; 'subject:format': 0.16; 'sure.': 0.16; 'volunteers.': 0.16; 'skip:= 10': 0.16; 'weird': 0.16; 'appropriate': 0.16; 'do,': 0.16; 'hire': 0.16; 'wrote:': 0.18; 'obviously': 0.18; 'bit': 0.19; 'possible,': 0.19; 'meant': 0.20; 'written': 0.21; 'help.': 0.21; 'example': 0.22; 'cc:addr:python.org': 0.22; 'print': 0.22; 'error': 0.23; 'entries': 0.24; 'file.': 0.24; 'question': 0.24; 'cc:2**0': 0.24; "i've": 0.25; 'script': 0.25; 'least': 0.26; 'code:': 0.26; 'primary': 0.26; 'values': 0.27; 'header:In-Reply-To:1': 0.27; 'record': 0.27; 'tried': 0.27; 'rest': 0.29; 'received:209.85.217': 0.29; "doesn't": 0.30; 'message- id:@mail.gmail.com': 0.30; 'skip:( 20': 0.30; 'code': 0.31; 'lines': 0.31; 'that.': 0.31; 'large.': 0.31; 'searches': 0.31; 'skip:= 20': 0.31; 'unique,': 0.31; 'file': 0.32; 'there.': 0.32; 'run': 0.32; 'checking': 0.33; 'noticed': 0.34; 'subject:the': 0.34; 'received:209.85': 0.35; 'problem.': 0.35; 'objects': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'really': 0.36; "i'll": 0.36; 'subject:?': 0.36; 'should': 0.36; 'detail': 0.37; 'example,': 0.37; 'half': 0.37; 'so,': 0.37; 'list': 0.37; 'received:209': 0.37; 'step': 0.37; 'stopped': 0.38; 'needed': 0.38; 'files': 0.38; 'explain': 0.39; 'does': 0.39; 'how': 0.40; 'skip:u 10': 0.60; 'tell': 0.60; 'forum': 0.61; 'new': 0.61; 'first': 0.61; 'you.': 0.62; 'here:': 0.62; 'back': 0.62; 'here': 0.66; 'frustrated': 0.68; 'skill': 0.68; 'respect': 0.70; 'helping': 0.70; 'behavior': 0.77; '(url)': 0.84; 'easier,': 0.84; "else's": 0.84; 'irrelevant': 0.84; 'to:addr:support': 0.84; 'mean.': 0.91; 'angry': 0.93; '2013': 0.98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; bh=HVWfL2/1H/Kv2risRY+fJguXYYac3IG5oHd1ZTCulfs=; b=uBGLB/MwNS1RfSRhvu7jXBZxpZMWv46NPWUqew+ZrRG64Ufr65BrU9UGi6Jd80xNug fkGQKnh9twUU8Rev7f1wt90e1gwA1hIL+txqmr9q7vtVcJeDq0k6AA+9OIOuuXIo12xf Z4CoBRNGQdJezxx4B6wzpeODL3F1BPSLRaK3x0QWnhgq9JuY2VrO+EXAPgMruJ3wJ/gb FcS0A0Qyhz/ZcoVWAp1oa7sXy22ea6R+0+NVVTIWolci5VIv92P7bUx2/iNhk1WdpFNI 9ibkr+Fyb1EyjKPsiWVj3VX65P08u6N7Mqs2gRhyq3e3xQilhSJihzZaOFboaDyhnK/r 5LSQ== X-Received: by 10.112.89.226 with SMTP id br2mr3469437lbb.12.1371328665257; Sat, 15 Jun 2013 13:37:45 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: From: Joshua Landau Date: Sat, 15 Jun 2013 21:37:05 +0100 Subject: Re: Why 'files.py' does not print the filenames into a table format? To: Nick the Gr33k Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: python-list X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 85 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1371328673 news.xs4all.nl 15975 [2001:888:2000:d::a6]:59547 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:48367 On 15 June 2013 20:51, Nick the Gr33k wrote: > On 15/6/2013 10:46 =CE=BC=CE=BC, Jarrod Henry wrote: >> >> Nick, at this point, you need to hire someone to do your work for you. > > > The code is completely ready. > Some detail is missing and its not printing the files as expected. Look, Nick, A lot of people are frustrated by you. You should understand that. If you cannot, you need to step back and consider, or you really are a troll. Now, obviously it's not going to get you any help to have half of the forum angry at you. People have stopped helping, at least in large. This is fine; people here are volunteers. But you want help. So, Nick, listen. You need to learn how to ask *smart* questions. If you do, I *guarantee* that people will respect you a lot more. I'll be willing to give a bit of time to explain what I mean. 1) What is your problem. Not "I want to know why it doesn't print anything." Here's an example, for some random idea: > I've written some code to find the first file in a directory which > is not UTF-8. Lines 40-42 are meant to print out the file found > to a log ("/home/joshua/.logs/log"). Unfortunately, although > there is no error, no file is printed to the log. 2) What have you tried? What debugging have you done? For someone of your skill level, it's also important to tell us what you think your code is doing. Example: > I've tried checking for a failure - when there is no non-UTF-8 file > in the directory the appropriate error is raised. I think this should > mean that the "else" after the "for" loop would be run, and this > should run the lines 40-42 above when there *is* a non-UTF-8 > file. 3) If possible, give us an example we can run. > To make helping easier, I've removed the code that searches the > directory as I know that works, and instead there's a list of BytesIO > and StringIO objects that pretend to be them. The bug is still > there. Do you see the difference? > Irrelevant to my question i just noticed weird behavior about my > pelatologio.py script which can be seen here: > > http://superhost.gr/?show=3Dstats > > The first 3 files are of my doing. > All the rest are of someone else's that managed to append entries into my > counters database utilizing this code: > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > try: > #find the needed counter for the page URL > cur.execute('''SELECT ID FROM counters WHERE url =3D %s''= ', > page ) > data =3D cur.fetchone() #URL is unique, so should = only > be one > > if not data: > #first time for page; primary key is automatic, h= it > is defaulted > cur.execute('''INSERT INTO counters (url) VALUES > (%s)''', page ) > cID =3D cur.lastrowid #get the primary key > value of the new record > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > Does someone want to state something? Sure. Here I go: What's the question?