Re: is implemented with id ?

2012-09-06 Thread Ramchandra Apte
On Thursday, 6 September 2012 12:14:19 UTC+5:30, Steven D'Aprano wrote: > On Wed, 05 Sep 2012 14:27:44 -0400, Terry Reedy wrote: > > > > > On 9/5/2012 8:48 AM, Ramchandra Apte wrote: > > > > > > > and "a==True" should be automatically changed into memory comparison. > > > > > > I have no

Re: python docs search for 'print'

2012-09-06 Thread Ramchandra Apte
On Thursday, 6 September 2012 01:54:45 UTC+5:30, Walter Hurry wrote: > On Wed, 05 Sep 2012 15:03:16 -0400, Terry Reedy wrote: > > > > > On 9/5/2012 8:45 AM, Ramchandra Apte wrote: > > > > > > > These ever increasing extra blank lines with each quote are obnoxious. > > > Consider using a n

Re: is implemented with id ?

2012-09-06 Thread Ramchandra Apte
On Wednesday, 5 September 2012 19:43:30 UTC+5:30, Steven D'Aprano wrote: > On Wed, 05 Sep 2012 05:48:26 -0700, Ramchandra Apte wrote: > > > > > Seeing this thread, I think the is statment should be removed. It has a > > > replacement syntax of id(x) == id(y) > > > > A terrible idea. > > >

Re: Comparing strings from the back?

2012-09-06 Thread Steven D'Aprano
On Wed, 05 Sep 2012 22:47:14 +, Oscar Benjamin wrote: > In news.gmane.comp.python.general, you wrote: >> On Wed, 05 Sep 2012 16:51:10 +0200, Johannes Bauer wrote: [...] You are making unjustified assumptions about the distribution of letters in the words. This might be a list of long

Re: HTMLParser skipping HTML? [newbie]

2012-09-06 Thread BobAalsma
Op woensdag 5 september 2012 14:57:05 UTC+2 schreef BobAalsma het volgende: > I'm trying to understand the HTMLParser so I've copied some code from > http://docs.python.org/library/htmlparser.html?highlight=html#HTMLParser and > tried that on my LinkedIn page. > > No errors, but some of the tags

Re: simple client data base

2012-09-06 Thread Bryan
Mark R Rivet wrote: > Hello all, I am learning to program in python. I have a need to make a > program that can store, retrieve, add, and delete client data such as > name, address, social, telephone number and similar information. This > would be a small client database for my wife who has a home

Re: HTMLParser skipping HTML? [newbie]

2012-09-06 Thread BobAalsma
Op woensdag 5 september 2012 14:57:05 UTC+2 schreef BobAalsma het volgende: > I'm trying to understand the HTMLParser so I've copied some code from > http://docs.python.org/library/htmlparser.html?highlight=html#HTMLParser and > tried that on my LinkedIn page. > > No errors, but some of the tags

Re: is implemented with id ?

2012-09-06 Thread Chris Angelico
On Thu, Sep 6, 2012 at 6:26 PM, Ramchandra Apte wrote: > the is statement could be made into a function It's not a statement, it's an operator; and functions have far more overhead than direct operators. There's little benefit in making 'is' into a function, and high cost; unlike 'print', whose c

Re: Looking for an IPC solution

2012-09-06 Thread Gelonida N
On 08/31/2012 11:05 PM, Antoine Pitrou wrote: Laszlo Nagy shopzeus.com> writes: How about the standard multiprocessing module? It supports shared memory, remote processes, and will most probably work under PyPy: http://docs.python.org/library/multiprocessing.html I always thought, that th

Re: Looking for an IPC solution

2012-09-06 Thread Gelonida N
On 08/31/2012 11:05 PM, Antoine Pitrou wrote: Laszlo Nagy shopzeus.com> writes: How about the standard multiprocessing module? It supports shared memory, remote processes, and will most probably work under PyPy: http://docs.python.org/library/multiprocessing.html I always thought, that the

Re: is implemented with id ?

2012-09-06 Thread Duncan Booth
Steven D'Aprano wrote: > But less exotically, Frank isn't entirely wrong. With current day > computers, it is reasonable to say that any object has exactly one > physical location at any time. In Jython, objects can move around; in > CPython, they can't. But at any moment, any object has a spe

Re: is implemented with id ?

2012-09-06 Thread Chris Angelico
On Thu, Sep 6, 2012 at 7:34 PM, Duncan Booth wrote: > Steven D'Aprano wrote: > >> But at any moment, any object has a specific >> location, and no other object can have that same location. Two objects >> cannot both be at the same memory address at the same time. >> > > It is however perfectly po

Re: Looking for an IPC solution

2012-09-06 Thread Gelonida N
On 08/31/2012 11:05 PM, Antoine Pitrou wrote: Laszlo Nagy shopzeus.com> writes: How about the standard multiprocessing module? It supports shared memory, remote processes, and will most probably work under PyPy: http://docs.python.org/library/multiprocessing.html I always thought, that th

Re: Looking for an IPC solution

2012-09-06 Thread Laszlo Nagy
How about the standard multiprocessing module? It supports shared memory, remote processes, and will most probably work under PyPy: http://docs.python.org/library/multiprocessing.html I always thought, that the multiprocessing module does NOT use shared memory (at least not under windows) It

Re: Looking for an IPC solution

2012-09-06 Thread Laszlo Nagy
Hi Laszlo, There aren't a lot of ways to create a Python object in an "mmap" buffer. "mmap" is conducive to arrays of arrays. For variable-length structures like strings and lists, you need "dynamic allocation". The C functions "malloc" and "free" allocate memory space, and file creation a

Re: Comparing strings from the back?

2012-09-06 Thread Dave Angel
On 09/06/2012 04:33 AM, Steven D'Aprano wrote: > > > I may have been overly-conservative earlier when I said that on > average string equality has to compare half the characters. I thought > I had remembered that from a computer science textbook, but I can't > find that reference now, so possibly

Re: Looking for an IPC solution

2012-09-06 Thread Laszlo Nagy
Probably the fastest I/RPC implementation for Python should be OmniOrbpy: http://omniorb.sourceforge.net/ It's cross-platform, language-independent and standard-(Corba-) compliant. I don't want to use IDL though. Clients will be written in Python, and it would be a waste of time to write IDL

Need help fixing this error please:NameError: global name is not defined

2012-09-06 Thread shaun
Hi all, I have a class which I create an object from in a different script but when its run I get an error at the last part of this method: CODE/// def databasebatchcall(self,tid, bid): con=cx_Oracle.connect('user/user...@odb4.dcc.company/ODB4TEST.COMPA

Re: Comparing strings from the back?

2012-09-06 Thread Oscar Benjamin
On Thu, 06 Sep 2012 06:07:38 -0400, Dave Angel wrote: For random strings (as defined below), the average compare time is effectively unrelated to the size of the string, once the size passes some point. Define random string as being a selection from a set of characters, with replacement.

Re: Need help fixing this error please:NameError: global name is not defined

2012-09-06 Thread Chris Angelico
On Thu, Sep 6, 2012 at 8:45 PM, shaun wrote: > CODE/// > > def databasebatchcall(self,tid, bid): > > con=cx_Oracle.connect('user/user...@odb4.dcc.company/ODB4TEST.COMPANY.COM') > cur = con.cursor() > cur.execute("SELECT * FROM name) >

Re: Need help fixing this error please:NameError: global name is not defined

2012-09-06 Thread Dave Angel
On 09/06/2012 06:45 AM, shaun wrote: > Hi all, > > I have a class which I create an object from in a different script but when > its run I get an error at the last part of this method: > > CODE/// > > def databasebatchcall(self,tid, bid): > > con=cx_Oracle

Re: Need help fixing this error please:NameError: global name is not defined

2012-09-06 Thread Peter Otten
shaun wrote: > I have a class which I create an object from in a different script but when its run I get an error at the last part of this method: > def databasebatchcall(self,tid, bid): > con=cx_Oracle.connect( > 'user/user...@odb4.dcc.company/ODB4TEST.COMPANY.COM') > c

Re: Dynamically scheduling Cron Jobs for Python Scripts.

2012-09-06 Thread Vincent Vande Vyvre
On 06/09/12 08:21, coldfire wrote: > I have a web scrapper script which run every day at 0100 hrs using cron Job > over a shell account. > Now what I am looking for is to re run the same script. > 1> The script goes online to scrape some data including a schedule time for > my meeting. > I want t

Re: Python Interview Questions

2012-09-06 Thread MRAB
On 06/09/2012 05:24, Kushal Kumaran wrote: On Wed, Sep 5, 2012 at 3:11 PM, Stephen Anto wrote: On Wed, Sep 5, 2012 at 2:10 PM, Kushal Kumaran wrote: On Wed, Sep 5, 2012 at 12:20 PM, wrote: > On Tuesday, October 30, 2007 11:44:01 PM UTC+5:30, Krypto wrote: >> Hi, >> >> I have used Python fo

Re: Need help fixing this error please:NameError: global name is not defined

2012-09-06 Thread shaun
Sorry guys here is the full code for the class: #!/usr/bin/python # Echo client program import cx_Oracle import socket import pprint from struct import * import sys from binascii import * import time import datetime class StringCall: results=[] def databasebatchcall(self,termid,

Re: Need help fixing this error please:NameError: global name is not defined

2012-09-06 Thread shaun
This is the code in the script im calling: batchObject=StringCall() batchObject.databasebatchcall(termid, batchid) batchObject.fetchbatchdata() batchObject.createbatchstrings() BatchHeaderPacket =batchObject.returnbatchheader() ParameterPacket =batchObject.returnparameterpacket() TrailerPacket =

Re: Need help fixing this error please:NameError: global name is not defined

2012-09-06 Thread Chris Angelico
On Thu, Sep 6, 2012 at 9:37 PM, shaun wrote: > class StringCall: > results=[] > def databasebatchcall(self,termid, batchid): > con = > cx_Oracle.connect('user/user...@odb4.dcc.company.ie/ODB4TEST.COMPANY.IE') > cur = con.cursor() > c

Setting up a class

2012-09-06 Thread shaun
Hi all, So I'm trying to to OO a script which is currently in place on work. It connects to the database and makes multiple strings and sends them to a server. But I'm having major problems since I am new to python I keep trying to do it as I would do it in Java but classes seem to be very diff

Re: Need help fixing this error please:NameError: global name is not defined

2012-09-06 Thread MRAB
On 06/09/2012 12:37, shaun wrote: Sorry guys here is the full code for the class: #!/usr/bin/python # Echo client program import cx_Oracle import socket import pprint from struct import * import sys from binascii import * Don't use "from something import *". It'll import a whole load of names.

Re: Need help fixing this error please:NameError: global name is not defined

2012-09-06 Thread shaun
Hi Chris, I'm changing it into multiple classes because the script is going to get much larger its more for maintainability reasons rather than functionality reasons. Thanks so much man it was the "self" fix you stated above. I woe you a pint of Guinness :D Thanks again, Shaun -- http:/

Re: Comparing strings from the back?

2012-09-06 Thread Roy Smith
In article <50485fca$0$29977$c3e8da3$54964...@news.astraweb.com>, Steven D'Aprano wrote: > In any case, the *worst* case for string equality > testing is certainly O(N) (every character must be looked at), and the > *best* case is O(1) obviously (the first character fails to match). The best

Re: Setting up a class

2012-09-06 Thread Joel Goldstick
On Thu, Sep 6, 2012 at 8:00 AM, shaun wrote: > Hi all, > > So I'm trying to to OO a script which is currently in place on work. It > connects to the database and makes multiple strings and sends them to a > server. > > But I'm having major problems since I am new to python I keep trying to do it

Re: is implemented with id ?

2012-09-06 Thread Roy Smith
In article <50484643$0$29977$c3e8da3$54964...@news.astraweb.com>, Steven D'Aprano wrote: > On Wed, 05 Sep 2012 14:27:44 -0400, Terry Reedy wrote: > > > On 9/5/2012 8:48 AM, Ramchandra Apte wrote: > > > > > and "a==True" should be automatically changed into memory comparison. > > > > I have n

Re: Comparing strings from the back?

2012-09-06 Thread Chris Angelico
n Thu, Sep 6, 2012 at 10:13 PM, Roy Smith wrote: > In article <50485fca$0$29977$c3e8da3$54964...@news.astraweb.com>, > Steven D'Aprano wrote: > >> In any case, the *worst* case for string equality >> testing is certainly O(N) (every character must be looked at), and the >> *best* case is O(1) ob

Re: Setting up a class

2012-09-06 Thread MRAB
On 06/09/2012 13:00, shaun wrote: Hi all, So I'm trying to to OO a script which is currently in place on work. It connects to the database and makes multiple strings and sends them to a server. But I'm having major problems since I am new to python I keep trying to do it as I would do it in J

Re: Need help fixing this error please:NameError: global name is not defined

2012-09-06 Thread Chris Angelico
On Thu, Sep 6, 2012 at 10:07 PM, shaun wrote: > Hi Chris, > > I'm changing it into multiple classes because the script is going to get > much larger its more for maintainability reasons rather than functionality > reasons. Doesn't necessarily have to be multiple classes. Python gives you t

Re: Language workbench written in python3

2012-09-06 Thread Ramchandra Apte
On Thursday, 6 September 2012 02:34:17 UTC+5:30, Nestor Arocha wrote: > I'm developing a language workbench written in Python. The idea is to create > an environment where grammars and translators can interact easily. > > > > https://github.com/nesaro/pydsl > > > > any comments, feedback or

Re: is implemented with id ?

2012-09-06 Thread Ramchandra Apte
On Thursday, 6 September 2012 17:46:38 UTC+5:30, Roy Smith wrote: > In article <50484643$0$29977$c3e8da3$54964...@news.astraweb.com>, > > Steven D'Aprano wrote: > > > > > On Wed, 05 Sep 2012 14:27:44 -0400, Terry Reedy wrote: > > > > > > > On 9/5/2012 8:48 AM, Ramchandra Apte wrote: > >

Re: ===== Soft Skills Training In Chennai ======

2012-09-06 Thread Ramchandra Apte
On Thursday, 6 September 2012 11:26:21 UTC+5:30, mike pittenson wrote: > Ayus Technologies offers Dot net training in chennai,java/j2ee training in > chennai,SEO training in chennai,web designing training in chennai,soft skills > training in chennai,Software Testing training in chennai. > > >

Re: Comparing strings from the back?

2012-09-06 Thread Johannes Bauer
On 05.09.2012 18:24, Steven D'Aprano wrote: > On Wed, 05 Sep 2012 16:51:10 +0200, Johannes Bauer wrote: > [...] >>> You are making unjustified assumptions about the distribution of >>> letters in the words. This might be a list of long chemical compounds >>> where the words typically differ only in

Re: Setting up a class

2012-09-06 Thread Dave Angel
On 09/06/2012 08:00 AM, shaun wrote: > Hi all, > > So I'm trying to to OO a script which is currently in place on work. It > connects to the database and makes multiple strings and sends them to a > server. > > But I'm having major problems since I am new to python I keep trying to do it > as I

Re: Language workbench written in python3

2012-09-06 Thread Dave Angel
On 09/06/2012 09:34 AM, Ramchandra Apte wrote: > Translator means what precisely? Examples of translators include compilers, assemblers, and interpreters. They also include implementations like cfront, which translates from one high-level language to another lower-level language. (high and low b

Re: Setting up a class

2012-09-06 Thread Colin J. Williams
On 06/09/2012 8:20 AM, MRAB wrote: On 06/09/2012 13:00, shaun wrote: Hi all, So I'm trying to to OO a script which is currently in place on work. It connects to the database and makes multiple strings and sends them to a server. But I'm having major problems since I am new to python I keep try

Re: Comparing strings from the back?

2012-09-06 Thread Johannes Bauer
On 06.09.2012 10:33, Steven D'Aprano wrote: > But you know, it really doesn't make a difference. Equality testing will > *still* be O(N) since the asymptomatic behaviour for sufficiently large > string comparisons will be bounded by O(N). Multiplicative constants > ("half the string" versus "0.

Re: Language workbench written in python3

2012-09-06 Thread Ramchandra Apte
On Thursday, 6 September 2012 19:16:38 UTC+5:30, Dave Angel wrote: > On 09/06/2012 09:34 AM, Ramchandra Apte wrote: > > > Translator means what precisely? > > > > Examples of translators include compilers, assemblers, and > > interpreters. They also include implementations like cfront, which

Re: Is there a way to configure IDLE to use spaces instead of tabs for indenting?

2012-09-06 Thread Alex
Ramchandra Apte wrote: > On Saturday, 25 August 2012 04:03:52 UTC+5:30, Alex wrote: > > I'm new to Python and have been using IDLE 3.2.3 to experiment with > > > > code as I learn. Despite being configured to use a 4 space > > indentation > > > > width, sometimes IDLE's "smart" indentation insi

Re: Is there a way to configure IDLE to use spaces instead of tabs for indenting?

2012-09-06 Thread Ramchandra Apte
On Thursday, 6 September 2012 19:13:23 UTC+5:30, Alex wrote: > Ramchandra Apte wrote: > > > > > On Saturday, 25 August 2012 04:03:52 UTC+5:30, Alex wrote: > > > > I'm new to Python and have been using IDLE 3.2.3 to experiment with > > > > > > > > code as I learn. Despite being configured t

python docs search for 'print'

2012-09-06 Thread David Hoese
On 9/5/12 3:03 PM, Grant Edwards wrote: On 2012-09-05, Dave Angel wrote: >On 09/05/2012 01:47 PM, Grant Edwards wrote: > >>Making the site's "search" box use Google or somesuch is probably the >>simplest solution. I'm not enough of a web guy to know how to do >>that, but I do know that some si

Re: Comparing strings from the back?

2012-09-06 Thread Dave Angel
On 09/06/2012 09:43 AM, Johannes Bauer wrote: > > Yes, worst-case is O(N), best case O(1). Average is O(n log n). Can't see how you came up with an average of n log(n). Fourteen minutes before you made this post, you demonstrated it was less than 2 for any N. And I previously posted that for a

Re: Language workbench written in python3

2012-09-06 Thread Dave Angel
On 09/06/2012 09:53 AM, Ramchandra Apte wrote: > On Thursday, 6 September 2012 19:16:38 UTC+5:30, Dave Angel wrote: >> On 09/06/2012 09:34 AM, Ramchandra Apte wrote: >> >>> Translator means what precisely? >> >> >> Examples of translators include compilers, assemblers, and >> >> interpreters. The

Re: Comparing strings from the back?

2012-09-06 Thread Johannes Bauer
On 06.09.2012 16:23, Dave Angel wrote: > On 09/06/2012 09:43 AM, Johannes Bauer wrote: >> >> Yes, worst-case is O(N), best case O(1). Average is O(n log n). > > Can't see how you came up with an average of n log(n). Fourteen minutes > before you made this post, you demonstrated it was less than

Re: Comparing strings from the back?

2012-09-06 Thread Johannes Bauer
On 06.09.2012 15:43, Johannes Bauer wrote: > Wrong, at least for randomized strings (i.e. every character with the > same probability). O(N) is worst-case, O(log N) is correct for > randomized strings. ^^ Here I write the right thing. Then further below... > Yes, worst-case is O(N), best case O(1

Re: Comparing strings from the back?

2012-09-06 Thread Johannes Bauer
On 06.09.2012 16:23, Dave Angel wrote: > On 09/06/2012 09:43 AM, Johannes Bauer wrote: >> >> Yes, worst-case is O(N), best case O(1). Average is O(n log n). > > Can't see how you came up with an average of n log(n). Fourteen minutes > before you made this post, you demonstrated it was less than

Re: Comparing strings from the back?

2012-09-06 Thread Chris Angelico
On Thu, Sep 6, 2012 at 11:37 PM, Johannes Bauer wrote: > Not in my original post. If you read it again, you will clearly see that > I was talking about purely random strings. And since you like to > nitpick, I'll clarify further: I'm talking about bitstrings in which > every bit of every character

Function for examine content of directory

2012-09-06 Thread Tigerstyle
Hi guys, I'm trying to write a module containing a function to examine the contents of the current working directory and print out a count of how many files have each extension (".txt", ".doc", etc.) This is the code so far: -- import os path = "v:\\workspace\\Python2_Homework03\\src\\" dirs

Re: Function for examine content of directory

2012-09-06 Thread Ian Foote
On 06/09/12 15:56, Tigerstyle wrote: Hi guys, I'm trying to write a module containing a function to examine the contents of the current working directory and print out a count of how many files have each extension (".txt", ".doc", etc.) This is the code so far: -- import os path = "v:\\wo

Accessing dll

2012-09-06 Thread Helpful person
I am a complete novice to Python. I wish to access a dll that has been written to be compatible with C and VB6. I have been told that after running Python I should enter "from ctypes import *" which allows Python to recognize the dll structure. I have placed the dll into my active directory (if

Re: Function for examine content of directory

2012-09-06 Thread MRAB
On 06/09/2012 15:56, Tigerstyle wrote: Hi guys, I'm trying to write a module containing a function to examine the contents of the current working directory and print out a count of how many files have each extension (".txt", ".doc", etc.) This is the code so far: -- import os path = "v:\\wor

Re: Accessing dll

2012-09-06 Thread Benjamin Kaplan
On Sep 6, 2012 8:15 AM, "Helpful person" wrote: > > I am a complete novice to Python. I wish to access a dll that has > been written to be compatible with C and VB6. I have been told that > after running Python I should enter "from ctypes import *" which > allows Python to recognize the dll str

Re: Accessing dll

2012-09-06 Thread Jerry Hill
On Thu, Sep 6, 2012 at 11:07 AM, Helpful person wrote: > I am a complete novice to Python. I wish to access a dll that has > been written to be compatible with C and VB6. I have been told that > after running Python I should enter "from ctypes import *" which > allows Python to recognize the dl

Re: Comparing strings from the back?

2012-09-06 Thread Johannes Bauer
On 06.09.2012 16:39, Chris Angelico wrote: > In any case, it'll be far FAR more useful than arguing from > totally random, or random word selection, or anything. > > Who's game? Okay, patched against Python 3.2.3: http://pastebin.com/PRRN53P6 To invoke display of the stats, compare the string "

Re: Accessing dll

2012-09-06 Thread Helpful person
FYI My Python version is 2.5.4 -- http://mail.python.org/mailman/listinfo/python-list

Re: Accessing dll

2012-09-06 Thread Helpful person
On Sep 6, 8:30 am, Jerry Hill wrote: > You should start by reading the ctypes documentation, > here:http://docs.python.org/library/ctypes.html.  It has a lot of examples > that ought to get you started. > > When you run into more specific problems, you're going to have to > provide a lot more inf

Re: Comparing strings from the back?

2012-09-06 Thread Johannes Bauer
On 06.09.2012 17:36, Johannes Bauer wrote: > "pleasedumpstats" < "" And against a XML-reading C code generator that uses mako: strCmpEq 39670 strCmpLt 2766215 strCmpGt 2744002 strCmpTc 37430821 strCmpCc 14048656 Compared strings: 5549887 Equal: 0.7% Average wordlength: 6.74 chars Average compare

Re: Comparing strings from the back?

2012-09-06 Thread Dave Angel
On 09/06/2012 10:42 AM, Johannes Bauer wrote: > On 06.09.2012 16:23, Dave Angel wrote: >> On 09/06/2012 09:43 AM, Johannes Bauer wrote: >>> >>> Yes, worst-case is O(N), best case O(1). Average is O(n log n). >> Can't see how you came up with an average of n log(n). Fourteen minutes >> before you

Re: Accessing dll

2012-09-06 Thread Ulrich Eckhardt
Am 06.09.2012 17:07, schrieb Helpful person: I am a complete novice to Python. Welcome! I wish to access a dll that has been written to be compatible with C and VB6. I have been told that after running Python I should enter "from ctypes import *" which allows Python to recognize the dll str

Re: Accessing dll

2012-09-06 Thread Helpful person
On Sep 6, 8:28 am, Ulrich Eckhardt wrote: > Am 06.09.2012 17:07, schrieb Helpful person: > > > I am a complete novice to Python. > > Welcome! > > > I wish to access a dll that has > > been written to be compatible with C and VB6.  I have been told that > > after running Python I should enter  "fro

Re: Accessing dll

2012-09-06 Thread Helpful person
On Sep 6, 8:30 am, Jerry Hill wrote: > > You should start by reading the ctypes documentation, > here:http://docs.python.org/library/ctypes.html.  It has a lot of examples > that ought to get you started. > The reference might help if I could get Python to recognize the dll as a module. -- http

Re: Accessing dll

2012-09-06 Thread Jerry Hill
On Thu, Sep 6, 2012 at 12:46 PM, Helpful person wrote: > The reference might help if I could get Python to recognize the dll as > a module. That's never going to happen. It's a DLL, not a python module. I think the documentation lays that out pretty explicitly. Have you experimented with the v

Re: Accessing dll

2012-09-06 Thread Helpful person
On Sep 6, 9:58 am, Jerry Hill wrote: What do you get if you do the following at the > interactive interpreter? > > >>> from ctypes import * > >>> print windll. > > -- > Jerry I get: , handle 41 at 2ace070> -- http://mail.python.org/mailman/listinfo/python-list

Re: Accessing dll

2012-09-06 Thread MRAB
On 06/09/2012 17:58, Jerry Hill wrote: On Thu, Sep 6, 2012 at 12:46 PM, Helpful person wrote: The reference might help if I could get Python to recognize the dll as a module. That's never going to happen. It's a DLL, not a python module. I think the documentation lays that out pretty explic

Re: A Python class

2012-09-06 Thread Terry Reedy
On 9/6/2012 11:08 AM, Yves S. Garret wrote: I'd like to know if there are any online Python classes offered online from reliable institutions that you would recommend. Google 'online programming course python' for taught courses. At least 2 of MIT's self-guided OpenCourseWare courses use P

How to print something only if it exists?

2012-09-06 Thread tinnews
I want to print a series of list elements some of which may not exist, e.g. I have a line:- print day, fld[1], balance, fld[2] fld[2] doesn't always exist (fld is the result of a split) so the print fails when it isn't set. I know I could simply use an if but ultimately there may be more el

Re: Is there a way to configure IDLE to use spaces instead of tabs for indenting?

2012-09-06 Thread Terry Reedy
On 9/6/2012 9:43 AM, Alex wrote: On Saturday, 25 August 2012 04:03:52 UTC+5:30, Alex wrote: I'm new to Python and have been using IDLE 3.2.3 to experiment with code as I learn. Despite being configured to use a 4 space indentation width, sometimes IDLE's "smart" indentation insists >>> upon

Re: How to print something only if it exists?

2012-09-06 Thread Emile van Sebille
On 9/6/2012 10:59 AM tinn...@isbd.co.uk said... I want to print a series of list elements some of which may not exist, e.g. I have a line:- print day, fld[1], balance, fld[2] fld[2] doesn't always exist (fld is the result of a split) so the print fails when it isn't set. I know I could s

Re: How to print something only if it exists?

2012-09-06 Thread Dave Angel
On 09/06/2012 01:59 PM, tinn...@isbd.co.uk wrote: > I want to print a series of list elements some of which may not exist, > e.g. I have a line:- > > print day, fld[1], balance, fld[2] > > fld[2] doesn't always exist (fld is the result of a split) so the > print fails when it isn't set. > > I

Re: python docs search for 'print'

2012-09-06 Thread Mark Lawrence
On 06/09/2012 15:01, David Hoese wrote: On 9/5/12 3:03 PM, Grant Edwards wrote: On 2012-09-05, Dave Angel wrote: >On 09/05/2012 01:47 PM, Grant Edwards wrote: > >>Making the site's "search" box use Google or somesuch is probably the >>simplest solution. I'm not enough of a web guy to know how

Re: python docs search for 'print'

2012-09-06 Thread Terry Reedy
On 9/6/2012 10:01 AM, David Hoese wrote: On 9/5/12 3:03 PM, Grant Edwards wrote: On 2012-09-05, Dave Angel wrote: >On 09/05/2012 01:47 PM, Grant Edwards wrote: > >>Making the site's "search" box use Google or somesuch is probably the >>simplest solution. I'm not enough of a web guy to know ho

Parsing ISO date/time strings - where did the parser go?

2012-09-06 Thread John Nagle
In Python 2.7: I want to parse standard ISO date/time strings such as 2012-09-09T18:00:00-07:00 into Python "datetime" objects. The "datetime" object offers an output method , datetimeobj.isoformat(), but not an input parser. There ought to be classmethod datetime.fromisofo

Re: How to print something only if it exists?

2012-09-06 Thread Terry Reedy
On 9/6/2012 1:59 PM, tinn...@isbd.co.uk wrote: I want to print a series of list elements some of which may not exist, e.g. I have a line:- print day, fld[1], balance, fld[2] fld[2] doesn't always exist (fld is the result of a split) so the print fails when it isn't set. What fails is th

Re: Language workbench written in python3

2012-09-06 Thread Nestor Arocha
On Thursday, September 6, 2012 2:53:15 PM UTC+1, Ramchandra Apte wrote: > On Thursday, 6 September 2012 19:16:38 UTC+5:30, Dave Angel wrote: > > > On 09/06/2012 09:34 AM, Ramchandra Apte wrote: > > > > > > > Translator means what precisely? > > > > > > > > > > > > Examples of translator

Re: Parsing ISO date/time strings - where did the parser go?

2012-09-06 Thread Thomas Jollans
On 09/06/2012 09:27 PM, John Nagle wrote: > In Python 2.7: > >I want to parse standard ISO date/time strings such as > > 2012-09-09T18:00:00-07:00 > > into Python "datetime" objects. The "datetime" object offers > an output method , datetimeobj.isoformat(), but not an input > parser.

Re: How to print something only if it exists?

2012-09-06 Thread Joshua Landau
On 6 September 2012 18:59, wrote: > I want to print a series of list elements some of which may not exist, > e.g. I have a line:- > > print day, fld[1], balance, fld[2] > > fld[2] doesn't always exist (fld is the result of a split) so the > print fails when it isn't set. > What I might do i

Re: Parsing ISO date/time strings - where did the parser go?

2012-09-06 Thread Paul Rubin
John Nagle writes: > There's an iso8601 module on PyPi, but it's abandoned; it hasn't been > updated since 2007 and has many outstanding issues. Hmm, I have some code that uses ISO date/time strings and just checked to see how I did it, and it looks like it uses iso8601-0.1.4-py2.6.egg . I don't

Re: Parsing ISO date/time strings - where did the parser go?

2012-09-06 Thread Dave Angel
On 09/06/2012 03:27 PM, John Nagle wrote: > In Python 2.7: > >I want to parse standard ISO date/time strings such as > > 2012-09-09T18:00:00-07:00 > > into Python "datetime" objects. The "datetime" object offers > an output method , datetimeobj.isoformat(), but not an input > parser. Th

Re: Dynamically scheduling Cron Jobs for Python Scripts.

2012-09-06 Thread Miki Tebeka
> I want to re run the script at that schedule time to send me a email. Calculate how much time until the meeting. And spawn the script that will sleep that amount of time and then send email. -- http://mail.python.org/mailman/listinfo/python-list

Re: Accessing dll

2012-09-06 Thread Tim Williams
On Thursday, September 6, 2012 11:07:07 AM UTC-4, Helpful person wrote: > I am a complete novice to Python. I wish to access a dll that has > > been written to be compatible with C and VB6. I have been told that > > after running Python I should enter "from ctypes import *" which > > allows P

Re: Function for examine content of directory

2012-09-06 Thread Tigerstyle
Thanks, just what I was looking for :-) T kl. 17:20:27 UTC+2 torsdag 6. september 2012 skrev MRAB følgende: > On 06/09/2012 15:56, Tigerstyle wrote: > > > Hi guys, > > > > > > I'm trying to write a module containing a function to examine the contents > > of the current working directory and p

Re: Accessing dll

2012-09-06 Thread Tim Williams
On Thursday, September 6, 2012 4:21:56 PM UTC-4, Tim Williams wrote: > On Thursday, September 6, 2012 11:07:07 AM UTC-4, Helpful person wrote: > > > I am a complete novice to Python. I wish to access a dll that has > > > > > > been written to be compatible with C and VB6. I have been told tha

Re: Parsing ISO date/time strings - where did the parser go?

2012-09-06 Thread John Nagle
On 9/6/2012 12:51 PM, Paul Rubin wrote: > John Nagle writes: >> There's an iso8601 module on PyPi, but it's abandoned; it hasn't been >> updated since 2007 and has many outstanding issues. > > Hmm, I have some code that uses ISO date/time strings and just checked > to see how I did it, and it loo

Re: Looking for an IPC solution

2012-09-06 Thread Dave Angel
On 09/06/2012 04:33 PM, Dennis Lee Bieber wrote: > > Note that this difference mainly applies to how the processes are > themselves are created... How the library wraps shared data is > possibly different (I've never understood how a "fork" process can > avoid memory conflicts if it has write acc

Re: A Python class

2012-09-06 Thread Chris Angelico
On Fri, Sep 7, 2012 at 3:30 AM, Terry Reedy wrote: > On 9/6/2012 11:08 AM, Yves S. Garret wrote: > >> I'd like to know if there are any online Python classes offered >> online from reliable institutions that you would recommend. > > Google 'online programming course python' for taught courses.

Re: Function for examine content of directory

2012-09-06 Thread Chris Angelico
On Fri, Sep 7, 2012 at 12:56 AM, Tigerstyle wrote: > I'm trying to write a module containing a function to examine the contents of > the current working directory and print out a count of how many files have > each extension (".txt", ".doc", etc.) If you haven't already, look into the Python 'd

HP Quality Center only works with ActiveState Python 2.5

2012-09-06 Thread bbeacham
Does anyone know why this is? I cannot find anything via Google about this, but HP says it is so. Of course it is now impossible to get ActiveState Python 2.5 for free. You can spend a $1000 for a copy. :) Anyway, it is irritating me that we are starting a new automation environment in Pyt

Re: Parsing ISO date/time strings - where did the parser go?

2012-09-06 Thread Miki Tebeka
I'd look also into dateutil.parser.parse and feedparser._parse_date On Thursday, September 6, 2012 1:34:18 PM UTC-7, John Nagle wrote: > On 9/6/2012 12:51 PM, Paul Rubin wrote: > > > John Nagle writes: > > >> There's an iso8601 module on PyPi, but it's abandoned; it hasn't been > > >> updated

Re: Parsing ISO date/time strings - where did the parser go?

2012-09-06 Thread Roy Smith
In article , John Nagle wrote: > In Python 2.7: > >I want to parse standard ISO date/time strings such as > > 2012-09-09T18:00:00-07:00 > > into Python "datetime" objects. The "datetime" object offers > an output method , datetimeobj.isoformat(), but not an input > parser. There o

Re: Parsing ISO date/time strings - where did the parser go?

2012-09-06 Thread Roy Smith
In article , Dave Angel wrote: > For working with datetime, see > http://docs.python.org/library/datetime.html#datetime.datetime > > and look up datetime.strptime() strptime has two problems. One is that it's a pain to use (you have to look up all those inscrutable %-thingies every time

Re: HP Quality Center only works with ActiveState Python 2.5

2012-09-06 Thread Dwight Hutto
On Thu, Sep 6, 2012 at 6:12 PM, wrote: > Does anyone know why this is? I cannot find anything via Google about > this, but HP says it is so. Of course it is now impossible to get > ActiveState Python 2.5 for free. You can spend a $1000 for a copy. :) > > Anyway, it is irritating me that we a

Bitshifts and "And" vs Floor-division and Modular

2012-09-06 Thread jimbo1qaz
Is it faster to use bitshifts or floor division? And which is better, & or %? All divisors and mods are power of 2, so are binary operations faster? And are they considered bad style? -- http://mail.python.org/mailman/listinfo/python-list

lxml can't output right unicode result

2012-09-06 Thread contro opinion
i eidt a file and save it in gbk encode named test. my system is :debian,locale,en.utf-8;python2.6,locale,utf-8. 你 in terminal i input: xxd test 000: 3c68 746d 6c3e 0a3c 703e c4e3 3c2f 703e ... 010: 0a3c 2f68 746d 6c3e 0a .. 你 is you in english, "\xc4\xe3" is the

  1   2   >