Re: Python Love :)

2006-03-13 Thread rtilley
BWill wrote: > and ixnay on the ubyray or else I'll tell you where to stick your > endblock delimiter :P OK, I can't help it... which is more readable: a_string.reverse(ruby) a_string[::-1] (python) -- http://mail.python.org/mailman/listinfo/python-list

Jython

2006-03-11 Thread rtilley
Is development still going on with Jython? Version 2.1 came out in 2001 and it's still the most current stable release. Thanks! -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Evangelism

2006-03-09 Thread rtilley
Paul Boddie wrote: > I agree with you here, though. I want to be diplomatic here, but Cheese > Shop - a name for a package repository, for those who are lost already > - is really just a totally stupid name. Yes, I'm aware of the Monty > Python sketch, mediocre by the high standards of the Pythons'

Re: Python Evangelism

2006-03-09 Thread rtilley
Andrew Gwozdziewycz wrote: > What would changing the name of language you're > trying to market do for the marketing campaign? I forgot to address this part... I think it would create a lot of hype. What well-established programming language has ever had the nerve to change its name after more

Re: Python Evangelism

2006-03-09 Thread rtilley
Andrew Gwozdziewycz wrote: > On 3/9/06, rtilley <[EMAIL PROTECTED]> wrote: > > >>>Doug Bromley wrote: >>> >>>>I can see Ruby overtaking Python if we don't ALL do something about it. >> >>I think it's the name. Python. Let'

Re: Python Evangelism

2006-03-09 Thread rtilley
Dale Strickland-Clark wrote: > rtilley wrote: > > >>Psychology is important. Just as important as good design. I think this >>fact doesn't sink in to the Python community. > > > You speak of fluff and ribbons and glitter. Yes, I know. Great products, ideas

Re: Python Evangelism

2006-03-09 Thread rtilley
Steve Holden wrote: > Doug Bromley wrote: >> I can see Ruby overtaking Python if we don't ALL do something about it. I think it's the name. Python. Let's change it to something nicer. Think about it... if you found a Ruby, you'd pick it up and put it in your pocket. If you ran across a Python, y

Re: Learning different languages

2006-03-07 Thread rtilley
Rich wrote: > Anyway, my question is: what experience you people have with working > with different languages at the same time? IMO, it's a good idea. Currently, I'm using Python and Ruby. I'll write something in one and then try it in the other. I know Python better than Ruby, so it's a learni

Re: Send email notification

2006-03-07 Thread rtilley
Ernesto wrote: > Is there a special module for mail ? > > I'd like to send an email [to 'n' unique email addresses] from a python > script. from email.MIMEText import MIMEText import email.Utils import smtplib # 'users' is a list of email addys. for u in users: try

Re: white space in expressions and argument lists

2006-03-02 Thread rtilley
John Salerno wrote: > All of it was a joke? You'd have to ask Guido that :) I took it literally when I first read it b/c it made sense to me and I did not notice the date. I don't think it will ever be _required_ of all Python hackers, but I may be wrong. -- http://mail.python.org/mailman/list

Re: white space in expressions and argument lists

2006-03-02 Thread rtilley
Fredrik Lundh wrote: > in his april 1st, 2005 paper ? > > http://www.artima.com/weblogs/viewpost.jsp?thread=101968 That was an April's Fools joke, right? I like it though :) Maybe it'll happen! -- http://mail.python.org/mailman/listinfo/python-list

Re: white space in expressions and argument lists

2006-03-02 Thread rtilley
John Salerno wrote: > A minor concern, but I'm curious if there is any kind of best practice > for using whitespace within expressions and argument lists in the Python > world. For example: > > 1 + 2 or 1+2 IMO, good style calls for spaces. Most companies have style guides for programmers t

Re: why? [win32com/WMI]

2006-03-01 Thread rtilley
Tim Golden wrote: > [Sergey] > > | import win32com.client > | > | loc = win32com.client.Dispatch("WbemScripting.SWbemLocator") > | svc = loc.ConnectServer("srv", "root/cimv2", "[EMAIL PROTECTED]", "**") > | sys = svc.get("Win32_Process") > | sys.create("notepad.exe") > | > | => > | > | Trac

Re: spaces at ends of filenames or directory names on Win32

2006-02-28 Thread rtilley
[EMAIL PROTECTED] wrote: > It works for me. Right. I've found that it's not just the end spaces. The Macs somehow copy these files and folders to the PCs without a security descriptor of any type! When I goto the folder's properties, I see three tabs: 1. General 2. Web Sharing 3. Customize The

Re: spaces at ends of filenames or directory names on Win32

2006-02-27 Thread rtilley
Roel Schroeven wrote: > rtilley schreef: > >> This will at least allow me to ID folders that start with >> whitespace... from within Windows too :) yet I still cannot rename the >> folders after stripping the whitespace... attempting to gives an >> [Errno 2]

Re: spaces at ends of filenames or directory names on Win32

2006-02-27 Thread rtilley
This will at least allow me to ID folders that start with whitespace... from within Windows too :) yet I still cannot rename the folders after stripping the whitespace... attempting to gives an [Errno 2] No such file or directory. The strip seems to work right too according to the prints before

Re: different ways to strip strings

2006-02-27 Thread rtilley
Kent Johnson wrote: > So... > s.strip() gets a bound method object from the class and calls it with no > additional argument. > str.strip(s) gets an unbound method object from the class and calls it, > passing a class instance as the first argument. > > Kent Thank you Kent. That's a very inform

different ways to strip strings

2006-02-27 Thread rtilley
s = ' qazwsx ' # How are these different? print s.strip() print str.strip(s) Do string objects all have the attribute strip()? If so, why is str.strip() needed? Really, I'm just curious... there's a lot don't fully understand :) -- http://mail.python.org/mailman/listinfo/python-list

Re: spaces at ends of filenames or directory names on Win32

2006-02-27 Thread rtilley
[EMAIL PROTECTED] wrote: > Please post your Python code. I don't see the problem you're > describing. OK, here's a copy. This works on Mac/Unix/Linux yet has no effect on Windows: - import os import os.path for root, dirs, files

Re: spaces at ends of filenames or directory names on Win32

2006-02-27 Thread rtilley
[EMAIL PROTECTED] wrote: > Please post your Python code. I don't see the problem you're > describing. OK, here's a copy. This works on Mac/Unix/Linux yet has no effect on Windows: - import os import os.path for root, dirs, files

Re: spaces at ends of filenames or directory names on Win32

2006-02-23 Thread rtilley
Larry Bates wrote: > How about not naming files with leading and trailing spaces on > the Mac? Seems like a bad habit that needs breaking ;-). > > -Larry Bates Users will be users! Tell that to the guys and gals on Macs who like to make a folder sort based on the number of spaces they've placed

Re: urllib2 auth error

2006-02-20 Thread rtilley
rtilley wrote: > I have the right username and password. I may be using the above code > wrong. Any tips? I had the _wrong_ password... Sorry. -- http://mail.python.org/mailman/listinfo/python-list

urllib2 auth error

2006-02-20 Thread rtilley
I get this error: HTTP Error 401: Authorization Required When I do this: try: handler = urllib2.HTTPBasicAuthHandler() handler.add_password('realm', 'website', 'user', 'pass') opener = urllib2.build_opener(handler) urllib2.install_opener(opener) f = urllib2.urlopen('http

Re: %SystemDrive%

2006-02-15 Thread rtilley
Atanas Banov wrote: > using >os.chdir('/') >os.getcwd() > is plain wrong in Windows. > > what it does is change the current directory to root of the CURRENT > DRIVE (i.e. the drive of the directory where script was started from), > not the system drive. for example, if current directory wa

Re: %SystemDrive%

2006-02-15 Thread rtilley
Carsten Haese wrote: > Is there a reason why os.environ['SYSTEMDRIVE'] shouldn't work? > > Hope this helps I didn't know it was in os! It returns C: instead of C:\ like my method. Other than that, it seems to do the trick. Thank you! Brad -- http://mail.python.org/mailman/listinfo/python-lis

%SystemDrive%

2006-02-15 Thread rtilley
Is there a proper way to get this variable from Windows? I know it's in the registry, but I'd rather not go there. I could not find a CSIDL shell constant for it either. I've been doing this: os.chdir('/') sys_drive = os.getcwd() print sys_drive C:\ This seems too much of a hack and maybe not 1

Re: windows security descriptors

2006-02-15 Thread rtilley
The link changed... sorry. http://opensource.w2k.vt.edu/Win32_Perms.php -- http://mail.python.org/mailman/listinfo/python-list

Re: How to cat None

2006-02-14 Thread rtilley
LittlePython wrote: I am not too sure I know what None really means. It means null, void or lack of value. It is not an empty string. You can't add None to stings. >>> r = None >>> print r None >>> print type(r) -- http://mail.python.org/mailman/listinfo/python-list

windows security descriptors

2006-02-14 Thread rtilley
Hope this isn't too inappropriate: Thanks to tips from comp.lang.python and the Python win32 mailing list, I've been able to begin using Python to work with Windows security descriptors with some small success. http://opensource.w2k.vt.edu/brad_scripts.php I've just started, not a whole lot th

Re: readlines and break apart based on letters

2006-02-13 Thread rtilley
I got this to work... just FYI: s = 'O:owner_sidG:group_sidD:dacl_flags(string_ace1)(string_ace2)...(string_acen)S:sacl_flags(string_ace1)(string_ace2)...(string_acen)' SD = {} S = str.split(s, 'S:') SD['S_ACL'] = S[1] D = str.split(S[0], 'D:') SD['D_ACL'] = D[1] G = str.split(D[0], 'G:') SD['G

Re: invert the order of a string

2006-02-13 Thread rtilley
Dave Hansen wrote: > It's just simple slicing. Well, maybe not so simple, or at least not > so common, but with a syntax similar to the range function. Consider > the following (string chosen to make it obvious what's going on): > > s = "0123456789" > s[::] > s[3::] > s[:3:] > s[::3] > s[::-2] >

Re: invert the order of a string

2006-02-13 Thread rtilley
Dave Hansen wrote: > How about > > s = "some random string" > print s > s = s[::-1] > print s That looks like Perl, but it works. Makes me wonder with the string module doesn't have a reverse or invert function? -- http://mail.python.org/mailman/listinfo/python-list

invert the order of a string

2006-02-13 Thread rtilley
s = list('some_random_string') print s s.reverse() print s s = ''.join(s) print s Surely there's a better way to do this, right? -- http://mail.python.org/mailman/listinfo/python-list

readlines and break apart based on letters

2006-02-13 Thread rtilley
Hi, While trying to better understand security descriptors on Windows. I've been examining text-based security descriptors. I have the security descriptors on individual lines stored in a text file. I want to break these lines apart based on owner, group, dacl and sacl. These areas are demarca

Re: Is python very slow compared to C

2006-02-11 Thread rtilley
[EMAIL PROTECTED] wrote: > I have just started to learn python. Some said that its slow. Can > somebody pin point the issue. It depends on what you are doing. Much of Python is just wrapped C. So many things are very fast. -- http://mail.python.org/mailman/listinfo/python-list

Re: python 2.5 and hashlib

2006-02-11 Thread rtilley
Alex Martelli wrote: > http://python.org/peps/pep-0356.html -- but it's still a draft, being > discussed in the last few days on python-dev. Thank you, that's exactly what I was looking for! -- http://mail.python.org/mailman/listinfo/python-list

python 2.5 and hashlib

2006-02-11 Thread rtilley
Is there a road map for python a 2.5 releases yet? I'd like to begin testing the new hashlib module with some old scripts I have that currently use the md5 and sha modules. Thanks, Brad -- http://mail.python.org/mailman/listinfo/python-list

Re: problems opening IDLE

2006-02-09 Thread rtilley
Bennie Tilma wrote: > I'm having trouble with opening the IDLE and running programs. Every > time I try to open it, it says: > 1. Socket error: Connection refused > 2. IDLE's subprocess didn't make connection. Either IDLE can't start a > subprocess or personal firewall software is blocking the co

spell check code

2006-02-08 Thread rtilley
What is the most common way to spell check comments in code? Are there any idle plugins or modules that do this? Thanks! -- http://mail.python.org/mailman/listinfo/python-list

Re: os.walk() dirs and files

2006-02-08 Thread rtilley
George Sakkis wrote: > Or a bit more efficiently (no need to allocate a new list for storing > files+dirs): > > from itertools import chain > for root, dirs, files in os.walk(path): > for fs_object in chain(files,dirs): > ADD fs_object to dictionary I like that! itertools is

Re: os.walk() dirs and files

2006-02-08 Thread rtilley
rtilley wrote: > Hello, > > When working with file and dir info recursively on Windows XP. I'm going > about it like this: > > for root, dirs, files in os.walk(path): > for f in files: > ADD F to dictionary > for d in dirs: > ADD D to d

Re: os.walk() dirs and files

2006-02-08 Thread rtilley
Duncan Booth wrote: > How about just concatentating the two lists: > >>for root, dirs, files in os.walk(path): >for fs_object in files + dirs: >> ADD fs_object to dictionary Thank you Duncan! that solves the problem perfectly! -- http://mail.python.org/mailman/listinfo/python-li

os.walk() dirs and files

2006-02-08 Thread rtilley
Hello, When working with file and dir info recursively on Windows XP. I'm going about it like this: for root, dirs, files in os.walk(path): for f in files: ADD F to dictionary for d in dirs: ADD D to dictionary Is it possible to do something such as this: for root,

_winreg doc unclear on DeleteValue()

2005-11-15 Thread rtilley
A portion from the _winreg Documnetation: - DeleteValue(key, value) 1. Removes a named value from a registry key. --> OK 2. key is an already open key, or one of the predefined HKEY_* constants. --> OK 3. value is a str

Re: IE Temporary Internet Files & Python

2005-11-10 Thread rtilley
Tim Golden wrote: > [rtilley] > > >>Below is a script that recursively deletes files from a directory. It >>works well on the two directories that I'm currently using it on: > > >>C:\Documents and Settings\user\Cookies >>C:\Documents and Settings\u

Re: IE Temporary Internet Files & Python

2005-11-10 Thread rtilley
Laszlo Zsolt Nagy wrote: > >> The script does not seem to work when used on Temporary Internet Files. >> > Doesn't work well? What does it mean? Is there an exception raised? > > Les > No exception. The files are not deleted. -- http://mail.python.org/mailman/listinfo/python-list

IE Temporary Internet Files & Python

2005-11-10 Thread rtilley
A bit off-topic, but Python related. Below is a script that recursively deletes files from a directory. It works well on the two directories that I'm currently using it on: C:\Documents and Settings\user\Cookies C:\Documents and Settings\user\Temp However, I'd like to use it on this directory a

socket.setdefaulttimeout()

2005-10-08 Thread rtilley
Perhaps this is a dumb question... but here goes. Should a socket client and a socket server each have different values for socket.setdefaulttimeout() what happens? Does the one with the shortest timeout period end first? -- http://mail.python.org/mailman/listinfo/python-list