Code objects

2007-07-23 Thread Evan Klitzke
I was playing around with the inspect module tonight, and I have a question about "code components". Can an object have more than one code component? For example, will the following code ever create a list whose length is greater than one? import inspect # Some code here defining an object/functi

Re: Need Help with base64

2007-07-23 Thread Tim Roberts
pycraze <[EMAIL PROTECTED]> wrote: > >int base641_decodestring(char* pcstr,int size,char** ppcdest) >{ > unsigned char cin[4] = {""}; > unsigned char cout[3] = {""}; > unsigned char cv = 0; > int ni = 0; > int nlen = 0; > char* cptr = pcstr; > *ppcdest = malloc(sizeof(ch

Python Trainers, Promote Thyself!

2007-07-23 Thread Jeff Rush
With the recent establishment of the wiki page on python.org for those who offer training services for the Python language, we now have 23 listed, worldwide. http://wiki.python.org/moin/PythonTraining Many of the trainers are individuals or small companies, and it can be hard to get the atte

wxPython Internationalization

2007-07-23 Thread [EMAIL PROTECTED]
I know this may have a very simple answer, nonetheless. I am wishing to find the cleanest and most pythonic way of implementing the following: I am creating a internationalized application in wxPython and have sorted the directory structure in the following manner: start.py metamen

Re: Parsing XML with ElementTree (unicode problem?)

2007-07-23 Thread oren . tsur
On Jul 23, 4:46 pm, "Richard Brodie" <[EMAIL PROTECTED]> wrote: > <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED] > > > so what's the difference? how comes parsing is fine > > in the first case but erroneous in the second case? > > You may have guessed the encoding wrong. It probabl

Re: code packaging

2007-07-23 Thread Paul Rubin
[EMAIL PROTECTED] (John J. Lee) writes: > You can go further: in addition to developing a Debian package (or a > few of them) for your own project, build your OS image using > debootstrap (you'll probably want your own local repository(ies), for > reproducibility). Then you do your development in

Re: Confused with csv.reader copies

2007-07-23 Thread Jeethu Rao
Robert Dailey wrote: > First, take a look at my example code: > - > import csv > > def pass1( reader ): > print reader.next() > print reader.next() > > def pass2( reader ): > print reader.next() > print reader.next() > > re

Re: Where do they tech Python officialy ?

2007-07-23 Thread Paul Rubin
NicolasG <[EMAIL PROTECTED]> writes: > Does some one have any suggestions on which University to attend ? > Alternatives solutions are welcome.. If you have a good programming background in other languages, you should easily be able to pick up Python by reading the manual. If you don't have a pro

Usergroups Forming: Arizona and Carolina US Regions

2007-07-23 Thread Jeff Rush
Two new Python usergroups are being organized! = Arizona = Michael March is starting a group for those in the Flagstaff/Phoenix/Tucson region of Arizona. The first meeting to get organized will be held on *Monday July 30th* at 6:30pm. Location is not yet set -- need input from potential attende

Re: pylint style convention

2007-07-23 Thread Ben Finney
[EMAIL PROTECTED] (Mick Charles Beaver) writes: > Here's a snippet: pylint is reporting line numbers. Can you show us line numbers for this snippet? > #== > if __name__ == '__main__': > parser = optparse.OptionParser(usage='

Re: idiom for RE matching

2007-07-23 Thread Gabriel Genellina
En Tue, 24 Jul 2007 00:23:46 -0300, Gordon Airporte <[EMAIL PROTECTED]> escribió: > [EMAIL PROTECTED] wrote: >> if your search is not overly complicated, i think regexp is not >> needed. if you want, you can post a sample what you want to search, >> and some sample input. > > I'm afraid it's pre

Re: idiom for RE matching

2007-07-23 Thread Gordon Airporte
[EMAIL PROTECTED] wrote: > if your search is not overly complicated, i think regexp is not > needed. if you want, you can post a sample what you want to search, > and some sample input. I'm afraid it's pretty complicated :-). I'm doing analysis of hand histories that online poker sites leave for

Re: code indentation

2007-07-23 Thread Gabriel Genellina
En Mon, 23 Jul 2007 16:53:01 -0300, ...:::JA:::... <[EMAIL PROTECTED]> escribió: >> If you are using the tokenize module as suggested some time ago, try to >> analyze the token sequence you get using { } (or perhaps begin/end pairs >> in your own language, that are easier to distinguish from a d

classmethod & staticmethod

2007-07-23 Thread james_027
hi, python's staticmethod is the equivalent of java staticmethod right? with classmethod, I can call the method without the need for creating an instance right? since the difference between the two is that classmethod receives the class itself as implicti first argument. From my understanding cla

Re: Re-running unittest

2007-07-23 Thread Israel Fernández Cabrera
Hi Gabriel > Perhaps the best option is to run the tests in another process. Use any of > the available IPC mechanisms to gather the test results. This has the > added advantage of isolating the tested code from your GUI testing > framework; all requested resources are released to the OS; the test

Re: set_proxy in urllib2 is driving my crazy

2007-07-23 Thread O.R.Senthil Kumaran
* est <[EMAIL PROTECTED]> [2007-07-23 09:50:17]: > A simple py script > > import urllib2 > req=urllib2.Request("http://www.google.com";) > req.set_proxy("127.0.0.1:1","http") > print urllib2.urlopen(req).read() > Try to use the ProxyHandler of urllib2. import urllib2 proxy_url = 'http://' + PR

Re: Subclassing int

2007-07-23 Thread G
Thanks a lot Matt and Steve. I replaced __int__ with __new__ and it worked On 7/23/07, Matt McCredie <[EMAIL PROTECTED]> wrote: Do you guys know why the if statement is not evaluated? For immutable types __new__ is called before __init__. There are some details here: http://docs.python.org/r

[XBOX] Python XBOX360 Migration Question

2007-07-23 Thread [EMAIL PROTECTED]
Hello ALL, I have just migrated python-core to xbox360. I wonder if someone else has already done it yet ? The ctypes-module-migration puzzle me because I seldom use powerpc assembly. Can someone give me a hint ?? -- http://mail.python.org/mailman/listinfo/python-list

Re: pylint style convention

2007-07-23 Thread Michael Hoffman
Mick Charles Beaver wrote: > Hello, > > I've been looking into using PyLint on some of my programs, just as a > best practices kind of thing. > > Here's a snippet: > #== > if __name__ == '__main__': > parser = optparse.Option

Hacking with __new__

2007-07-23 Thread Sandra-24
Ok here's the problem, I'm modifying a 3rd party library (boto) to have more specific exceptions. I want to change S3ResponseError into about 30 more specific errors. Preferably I want to do this by changing as little code as possible. I also want the new exceptions to be a subclass of the old S3Re

Re: Re-running unittest

2007-07-23 Thread Gabriel Genellina
At 23/07/2007 09:59, "Israel Fernández Cabrera" <[EMAIL PROTECTED]> wrote: (Please keep posting on the list - many other people may have better ideas on this) > Well... probably my English and my intentions to not ti write > to much made my explanation unclear. The code I wrote was just > to il

Subclassing int

2007-07-23 Thread G
Hi, I am trying to subclass int to allow a constructor to accept None. I am trying the following class INT(int): def __init__(self, x): if x is None: return None else: int.__init__(x) b = INT(x=None) When i run the previous code i get the following er

Re: Subclassing int

2007-07-23 Thread Steve Holden
G wrote: > Hi, > > I am trying to subclass int to allow a constructor to accept None. I > am trying the following > > class INT(int): > def __init__(self, x): > if x is None: > return None > else: > int.__init__(x) > > b = INT(x=None) > > When i

Re: pylint style convention

2007-07-23 Thread Matt McCredie
Which style convention is it referring to? Should these really be all caps? I think pylint is expecting that any variables declared outside of a function should be constants with special meanings (similar to #define or enum values in c). So, I guess to get rid of that message you should do som

Re: Maintaining leading zeros with the lstrip string function?

2007-07-23 Thread Steve Holden
Randy Kreuziger wrote: > Thanks for the basename suggestion. That almost works. I'm running > into a problem with some of the directory names when they include > \800x\ see below. > �- > import sys, os, string > > te

Re: [2.5] Regex doesn't support MULTILINE?

2007-07-23 Thread Gilles Ganault
On Sun, 22 Jul 2007 05:34:17 -0300, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: >Try to avoid using ".*" and ".+" (even the non greedy forms); in this >case, I think you want the scan to stop when it reaches the ending >or any other tag, so use: [^<]* instead. > >BTW, better to use a raw st

RE: Maintaining leading zeros with the lstrip string function?

2007-07-23 Thread Randy Kreuziger
Thanks for the basename suggestion. That almost works. I'm running into a problem with some of the directory names when they include \800x\ see below. ―- import sys, os, string teststring = 'C:\shoreline\dvd\prep area

python a lonys

2007-07-23 Thread Nooby
http://www.directurl.de/39850293 thissi something new 4 u guys -- http://mail.python.org/mailman/listinfo/python-list

pylint style convention

2007-07-23 Thread Mick Charles Beaver
Hello, I've been looking into using PyLint on some of my programs, just as a best practices kind of thing. Here's a snippet: #== if __name__ == '__main__': parser = optparse.OptionParser(usage='usage: %prog [OPTIONS]') pa

Re: Maintaining leading zeros with the lstrip string function?

2007-07-23 Thread Steven D'Aprano
On Mon, 23 Jul 2007 15:21:20 -0400, Miles wrote: > Also, use raw strings ( r'\path\to\file' ) to avoid problems > with backslashes being interpreted in strings. Not quite. Raw strings are designed for building regular expressions, not file names. Consequently, there are still a few cases where th

Re: Extracting attributes from compiled python code or parse trees

2007-07-23 Thread Gabriel Genellina
En Mon, 23 Jul 2007 18:13:05 -0300, Matteo <[EMAIL PROTECTED]> escribió: > I am trying to get Python to extract attributes in full dotted form > from compiled expression. For instance, if I have the following: > > param = compile('a.x + a.y','','single') > > then I would like to retrieve the list

Re: Reading data from an ISA port

2007-07-23 Thread Diez B. Roggisch
Gabriel Dragffy schrieb: > Dear list members > > I must admit I am a new user of Python, but it is a language that I > enjoy using. > > For one of my university projects I need to write a program that can > read several bytes from an ISA port. It has been suggested to me that I > look at using

Re: Confused with csv.reader copies

2007-07-23 Thread Gabriel Genellina
En Mon, 23 Jul 2007 15:45:42 -0300, Robert Dailey <[EMAIL PROTECTED]> escribió: > import csv > > def pass1( reader ): > print reader.next() > print reader.next() > > def pass2( reader ): > print reader.next() > print reader.next() > > reader = csv.reader( open( "C:/IT/Met

Extracting attributes from compiled python code or parse trees

2007-07-23 Thread Matteo
Hello- I am trying to get Python to extract attributes in full dotted form from compiled expression. For instance, if I have the following: param = compile('a.x + a.y','','single') then I would like to retrieve the list consisting of ['a.x','a.y']. I have tried using inspect to look at 'co_names'

Re: Where do they tech Python officialy ?

2007-07-23 Thread Mike C. Fletcher
NicolasG wrote: ... > I'm planning to save some money and attend a course in any of the > universities that teach hard core Python. > > Does some one have any suggestions on which University to attend ? > In Canada, the University of Toronto is planning to switch all first-year Comp-Sci courses

Re: Can a low-level programmer learn OOP?

2007-07-23 Thread Paul McGuire
On Jul 23, 12:43 pm, [EMAIL PROTECTED] (Eddie Corns) wrote: > Paul McGuire <[EMAIL PROTECTED]> writes: > >On Jul 23, 5:53 am, [EMAIL PROTECTED] (Eddie Corns) wrote: > >> Wolfgang Strobl <[EMAIL PROTECTED]> writes: > >> >few of James Gimple's snippets from "Algorithms in SNOBOL4" > >> >(->http://www

sys.ps1 with formatting (linux)

2007-07-23 Thread Jon Dobson
I'm trying to set sys.ps1 and sys.ps2 with some formatting (linux) using: python -i -c 'import sys; sys.ps1="\033[1m\033[32mspy>\033[0m";sys.ps2="\033[1m\033[32m .\033[0m"' I get the colored prompt(s) as you might expect, but I'm getting some strange behavior with wrapping. Once the interact

Re: The Modernization of Emacs: exists already

2007-07-23 Thread Martijn Lievaart
On Wed, 18 Jul 2007 06:17:00 -0700, Xah Lee wrote: > About a month ago, i posted a message about modernization of emacs. I > enlisted several items that i think emacs should adapt. And you are posting this to compl.lang.perl because.?? F'up set. M4 -- http://mail.python.org/mailman/lis

Re: URL parsing for the hard cases

2007-07-23 Thread Miles
On 7/23/07, Miles wrote: > On 7/22/07, John Nagle wrote: > > Is there any library function that correctly tests for an IP address vs. a > > domain name based on syntax, i.e. without looking it up in DNS? > > import re, string > > NETLOC_RE = re.compile(r'''^ #start of string > (?:([EMAIL PR

Re: inet_addr() in Python

2007-07-23 Thread brad
Steve Holden wrote: > brad wrote: >> Does Python have an equivalent to C's inet_addr()? >> > socket.inet_aton() produces a four-byte string you can pass as a struct > in_addr, if that's what you are looking for. If you want a number then > use the struct module to manipulate it further. > > >>>

Re: inet_addr() in Python

2007-07-23 Thread Steve Holden
brad wrote: > Does Python have an equivalent to C's inet_addr()? > socket.inet_aton() produces a four-byte string you can pass as a struct in_addr, if that's what you are looking for. If you want a number then use the struct module to manipulate it further. >>> s.inet_aton('127.0.0.1') '\x7f\x

Re: Where do they tech Python officialy ?

2007-07-23 Thread supercooper
http://home.earthlink.net/~python-training/ I highly recommend Mark Lutz. Took the class last fall in Estes Park and it was worth every penny. -- http://mail.python.org/mailman/listinfo/python-list

Re: shutil.copyfile problem for GIS data

2007-07-23 Thread supercooper
import shutil import os src = "c:\mydata\test\mygeo.mdb" dst = "v:\updated\data\mygeo.mdb" shutil.copyfile(src,dst) This should totally work, do it all the time, but no one can be connected to the database, ie have ArcMap or ArcCatalog open at the time of copy, or the .ldb lock will kill it. I d

code indentation

2007-07-23 Thread ...:::JA:::...
Hello, In my previously post I have been talk about running code with exec in.. So now I have problem with code indentation, as Gabriel Genellina says: >If you are using the tokenize module as suggested some time ago, try to >analyze the token sequence you get using { } (or perhaps begin/end

Re: Confused with csv.reader copies

2007-07-23 Thread Larry Bates
Robert Dailey wrote: > First, take a look at my example code: > - > import csv > > def pass1( reader ): > print reader.next() > print reader.next() > > def pass2( reader ): > print reader.next() > print reader.next() > >

Re: link between python and the windows command prompt

2007-07-23 Thread Larry Bates
yadin wrote: > hi! i need to know how i can run ussal commands that i ussally type at > the windows command prompt from a python file. that is for example > from the windows command prompt i ussually type "cd D:\folder\ nec2++ - > i inputfile.nec -o outputfile.out " now how can i execute this > c

Re: Maintaining leading zeros with the lstrip string function?

2007-07-23 Thread Carsten Haese
On Mon, 2007-07-23 at 11:41 -0700, Randy Kreuziger wrote: > I need just the file name from a string containing the path to a file. > The name of the file starts with zeros. This is problematic because > the lstrip function strips them leaving this as the result: > 6128.jpg > > > How do I stri

Re: Maintaining leading zeros with the lstrip string function?

2007-07-23 Thread Miles
On 7/23/07, Randy Kreuziger <[EMAIL PROTECTED]> wrote: > I need just the file name from a string containing the path to a file. The > name of the file starts with zeros. This is problematic because the lstrip > function strips them leaving this as the result: > 6128.jpg > > > How do I strip the

inet_addr() in Python

2007-07-23 Thread brad
Does Python have an equivalent to C's inet_addr()? Thanks, Brad -- http://mail.python.org/mailman/listinfo/python-list

Maintaining leading zeros with the lstrip string function?

2007-07-23 Thread Randy Kreuziger
I need just the file name from a string containing the path to a file. The name of the file starts with zeros. This is problematic because the lstrip function strips them leaving this as the result: 6128.jpg How do I strip the path without losing the leading zeros in the file name? ―

Re: class C: vs class C(object):

2007-07-23 Thread Klaas
On Jul 20, 5:47 am, Hrvoje Niksic <[EMAIL PROTECTED]> wrote: > "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > > In particular, old-style classes are noticeably faster than > > new-style classes for some things (I think it was attribute lookup > > that surprised me recently, possibly related to t

Confused with csv.reader copies

2007-07-23 Thread Robert Dailey
First, take a look at my example code: - import csv def pass1( reader ): print reader.next() print reader.next() def pass2( reader ): print reader.next() print reader.next() reader = csv.reader( open( "C:/IT/Meth

link between python and the windows command prompt

2007-07-23 Thread yadin
hi! i need to know how i can run ussal commands that i ussally type at the windows command prompt from a python file. that is for example from the windows command prompt i ussually type "cd D:\folder\ nec2++ - i inputfile.nec -o outputfile.out " now how can i execute this command that i ussually

Re: Where do they tech Python officialy ?

2007-07-23 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, NicolasG <[EMAIL PROTECTED]> wrote: >Hi, > >I want to be a professional python programmer, unfortunately I'm >working on technical support and don't have the time/patience to start >making projects my self. I tried to apply to some Python positions but >unfortunatel

Re: Where do they tech Python officialy ?

2007-07-23 Thread BartlebyScrivener
On Jul 23, 11:52 am, NicolasG <[EMAIL PROTECTED]> wrote: > > Does some one have any suggestions on which University to attend ? > Alternatives solutions are welcome.. You might like this thread. Or go to comp.lang.python and search for "python taught in schools" http://tinyurl.com/2zlsxl rd --

Re: decorators tutorials

2007-07-23 Thread Jason
On Jul 23, 11:25 am, Jason <[EMAIL PROTECTED]> wrote: > On Jul 23, 2:13 am, james_027 <[EMAIL PROTECTED]> wrote: > > > Hi, > > > I am learning python by learning django, and I stumble upon decorator > > which is very cool, any beginners resources for python decorators, > > although I can google it,

Re: Can a low-level programmer learn OOP?

2007-07-23 Thread Eddie Corns
Paul McGuire <[EMAIL PROTECTED]> writes: >On Jul 23, 5:53 am, [EMAIL PROTECTED] (Eddie Corns) wrote: >> Wolfgang Strobl <[EMAIL PROTECTED]> writes: >> >few of James Gimple's snippets from "Algorithms in SNOBOL4" >> >(->http://www.snobol4.org/) as an exercise using that library might help >> >to ge

Re: decorators tutorials

2007-07-23 Thread Steve Holden
james_027 wrote: > Hi, > >>> def check_login(func): >>> def _check_login(*args): >>> print "I am decorator" >>> return func(*args) >>> return _check_login >>> @check_login >>> def method2(input): >>> print "I am method TWO. Input %s" % input >> That looks okay. What is

Re: Pickled objects over the network

2007-07-23 Thread Steve Holden
Hendrik van Rooyen wrote: > "Steve Holden" <[EMAIL PROTECTED]> wrote: > >> Yes. > > Why? > It's difficult to establish, and then correctly implement, almost any security protocol without leaving cracks that attackers can lever open and use to inject code into your process's memory space. By a

Re: decorators tutorials

2007-07-23 Thread Jason
On Jul 23, 2:13 am, james_027 <[EMAIL PROTECTED]> wrote: > Hi, > > I am learning python by learning django, and I stumble upon decorator > which is very cool, any beginners resources for python decorators, > although I can google it, I just want to get a good tutorial for this > topic. > > Thanks >

Re: Catching a key press

2007-07-23 Thread Petr Jakes
On 23 ec, 14:23, westymatt <[EMAIL PROTECTED]> wrote: > linux primarily still a little lost in how to implementent this, > however I understand what you are saying. maybe you can use this: http://tinyurl.com/2zyfmw HTH Petr Jakes -- http://mail.python.org/mailman/listinfo/python-list

Re: Need Help with base64

2007-07-23 Thread Terry Reedy
"pycraze" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | Hi , | | I am currently trying to implement base64 encoding and decoding | scheme in C . Python has a module , base64 , that will do the | encoding and decoding with ease . I am aware of OpenSSL having support | for base64

Re: Where do they tech Python officialy ?

2007-07-23 Thread Danyelle Gragsone
My school does damn near all of the main ones.. BUT python .. lame.. On 7/23/07, NicolasG <[EMAIL PROTECTED]> wrote: > Hi, > > I want to be a professional python programmer, unfortunately I'm > working on technical support and don't have the time/patience to start > making projects my self. I tri

Where do they tech Python officialy ?

2007-07-23 Thread NicolasG
Hi, I want to be a professional python programmer, unfortunately I'm working on technical support and don't have the time/patience to start making projects my self. I tried to apply to some Python positions but unfortunately sometimes to work as a programmer is really hard in this world, every emp

Reading data from an ISA port

2007-07-23 Thread Gabriel Dragffy
Dear list members I must admit I am a new user of Python, but it is a language that I enjoy using. For one of my university projects I need to write a program that can read several bytes from an ISA port. It has been suggested to me that I look at using C or Pyinline. If I can I would prefe

Re: decorators tutorials

2007-07-23 Thread Bruno Desthuilliers
james_027 a écrit : > hi bruno, > > That seems to be hard to read at all, or I am just very new to python? or just new to higher order functions ? (ie: functions working on functions). > With that decorator how do I take advantage of it compare when I just > write a function that could do the s

Re: Can a low-level programmer learn OOP?

2007-07-23 Thread Paul McGuire
On Jul 23, 5:53 am, [EMAIL PROTECTED] (Eddie Corns) wrote: > Wolfgang Strobl <[EMAIL PROTECTED]> writes: > >few of James Gimple's snippets from "Algorithms in SNOBOL4" > >(->http://www.snobol4.org/) as an exercise using that library might help > >to get a better appreciation. Perhaps I'll try, even

Re: decorators tutorials

2007-07-23 Thread Diez B. Roggisch
james_027 wrote: > hi bruno, > > That seems to be hard to read at all, or I am just very new to python? > > With that decorator how do I take advantage of it compare when I just > write a function that could do the same as what the decorator did? I > could translate the could from above into ...

Re: Parsing XML with ElementTree (unicode problem?)

2007-07-23 Thread Richard Brodie
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > so what's the difference? how comes parsing is fine > in the first case but erroneous in the second case? You may have guessed the encoding wrong. It probably wasn't utf-8 to start with but iso8859-1 or similar. What actual byte valu

Parsing XML with ElementTree (unicode problem?)

2007-07-23 Thread oren . tsur
(this question was also posted in the devshed python forum: http://forums.devshed.com/python-programming-11/parsing-xml-with-elementtree-unicode-problem-461518.html ). - (it's a bit longish but I hope I give all the information) 1. here is my problem: I'm trying to par

Re: decorators tutorials

2007-07-23 Thread james_027
Hi, > > def check_login(func): > > def _check_login(*args): > > print "I am decorator" > > return func(*args) > > return _check_login > > > @check_login > > def method2(input): > > print "I am method TWO. Input %s" % input > > That looks okay. What is unclear? > It jus

Python-URL! - weekly Python news and links (Jul 23)

2007-07-23 Thread Gabriel Genellina
QOTW: "It's a good QOTW but social romantic nonsense nevertheless." - Kay Schluehr http://groups.google.com/group/comp.lang.python/browse_thread/thread/6348bfbb69642a4a/ "If it [the QOTW] were predictable, wouldn't it be boring?" - Peter Otten An analysis of random.shuffle beha

Re: decorators tutorials

2007-07-23 Thread Ben Finney
james_027 <[EMAIL PROTECTED]> writes: > Hi all, (Please don't top-post your reply. Instead, remove from the quoted material all the parts that are irrelevant to your reply, and post underneath what you're responding to, in normal chronological order like any other discussion.) > I am having diff

Re: Python MAPI

2007-07-23 Thread kyosohma
On Jul 22, 3:00 pm, [EMAIL PROTECTED] wrote: > > Well, I ran Process Monitor with some filters enabled to only watch > > Thunderbird and MS Word. Unfortunately, that didn't give me any of the > > registry edits, so I disabled my filters and ran it without. Now I > > have a log file with 28,000 entr

Re: ANN: Snobol 1.0

2007-07-23 Thread Aahz
In article <[EMAIL PROTECTED]>, greg wrote: >Aahz wrote: >> >> So adding SNOBOL patterns to another library would be a wonderful >> gift to the Python community... > >I wrote a module for Snobol-style pattern matching a while back, but >didn't get around to releasing it. I've just put it on my w

Re: Pure Python equivalent of unix "file" command?

2007-07-23 Thread c james
Take a look at http://www.demonseed.net/~jp/code/magic.py W3 wrote: > Hi all, > > Just a quick one... Is there such a thing? > > Thanks, > /Walter -- http://mail.python.org/mailman/listinfo/python-list

Re: Need Help with base64

2007-07-23 Thread Diez B. Roggisch
pycraze wrote: > Hi , > > I am currently trying to implement base64 encoding and decoding > scheme in C . Python has a module , base64 , that will do the > encoding and decoding with ease . I am aware of OpenSSL having support > for base64 encoding and decoding , but i will have to now impleme

Need Help with base64

2007-07-23 Thread pycraze
Hi , I am currently trying to implement base64 encoding and decoding scheme in C . Python has a module , base64 , that will do the encoding and decoding with ease . I am aware of OpenSSL having support for base64 encoding and decoding , but i will have to now implement both in C without using t

Re: Catching a key press

2007-07-23 Thread westymatt
linux primarily still a little lost in how to implementent this, however I understand what you are saying. -- http://mail.python.org/mailman/listinfo/python-list

Re: decorators tutorials

2007-07-23 Thread james_027
hi bruno, That seems to be hard to read at all, or I am just very new to python? With that decorator how do I take advantage of it compare when I just write a function that could do the same as what the decorator did? I could translate the could from above into ... def check_login(msg): #...

Re: Configure apache to run python scripts

2007-07-23 Thread joe jacob
On Jul 23, 4:42 pm, Bruno Desthuilliers wrote: > joe jacob a écrit : > > > I need to configure apache to run python scripts. I followed the steps > > mentioned in this site (http://www.thesitewizard.com/archive/ > > addcgitoapache.shtml). But I am not able to run python scripts from > > Firefox, I

Re: Configure apache to run python scripts

2007-07-23 Thread Bruno Desthuilliers
joe jacob a écrit : > I need to configure apache to run python scripts. I followed the steps > mentioned in this site (http://www.thesitewizard.com/archive/ > addcgitoapache.shtml). But I am not able to run python scripts from > Firefox, I got a forbidden error "you do not have permission to >

Returned mail: Data format error

2007-07-23 Thread Post Office
Virus Warning Message (from InterScanVirusWall mbox.infotel.bg) Found virus WORM_MYDOOM.GEN in file DOCUMENT.SCR (in document.zip) The uncleanable file is deleted. If you have questions, contact administrator. - The original message was

Re: Can a low-level programmer learn OOP?

2007-07-23 Thread Eddie Corns
Wolfgang Strobl <[EMAIL PROTECTED]> writes: >few of James Gimple's snippets from "Algorithms in SNOBOL4" >(->http://www.snobol4.org/) as an exercise using that library might help >to get a better appreciation. Perhaps I'll try, eventually ... I never noticed them or the PDF of the book there befor

Re: decorators tutorials

2007-07-23 Thread james_027
Hi all, I am having difficulty understanding decorator. The definition was clear for me, but the syntax is not so clear to me. will decorators will always have to be in this way def check_login(func): def _check_login(*args): print "I am decorator" return func(*args) retu

Re: Lazy "for line in f" ?

2007-07-23 Thread Duncan Booth
Duncan Booth <[EMAIL PROTECTED]> wrote: > or even: > >read = f.readline >while read(): >pass > Oops, I forgot the other obvious variant on this, which has the benefit of getting rid of the test I said was 'required' while still leaving the data accessible: for line in ite

Re: Lazy "for line in f" ?

2007-07-23 Thread Alexandre Ferrieux
On Jul 23, 12:18 pm, Duncan Booth <[EMAIL PROTECTED]> wrote: > > Whatever, the iterator makes the code both cleaner and faster. It is at > the expense of not being suitable for interactive sessions, or in some > cases pipes, but for those situations you can continue to use readline > and the extra

Re: decorators tutorials

2007-07-23 Thread Bruno Desthuilliers
james_027 a écrit : > Hi all, > > I am having difficulty understanding decorator. The definition was > clear for me, but the syntax is not so clear to me. > > will decorators will always have to be in this way > > def check_login(func): > def _check_login(*args): > print "I am decora

Re: Lazy "for line in f" ?

2007-07-23 Thread Duncan Booth
Alexandre Ferrieux <[EMAIL PROTECTED]> wrote: > On Jul 23, 10:33 am, Duncan Booth <[EMAIL PROTECTED]> > wrote: >> >> The extra buffering means that iterating over a file is about 3 times >> faster than repeatedly calling readline. >> >> while 1: >> line = f.readline() >> if not

Re: problem with exec

2007-07-23 Thread vedrandekovic
On 23 srp, 09:19, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Sun, 22 Jul 2007 10:36:59 -0300, <[EMAIL PROTECTED]> > escribió: > > >> Since the application is transforming > >> its input, it could transform braces into indentation. Of course > >> *Python* > >> doesn't use braces, but the qu

set_proxy in urllib2 is driving my crazy

2007-07-23 Thread est
A simple py script import urllib2 req=urllib2.Request("http://www.google.com";) req.set_proxy("127.0.0.1:1","http") print urllib2.urlopen(req).read() Here is error: "C:\Python25\python.exe" -u "E:\Python\Crawler\test.py" Traceback (most recent call last): File "E:\Python\Crawler\test.py"

Re: Catching a key press

2007-07-23 Thread thebjorn
On Jul 23, 9:05 am, westymatt <[EMAIL PROTECTED]> wrote: > This is without a gui toolkit. This is going to be implemented on > console i/o If you're on windows, you'll need the kbhit() and getch() functions in the msvcrt module. The up arrow returns two separate "keyboard- hits" (with ordinal val

Re: Lazy "for line in f" ?

2007-07-23 Thread Alexandre Ferrieux
On Jul 23, 10:33 am, Duncan Booth <[EMAIL PROTECTED]> wrote: > > The extra buffering means that iterating over a file is about 3 times > faster than repeatedly calling readline. > > while 1: > line = f.readline() > if not line: > break > > for line in f: >

Re: decorators tutorials

2007-07-23 Thread Roel Schroeven
james_027 schreef: > Hi, > > I am learning python by learning django, and I stumble upon decorator > which is very cool, any beginners resources for python decorators, > although I can google it, I just want to get a good tutorial for this > topic. I like the short explanation on Kent's Korner:

python-fam documentation.

2007-07-23 Thread Shriphani
Folks, I am trying to create an app which stares at a file and when the file is altered, the script joins a channel on freenode and reports that the file has been altered. I found a module called python-fam, unfortunately i have been unable to find documentation for it. Can someone please help me ?

Re: decorators tutorials

2007-07-23 Thread [EMAIL PROTECTED]
james_027 wrote: > Hi, > > I am learning python by learning django, and I stumble upon decorator > which is very cool, any beginners resources for python decorators, > although I can google it, I just want to get a good tutorial for this > topic. Decorators are just a more concise but less obvious

Re: decorators tutorials

2007-07-23 Thread Michele Simionato
On Jul 23, 10:13 am, james_027 <[EMAIL PROTECTED]> wrote: > Hi, > > I am learning python by learning django, and I stumble upon decorator > which is very cool, any beginners resources for python decorators, > although I can google it, I just want to get a good tutorial for this > topic. > > Thanks

Re: Lazy "for line in f" ?

2007-07-23 Thread Duncan Booth
Alexandre Ferrieux <[EMAIL PROTECTED]> wrote: > On Jul 23, 9:36 am, Paul Rubin wrote: >> Alexandre Ferrieux <[EMAIL PROTECTED]> writes: >> > So I'll reiterate the question: *why* does the Python library add that >> > extra layer of (hard-headed) buffering on top of stdi

Re: Lazy "for line in f" ?

2007-07-23 Thread Alexandre Ferrieux
On Jul 23, 9:36 am, Paul Rubin wrote: > Alexandre Ferrieux <[EMAIL PROTECTED]> writes: > > So I'll reiterate the question: *why* does the Python library add that > > extra layer of (hard-headed) buffering on top of stdio's ? > > readline? I know readline() doesn't have t

Re: decorators tutorials

2007-07-23 Thread Bruno Desthuilliers
james_027 a écrit : > Hi, > > I am learning python by learning django, and I stumble upon decorator > which is very cool, any beginners resources for python decorators, > although I can google it, I just want to get a good tutorial for this > topic. You should find answers on python.org, and sear

  1   2   >