Re: complaints about no replies last week

2009-03-31 Thread Arnaud Delobelle
Arnaud Delobelle wrote: > prueba...@latinmail.com writes: > [...] > > I myself asked about how to write a library to efficiently do union > > and intersection of sets containing time intervals some time ago on > > this list and got little to no answers. It is a tricky problem. Since > > I was ge

Re: Thoughts on language-level configuration support?

2009-03-31 Thread rustom
I am not sure I understand your solution. I certainly think that the problem is big, very much bigger than is appreciated. Think of the hoopla in the RoR world about convention-over- configuration. On the other hand I feel that emacs is becoming messier and messier because it has taken up somethin

Re: Deleteing empty directories

2009-03-31 Thread CinnamonDonkey
Steven you are right, isDirEmpty() isn't even used. That's what happens when you try to get a last minute thread going 5 minutes before home time! ;-) Thanx for the responses guys! It's been very useful :) On 30 Mar, 16:38, Steven D'Aprano wrote: > On Mon, 30 Mar 2009 08:14:55 -0700, Cinnam

Re: Thoughts on language-level configuration support?

2009-03-31 Thread jfager
On Mar 31, 2:54 am, David Stanek wrote: > On Mon, Mar 30, 2009 at 9:40 AM, jfager wrote: > > I've written a short post on including support for configuration down > > at the language level, including a small preliminary half-functional > > example of what this might look like in Python, available

Re: usb mass storage device detection

2009-03-31 Thread Tim Golden
prakash jp wrote: Hi all, I am interested in detecting usb mass storage devices, r there any scripts in python to do so. Thanks in advance. What? Detecting their presence in your pocket? :) Which operating system are you using? It tends to make a difference: these things are quite OS-specific

Re: unpack the source tarball on Windows

2009-03-31 Thread Michael Torrie
Mensanator wrote: > Thanks. Still had to untar the ball, but I also downloaded a > trial version of Winzip which took care of that. Right. The proper command is: tar -xvjf tarball.tar.bz2 The recommended GUI for all things archival on Windows I think has to be 7zip. And it's not cursed sharewa

Re: Thoughts on language-level configuration support?

2009-03-31 Thread CTO
On the one hand, I can 110% see why you want to reduce boilerplate code and provide a discoverable, common mechanism for automating the two and three-quarters parsers that a lot of applications have to write to handle a config file, CLI, and/or registry values, but why introduce a syntax for it? A

Re: Thoughts on language-level configuration support?

2009-03-31 Thread Steven D'Aprano
On Mon, 30 Mar 2009 23:06:50 -0700, jfager wrote: > On Mar 30, 9:31 pm, "Rhodri James" wrote: ... >> This would be a interesting idea, but ultimately no more than a veneer >> over the current set of configuration possibilities.  Quite how such a >> system would tell whether to get configuration d

Re: Creating huge data in very less time.

2009-03-31 Thread John Machin
On Mar 31, 4:44 pm, "venutaurus...@gmail.com" wrote: > Hello all, >             I've a requirement where I need to create around 1000 > files under a given folder with each file size of around 1GB. The > constraints here are each file should have random data and no two > files should be unique eve

Re: Relative Imports, why the hell is it so hard?

2009-03-31 Thread Kay Schluehr
On 31 Mrz., 04:55, "Gabriel Genellina" wrote: > En Mon, 30 Mar 2009 21:15:59 -0300, Aahz escribió: > > > In article , > > Gabriel Genellina wrote: > > >> I'd recommend the oposite - use relative (intra-package) imports when > >> possible. Explicit is better than implicit - and starting with 2.7

Re: Thoughts on language-level configuration support?

2009-03-31 Thread jfager
On Mar 31, 3:08 am, rustom wrote: > I am not sure I understand your solution. Any questions, please ask. > I certainly think that the > problem is big, very much bigger than is appreciated. > Think of the hoopla in the RoR world about convention-over- > configuration. Certainly, it's a big pro

Any other web mail accessor like libgmail?

2009-03-31 Thread Ken
Is there other python wrapper such as libhotmail or libyahoomail? curiously ask. :p -- http://mail.python.org/mailman/listinfo/python-list

Re: Windows command line not displaying print commands

2009-03-31 Thread John Machin
On Mar 31, 11:42 am, Terry Reedy wrote: > JonathanB wrote: > > Ok, I'm sure this is really simple, but I cannot for the life of me > > get any print statements from any of my python scripts to actually > > print when I call them from the windows command line. What am I doing > > wrong? > > > hello

Re: Thoughts on language-level configuration support?

2009-03-31 Thread jfager
On Mar 31, 3:30 am, CTO wrote: > On the one hand, I can 110% see why you want to reduce boilerplate > code and provide a discoverable, common mechanism for automating the > two and three-quarters parsers that a lot of applications have to > write to handle a config file, CLI, and/or registry value

Re: Cyclic GC rules for subtyped objects with tp_dictoffset

2009-03-31 Thread Hrvoje Niksic
[ Questions such as this might be better suited for the capi-sig list, http://mail.python.org/mailman/listinfo/capi-sig ] BChess writes: > I'm writing a new PyTypeObject that is base type, supports cyclic > GC, and has a tp_dictoffset. If my type is sub-typed by a python > class, what exactly

Re: Creating huge data in very less time.

2009-03-31 Thread Steven D'Aprano
On Mon, 30 Mar 2009 22:44:41 -0700, venutaurus...@gmail.com wrote: > Hello all, > I've a requirement where I need to create around 1000 > files under a given folder with each file size of around 1GB. The > constraints here are each file should have random data and no two files > should

Re: An inheritance question: getting the name of the "one up" class

2009-03-31 Thread Steven D'Aprano
On Tue, 31 Mar 2009 01:29:50 -0300, Gabriel Genellina wrote: >> Oh, and while the gurus are at it, what would be the advantage (if any) >> of changing, say >>Primate.__init__(self) >> to >> super(Human, self).__init__() > > None, if you use single inheritance everywhere. But there's no

Re: Windows command line not displaying print commands

2009-03-31 Thread John Machin
On Mar 31, 9:57 am, JonathanB wrote: > On Mar 30, 6:28 pm, John Machin wrote: > > > On Mar 31, 8:37 am, Irmen de Jong wrote: > > > Does just typing: > > > >    python > > Yes, just typing python takes me to my interactive prompt > > > > Or do you have a module in your E:\Python\dev directory cal

Re: Ordered Sets

2009-03-31 Thread pataphor
On Mon, 30 Mar 2009 19:57:39 -0700 (PDT) Alex_Gaynor wrote: > I really like the Ordered Set class(I've been thinking about one ever > since ordered dict hit the std lib), is there any argument against > adding one to the collections module? I'd be willing to write a PEP > up for it. Suppose the

Re: An inheritance question: getting the name of the "one up" class

2009-03-31 Thread Michele Simionato
On Mar 31, 5:13 am, "Nick" wrote: > Oh, and while the gurus are at it, what would be the advantage (if any) of > changing, say >    Primate.__init__(self) > to >     super(Human, self).__init__() What others said. In Python 3.0 you would have a bigger advantage, since you can just write super()

Re: Thoughts on language-level configuration support?

2009-03-31 Thread jfager
On Mar 31, 3:40 am, Steven D'Aprano wrote: > On Mon, 30 Mar 2009 23:06:50 -0700, jfager wrote: > > On Mar 30, 9:31 pm, "Rhodri James" wrote: > ... > >> This would be a interesting idea, but ultimately no more than a veneer > >> over the current set of configuration possibilities.  Quite how such

Re: Thoughts on language-level configuration support?

2009-03-31 Thread Kay Schluehr
On 30 Mrz., 15:40, jfager wrote: > I've written a short post on including support for configuration down > at the language level, including a small preliminary half-functional > example of what this might look like in Python, available > athttp://jasonfager.com/?p=440. > > The basic idea is that

Re: Thoughts on language-level configuration support?

2009-03-31 Thread David Stanek
On Tue, Mar 31, 2009 at 3:19 AM, jfager wrote: > > "Simply having a configuration file" - okay.  What format?  What if > the end user wants to keep their configuration info in LDAP?  Did the > library I'm including make the same decisions, or do I have to do some > contortions to adapt?  Didn't I

Re: PyFits for Windows?

2009-03-31 Thread W. eWatson
W. eWatson wrote: W. eWatson wrote: It looks like PyFits downloads are for Linux. Isn't there anything available for Win (xp)? I'm now on the scipy mail list. Things look hopeful, according to the first respondent, to meet my criteria mentioned in another sub-thread to this one: "I'm hoping t

Re: Ordered Sets

2009-03-31 Thread pataphor
On Tue, 31 Mar 2009 10:33:26 +0200 pataphor wrote: > On Mon, 30 Mar 2009 19:57:39 -0700 (PDT) > Alex_Gaynor wrote: > > > I really like the Ordered Set class(I've been thinking about one > > ever since ordered dict hit the std lib), is there any argument > > against adding one to the collections

Re: Creating huge data in very less time.

2009-03-31 Thread andrea
On 31 Mar, 12:14, "venutaurus...@gmail.com" wrote: > > That time is reasonable. The randomness should be in such a way that > MD5 checksum of no two files should be the same.The main reason for > having such a huge data is for doing stress testing of our product. In randomness is not necessary (

Re: Creating huge data in very less time.

2009-03-31 Thread venutaurus...@gmail.com
On Mar 31, 1:15 pm, Steven D'Aprano wrote: > On Mon, 30 Mar 2009 22:44:41 -0700, venutaurus...@gmail.com wrote: > > Hello all, > >             I've a requirement where I need to create around 1000 > > files under a given folder with each file size of around 1GB. The > > constraints here are each f

Authorize.net integration problem

2009-03-31 Thread Lakshman
I am trying to integrate Authorize.net SIM API into django views. I am facing a problem in the fingerprint generation. I am repeatedly getting that the fingerprint generated doesn't match the one the server generates. I have generated the md5 hash with the key provided as specified in the SIM doc

How to pass one HTML values to another HTML

2009-03-31 Thread Kalyan
hi by using python and google app engine how can i pass one HTML values to another HTML .. i am very new to Python programing Example : in one HTML i entered Name and Address fields and i submit the page at that time i want to see those two values in another HTML page.. please reply me.. adv

[ANN] Data Plotting Library DISLIN 9.5

2009-03-31 Thread Helmut Michels
Dear Python users, I am pleased to announce version 9.5 of the data plotting software DISLIN. DISLIN is a high-level and easy to use plotting library for displaying data as curves, bar graphs, pie charts, 3D-colour plots, surfaces, contours and maps. Several output formats are supported such as

Re: Creating huge data in very less time.

2009-03-31 Thread Tim Chase
venutaurus...@gmail.com wrote: On Mar 31, 1:15 pm, Steven D'Aprano The fastest HDDs can reach about 125 MB per second under ideal circumstances, so that will take at least 8 seconds per 1GB file or 8000 seconds in total. That time is reasonable. You did catch the bit about "the *fastest* HD

First project in python, want someone to hold my hand for 2 hours for $100

2009-03-31 Thread googleaccount
Hey, I have to generate this really big matrix from some data. It's extremely straightforward for someone who has the slightest idea what they are doing. I'd really like to learn how to do this but I've gotten impatient with the tutorials because this should be so straightforward. Email me or ideal

UnknownTimeZoneError

2009-03-31 Thread Brian
I'm running App Engine with Django. I'm having troubles executing timezone conversion via pytz. I have looked at the Google example implementation. The following works in IDLE: >>> import pytz >>> from pytz import common_timezones >>> from pytz import timezone >>> import datetime >>> timestamp = d

Re: Creating huge data in very less time.

2009-03-31 Thread Tim Chase
andrea wrote: On 31 Mar, 12:14, "venutaurus...@gmail.com" wrote: That time is reasonable. The randomness should be in such a way that MD5 checksum of no two files should be the same.The main reason for having such a huge data is for doing stress testing of our product. In randomness is not n

Re: Authorize.net integration problem

2009-03-31 Thread andrew cooke
have you printed msg and checked it is formatted correctly? i have node idea what the protocol is, but your use of join and string concatenation in the generation of msg looks unusual to me. andrew Lakshman wrote: > I am trying to integrate Authorize.net SIM API into django views. > > I am faci

Hands on Python - Problem with Local Cgi Server

2009-03-31 Thread Gary Wood
I have the DOS box with the message Localhost CGI server started But when i try this Back in the www directory, 1.. Open the web link http://localhost:8080/adder.html (preferably in a new window, separate from this this tutorial). 2.. You should see an adder form in your browser again.

Re: Ordered Sets

2009-03-31 Thread Alex_Gaynor
On Mar 31, 5:52 am, pataphor wrote: > On Tue, 31 Mar 2009 10:33:26 +0200 > > pataphor wrote: > > On Mon, 30 Mar 2009 19:57:39 -0700 (PDT) > > Alex_Gaynor wrote: > > > > I really like the Ordered Set class(I've been thinking about one > > > ever since ordered dict hit the std lib), is there any a

Re: Authorize.net integration problem

2009-03-31 Thread Lakshman Prasad
Yup. Unusual, it is. But thats how their string specification syntax is. It includes a ^ at the end. On Tue, Mar 31, 2009 at 6:13 PM, andrew cooke wrote: > > have you printed msg and checked it is formatted correctly? i have node > idea what the protocol is, but your use of join and string co

Re: Thoughts on language-level configuration support?

2009-03-31 Thread jfager
On Mar 31, 5:57 am, Kay Schluehr wrote: > On 30 Mrz., 15:40, jfager wrote: > > > > > I've written a short post on including support for configuration down > > at the language level, including a small preliminary half-functional > > example of what this might look like in Python, available > > at

Re: Authorize.net integration problem

2009-03-31 Thread Aahz
In article , Lakshman wrote: > >I am facing a problem in the fingerprint generation. I am repeatedly >getting that the fingerprint generated doesn't match the one the >server generates. How are you getting this? Server error? You're not giving us enough information. -- Aahz (a...@pythoncraft.

Re: Windows command line not displaying print commands

2009-03-31 Thread JonathanB
I think I found the problem. I recently removed Python 2.5 and replaced it with 2.6. When I got in, I tried to run some django commands and even they weren't producing output. On a hunch, I tried to uninstall 2.6 and reinstall it, since now even django wasn't producing output. When I tried, it told

Re: Thoughts on language-level configuration support?

2009-03-31 Thread jfager
On Mar 31, 6:02 am, David Stanek wrote: > On Tue, Mar 31, 2009 at 3:19 AM, jfager wrote: > > > "Simply having a configuration file" - okay.  What format?  What if > > the end user wants to keep their configuration info in LDAP?  Did the > > library I'm including make the same decisions, or do I h

Listing all python modules robustly

2009-03-31 Thread Brian
I've used the C api to write a method that can call any python module function. I would like to extend the interface to allow dynamically listing all python modules, and for a given module all functions, and for a given function all argument types and the return types if possible. Starting with the

Re: Creating huge data in very less time.

2009-03-31 Thread Dave Angel
I wrote a tiny DOS program called resize that simply did a seek out to a (user specified) point, and wrote zero bytes. One (documented) side effect of DOS was that writing zero bytes would truncate the file at that point. But it also worked to extend the file to that point without writing any

RE: Cannot register to submit a bug report

2009-03-31 Thread John Posner
>> >> We can try to debug this :) >> >> >> >> > E-mail message checked by Spyware Doctor (6.0.0.386) >> >> > Database version: >> >> 5.12060http://www.pctools.com/en/spyware-doctor-antivirus/ >> >> >> >> Any chance it's Spyware Doctor or some anti-virus flagging >> >> the messag

Re: win32com python AttributeError!

2009-03-31 Thread Mike Driscoll
On Mar 30, 11:17 pm, Michael wrote: > Hi Python-list - > > Has anyone figured this out from Rebecca: > > Hi, I am having trouble with win32com for python.  I get the following > error when I try to issue any command after using Dispatch. > > >>> xl=win32com.client.Dispatch("Excel.Application") > >

Re: Thoughts on language-level configuration support?

2009-03-31 Thread David Stanek
On Tue, Mar 31, 2009 at 10:01 AM, jfager wrote: > On Mar 31, 6:02 am, David Stanek wrote: >> On Tue, Mar 31, 2009 at 3:19 AM, jfager wrote: >> >> > "Simply having a configuration file" - okay.  What format?  What if >> > the end user wants to keep their configuration info in LDAP?  Did the >> >

RE: Style question - defining immutable class data members

2009-03-31 Thread John Posner
I said: >> > My intent was to fix an obvious omission: a special case >> was discussed in >> > the "Augmented assignment statements" section, but an >> almost-identical >> > special case was omitted from the "Assignment statements" section. After finally getting registered at bugs.python.o

Re: Ordered Sets

2009-03-31 Thread pataphor
On Tue, 31 Mar 2009 06:03:13 -0700 (PDT) Alex_Gaynor wrote: > My inclination would be to more or less *just* have it implement the > set API, the way ordered dict does in 2.7/3.1. As far as I can tell all that would be needed is read/write access to two key variables: The iterator start position

methods and class methods

2009-03-31 Thread Zach Goscha
I just learned python programming and is wondering how to change a method to a class method. Also what are the differences between a method and class method. Thanks in advance - Zach (Freshman student in High school) -- http://mail.python.org/mailman/listinfo/python-list

Re: An inheritance question: getting the name of the "one up" class

2009-03-31 Thread Nick
Thanks for the replies. This has given me some incentive to start looking at Python 3. Oh, and thanks for the articles on super(). Nick -- http://mail.python.org/mailman/listinfo/python-list

Re: methods and class methods

2009-03-31 Thread Daniel Fetchinson
> I just learned python programming and is wondering how to change a method to > a class method. class x( object ): @classmethod i_will_be_a_class_method( cls ): pass > Also what are the differences between a method and class method. A class method receives the class as its first argumen

regex negative lookbehind assertion not working correctly?

2009-03-31 Thread Gabriel Rossetti
Hello everyone, I am trying to write a regex pattern to match an ID in a URL only if it is not a given ID. Here's an example, the ID not to match is "14522XXX98", if my URL is "/profile.php?id=14522XXX99" I want it to match and if it's "/profile.php?id=14522XXX98" I want it not to. I tried th

Re: Authorize.net integration problem

2009-03-31 Thread Stephen Chapman
Are they expecting the results in a specific order... because as you probably know a dictionary is never in the order that you add the items. Lakshman Prasad wrote: Yup. Unusual, it is. But thats how their string specification syntax is. It includes a ^ at the end. On Tue, Mar 31, 2009 at

Re: An inheritance question: getting the name of the "one up" class

2009-03-31 Thread Gabriel Genellina
En Tue, 31 Mar 2009 05:16:47 -0300, Steven D'Aprano escribió: On Tue, 31 Mar 2009 01:29:50 -0300, Gabriel Genellina wrote: Oh, and while the gurus are at it, what would be the advantage (if any) of changing, say Primate.__init__(self) to super(Human, self).__init__() None, if you u

Re: complaints about no replies last week

2009-03-31 Thread pruebauno
On Mar 31, 2:56 am, Arnaud Delobelle wrote: > Arnaud Delobelle wrote: > > prueba...@latinmail.com writes: > > [...] > > > I myself asked about how to write a library to efficiently do union > > > and intersection of sets containing time intervals some time ago on > > > this list and got little to

Re: Introducing Python to others

2009-03-31 Thread David C. Ullrich
In article <039360fb-a29c-4f43-b6e0-ba97fb598...@z23g2000prd.googlegroups.com>, Mensanator wrote: > On Mar 26, 11:42 am, "andrew cooke" wrote: > > David C. Ullrich wrote: > > > In article , > > >  "Paddy O'Loughlin" wrote: > > > > > Here's my favorite thing about Python (you'd of course > > >

Re: regex negative lookbehind assertion not working correctly?

2009-03-31 Thread andrew cooke
it is working - it's making the final "8" not be matched. don't you want lookahead rather than lookbehind? or force an end of string? andrew Gabriel Rossetti wrote: > Hello everyone, > > I am trying to write a regex pattern to match an ID in a URL only if it > is not a given ID. Here's an ex

Re: Introducing Python to others

2009-03-31 Thread David C. Ullrich
In article , Scott David Daniels wrote: > Mensanator wrote: > > On Mar 26, 11:42 am, "andrew cooke" wrote: > >> ... > >> that's cute, but if you show them 2.6 or 3 it's even cuter: > >> > > from operator import add > > class Vector(list): > >> ... def __add__(self, other): > >> ...

Re: Introducing Python to others

2009-03-31 Thread andrew cooke
David C. Ullrich wrote: > In article , > Scott David Daniels wrote: > >> Mensanator wrote: >> > On Mar 26, 11:42 am, "andrew cooke" wrote: >> >> ... >> >> that's cute, but if you show them 2.6 or 3 it's even cuter: >> >> >> > from operator import add >> > class Vector(list): >> >> ...

Re: Listing all python modules robustly

2009-03-31 Thread Brian
Turns out that the Twisted framework provides better introspective support than standard python, so problem solved! http://twistedmatrix.com/documents/8.2.0/api/twisted.python.modules.html#walkModules On Tue, Mar 31, 2009 at 8:12 AM, Brian wrote: > I've used the C api to write a method that can

Detecting Binary content in files

2009-03-31 Thread ritu
Hi, I'm wondering if Python has a utility to detect binary content in files? Or if anyone has any ideas on how that can be accomplished? I haven't been able to find any useful information to accomplish this (my other option is to fire off a perl script from within m python script that will tell me

Re: Creating huge data in very less time.

2009-03-31 Thread Grant Edwards
On 2009-03-31, Dave Angel wrote: > I wrote a tiny DOS program called resize that simply did a > seek out to a (user specified) point, and wrote zero bytes. > One (documented) side effect of DOS was that writing zero > bytes would truncate the file at that point. But it also > worked to extend th

urllib2 problem, data param not working?

2009-03-31 Thread Gabriel Rossetti
Hello everyone, I am having a problem with urllib2, when I do this : post = urllib.urlencode(post) request = urllib2.Request(url, post) response = urllib2.urlopen(request) or this : post = urllib.urlencode(post) response = urllib2.urlopen(url, post) or this : post = urllib.

Re: Relative Imports, why the hell is it so hard?

2009-03-31 Thread s4g
Hi, I was looking for a nice idiom for interpackage imports as I found this thread. Here come a couple of solutions I came up with. Any discussion is welcome. I assume the same file structure \ App | main.py +--\subpack1 | | __init__.py | | module1.py | +--\subpack2 | | __init__.py | | module2.p

Re: Detecting Binary content in files

2009-03-31 Thread Matt Nordhoff
ritu wrote: > Hi, > > I'm wondering if Python has a utility to detect binary content in > files? Or if anyone has any ideas on how that can be accomplished? I > haven't been able to find any useful information to accomplish this > (my other option is to fire off a perl script from within m python

Re: Creating huge data in very less time.

2009-03-31 Thread Grant Edwards
On 2009-03-31, Steven D'Aprano wrote: [writing a bunch of files with a bunch of random data in each] >> Can this be done within few minutes of time. Is it possble >> only using threads or can be done in any other way. This has >> to be done in Windows. > > Is it possible? Sure. In a couple of mi

Re: Creating huge data in very less time.

2009-03-31 Thread Terry Reedy
venutaurus...@gmail.com wrote: That time is reasonable. The randomness should be in such a way that MD5 checksum of no two files should be the same.The main reason for having such a huge data is for doing stress testing of our product. For most purposes (other than stress testing the HD and HD

Re: Creating huge data in very less time.

2009-03-31 Thread Tim Chase
Is there a way to create a file to big withouth actually writing anything in python (just give me the garbage that is already on the disk)? No. That would be a monstrous security hole. Sure...just install 26 hard-drives and partition each up into 40 1-GB unformatted partitions each, and then

Printing Out Called Function Calls

2009-03-31 Thread Victor Subervi
Hi; Due to screwy problems at my server farm that they refuse to fix, I need to call lines that execute code from other files, like this: theContent += `tidBits[i][y][:-2]` but what that returns is this (as an example): tableTop(348,180) when I need it to execute the fn tableTop. What do? TIA,

Writing to Console on mac OS X

2009-03-31 Thread RGK
I'm on mac os x 10.4.11 running python 2.5.2, and Django 1.0, but this is a python question. When doing django/mod_python stuff, I can write to the Apache error_log file with sys.stderr.write("SOMETHING I WANT TO KNOW") which had me wondering if there's not a means for a misc. python pro

Re: Detecting Binary content in files

2009-03-31 Thread Benjamin Kaplan
On Tue, Mar 31, 2009 at 12:23 PM, ritu wrote: > Hi, > > I'm wondering if Python has a utility to detect binary content in > files? Or if anyone has any ideas on how that can be accomplished? I > haven't been able to find any useful information to accomplish this > (my other option is to fire off

Re: regex negative lookbehind assertion not working correctly?

2009-03-31 Thread MRAB
Gabriel Rossetti wrote: Hello everyone, I am trying to write a regex pattern to match an ID in a URL only if it is not a given ID. Here's an example, the ID not to match is "14522XXX98", if my URL is "/profile.php?id=14522XXX99" I want it to match and if it's "/profile.php?id=14522XXX98" I wa

Re: create a log level for python logging module

2009-03-31 Thread dj
On Mar 30, 4:18 pm, Vinay Sajip wrote: > On Mar 30, 4:13 pm, dj wrote: > > > > > I am trying to create a log level called userinfo for the pythonlogging. I > > read the source code and tried to register the level to theloggingnamespace > > with the following source: > > >              fromloggi

Re: Printing Out Called Function Calls

2009-03-31 Thread andrew cooke
Victor Subervi wrote: > Hi; > Due to screwy problems at my server farm that they refuse to fix, I need > to > call lines that execute code from other files, like this: > theContent += `tidBits[i][y][:-2]` > but what that returns is this (as an example): > tableTop(348,180) > when I need it to e

Re: Cyclic GC rules for subtyped objects with tp_dictoffset

2009-03-31 Thread BChess
On Mar 31, 12:27 am, Hrvoje Niksic wrote: > [ Questions such as this might be better suited for the capi-sig list, >  http://mail.python.org/mailman/listinfo/capi-sig] > > BChess writes: > > I'm writing a new PyTypeObject that is base type, supports cyclic > > GC, and has a tp_dictoffset.  If my t

Re: Detecting Binary content in files

2009-03-31 Thread Josh Dukes
There might be another way but off the top of my head: #!/usr/bin/env python def isbin(filename): fd=open(filename,'rb') for b in fd.read(): if ord(b) > 127: fd.close() return True fd.close() return False for f in ['/bin/bash', '/etc/passwd']: print "%

Re: Detecting Binary content in files

2009-03-31 Thread Josh Dukes
s/if ord(b) > 127/if ord(b) > 127 or ord(b) < 32/ On Tue, 31 Mar 2009 10:19:44 -0700 Josh Dukes wrote: > There might be another way but off the top of my head: > > #!/usr/bin/env python > > def isbin(filename): >fd=open(filename,'rb') >for b in fd.read(): >if ord(b) > 127: >

Re: Does Python have certificate?

2009-03-31 Thread Aahz
In article , Paddy3118 wrote: > >The Academy of Research into Science Education being a true leader in >the field offers acclaimed accreditation for Python programmers. Those >who pass our strict exams and pay our modest fees will earn our >prestigious certification. > >Those who show promise can

Re: Cannot register to submit a bug report

2009-03-31 Thread Terry Reedy
John Posner wrote: My ISP (AT&T/Yahoo) was blocking email from the Python bug-tracker: "The sending system has been identified as a source of spam". I hope you were able to suggest to them that that identification must be an error. Frustrating given the spam sources that somehow do not get

Re: Ordered Sets

2009-03-31 Thread Alex_Gaynor
On Mar 31, 11:06 am, pataphor wrote: > On Tue, 31 Mar 2009 06:03:13 -0700 (PDT) > > Alex_Gaynor wrote: > > My inclination would be to more or less *just* have it implement the > > set API, the way ordered dict does in 2.7/3.1. > > As far as I can tell all that would be needed is read/write access

Re: Detecting Binary content in files

2009-03-31 Thread Josh Dukes
or rather: #!/usr/bin/env python import string def isbin(filename): fd=open(filename,'rb') for b in fd.read(): if not b in string.printable and b not in string.whitespace: fd.close() return True fd.close() return False for f in ['/bin/bash', '/etc/passwd']:

Re: Printing Out Called Function Calls

2009-03-31 Thread Victor Subervi
> > change server famrs? > Really. But I imagine they are all trash for the price I pay. > > use eval() or exec()? > eval worked, exec no. Thanks! > > andrew > > -- http://mail.python.org/mailman/listinfo/python-list

Re: Relative Imports, why the hell is it so hard?

2009-03-31 Thread Kay Schluehr
On 31 Mrz., 18:48, s4g wrote: > Hi, > > I was looking for a nice idiom for interpackage imports as I found > this thread. > Here come a couple of solutions I came up with. Any discussion is > welcome. > > I assume the same file structure > > \ App > | main.py > +--\subpack1 > | | __init__.py > | |

Re: create a log level for python logging module

2009-03-31 Thread MRAB
dj wrote: On Mar 30, 4:18 pm, Vinay Sajip wrote: On Mar 30, 4:13 pm, dj wrote: I am trying to create a log level called userinfo for the pythonlogging. I read the source code and tried to register the level to theloggingnamespace with the following source: fromloggingimport

Re: Creating huge data in very less time.

2009-03-31 Thread Irmen de Jong
venutaurus...@gmail.com wrote: On Mar 31, 1:15 pm, Steven D'Aprano wrote: On Mon, 30 Mar 2009 22:44:41 -0700, venutaurus...@gmail.com wrote: Hello all, I've a requirement where I need to create around 1000 files under a given folder with each file size of around 1GB. The constraint

Re: udp package header

2009-03-31 Thread Artur M. Piwko
In the darkest hour on Tue, 24 Mar 2009 00:50:10 + (UTC), R. David Murray screamed: >> I got a problem. İ want to send udp package and get this package (server and >> clinet ). it's easy to python but i want to look the udp header how can i >> do ? > > The English word is 'packet'. > > If yo

custom handler does not write to log file

2009-03-31 Thread dj
It seems that you can create custom handlers and add them to the logging.handlers namespace(http://mail.python.org/pipermail/python- list/2008-May/493826.html.) But for reasons beyond my understanding my log file (test.log) is not written to. my handler class

Re: Thoughts on language-level configuration support?

2009-03-31 Thread Lorenzo Gatti
On 31 Mar, 09:19, jfager wrote: > On Mar 31, 2:54 am, David Stanek wrote: > > > On Mon, Mar 30, 2009 at 9:40 AM, jfager wrote: > > >http://jasonfager.com/?p=440. > > > > The basic idea is that a language could offer syntactic support for > > > declaring configurable points in the program. The l

RE: Cannot register to submit a bug report

2009-03-31 Thread John Posner
Terry Ready said: >> > My ISP (AT&T/Yahoo) was blocking email from the Python bug-tracker: "The >> > sending system has been identified as a source of spam". >> >> I hope you were able to suggest to them that that >> identification must be >> an error. Frustrating given the spam sources

Re: Writing to Console on mac OS X

2009-03-31 Thread Irmen de Jong
RGK wrote: I'm on mac os x 10.4.11 running python 2.5.2, and Django 1.0, but this is a python question. When doing django/mod_python stuff, I can write to the Apache error_log file with sys.stderr.write("SOMETHING I WANT TO KNOW") which had me wondering if there's not a means for a misc

Re: Writing to Console on mac OS X

2009-03-31 Thread RGK
Thanks for the pointer Irmen. That works fine. Also my unfamiliarity with the console app is showing - I just learned that there is a navigation pane activated by the 'logs' icon that allows me to see various system logs, including the Apache ones :p You're right, I've heard a bit about the

Re: Relative Imports, why the hell is it so hard?

2009-03-31 Thread Terry Reedy
Kay Schluehr wrote: On 31 Mrz., 18:48, s4g wrote: This and similar solutions ( see Istvan Alberts ) point me to a fundamental problem of the current import architecture. Suppose you really want to run a module as a script without a prior import from a module path: ...A\B\C> python my_module.

Re: Relative Imports, why the hell is it so hard?

2009-03-31 Thread Kay Schluehr
On 31 Mrz., 20:50, Terry Reedy wrote: > Nothing is added to sys.modules, except the __main__ module, unless > imported (which so are on startup). Yes. The startup process is opaque but at least user defined modules are not accidentally imported. > > > Although the ceremony has been performed >

Re: regex negative lookbehind assertion not working correctly?

2009-03-31 Thread Gabriel Rossetti
MRAB wrote: Gabriel Rossetti wrote: Hello everyone, I am trying to write a regex pattern to match an ID in a URL only if it is not a given ID. Here's an example, the ID not to match is "14522XXX98", if my URL is "/profile.php?id=14522XXX99" I want it to match and if it's "/profile.php?id=145

Re: Detecting Binary content in files

2009-03-31 Thread Dave Angel
There are lots of ways to decide if a file is non-text, but I don't know of any "standard" way. You can detect a file as not-ascii by simply searching for any character greater than 0x7f. But that doesn't handle a UTF-8 file, which is an 8bit text file representing Unicode. The way I've see

Re: Detecting Binary content in files

2009-03-31 Thread Dave Angel
All files are binary, but probably by binary you mean non-text. There are lots of ways to decide if a file is non-text, but I don't know of any "standard" way. You can detect a file as not-ascii by simply searching for any character greater than 0x7f. But that doesn't handle a UTF-8 file, wh

Re: Re: Creating huge data in very less time.

2009-03-31 Thread Dave Angel
The FAT file system does not support sparse files. They were added in NTFS, in the Windows 2000 timeframe, to my recollection. Don't try to install NTFS on a floppy. Grant Edwards wrote: On 2009-03-31, Dave Angel wrote: I wrote a tiny DOS program called resize that simply did a seek out

Re: please include python26_d.lib in the installer

2009-03-31 Thread Compie
On 27 mrt, 17:01, Carl Banks wrote: > OTOH, it's possible that SWIG and Python just happen to use the same > macro to indicate debugging mode.  So I think you raise a valid point > that this can be problematic.  Perhaps something like _Py_DEBUG should > be used instead. This would be a good solut

Re: custom handler does not write to log file

2009-03-31 Thread dj
On Mar 31, 1:13 pm, dj wrote: > It seems that you can create custom handlers and add them to the > logging.handlers namespace(http://mail.python.org/pipermail/python- > list/2008-May/493826.html.) > But for reasons beyond my understanding my log file (test.log) is not > written to. > > ###

  1   2   >