urgent help

2015-02-20 Thread ismahameed
sir these errors whats mean by it warning (from warnings module): File "D:\PHD 1st semester\scripts\NetDoctor\getNetDoctor.py", line 18 br.set_handle_gzip(True) UserWarning: gzip transfer encoding is experimental! Traceback (most recent call last): File "D:\PHD 1st semester\scripts\NetDoc

Re: urgent help

2015-02-20 Thread Mark Lawrence
On 20/02/2015 08:24, ismaham...@gcuf.edu.pk wrote: Would you please give your requests a meaningful subject. sir these errors whats mean by it warning (from warnings module): File "D:\PHD 1st semester\scripts\NetDoctor\getNetDoctor.py", line 18 br.set_handle_gzip(True) UserWarning: gzip

Re: Logging with Custom Levels not working

2015-02-20 Thread Ian Kelly
On Thu, Feb 19, 2015 at 11:16 AM, Didymus wrote: > On Wednesday, February 18, 2015 at 3:16:40 PM UTC-5, Ian wrote: >> > def perror(self, message, *args, **kws): >> > """ Performance Error Message Level """ >> > # Yes, logger takes its '*args' as 'args'. >> > self._log(PERROR_NUM, messa

Date Difference issue in Python 2.7.8

2015-02-20 Thread Puruganti Ramesh
Hi, I have an issue in comparing dates in python 2.7.8 I have written code as below but i am getting error import datetime as dt from datetime import datetime from datetime import datetime, timedelta, date dt_str='2014-5-11' dt_strq='2014-9-11' dt_datea = datetime.strptime(dt_str, '%Y-%m-%d').

Re: Bad text appearance in IDLE

2015-02-20 Thread ast
"David H. Lipman" a écrit dans le message de news:czgdnvx2faf0q0ljnz2dnuu7-uwdn...@giganews.com... http://support.microsoft.com/kb/3013455 KB3013455 has been found to be causing Display Font problems for Windows Vista and Server 2003. A partial mitigation is to use ClearType Font Smoothin

Re: Date Difference issue in Python 2.7.8

2015-02-20 Thread Chris Angelico
On Fri, Feb 20, 2015 at 8:32 PM, Puruganti Ramesh wrote: > import datetime as dt > from datetime import datetime > from datetime import datetime, timedelta, date The first two lines here are achieving nothing - the third should be all you need. > dt_str='2014-5-11' > dt_strq='2014-9-11' > > dt_d

Re: Date Difference issue in Python 2.7.8

2015-02-20 Thread Peter Otten
Puruganti Ramesh wrote: > I have an issue in comparing dates in python 2.7.8 No, you are stuck with parsing the dates, you don't get to the point of comparing them. > I am getting below excption > Traceback (most recent call last): > File "FunctionUpdate.py", line 204, in > dt_dateb = datetime

Re: What the Pythons docs means by "container" ?

2015-02-20 Thread Rustom Mody
On Wednesday, February 18, 2015 at 2:51:34 AM UTC+5:30, candide wrote: > Official Python documentation very frequently invokes a mysterious > *container* data structure. The PLR manual explains : > > -- > Some objects contain references to other objects; these are called c

Re: What behavior would you expect?

2015-02-20 Thread Gregory Ewing
Jason Friedman wrote: It's a shame that glob.glob does not take an arbitrary directory as an optional argument if one does not want to scan the current directory. It doesn't have to -- you can give it an absolute path: >>> from glob import glob >>> glob("/usr/include/std*.h") ['/usr/include/st

Re: What behavior would you expect?

2015-02-20 Thread Dave Angel
On 02/20/2015 12:51 AM, Jason Friedman wrote: I'd still advise using my_list.sort() rather than sorted(), as you don't need to retain the original. Hmm. Trying to figure out what that looks like. If I understand correctly, list.sort() returns None. What would I return to the caller? r

Re: Python - parsing nested information and provide it in proper format from log file

2015-02-20 Thread Peter Otten
Jay T wrote: > have some log file which has nested data which i want to filter and > provide specific for student with total counts > > Here is my log file sample: > Student name is ABC > Student age is 12 > student was late > student was late > student was late > Student name is DEF > student

Re: Logging with Custom Levels not working

2015-02-20 Thread Didymus
On Friday, February 20, 2015 at 4:25:50 AM UTC-5, Ian wrote: > > On Wednesday, February 18, 2015 at 3:16:40 PM UTC-5, Ian wrote: > >> > def perror(self, message, *args, **kws): > >> > """ Performance Error Message Level """ > >> > # Yes, logger takes its '*args' as 'args'. > >> > self._

Re: Python - parsing nested information and provide it in proper format from log file

2015-02-20 Thread jt11380
On Friday, February 20, 2015 at 8:11:59 AM UTC-5, Peter Otten wrote: > Jay T wrote: > > > have some log file which has nested data which i want to filter and > > provide specific for student with total counts > > > > Here is my log file sample: > > Student name is ABC > > Student age is 12 > >

Re: Python - parsing nested information and provide it in proper format from log file

2015-02-20 Thread Peter Otten
jt11...@gmail.com wrote: > On Friday, February 20, 2015 at 8:11:59 AM UTC-5, Peter Otten wrote: >> Jay T wrote: >> >> > have some log file which has nested data which i want to filter and >> > provide specific for student with total counts >> > >> > Here is my log file sample: >> > Student nam

Python path on windows

2015-02-20 Thread loial
On Linux we use #!/usr/bin/env python At the start of scripts to ensure that the python executable used is the one defined in the PATH variable, rather than hardcoding a path to the python executable. What is the equivalent functionality in Windows? -- https://mail.python.org/mailman/listinf

Re: Python path on windows

2015-02-20 Thread Dave Angel
On 02/20/2015 09:43 AM, loial wrote: On Linux we use #!/usr/bin/env python At the start of scripts to ensure that the python executable used is the one defined in the PATH variable, rather than hardcoding a path to the python executable. What is the equivalent functionality in Windows? Dep

Re: Python path on windows

2015-02-20 Thread Ian Kelly
On Feb 20, 2015 7:46 AM, "loial" wrote: > > On Linux we use > #!/usr/bin/env python > > At the start of scripts to ensure that the python executable used is the one defined in the PATH variable, rather than hardcoding a path to the python executable. > > What is the equivalent functionality in Win

pypandoc and restructured text

2015-02-20 Thread alb
Hi everyone, I'm trying to convert restructured text to latex with pandoc and it seems to me there's something not correctly working. I have the following text: .. figure:: picture.png :scale: 50 % :alt: map to buried treasure This is the caption of the figure (a simple paragraph).

Re: Python path on windows

2015-02-20 Thread loial
On Friday, February 20, 2015 at 2:54:26 PM UTC, Ian wrote: > On Feb 20, 2015 7:46 AM, "loial" wrote: > > > > > > On Linux we use > > > #!/usr/bin/env python > > > > > > At the start of scripts to ensure that the python executable used is the > > one defined in the PATH variable, rather than

Re: pypandoc and restructured text

2015-02-20 Thread Wolfgang Maier
On 20.02.2015 15:59, alb wrote: My installation is the following: pandoc 1.5.1.1 python 2.6.6 debian squeeze Any idea why? Should I upgrade somehow beyond what the debian repository delivers? I have pandoc 1.12.2.1 and it recognizes the figure directive just fine (tested with html output so

Python Requests logging 401 immediately before 200

2015-02-20 Thread Zach Dunlap
Hi everyone, I'm using MarkLogic and have a Python script set up to check for documents using Requests (http://docs.python-requests.org/en/latest/) and I have logging included in the script. I have logging set to the DEBUG level. When I set the script to simple search and return the HTTP statu

Re: Accessible tools

2015-02-20 Thread Eric S. Johansson
On 2/19/2015 10:33 AM, Bryan Duarte wrote: Thank you jwi, and Jacob, I took a look at that posting and it seems pretty unique. I am not much interested in the speech driven development, but I am very interested in developing an accessible IDE. Well you should be because it looks like an aur

Re: Python Requests logging 401 immediately before 200

2015-02-20 Thread Chris Angelico
On Sat, Feb 21, 2015 at 4:16 AM, Zach Dunlap wrote: > INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection > (1): localhost > DEBUG:requests.packages.urllib3.connectionpool:"GET > /v1/documents?uri=000248e4331d4db5856df8fd427b3cdb.xml HTTP/1.1" 401 211 > DEBUG:requests.pack

Re: Python Requests logging 401 immediately before 200

2015-02-20 Thread Zach Dunlap
On Friday, February 20, 2015 at 12:31:00 PM UTC-5, Chris Angelico wrote: > On Sat, Feb 21, 2015 at 4:16 AM, Zach Dunlap wrote: > > INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection > > (1): localhost > > DEBUG:requests.packages.urllib3.connectionpool:"GET > > /v1/documen

Re: Python path on windows

2015-02-20 Thread Ian Kelly
On Fri, Feb 20, 2015 at 8:16 AM, loial wrote: > On Friday, February 20, 2015 at 2:54:26 PM UTC, Ian wrote: >> On Feb 20, 2015 7:46 AM, "loial" wrote: >> >> > >> >> > On Linux we use >> >> > #!/usr/bin/env python >> >> > >> >> > At the start of scripts to ensure that the python executable used is

Re: Python path on windows

2015-02-20 Thread Mark Lawrence
On 20/02/2015 15:16, loial wrote: On Friday, February 20, 2015 at 2:54:26 PM UTC, Ian wrote: On Feb 20, 2015 7:46 AM, "loial" wrote: On Linux we use #!/usr/bin/env python At the start of scripts to ensure that the python executable used is the one defined in the PATH variable,

Re: Python Requests logging 401 immediately before 200

2015-02-20 Thread Mark Lawrence
On 20/02/2015 17:16, Zach Dunlap wrote: Hi everyone, I'm using MarkLogic A name that frightens me to death, what idiot thought of that? :) -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailm

Re: Accessible tools

2015-02-20 Thread Jacob Kruger
Eric, issue is that with screenreaders, we're generally way more into navigating code and interface character by character/by keyboard, so , yes, keeping interface relatively simple is a good thing, but, we also would prefer to primarily keep all interface elements to make use of standard UI contr

Re: What the Pythons docs means by "container" ?

2015-02-20 Thread Ian Kelly
On Fri, Feb 20, 2015 at 4:37 AM, Rustom Mody wrote: > See https://www.python.org/dev/peps/pep-0246/ > > There Guido says "something much better is about to happen" > > Best as I know its not happened yet... Well, since that PEP was rejected we now have ABCs. Although PEP 3119 wasn't written until

Re: Python path on windows

2015-02-20 Thread Wolfgang Maier
On 20.02.2015 19:25, Ian Kelly wrote: On Fri, Feb 20, 2015 at 8:16 AM, loial wrote: On Friday, February 20, 2015 at 2:54:26 PM UTC, Ian wrote: On Feb 20, 2015 7:46 AM, "loial" wrote: On Linux we use #!/usr/bin/env python At the start of scripts to ensure that the python execut

Re: 'Lite' Databases (Re: sqlite3 and dates)

2015-02-20 Thread Paul Rubin
Ben Finney writes: > I don't know of a free-software concurrent RDBMS which can be considered > lighter than that. (No, MySQL doesn't count; its concurrency is > *unreliable* and it commonly loses data silently. Don't use MySQL.) I thought they fixed MySQL transactions years ago, with the InnoDB

Re: 'Lite' Databases (Re: sqlite3 and dates)

2015-02-20 Thread Mark Lawrence
On 20/02/2015 21:17, Paul Rubin wrote: Ben Finney writes: I don't know of a free-software concurrent RDBMS which can be considered lighter than that. (No, MySQL doesn't count; its concurrency is *unreliable* and it commonly loses data silently. Don't use MySQL.) I thought they fixed MySQL tra

Re: 'Lite' Databases (Re: sqlite3 and dates)

2015-02-20 Thread Ethan Furman
On 02/20/2015 01:17 PM, Paul Rubin wrote: > SQLite always seemed bloated (from the embedded NoSQL point of view) and > fragile to me, and the vendor plays an annoying anti-forking trick, > which is that the code is released but the developers' test suite is > secret and proprietary (can be license

subprocess command fails

2015-02-20 Thread Brad s
# cat makekeys.py #!/usr/bin/python3.4 import subprocess import sys import string import os.path import datetime import shlex from time import gmtime, strftime from subprocess import Popen, PIPE, STDOUT pretime = strftime("%Y%m%d%H", gmtime()) time = datetime.datetime.strptime(pretime,'%Y%m%d%H')

Re: urgent help

2015-02-20 Thread ms . isma222
On Friday, February 20, 2015 at 4:41:57 PM UTC+8, Mark Lawrence wrote: > On 20/02/2015 08:24, ismaham...@gcuf.edu.pk wrote: > > Would you please give your requests a meaningful subject. > > > sir these errors whats mean by it > > warning (from warnings module): > >File "D:\PHD 1st semester\sc

Re: urgent help

2015-02-20 Thread ms . isma222
On Saturday, February 21, 2015 at 8:14:43 AM UTC+8, ms.is...@gmail.com wrote: > On Friday, February 20, 2015 at 4:41:57 PM UTC+8, Mark Lawrence wrote: > > On 20/02/2015 08:24, ismaham...@gcuf.edu.pk wrote: > > > > Would you please give your requests a meaningful subject. > > > > > sir these error

Re: urgent help

2015-02-20 Thread ms . isma222
On Saturday, February 21, 2015 at 8:17:06 AM UTC+8, ms.is...@gmail.com wrote: > On Saturday, February 21, 2015 at 8:14:43 AM UTC+8, ms.is...@gmail.com wrote: > > On Friday, February 20, 2015 at 4:41:57 PM UTC+8, Mark Lawrence wrote: > > > On 20/02/2015 08:24, ismaham...@gcuf.edu.pk wrote: > > > >

Re: urgent help

2015-02-20 Thread Dave Angel
On 02/20/2015 07:20 PM, ms.isma...@gmail.com wrote: On Saturday, February 21, 2015 at 8:17:06 AM UTC+8, ms.is...@gmail.com wrote: On Saturday, February 21, 2015 at 8:14:43 AM UTC+8, ms.is...@gmail.com wrote: On Friday, February 20, 2015 at 4:41:57 PM UTC+8, Mark Lawrence wrote: On 20/02/2015 0

Re: urgent help

2015-02-20 Thread MRAB
On 2015-02-21 00:14, ms.isma...@gmail.com wrote: On Friday, February 20, 2015 at 4:41:57 PM UTC+8, Mark Lawrence wrote: On 20/02/2015 08:24, ismaham...@gcuf.edu.pk wrote: Would you please give your requests a meaningful subject. > sir these errors whats mean by it > warning (from warnings modu

Re: urgent help

2015-02-20 Thread MRAB
On 2015-02-21 00:16, ms.isma...@gmail.com wrote: On Saturday, February 21, 2015 at 8:14:43 AM UTC+8, ms.is...@gmail.com wrote: On Friday, February 20, 2015 at 4:41:57 PM UTC+8, Mark Lawrence wrote: > On 20/02/2015 08:24, ismaham...@gcuf.edu.pk wrote: > > Would you please give your requests a mea

Re: urgent help

2015-02-20 Thread MRAB
On 2015-02-21 00:20, ms.isma...@gmail.com wrote: On Saturday, February 21, 2015 at 8:17:06 AM UTC+8, ms.is...@gmail.com wrote: On Saturday, February 21, 2015 at 8:14:43 AM UTC+8, ms.is...@gmail.com wrote: > On Friday, February 20, 2015 at 4:41:57 PM UTC+8, Mark Lawrence wrote: > > On 20/02/2015

Re: subprocess command fails

2015-02-20 Thread Cameron Simpson
On 20Feb2015 15:30, Brad s wrote: I am trying to execute a subprocess, something done in my script a couple of times. But on the last one, it outputs an error I cannot find the solution to. The exact same command using the same files produced at the command line works just fine. Hi Brad,

Re: 'Lite' Databases (Re: sqlite3 and dates)

2015-02-20 Thread Chris Angelico
On Sat, Feb 21, 2015 at 8:17 AM, Paul Rubin wrote: > Ben Finney writes: >> I don't know of a free-software concurrent RDBMS which can be considered >> lighter than that. (No, MySQL doesn't count; its concurrency is >> *unreliable* and it commonly loses data silently. Don't use MySQL.) > > I thoug

Design thought for callbacks

2015-02-20 Thread Cem Karan
Hi all, I'm working on a project that will involve the use of callbacks, and I want to bounce an idea I had off of everyone to make sure I'm not developing a bad idea. Note that this is for python 3.4 code; I don't need to worry about any version of python earlier than that. In order to inform

try pattern for database connection with the close method

2015-02-20 Thread Mario Figueiredo
Hello all, I'm using the following pattern for db access that requires me to close the connection as soon as it is not needed: import sqlite3 as lite try: db = lite.connect('data.db') except lite.DatabaseError: raise OSError('database file corrupt

Re: try pattern for database connection with the close method

2015-02-20 Thread Chris Kaynor
On Fri, Feb 20, 2015 at 6:42 PM, Mario Figueiredo wrote: > import sqlite3 as lite > > try: > db = lite.connect('data.db') > except lite.DatabaseError: > raise OSError('database file corrupt or not found.') > else: > try: >

Re: 'Lite' Databases

2015-02-20 Thread Ben Finney
Chris Angelico writes: > Even if you use InnoDB for all of _your_ tables, the system catalog > tables will all be MyISAM. So it's possible to lose critical metadata. In addition, MySQL silently [0] loses data in many common situations. https://dev.mysql.com/doc/refman/5.6/en/silent-column-c

Re: urgent help

2015-02-20 Thread Denis McMahon
On Fri, 20 Feb 2015 16:14:18 -0800, ms.isma222 wrote: > sir what mean by the following errors: > Traceback (most recent call last): > File "D:\My Documents\Desktop\scripts\WebMD\getWebMDExperts.py", line > 143, in > links = getExpertInfoLinks() > File "D:\My Documents\Desktop\scripts\W

Re: 'Lite' Databases (Re: sqlite3 and dates)

2015-02-20 Thread Tim Chase
On 2015-02-20 13:17, Paul Rubin wrote: > For stuff like browser bookmarks or other typical embedded database > purposes, I don't see why SQL or relations are needed. Berkeley DB > is a transactional key-value store that's been around for decades > and is way simpler than SQLite, and there's other

Re: subprocess command fails

2015-02-20 Thread Brad s
Yes, the program deletes the same files it produces. It looks to see if old stuff is there and if it exist, it deletes the files and creates and entirely new DNS zone with keys and then it is supposed to sign it. The last step is where it is still failing but your code helped me to figure out wh

Re: subprocess command fails

2015-02-20 Thread Brad s
Time adjustment error: # python3.4 timefix.py 2015022105 2015-02-21 05:00:00 Traceback (most recent call last): File "timefix.py", line 15, in ndate = datetime.datetime.strptime(timeadd, '%Y%m%d%H') TypeError: must be str, not datetime.datetime # cat timefix.py #!/usr/bin/python3.4 impor

Re: 'Lite' Databases

2015-02-20 Thread Chris Angelico
On Sat, Feb 21, 2015 at 2:13 PM, Ben Finney wrote: > In addition, MySQL silently [0] loses data in many common situations. > > https://dev.mysql.com/doc/refman/5.6/en/silent-column-changes.html> > http://www.davidpashley.com/2009/02/15/silently-truncated/> > http://effectivemysql.com/d

Re: Design thought for callbacks

2015-02-20 Thread Frank Millman
"Cem Karan" wrote in message news:33677ae8-b2fa-49f9-9304-c8d937842...@gmail.com... > Hi all, I'm working on a project that will involve the use of callbacks, > and I want to bounce an idea I had off of everyone to make sure I'm not > developing a bad idea. Note that this is for python 3.4 co

Re: Design thought for callbacks

2015-02-20 Thread Chris Angelico
On Sat, Feb 21, 2015 at 1:44 PM, Cem Karan wrote: > In order to inform users that certain bits of state have changed, I require > them to register a callback with my code. The problem is that when I store > these callbacks, it naturally creates a strong reference to the objects, > which means

Re: 'Lite' Databases (Re: sqlite3 and dates)

2015-02-20 Thread Ned Deily
In article <54e7b0da.7060...@stoneleaf.us>, Ethan Furman wrote: > On 02/20/2015 01:17 PM, Paul Rubin wrote: > > > SQLite always seemed bloated (from the embedded NoSQL point of view) and > > fragile to me, and the vendor plays an annoying anti-forking trick, > > which is that the code is releas

Re: subprocess command fails

2015-02-20 Thread Brad s
fixed with now = datetime.datetime.now() later = now + datetime.timedelta(days=2*365) striplater = later.strftime('%Y%m%d%H') # python3.4 makekeys.py Enter the domain to configure keys for? test1234.com Generating key pair..

Re: 'Lite' Databases (Re: sqlite3 and dates)

2015-02-20 Thread Paul Rubin
Ned Deily writes: > (though I don't know why anyone would want to fork it). Same reason lots of people have forked Postgres. Or you might just want to customize it. > I imagine that is done as an incentive to help > finance the on-going development and maintenance of SQLite. It's a pretty un

Re: subprocess command fails

2015-02-20 Thread Cameron Simpson
On 20Feb2015 21:14, Brad s wrote: Time adjustment error: # python3.4 timefix.py 2015022105 2015-02-21 05:00:00 Traceback (most recent call last): File "timefix.py", line 15, in ndate = datetime.datetime.strptime(timeadd, '%Y%m%d%H') TypeError: must be str, not datetime.datetime # cat ti