Re: Jewish Pirates of the Caribbean

2010-06-18 Thread Mick

George Neuner DESERVES his FREEDOM OF SPEECH.

Freedom of speech dousn't guarantee an audience 
--
http://mail.python.org/mailman/listinfo/python-list


Re: RELEASED Python 2.4.2 (final)

2005-09-29 Thread Trent Mick
[Bugs wrote]
> I downloaded the 2.4.2 Windows Binary Installer from python.org but when 
> I try to run python.exe I get the following in the console:
> 
> ActivePython 2.4.1 Build 247 (ActiveState Corp.) based on
> Python 2.4.1 (#65, Jun 20 2005, 17:01:55) [MSC v.1310 32 bit (Intel)] on 
> win32
> Type "help", "copyright", "credits" or "license" for more information.
>  >>>
> 
> It says ActivePython 2.4.1 but I downloaded the 2.4.2 binary installer 
> from python.org and the python.exe executable I'm running is timestamped 
> 9/28/2005 12:41PM...  Any ideas what I'm doing wrong?

It is possible that the python.org installer didn't overwrite the
"python24.dll" in the system directory (C:\WINDOWS\system32). Try doing
this:

- manually delete C:\WINDOWS\system32\python24.dll
- run the "repair" functionality of the python.org installer (you can
  either do this from  "Start | Settings | Control Panel | Add/Remove
  Programs" or by just running the .msi file again

Then try running python again.

Trent


-- 
Trent Mick
[EMAIL PROTECTED]
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: RELEASED Python 2.4.2 (final)

2005-09-30 Thread Trent Mick
[Peter Hansen wrote]
> Couldn't it also happen if the first time someone did an "admin" install 
> which (I believe) puts the DLLs in the system folder, and the next time 
> did just a non-admin install which doesn't do that?  (Or am I 
> misunderstanding the conditions under which c:\windows\system32 has 
> files written to it?)

I suppose that is possible.  Martin, does python-2.4.2.msi install
python24.dll to the Python install dir for a "per-user" installation?

Note: I started this bug to track this and try to repro:
http://bugs.activestate.com/ActivePython/show_bug.cgi?id=41083

Trent

-- 
Trent Mick
[EMAIL PROTECTED]
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: RELEASED Python 2.4.2 (final)

2005-09-30 Thread Trent Mick
[Fuzzyman wrote]
> I had problems updating from activestate 2.4 to activestate 2.4.1
> 
> I think it was caused by not uninstalling the original. This does mean
> that even a *minor* version upgrade is a PITA. To do it cleanly all
> extension modules have to be uninstalled and re-installed.
> 
> *sigh*

As Steve said, uninstalling ActivePython 2.4 will leave your extensions
alone and then installing ActivePython 2.4.1 will install in the same
proper places so that all your extensions should just work.

Trent

-- 
Trent Mick
[EMAIL PROTECTED]
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How to prevent logging warning?

2005-10-05 Thread Trent Mick
[Thomas Heller wrote]
> I'm about to add some logging calls to a library I have.  How can I
> prevent that the script that uses the library prints
> 'No handlers could be found for logger "comtypes.client"' when the
> script runs?
> 
> I would like to setup the logging so that there is no logging when
> nothing is configured, and no warning messages are printed.

This is probably a gross hack, but then I think one could argue that the
one-time "No handlers could be found for" warning is a misfeature -- at
least without a clean way to suppress it. I don't know the history of
that warning though:


-- mylib.py ---
import logging
log = logging.getLogger("mylib")
def func():
log.warn("don't go near the river")
log.error("I'm drowning!")
--


-- myscript.py ---
import sys
import logging
import mylib

if __name__ == "__main__":
if "-v" in sys.argv:
logging.basicConfig()
else:
logging.Logger.manager.emittedNoHandlerWarning = True
mylib.func()
--


$ python myscript.py

$ python myscript.py -v
WARNING:mylib:don't go near the river
ERROR:mylib:I'm drowning!


hackily yours,
Trent

-- 
Trent Mick
[EMAIL PROTECTED]
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: installer for amd64 build of python?

2005-10-13 Thread Trent Mick
[Brett Hoerner wrote]
> As an aside to this, are there any freely available C compilers for
> Windows that can compile 64-bit binaries?  I find nothing for Cygwin or
> MinGW...

Yes. The MS Platform SDK is free and includes a compiler that can target
x86, ia64 and x64 (the latter is what MS -- and Sun -- are calling
AMD64).

Trent

-- 
Trent Mick
[EMAIL PROTECTED]
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: installer for amd64 build of python?

2005-10-13 Thread Trent Mick
[Brett Hoerner wrote]
> Thanks, looking at their site I can't find a Platform SDK for XP... am
> I looking for the Windows 2003 Server SDK...?  Seems counter-intuitive

Yes, I believe that is the one I am using. MS seems to aim for minimal
intuitive-factor with Platform SDK version naming.

Trent

-- 
Trent Mick
[EMAIL PROTECTED]
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Yes, this is a python question, and a serious one at that (moving to Win XP)

2005-10-13 Thread Trent Mick
[John J. Lee wrote]
> 4. There's a registry key for tab completion somewhere...

Search for "CompletionChar" and change it to 9.

http://www.microsoft.com/resources/documentation/Windows/2000/server/reskit/en-us/Default.asp?url=/resources/documentation/Windows/2000/server/reskit/en-us/regentry/34995.asp


Cheers,
Trent

-- 
Trent Mick
[EMAIL PROTECTED]
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Moving to Win XP as a Python developer

2005-10-14 Thread Trent Mick
[Thomas Heller wrote]
> I have an elisp function bound to a key in XEmacs that starts cmd in the
> directory where the current buffer is.  IMO this is very convenient.  To
> access explorer from that command prompt (in the rare cases that I need
> it) I use 'start .'.

I kind of have the same thing with Dave's Quick Search Deskbar
(http://www.dqsd.net/) and my little "go" script
(http://trentm.com/projects/go/). The keystrokes to open a cmd.exe shell
in my "src" folder is down to:

# to focus in the Quick Search Deskbar textbox
go src

or to open Explorer in that dir:

go -o src 

or in another "tagged" dir:

go ~   # open in my home dir

DQSD is a fantastic tool for speeding up launching other things, too:
mainly Google searches.

Cheers,
Trent

-- 
Trent Mick
[EMAIL PROTECTED]
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Eclipse best/good or bad IDE for Python?

2005-12-05 Thread Trent Mick
[John J. Lee wrote]
> I now find it difficult to mis-type variable names in Emacs, since I
> have F4 bound to dabbrev-expand.  I also do standard things like using
> query-replace when renaming.  Actually, something like dabbrev-expand
> is perhaps the one thing I would find indispensible switching to any
> other editor -- I wonder if Eclipse/PyDev has it?

Komodo has that too -- we call it "word completion".

Trent

-- 
Trent Mick
[EMAIL PROTECTED]
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: extract python install info from registry

2005-12-06 Thread Trent Mick
[Laszlo Zsolt Nagy wrote]
> rbt wrote:
> 
> >On windows xp, is there an easy way to extract the information that 
> >Python added to the registry as it was installed?
> >  
> >
> Using regedit.exe, look at the registry keys and values under
> 
> HKEY_LOCAL_MACHINE\Software\Python
> 
> If you need to know how to read the registry from Python: please install 
> the python win32 extensions (or use ActivePython).

Actually you don't need the PyWin32 extensions to read the Windows
registry since the _winreg module was added to the Python core.

Trent

-- 
Trent Mick
[EMAIL PROTECTED]
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: windows installer problems

2005-12-06 Thread Trent Mick
[EMAIL PROTECTED] wrote]
> Hi,
> I'm trying to install Python on Windows 2000 Server using remote
> desktop. I log as a user that is in administrators group. Instalator
> starts, I select default installation directory, on the next screen
> with parts to install I click just next. Than blicks screen with
> progress bar but it is immediately replaced with screen informing that
> installation failed. But there's no information why or what is wrong.
> On remote connection I use 16 colors - can it be the problem?

You can turn on logging when installing an MSI:

http://aspn.activestate.com/ASPN/docs/ActivePython/2.4/installnotes.html#install_logging

The same instructions will work for the python.org MSI as well.

Trent

-- 
Trent Mick
[EMAIL PROTECTED]
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Eclipse best/good or bad IDE for Python?

2005-12-06 Thread Trent Mick
[Paul Boddie wrote]
> Shouldn't you have something nice to say about Komodo instead, however?
> ;-)

Yah, I was just reminding Aaron of his fine-print legal requirements to
evermore only be able to extol the virtues of Komodo. Muuuwahahaha! :)

Trent

-- 
Trent Mick
[EMAIL PROTECTED]
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: can't find socket.ssl() on win32

2005-12-07 Thread Trent Mick
> > i'm running this under ActiveState version 2.2.2, but i have also tried 
> > under ActiveState version 2.3 anyone have any ideas?

[Richard Brodie wrote]
> ActiveState don't ship crypto stuff because they don't want to jump
> through the legal hoops. You can add it in or use a regular build. 

Slight modification there: ...because we are currently jumping through
the legal hoops...

But, yes, you are correct that ActivePython does not currently include
the _ssl extension because of crypto export restriction legal rules.
We've had a breakthrough here though (yeah!) and I'm hopeful that in the
not too distant future I'll be able to include SSL in ActivePython (and
other products I work on here at ActiveState).

Trent

-- 
Trent Mick
[EMAIL PROTECTED]
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Documentation suggestions

2005-12-08 Thread Trent Mick
[Mike Meyer wrote]
> "BartlebyScrivener" <[EMAIL PROTECTED]> writes:
> > Too bad there
> > isn't something like what Ruby does with the "Try Ruby In Your Browser"
> > thing, which is a very effective marketing tool (although obviously I
> > chose Python).
> >
> > http://tryruby.hobix.com/
> 
> I've seen things like this for other language as well. Doing it in
> for Python isn't all that hard.
> 
> The question is how do you keep the system that the Python code is
> actually running on safe? Ruby may have a real bastion mode, but
> Python doesn't.

Nah, the Try Ruby thing is mostly faking it (I believe) rather than
running an actually Ruby interactive session ("bastion'ed" or not).

Trent

-- 
Trent Mick
[EMAIL PROTECTED]
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Documentation suggestions

2005-12-09 Thread Trent Mick
[EMAIL PROTECTED] wrote]
> 
> Trent> Nah, the Try Ruby thing is mostly faking it (I believe) rather
> Trent> than running an actually Ruby interactive session ("bastion'ed"
> Trent> or not).
> 
> I don't think so.  I tried typing some stuff at the prompt that it wasn't
> asking for, like "x = [1,2,3]" followed by "x * 5" when it was asking me to
> type "2 + 6".  It evaluated both properly as far as I could tell.  

Yah. My guess at what he is doing (and the way I'd probably do this for
Python) is to compile each statement, only allow certain constructs
(like assigning to a variable, defining literals, basic operator usage,
maybe some control flow statements -- although I didn't get that far)
and then execute those.

> OTOH, it
> hung when I entered "def fib(n)".  Never got to the next prompt.  

Punted on continued/multi-line statements maybe?

> Looking at
> the Javascript, it appears to be some sort of Ajaxian thing...

Yup.


Trent

-- 
Trent Mick
[EMAIL PROTECTED]
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Hash of class from instance

2005-02-02 Thread Mick Krippendorf
Joakim Storck wrote:
> [...] the hash values of classes will be used as
> keys in a dictionary that serve as an object pool. [...]

That does seem unwise (as Teal'c would have uttered). The spec says:


  hash( object)

Return the hash value of the object (if it has one). Hash values are
integers. They are used to quickly compare dictionary keys during a
dictionary lookup. Numeric values that compare equal have the same hash
value (even if they are of different types, as is the case for 1 and
1.0).


Normally the following should hold (not mentioned in the above spec but
true for Java, e.g.): if a and b are objects such that a equals b then
hash(a) equals hash(b). This does not imply that if hash(a) equals
hash(b) also a equals b. More formally: (a == b) -> (hash(a) ==
hash(b)).

In Python there seems to be no guarantee that different objects also
have different hash values. So let's assume we have class objects Foo
and Bar, which by some unlikely incident happen to have the same hash
values, then storing them in a dictonary under their respective hash
values (which are identical) would most probably lead into a problem,
secifically the problem that you'd end up accessing Foo when you indeed
think you are accessing Bar, or vice versa. Just try this:

 >>> my_pseudo_hash_code = 1
 >>> my_dict = {my_pseudo_hash_code:"gnarf",
my_pseudo_hash_code:"snarf"}
 >>> print my_dict

Mick.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: returning True, False or None

2005-02-04 Thread Mick Krippendorf
Steven Bethard wrote:
> I have lists containing values that are all either True, False or
> None, e.g.:
> 
>  [True,  None,  None,  False]
>  [None,  False, False, None ]
>  [False, True,  True,  True ]
>  etc.
> 
> For a given list:
> * If all values are None, the function should return None.
> * If at least one value is True, the function should return True.
> * Otherwise, the function should return False.

Try:

 >>> max(lst)

Mick.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: returning True, False or None

2005-02-04 Thread Mick Krippendorf
Fredrik Lundh wrote:
> Steven Bethard wrote:
>> Raymond Hettinger wrote:
>>> 
>>> return max(lst)
>> 
>> Very clever!  Thanks!
> 
> too clever.  boolean > None isn't guaranteed by the language
> specification: 
> 
> http://docs.python.org/ref/comparisons.html
> 
> "... objects of different types always compare unequal, and are
> ordered consistently but arbitrarily. /.../ In the future, the
> comparison rules for objects of different types are likely to
> change. ..." 

Then maybe like this:

 >>> def max_of_two_with_None_less_than_any_other_object(e1, e2):
 ... if e1 == None:
 ... return e2
 ... elif e2 == None:
 ... return e1
 ... else:
 ... return max(e1, e2)

 >>> reduce(max_of_two_with_None_less_than_any_other_object, lst)

Mick.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: returning True, False or None

2005-02-04 Thread Mick Krippendorf
Daniel Bickett wrote:
> 
> >>> def boolhunt( items ):
> ... falseExists = False
> ... for item in items:
> ... if item is True:
> ... return True
> ... elif item is False and not falseExists:
> ... falseExists = True
> ... if falseExists:
> ... return False



Or even shorter:

 >>> def boolhunt(items):
 ...result = None
 ...for item in items:
 ...if item:
 ...return True
 ...elif result is None and item is False:
 ...result = False
 ...return result 


Or like the Melmacians would do it:

 >>> def boolgen(items):
 ... result = None
 ... for item in items:
 ... if result:
 ... raise StopIteration
 ... elif item is not None:
 ... result = item
 ... yield result

 >>> [item for item in boolgen(a_list)][-1]


Mick.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: returning True, False or None

2005-02-04 Thread Mick Krippendorf
Fahri Basegmez wrote:
> reduce(lambda x, y: x or y, lst)

This doesn't solve the OPs problem since

 >>> reduce(lambda x, y: x or y, [False, None])

returns None instead of False.

Mick.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: PEP 304 - is anyone really interested?

2005-06-22 Thread Trent Mick
[Skip Montanaro wrote]
> 
> I wrote PEP 304, "Controlling Generation of Bytecode Files":
> 
> http://www.python.org/peps/pep-0304.html
> 
> ...
> So speak up folks, otherwise my recommendation is that it be put out of its
> misery.

I've had use for it before, but have managed to work around the
problems. I think it is a good feature, but I wouldn't have the time to
shepherd the patch.

Trent

-- 
Trent Mick
[EMAIL PROTECTED]
-- 
http://mail.python.org/mailman/listinfo/python-list


ANN: ActivePython 2.4.1 for Solaris 10 on SPARC, x86 and x64 systems

2005-06-28 Thread Trent Mick

I'm happy to announce that ActivePython 2.4.1 for Solaris 10 on SPARC,
x86 and x64 systems is now available for free download from:

 http://www.ActiveState.com/Products/ActivePython/

This release adds support for Solaris running on x86 and x64 systems.

Note: This release (build 247) also includes important updates for the
recently released ActivePython for Mac OS X. Please see the release
notes for details.


http://aspn.activestate.com/ASPN/docs/ActivePython/2.4/relnotes.html#release_history


What is ActivePython?
-

ActivePython is ActiveState's quality-assured binary distribution of
Python.  Builds for Linux, Mac OS X, Solaris and Windows are made freely
available.

ActivePython includes the Python core and core extensions (zlib 1.2.1,
bzip2 1.0.2, bsddb 4.2.52, Tk 8.4.9, and Tix 8.1.4) and is fully
compatible with other Python distributions of the same version.

ActivePython also includes a wealth of Python documentation, including:
- the core Python docs;
- Andrew Kuchling's "What's New in Python" series;
- the Non-Programmer's Tutorial for Python;
- Mark Pilgrim's excellent "Dive into Python"; and
- a snapshot of the Python FAQs, HOWTOs and PEPs.

An online version of the docs can be found here:
http://aspn.activestate.com/ASPN/docs/ActivePython/2.4/welcome.html

Thanks, and enjoy!

Trent, Python Tech Lead

-- 
Trent Mick
[EMAIL PROTECTED]
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How to find Windows "Application data" directory??

2005-06-28 Thread Trent Mick
[Paul Rubin wrote]
> I'm writing a Windows program that needs to store some user files.
> 
> The logical place to store them is in "Application Data", right?
> 
> Is there a good way to find the correct location of that directory,
> preferably without any C extensions?  It's ok if the directory is
> found at installation time rather than runtime, and bdist_wininst does
> have a way to find it from a post-installation script.  The trouble is
> that the post-installation script doesn't seem to have an obvious way
> to communicate the info to the application for later use!
> 
> Any suggestions?

The canonical way is using the Window API SHGetFolderPath function with
the CSIDL_APPDATA key:

from win32com.shell import shellcon, shell
print shell.SHGetFolderPath(0, shellcon.CSIDL_APPDATA, 0, 0)

This requires the PyWin32 extensions (which you already have if you have
ActivePython installed).

Alternatively you could write your own little C extension to call this
Window API function... but you didn't want to do that. You can also call
this WIndows API function (in the shell32.dll) with the Python "ctypes"
modules out there.


Trent

-- 
Trent Mick
[EMAIL PROTECTED]
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How to find Windows "Application data" directory??

2005-06-29 Thread Trent Mick
[Paul Rubin wrote]
> "Rune Strand" <[EMAIL PROTECTED]> writes:
> > You have the environment variable APPDATA. You can access it with
> > os.environ().
> 
> Thanks!!  Wow, I'd been hacking away at much messier approaches
> than that.  It's actually os.environ['APPDATA'] ;-)

Note that the APPDATA environment variable is only there on *some* of
the Windows flavours. It is there on Win2k and WinXP. It is not there on
WinME. Dunno about Win95, Win98, WinNT... but you may not care about
those old guys.

Cheers,
Trent

-- 
Trent Mick
[EMAIL PROTECTED]
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: qustion about build Python on the Solaris 9

2005-07-08 Thread Trent Mick
[Hu, Bizhong wrote]
> My question is that is
> anyone know if python can
> Be build as 64 bits application on SPARC ???

I don't know of any reason why not. I haven't built for *64-bit* SPARC
yet but Python builds fine 32-bit on SPARC and build fine 64-bit on a
number of other platforms (linux-x86_64, linux-ia64, win64-ia64,
win64-x64, 64-bit AIX).


Trent

-- 
Trent Mick
[EMAIL PROTECTED]
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: problem with ActiveState install

2005-07-26 Thread Trent Mick
[Steve wrote]
> I've installed the ActiveState binary distribution for Solaris in my
> home directory, but I'm having problems with Tk.
> 
> I think I did everything right -- I used gtar rather than Solaris tar,
> and the install process indicated it was successful.  I added the
> python directory to ~/.bashrc.
> 
> Python works fine from the command line.
> 
> But if I try to execute anything that uses Tkinter (including Idle),
> the console window goes blank and then nothing else happens.  I have to
> use control+z to break out.
> 
> Does anyone have any idea what the problem might be, and how to fix it?

What version did you install? I.e. what was the package name. Or do
this:

$ python
>>> import activestate, pprint
>>> pprint.pprint(activestate.version_info)

What version of Solaris do you have? Run:

uname -a

Do you get an error doing the following minimal Tkinter test:

    >>> import Tkinter
>>> Tkinter.Tk()


Cheers,
Trent

-- 
Trent Mick
[EMAIL PROTECTED]
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: creating/modifying sparse files on linux

2005-08-17 Thread Trent Mick
[EMAIL PROTECTED] wrote]
> 
> Hi,
> 
> Is there any special support for sparse file handling in python? My
> initial search didn't bring up much (not a thorough search). I wrote
> the following pice of code:
> 
> options.size = 6442450944
> options.ranges = ["4096,1024","3,314572800"]
> fd = open("testfile", "w")
> fd.seek(options.size-1)
> fd.write("a")
> for drange in options.ranges:
> off = int(drange.split(",")[0])
> len = int(drange.split(",")[1])
> print "off =", off, " len =", len
> fd.seek(off)
> for x in range(len):
> fd.write("a")
> 
> fd.close()
> 
> This piece of code takes very long time and in fact I had to kill it as
> the linux system started doing lot of swapping. Am I doing something
> wrong here? Is there a better way to create/modify sparse files?

test_largefile.py in the Python test suite does this kind of thing and
doesn't take very long for me to run on Linux (SuSE 9.0 box).

Trent

-- 
Trent Mick
[EMAIL PROTECTED]
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Unix diff command under Window.

2005-08-25 Thread Trent Mick
[Neil Hodgson wrote]
> Thomas Heller:
> 
> > Yes.  There's a script in your Python distribution:
> > Tools/scripts/diff.py
> > 
> > See also the docs for the 'difflib' standard library module.
> 
> Is the opposite code, a Python equivalent to 'patch' available? I 
> have endless trouble receiving patch files that assume one of Windows or 
> Unix (in terms of path names and line end characters) which then fail to 
> apply on the other platform. I would like to have a version I could hack on.

So would I! I also have problems with the available patch.exe binaries
hanging or crashing occassionally on Windows.

Trent

-- 
Trent Mick
[EMAIL PROTECTED]
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Command Line arguments

2005-08-25 Thread Trent Mick
[michael wrote]
> SOLVED! Thank you.
> 
> I wonder why this was needed for 2.4 and not 2.2? I don't think it was
> lingering things from old installs because it happened on a persons
> computer that had never had any python installed before 2.4.

It might be due to a bug in the Python 2.4 installer not setting the
proper file associations. What installer package did you use?

Trent

-- 
Trent Mick
[EMAIL PROTECTED]
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: minimalist regular expression

2005-08-25 Thread Trent Mick
[EMAIL PROTECTED] wrote]
> Exists some tool, programs or some able to compute the minimal regular
> expression, namely ,taking a series of regular exoression, the minimal
> one that makes the same matching?

def get_minimal_regex(*regexes):
return ".*"

:)  Or, slightly less smart-ass-y:

def get_not_really_minimal_regex(*regexes):
return "(" + "|".join(regexes) + ")"

Trent

-- 
Trent Mick
[EMAIL PROTECTED]
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Command Line arguments

2005-08-26 Thread Trent Mick
[michael wrote]
> >> I wonder why this was needed for 2.4 and not 2.2? I don't think it was
> >> lingering things from old installs because it happened on a persons
> >> computer that had never had any python installed before 2.4.
> > 

[Trent]
> > It might be due to a bug in the Python 2.4 installer not setting the
> > proper file associations. What installer package did you use?
> 
> I used the python2.4.MSI from python.org site (dated 3-6-05). I think this
> was the first time they went to MSI verses an exe based installer.
> 
> it says Python 2.4 (#60 November 30th, 2004) when I start it.

I think Martin has been doing MSIs for a little bit longer than that,
but I'm not sure.

Martin, is it possible that there is a bug in setting up the
.py/Python.File association in the python2.4.msi? Here is the start of
this thread:

http://mail.python.org/pipermail/python-list/2005-August/296007.html

What association (if any) does your Python MSI setup?

Cheers,
Trent

-- 
Trent Mick
[EMAIL PROTECTED]
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python2Html regex question

2005-08-30 Thread Trent Mick
[Gerard Flanagan wrote]
> I've been using the Html Formatter at
> http://www.manoli.net/csharpformat to format c# code (paste your code
> into the box, click the button and get html/css).  Is there anything
> similar for Python code, does anyone know?

Checkout SilverCity:
http://silvercity.sourceforge.net/

As a CGI script:
http://www.sweetapp.com/cgi-bin/cgi-styler-form.py

Cheers,
Trent

-- 
Trent Mick
[EMAIL PROTECTED]
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Problem building Python on HP-UX

2005-09-02 Thread Trent Mick
[Dr. Who wrote]
> I'm trying to build Python 2.4.1 on HP-UX 11.00 with full tcl/tk IDLE
> support.  So far, I haven't had any luck.  I always wind up getting
> errors of the form:
> 
> ld: DP relative code in file
> /ptg/devtools/hppa1.1/pre/lib/libtk8.4.a(tkWindow.o) - shared library
> must be position independent.  Use +z or +Z to recompile.
> 
> I have tried building tcl/tk without any configure options as well as
> with --disable-shared and --disable-load but this doesn't help.
> 
> Anyone seen anything like this or know how to get around it?

For Python on HP-UX I build Tcl/Tk with --enable-shared. I don't *think*
I had to do much else special -- other than tweaking Python's setup.py
detect_tkinter() code to find where I had built and "installed" my
Tcl/Tk libs.

Cheers,
Trent

p.s. Note that we now have free ActivePython binary installers for
 HP-UX at ActiveState.
 http://www.activestate.com/Products/ActivePython/

-- 
Trent Mick
[EMAIL PROTECTED]
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: ANN: PyInstaller 1.0 in the works: package your Python app into a single-file executable

2005-09-06 Thread Trent Mick
[Giovanni Bajo wrote]
> Hello,
> 
> http://pyinstaller.hpcf.upr.edu/
> 
> PyInstaller is a program that packages Python programs into stand-alone
> executables, under both Windows and Linux. This is similar to the famous
> py2exe, but PyInstaller is also able to build fully-contained (single file)
> executables, while py2exe can only build directories containing an executable
> with multiple dynamic libraries.

I notice that the release notes for py2exe 0.6.1 mention that it finally
*can* make a single file executable. I'm not involved in developing it
nor am I that experienced with it. Just an FYI.

http://starship.python.net/crew/theller/py2exe/

Trent

-- 
Trent Mick
[EMAIL PROTECTED]
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: improvements for the logging package

2005-09-06 Thread Trent Mick
[Rotem wrote]
> while working on something in my current project I have made several
> improvements to the logging package in Python, two of them are worth
> mentioning:
> 1. addition of a logging record field %(function)s, which results in
> the name
> of the entity which logged the record. My version even deduces the
> class name in the case which the logger is a bound method, and assuming
> the name of the "self" variable is indeed "self".
> 
> This ability can be turned off, for performance reasons, and is useful
> for debugging phases.
> 
> 2. log coloring formatter (useful for console output) - support for log
> lines like BLUE<>, etc.
> 
> Now, I asked several friends of mine who program in Python often, and
> they told me they could use these features very much.
> 
> I'm taking a risk here, that maybe someone already proposed this in
> this group, but I'll ask either way:
> Has anyone thought of posting a PEP about this? Do you think I should?

Cool. Your additions sound useful.
This might be a bit small for a PEP (though I am hardly an authority).
You could post your patch on a new bug on SourceForge.

http://sourceforge.net/tracker/?group_id=5470

> I have made a great use of the logging package, and would certainly
> like to see it evolve and include more features.

Something to consider that would help to get the logging package more
used would be to write up your experiences with it: write a tutorial or
HOWTO or improvements of the core logging docs. Currently the logging
package looks fairly uninviting/untractable to new users.

Cheers
Trent

-- 
Trent Mick
[EMAIL PROTECTED]
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: ANN: PyInstaller 1.0 in the works: package your Python app into asingle-file executable

2005-09-06 Thread Trent Mick
[Giovanni Bajo wrote]
> Trent Mick wrote:
> 
> > I notice that the release notes for py2exe 0.6.1 mention that it
> > finally *can* make a single file executable. I'm not involved in
> > developing it
> > nor am I that experienced with it. Just an FYI.
> 
> Yes, I noticed it. You'll have noticed also that the announcement happened
> after my mail was already posted. I'll update PyInstaller's website ASAP to 
> fix
> the now incorrect information in there.

Yah. I read about the py2exe release on python-announce first and then
your announcement on python-list and then the py2exe announcement on
python-list.  Sorry for jumping the gun.

Trent

-- 
Trent Mick
[EMAIL PROTECTED]
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: improvements for the logging package

2005-09-07 Thread Trent Mick
[EMAIL PROTECTED] wrote]
> Perhaps so, but the logging module seems like such an unpythonic beast to
> me.  How about cleaning it up (*) before we add more to it?

Yes. I was also trying to encourage Rotem to get involved in other parts
of the logging module/package later on in my email. :)

> Stuff like colorizing seems like it belongs in its own module
> (presuming a reasonably general markup scheme can be agreed upon) so
> it can be used outside the logging package.

Yah, you are probably right. Most additions to the logging system could
easily live as their own separate pieces.

> (*) Stuff that seems very odd to me:
> 
> - It's a package, but contrary to any other package I've ever seen, most
>   of its functionality is implemented in __init__.py.  __init__.py is
>   roughly four times larger than the next largest (bsddb, which is a
>   beast because BerkDB has gotten so big over the years and the
>   module/package has strived to remain backwards-compatible).

I'm not defending the implementation, but does this cause any particular
problems?


>   The obvious 'hello world' example
> 
> import logging
> logging.info('hello world')
> 
>   ought to just work (implicitly add a stream handler connected to
>   stderr to the root logger).

Maybe. Unless that causes troubles for real use. Having lazy
configuration like this means that it can be a subtle thing for
top-level application code to setup the proper logging configuration.

I cringe a little bit when I see this presented as the "hello world"
example. My basic hello world tends to be:

import logging
log = logging.getLogger("name-of-my-module-or-script")

# use log.{debug|info|warn|error}() in module/script...
#...

if __name__ == "__main__":
logging.basicConfig()
#...

and then I wish again that the default output were a bit nicer for my
most common usage -- which is logging to the command line in scripts --
rather than looking more like to web server error/access logs.

I think the usability of the logging module could be much improved with
a nicer introduction to it (i.e. docs). It's not really a "hello world"
type of tool. Its usefulness only really shows in larger use cases.


> - Its functionality is partitioned in sometimes odd ways.  For example,
>   it has a handlers module, but what I presume would be the most
>   commonly used handler (StreamHandler) is not defined there.  It's in
>   (you have three guesses and the first two don't count) __init__.py
>   instead of in logging.handlers.  Consequently, browsing in the obvious
>   way fails to find the StreamHandler class.
>
> - It doesn't use PEP 8 style as far as naming is concerned, instead
>   doing some sort of Java or C++ or Perl camelCase thing.  Eschewing PEP
>   8 is fine for other stuff, but code in the Python core (especially new
>   code like the logging module) should strive to adhere to PEP 8, since
>   many people will use the core code as a pattern for their own code.

Perhaps Vijay (who did all the implementation) can comment on these.
Unfortunately backwards-compat might restrict some cleanups to the
package, but perhaps not too much. I did a poor job of keeping up with
the package after I laid out an initial design, er copied an initial
design from Java's log4j package (and I'm not even a Java guy). :(

Trent

-- 
Trent Mick
[EMAIL PROTECTED]
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: improvements for the logging package

2005-09-07 Thread Trent Mick
[EMAIL PROTECTED] wrote]
> 
> >> - It's a package, but contrary to any other package I've ever seen,
> >>   most of its functionality is implemented in __init__.py.
> 
> Trent> I'm not defending the implementation, but does this cause any
> Trent> particular problems?
> 
> No, it just seems symptomatic of some potential organizational problems.

Fair enough. I'm all for having consistent and well structure code in
the stdlib.


> >> import logging
> >> logging.info('hello world')
> >> 
> >> ought to just work (implicitly add a stream handler connected to
> >> stderr to the root logger).
> 
> Trent> Maybe. Unless that causes troubles for real use. 
> 
> Maybe there's a bug then (or maybe the docs still need work).  When I
> executed (all of these examples were typed at an interactive prompt):
> 
> import logging
> logging.info('hello world')
> 
> I get no output.  Looking at the doc for the basicConfig() function, I see:
> 
> The functions debug(), info(), warning(), error() and critical() will
> call basicConfig() automatically if no handlers are defined for the root
> logger.
> 

Unfortunately your getting caught by the default logging level being
WARN, so that any log level below that is tossed.

import logging
logging.basicConfig()
logging.error("help!")
logging.warn("stay away from the river")
logging.info("nice sunset, eh?")

Running that generates:

ERROR:root:help!
WARNING:root:stay away from the river

> Trent> Having lazy configuration like this means that it can be a subtle
> Trent> thing for top-level application code to setup the proper logging
> Trent> configuration.
> 
> Again, based on my reading of the basicConfig doc, it seems like the logging
> package is supposed to already do that.

Sort of. I guess all it implies is that if application code wants
to do special log handler setup then it needs to make sure to work in
the case of basicConfig() having been called and not.

The configuration stuff is quite subtle. The docs need to give
good best practices for a could coverage of reasonable use cases.
Nothing catastrophic will happen with a weird logging configuration --
probably just more log messages that you'd want.


> It was probably the log4j roots that provided the non-PEP 8 naming.

Definitely.

> I suspect the naming could be improved while providing backward
> compatibility aliases and deprecating those names.

Do you mean naming like "makeLogRecord" etc? I thought PEP 8 said
camelCase (or whatever it is called) was okay?


Trent

-- 
Trent Mick
[EMAIL PROTECTED]
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: improvements for the logging package

2005-09-08 Thread Trent Mick
[EMAIL PROTECTED] wrote]
> Trent> I thought PEP 8 said camelCase (or whatever it is called) was
> Trent> okay?
> 
> Hmmm...  In the section entitled "Naming Conventions" I see:
> 
> Function Names
> 
>   Function names should be lowercase, possibly with words separated by
>   underscores to improve readability.  mixedCase is allowed only in
>   contexts where that's already the prevailing style (e.g. threading.py),
>   to retain backwards compatibility.
> 
> Method Names and Instance Variables
> 
>   The story is largely the same as with functions: in general, use
>   lowercase with words separated by underscores as necessary to improve
>   readability.

I swear that has changed since I last read that. :)
...checking... Guess I haven't read it in about 2 years. This patch:

Sat Mar 20 06:42:29 2004 UTC (17 months, 2 weeks ago) by kbk 

Patch 919256
Clarify and standardize the format for names of modules,
functions, methods, and instance variables.

Consistent, I hope, with discussion on python-dev

http://mail.python.org/pipermail/python-dev/2004-March/043257.html

http://mail.python.org/pipermail/python-dev/2004-March/043259.html

Made this change:


http://cvs.sourceforge.net/viewcvs.py/python/python/nondist/peps/pep-0008.txt?r1=1.20&r2=1.21

 Function Names
 
-  Plain functions exported by a module can either use the CapWords
-  style or lowercase (or lower_case_with_underscores).  There is
-  no strong preference, but it seems that the CapWords style is
-  used for functions that provide major functionality
-  (e.g. nstools.WorldOpen()), while lowercase is used more for
-  "utility" functions (e.g. pathhack.kos_root()).
+  Function names should be lowercase, possibly with underscores to
+  improve readability.  mixedCase is allowed only in contexts where
+  that's already the prevailing style (e.g. threading.py), to retain
+  backwards compatibility.



> Since the logging package currently uses mixedCase it would appear it
> shouldn't revert to lower_case.  I'm thinking it should have probably used
> lower_case from the start though.  I see no real reason to have maintained
> compatibility with log4j.  Similarly, I think PyUnit (aka unittest) should
> probably have used lower_case method/function names.  After all, someone
> went to the trouble of PEP-8-ing the module name when PyUnit got sucked into
> the core.  Why not the internals as well?

Perhaps because of the timing.


> If I remember
> correctly, it was more-or-less written for inclusion in the core.

Yah. It was added before Guido more clearly stated that he thought
modules should have a successful life outside the core before being
accepted in the stdlib.

Trent

-- 
Trent Mick
[EMAIL PROTECTED]
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How to upgrade to 2.4.1 on Mac OS X tiger

2005-09-09 Thread Trent Mick
[Mike Meyer wrote]
> stri ker <[EMAIL PROTECTED]> writes:
> > Has anyone here upgraded from 2.3 to 2.4 on Tiger?
> > If so how'd ya do it?
> 
> You don't. You install 2.4 in parallel with 2.3. You can do pretty
> much whatever you want with /usr/bin/python, /usr/local/bin/python,
> etc. - Tiger doesn't seem to use those. I don't remember if I replaced
> one or not, but don't touch anything else about the 2.3 installtion.
> 
> I installed the darwinports version of 2.4, and have been using it
> ever since for all my stuff.

There are also the following install options:

- ActivePython:
  http://www.activestate.com/Products/ActivePython/
  (disclaimer: I make this distro)

- MacPython:
  http://undefined.org/python/#python
  by Bob Ippolito

- fink (similar in spirit to the darwinports project) also has a Python
  I believe


Trent

-- 
Trent Mick
[EMAIL PROTECTED]
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: improvements for the logging package

2005-09-14 Thread Trent Mick
[EMAIL PROTECTED] wrote]
> >> It does, in the "in-development" version of the documentation. Sorry it
> >> was not in the 2.4 releases :-(
> 
> Thomas> Maybe it can be backported to 2.4.2 - is there still time for 
> that?
> 
> Changed now in CVS.  When 2.4.2 is released it should be there.

Is this the same kind of thing as the (generally ill-regarded) change in
Python 2.2.x (for some x != 0) that added:
True, False = 0, 1
I may have the details wrong.

Now there is a feature in 2.4.x that wasn't in 2.4.(x-1), which could
cause surprises. I.e. I write code that uses the new thing, test it with
my 2.4.2 install, think that is works with 2.4.* and say so when I
distribute it. 

Maybe that is okay.  Just asking here because I don't keep up with
Python changes -- or sentiment on how to handle this kind of thing --
well enough.

Trent

-- 
Trent Mick
[EMAIL PROTECTED]
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: improvements for the logging package

2005-09-15 Thread Trent Mick
[EMAIL PROTECTED] wrote]
> 
> >> Changed now in CVS.  When 2.4.2 is released it should be there.
> 
> Trent> Is this the same kind of thing as the (generally ill-regarded)
> Trent> change in Python 2.2.x (for some x != 0) that added:
> 
> No, I just backported the documentation bit that marked the keyword
> parameter change to basicConfig() as happening in 2.4.  I didn't change any
> code.

Duh. Sorry.

Trent

-- 
Trent Mick
[EMAIL PROTECTED]
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: ddd or eclipse with mod_python

2005-09-15 Thread Trent Mick
[Sakcee wrote]
> Hi
> 
> I am using mod_python for web development, I am in need of some ide ,
> can i use ddd or eclipse with pydev with mod_python.
> 
> can these ide's handle requests from mod_python and run server side
> scripts 

You should be able to debug with Komodo(*):

Using the Python Remote Debugger

http://aspn.activestate.com/ASPN/docs/Komodo/3.1/komodo-doc-debugpython.html#Using_the_Python_Remote_Debugger

You can get a trial here:
www.activestate.com/Komodo/Trial

Cheers,
Trent

(*) Disclaimer: I work on Komodo.


-- 
Trent Mick
[EMAIL PROTECTED]
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Finding where to store application data portably

2005-09-21 Thread Trent Mick
> > > I'm using pygame to write a game called Bombz which needs to save some
> > > data in a directory associated with it. In Unix/Linux I'd probably use
> > > "~/.bombz", in Windows something like
> > > "C:\Documents And Settings\\Applicacation Data\Bombz".
> > 
> > In Windows, you shouldn't hard-code the drive letter. I don't know how you
> > find out what the correct value is, but hard-coding it is just Bad.
> > 
>   XP Pro seems to take
> 
> >>> print os.environ["APPDATA"]
> C:\Documents and Settings\Dennis Lee Bieber\Application Data
> 
>   Though the more consistent might be to hit the registry:
> 
> HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell
> Folders\AppData
> 
> and to confuse matters, there is also a "Local AppData" entry

It isn't just the drive letter you shouldn't hardcode. In different
locales the phrases "Documents and Settings" and "Application Data"
are often different. The canonical way to get this dir on Windows is by
using the SHGetFolderPath Windows API call with the CSIDL_APPDATA
constant:


http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/reference/functions/shgetfolderpath.asp

In Python code that is:

from win32com.shell import shellcon, shell
path = shell.SHGetFolderPath(0, shellcon.CSIDL_APPDATA, 0, 0)

Unfortunately that either means having the PyWin32 extensions installed
(which not all Python installations on Windows have) or building your
own small binary extension to make that call. Failing that, using the
registry location or the environment variable above might suffice
Note that on some older Windows flavours -- not sure exactly which --
the APPDATA env. var. might not be defined.

Also note that Windows app guidelines encourage you to have an
additional vendor/owner directory level before the app name. So:

%APPDATA%\\Bombz

I have a little working script that I use for this kind of stuff which
you are welcome too, if it helps. (attached)

Trent

-- 
Trent Mick
[EMAIL PROTECTED]
# Copyright (c) 2005 ActiveState Corp.
# License: MIT
# Author:  Trent Mick ([EMAIL PROTECTED])

"""Cross-platform application utilities:

Utility Functions:
user_data_dir(...)  path to user-specific app data dir
site_data_dir(...)  path to all users shared app data dir
"""
#TODO:
# - Add cross-platform versions of other abstracted dir locations, like
#   a cache dir, prefs dir, something like bundle/Contents/SharedSupport
#   on OS X, etc.
#   
http://developer.apple.com/documentation/MacOSX/Conceptual/BPRuntimeConfig/Concepts/UserPreferences.html
#   
http://developer.apple.com/documentation/MacOSX/Conceptual/BPFileSystem/index.html
#   
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/reference/enums/csidl.asp
#

import sys
import os


class Error(Exception):
pass



def user_data_dir(appname, owner=None, version=None):
"""Return full path to the user-specific data dir for this application.

"appname" is the name of application.
"owner" (only required and used on Windows) is the name of the
owner or distributing body for this application. Typically
it is the owning company name.
"version" is an optional version path element to append to the
path. You might want to use this if you want multiple versions
of your app to be able to run independently. If used, this
would typically be ".".

Typical user data directories are:
Windows:C:\Documents and Settings\USER\Application 
Data\\
Mac OS X:   ~/Library/Application Support/
Unix:   ~/.
"""
if sys.platform.startswith("win"):
# Try to make this a unicode path because SHGetFolderPath does
# not return unicode strings when there is unicode data in the
# path.
if owner is None:
raise Error("must specify 'owner' on Windows")
from win32com.shell import shellcon, shell
path = shell.SHGetFolderPath(0, shellcon.CSIDL_APPDATA, 0, 0)
try:
path = unicode(path)
except UnicodeError:
pass
path = os.path.join(path, owner, appname)
elif sys.platform == 'darwin':
from Carbon import Folder, Folders
path = Folder.FSFindFolder(Folders.kUserDomain,
   Folders.kApplicationSupportFolderType,
   Folders.kDontCreateFolder)
path = os.path.join(path.FSRefMakePath(), appname)
else:
path = os.path.expanduser("~/." + a

ANN: ActivePython 2.3.5.236 and ActivePython 2.4.0.244 are available

2005-02-10 Thread Trent Mick
I'm pleased to announce that ActivePython 2.3.5 build 236 and
ActivePython 2.4.0 build 244 are now available from:
http://www.ActiveState.com/Products/ActivePython
ActivePython 2.3.5.236 is a bug-fix release matching core Python 2.3.5.
ActivePython 2.4.0.244 is a bug-fix release matching core Python 2.4.0.
Both of these releases contain an important security fix for
SimpleXMLRPCServer as detailed here:
http://www.activestate.com/Products/ActivePython/advisory.plex
http://www.python.org/security/PSF-2005-001/
Builds for Linux, Solaris and Windows are available.
We would welcome any and all feedback to:
[EMAIL PROTECTED]
Please file bugs against ActivePython at:
http://bugs.ActiveState.com/ActivePython
What is ActivePython?
-
ActivePython is ActiveState's quality-assured binary build of Python.
Builds for Windows, Linux and Solaris and made freely available.
ActivePython includes the Python core and core extensions (zlib 1.2.1,
bzip2 1.0.2, bsddb 4.2.52, Tk 8.4.4, and Tix 8.1.4). On Windows,
ActivePython includes the PyWin32 suite of Windows tools developed by
Mark Hammond, including bindings to the Win32 API and Windows COM, the
Pythonwin IDE, and more.
ActivePython also includes a wealth of Python documentation, including:
- the core Python docs
- Andrew Kuchling's "What's New in Python" series
- the Non-Programmer's Tutorial for Python
- Mark Pilgrim's excellent "Dive into Python", and
- a snapshot of the Python FAQs, HOWTOs and PEPs.
An online version of the docs can be found here:
http://aspn.activestate.com/ASPN/docs/ActivePython/2.3/welcome.html
http://aspn.activestate.com/ASPN/docs/ActivePython/2.4/welcome.html
In particular the Release Notes:
http://aspn.activestate.com/ASPN/docs/ActivePython/2.3/relnotes.html
http://aspn.activestate.com/ASPN/docs/ActivePython/2.4/relnotes.html
and the Installation Guide:
http://aspn.activestate.com/ASPN/docs/ActivePython/2.3/installnotes.html
http://aspn.activestate.com/ASPN/docs/ActivePython/2.4/installnotes.html
Extra Bits
--
This release of ActivePython also includes the following packages:
- a Windows "debug" package: debug-built binaries for ActivePython
  users building debug versions of their binary Python extensions
- ActivePython23.chm & ActivePython24.chm: an MS compiled help
  collection of the full ActivePython documentation set. Linux
  users of applications such as xCHM might find this useful.
These packages are available from:
ftp://ftp.activestate.com/ActivePython/etc/
On behalf of the team at ActiveState,
Thanks, and enjoy!
--
Trent Mick
[EMAIL PROTECTED]


--
http://mail.python.org/mailman/listinfo/python-list


Re: ActivePython 2.3.5.236 and ActivePython 2.4.0.244 are available

2005-02-11 Thread Trent Mick
 
ActivePython-2.4.0-243-win32-ix86/INSTALLDIR/Lib/site-packages/win32comext/taskscheduler:
 taskscheduler_d.pdb
Only in 
ActivePython-2.4.0-243-win32-ix86/INSTALLDIR/Lib/site-packages/win32comext/taskscheduler:
 taskscheduler_d.pyd
Only in ActivePython-2.4.0-243-win32-ix86/INSTALLDIR: pythoncom24_d.dll
Only in ActivePython-2.4.0-243-win32-ix86/INSTALLDIR: pywintypes24_d.dll
Only in ActivePython-2.4.0-243-win32-ix86/SystemFolder: pythoncom24_d.pdb
Only in ActivePython-2.4.0-243-win32-ix86/SystemFolder: pywintypes24_d.pdb

Cheers,
Trent
--
Trent Mick
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list


Re: Help Installing Python 2.3.5

2005-03-11 Thread Trent Mick
[Peter Hansen wrote]
> Python has never (as far as I know) set up the PATH during
> installation.

I think that's true of the python.org installer. ActivePython will add
the install directory to your PATH.

Trent

-- 
Trent Mick
[EMAIL PROTECTED]
-- 
http://mail.python.org/mailman/listinfo/python-list


ANN: ActivePython 2.4.0 build 243 is available

2004-11-30 Thread Trent Mick
ActivePython 2.4.0 (final) is now available from:
http://www.ActiveState.com/Products/ActivePython
This is a release candidate matching the recently tagged core Python
2.4.0. Builds for Linux, Solaris and Windows are available.
We would welcome any and all feedback to:
[EMAIL PROTECTED]
Please file bugs against ActivePython at:
http://bugs.ActiveState.com/ActivePython
What is ActivePython?
-
ActivePython is ActiveState's quality-assured binary build of Python.
Builds for Windows, Linux and Solaris and made freely available.
ActivePython includes the Python core and core extensions (zlib 1.2.1,
bzip2 1.0.2, bsddb 4.2.52, Tk 8.4.4, and Tix 8.1.4). On Windows,
ActivePython includes the PyWin32 suite of Windows tools developed by
Mark Hammond, including bindings to the Win32 API and Windows COM, the
Pythonwin IDE; and more.
ActivePython also includes a wealth of Python documentation, including:
- the core Python docs;
- Andrew Kuchling's "What's New in Python" series;
- the Non-Programmer's Tutorial for Python;
- Mark Pilgrim's excellent "Dive into Python"; and
- a snapshot of the Python FAQs, HOWTOs and PEPs.
An online version of the docs can be found here:
http://aspn.activestate.com/ASPN/docs/ActivePython/2.4/welcome.html
Extra Bits
--
This release of ActivePython also includes the following packages:
- a "doc" package: the full ActivePython documentation set viewable
  with any browser
- a "debug" package: debug-built binaries for ActivePython users
  building debug versions of their binary Python extensions
- ActivePython24.chm: an MS compiled help collection of the full
  ActivePython documentation set. Linux users of applications such
  as xCHM might find this useful.
These packages are available from:
ftp://ftp.activestate.com/ActivePython/etc/
Thanks, and enjoy!
Trent (and the hard-working elves at ActiveState)
--
Trent Mick
[EMAIL PROTECTED]

--
http://mail.python.org/mailman/listinfo/python-list


Re: Python Win32 Silent Install

2004-12-01 Thread Trent Mick
Matt Gerrans wrote:
Maybe there is a better way to do an unattended install of the Win32 
extensions (that is, perhaps without using the binary)?
You could use the ActivePython MSI package, which includes the PyWin32 
extensions and offers a silent install option:

http://aspn.activestate.com/ASPN/docs/ActivePython/2.4/installnotes.html#install_silent
Cheers,
Trent
--
Trent Mick
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list


Re: pythonwin broke

2004-12-03 Thread Trent Mick
Jean Brouwers wrote:
PPS) It looks like Python 2.4 and Python 2.3 can not co-exist (in
different folders under Program Files) but we did not investigate that
any further.
That's not true. I have every version of Python back to 2.0 installed 
and all running fine on my system. Obviously you can only have one of 
your Python installations first on your PATH (and hence the one that 
gets run by simply typing "python"). Also, you can only have one of you 
Python installations registered as the default handler for .py files 
(and hence the one that gets run by simple double-clicking on a .py file 
in explorer or running a Python script without the extension from the 
command line).

It is also possible that there is some little installer bug or detail on 
 your environment that is causing the problem. You could try 
ActivePython. I regularly install and uninstall ActivePython 2.3 and 2.4 
installers and both installs are still working fine.

Cheers,
Trent
--
Trent Mick
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list


Re: Python Cookbook, 2'nd. Edition is published

2005-03-28 Thread Trent Mick
> > I don't have my copy yet. Can you give any guidance on how the 2'nd
> > edition compares to the 1'st edition?

Here is an excerpt from the preface (typing errors are mine):

If you already own the first edition, you may be wondering whether
you need this second edition, too. We think the answer is "yes." The
first edition had 245 recipes; we kep 146 of those (with lots of
editing in almost all cases), and added 192 new ones, for a total of
338 recipes in this second e4dition. So, over half of the recipes in
this edition are complete,ly new, and all the recipes are updated
to apply to today's Python -- releases 2.3 and 2.4. Indeed, this
update is the main factor which lets us have almost 100 more recipes
in a book of about the same size. The first edition covered all
versions from 1.5.2 (one sometimes earlier) to 2.2; this one focuses
fimly on 2.3 and 2.4. Thianks to the greater port of today's Python,
and, even more4, thanks to the fact that this edition avoids the
"historical" treatises about how you had to do things in Python
versions releases 5 or more years ago, we were able to provide
substantially more currently relevant recipes and information in
roughtly the same amount of space.

Trent

-- 
Trent Mick
[EMAIL PROTECTED]
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: checksum works in unix but not win32 os

2005-03-29 Thread Trent Mick
[GujuBoy wrote]
> i have the following code...which works fine in UNIX but then i move it
> over to WINDOWS XP and check the sum on the same file that i tested on
> unix and i get different results.
> 
> def checksum(fileobj):
> filedata = array.array('B', fileobj.read())
> totbytes = len(filedata)
> result = 0
> def rotate_right(c):
> if c&1: return (c>>1)|0x8000
> else: return c>>1
> for ch in filedata:
> result = (rotate_right(result)+ch) & 0x
> return result
> 
> Unix File = 8683
> Win32 = 23662
> 
> Please let me know why its acting different in WIN32, also it only does
> this on SOME files...out of 50 i tested only 5 it failed on.

By "failed" you mean the checksum is different? The file itself (if it
is a text file) might very well have different content: EOL characters
are different on Windows (CRLF) and Unix (LF). If a text file is opened
in textmode (the default), then the CRLF's will get translated to LF's,
however, if opened in binary mode (by having a 'b' in the mode option to
open()/file()) then this translation is not done.

Also, any reason you are not just using the hexdigest() method in the
md5 module?

Cheers,
Trent

-- 
Trent Mick
[EMAIL PROTECTED]
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: checking if program is installing using python

2005-03-30 Thread Trent Mick
[EMAIL PROTECTED] wrote]
> does this help?
> http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52224

There is the "which" module that I wrote that does this a little more
robustly:
http://starship.python.net/~tmick/#which

However, I didn't see the original posting for this thread so I'm not
sure if this is what is being looked for.

Cheers,
Trent

-- 
Trent Mick
[EMAIL PROTECTED]
-- 
http://mail.python.org/mailman/listinfo/python-list


ANN: ActivePython 2.4.1 build 245 is available

2005-03-31 Thread Trent Mick
I'm pleased to announce that ActivePython 2.4.1 build 245 is now
available from:

 http://www.ActiveState.com/Products/ActivePython

ActivePython 2.4.1.245 is a bug-fix release matching the recent core
Python 2.4.1 release. ActivePython builds for Linux, Solaris and
Windows are available.

We welcome any and all feedback to:
[EMAIL PROTECTED]
Please file bugs against ActivePython at:
http://bugs.ActiveState.com/ActivePython


What is ActivePython?
-

ActivePython is ActiveState's quality-assured binary build of Python.
Builds for Windows, Linux and Solaris and made freely available.

ActivePython includes the Python core and core extensions (zlib 1.2.1,
bzip2 1.0.2, bsddb 4.2.52, Tk 8.4.9, and Tix 8.1.4). On Windows,
ActivePython includes the PyWin32 suite of Windows tools developed by
Mark Hammond, including bindings to the Win32 API and Windows COM, the
Pythonwin IDE, and more.

ActivePython also includes a wealth of Python documentation, including:
- the core Python docs
- Andrew Kuchling's "What's New in Python" series
- the Non-Programmer's Tutorial for Python
- Mark Pilgrim's excellent "Dive into Python", and
- a snapshot of the Python FAQs, HOWTOs and PEPs.

An online version of the docs can be found here:
http://aspn.activestate.com/ASPN/docs/ActivePython/2.4/welcome.html
In particular the Release Notes:
http://aspn.activestate.com/ASPN/docs/ActivePython/2.4/relnotes.html
and the Installation Guide:
http://aspn.activestate.com/ASPN/docs/ActivePython/2.4/installnotes.html

Extra Bits
--

ActivePython releases also include the following packages:

- a Windows "debug" package: debug-built binaries for ActivePython
  users building debug versions of their binary Python extensions
- ActivePython24.chm: an MS compiled help collection of the full
  ActivePython documentation set. Linux users of applications such as
  xCHM might find this useful. This package is installed by default on
  Windows.

These packages are available from:
 ftp://ftp.activestate.com/ActivePython/etc/

On behalf of the team at ActiveState,
Thanks, and enjoy!

-- 
Trent Mick
[EMAIL PROTECTED]
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: System bell

2005-03-31 Thread Trent Mick
[Baza wrote]
> Am I right in thinking that >>>print "\a" should sound the system, 'bell'?

It works on the shell on Windows for me (WinXP).

Trent

-- 
Trent Mick
[EMAIL PROTECTED]
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: System bell

2005-03-31 Thread Trent Mick
[Mr6 wrote]
> Matt wrote:
> >Try:
> >import os
> >os.system('\a')
> >
> 
> Ta, that's got it.

I suspect that you are misinterpreting failure as success here. This is
probably only resulting in a bell from the shell when it complains that
it doesn't know of any command called "\a" to run.

Trent

-- 
Trent Mick
[EMAIL PROTECTED]
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: System bell

2005-04-01 Thread Trent Mick
[Mr6 wrote]
> It's a weird thing. But if I run print "\a" from idle it does not work. 
> But if I save as a file, say, sound.py. Then run that with python 
> sound.py it does.
> 
> Why is that?

The IDLE stdout/stderr handling is not invoking a system bell when it
sees '\a'. I suppose that one could consider that a bug. If I were an
IDLE developer/maintainer, I don't think I'd rate that as a very high
prioirty bug though. :)

Trent

-- 
Trent Mick
[EMAIL PROTECTED]
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: terminating an inactive process

2005-04-04 Thread Trent Mick
[Earl Eiland wrote]
> I'm running a PyWin program that executes another program using
> subprocess.Popen().  Unfortunately, this other program isn't well
> behaved, and frequently terminates without terminating its process. 
> After this happens enough times, all my memory is tied up, and the
> machine crashes.
> 
> Using subprocess.poll(), I can keep my program from hanging, by timing
> out the process, and starting anew.  This still leaves the previous
> process hogging memory.  How do I kill the old process in Windows?

You might be able to use or borrow code from my process.py module.
process.py is very similar to Python 2.4's subprocess. It provides a
ProcessOpen class (similar to subprocess' Popen). A ProcessOpen instance
has wait() and kill() methods that work fine on Windows. Under the hood
they are using the Win32 API WaitForSingleObject() and
TerminateProcess() functions.

http://starship.python.net/~tmick/

Yes, I haven't updated process.py in a while. :) It works fine with
Python 2.3 and 2.4 (despite only saying Python 2.2 there). It *does*
rely on the PyWin32 extensions being installed with you Python
installation -- which you'll already have if you use ActivePython or
which you can install separately from here:

http://sourceforge.net/project/showfiles.php?group_id=78018

Cheers,
Trent

-- 
Trent Mick
[EMAIL PROTECTED]
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Updating Windows File Summary Data

2005-04-18 Thread Trent Mick
[Denrael wrote]
> I am looking for a way in Python to update Windows File Summary
> Metadata. By that I mean the data (Title, Subject, Keywords, Comments)
> found when you right click a windows file, select properties and then
> summary. Can anyone point me in the right direction?

I'm not sure if modifying that metadata works the same way as updating
version metadata. If so, verstamp.py here might help you get started:


http://cvs.sourceforge.net/viewcvs.py/pywin32/pywin32/win32/scripts/VersionStamp/
 

Cheers,
Trent

-- 
Trent Mick
[EMAIL PROTECTED]
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: create python process

2005-04-26 Thread Trent Mick
[EMAIL PROTECTED] wrote]
> I use windows and os.fork is not working in windows.
> Can we create process inside python I mean I have function and I want
> to run it as a process not a thread ?
> 
> Should I run code from os. in order to run  a processes?

Check out any or all of:

   subprocess (new module in Python 2.4)
   os.system
   os.popen, os.popen2, os.popen3, os.popen4

Note that you can't just run a Python *function* in a separate process
directly. You'll have to have some way to call:
python.exe your_script.py
such that your function gets called.

Cheers,
Trent

-- 
Trent Mick
[EMAIL PROTECTED]
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Coding Standards (and Best Practices)

2005-04-26 Thread Trent Mick
[Isaac Rodriguez wrote]
> Hi,
> 
> I am fairily new to Python, but I am really liking what I am seeing. My team 
> is going to re-design some automation projects, and we were going to use 
> Python as our programming language. One of the things we would like to do, 
> since we are all new to the language, is to define a set of guidelines and 
> best practices as our coding standards.
> 
> Does anyone know where I can get some information about what the community 
> is doing? Are there any well defined guidelines established?

http://www.python.org/peps/pep-0008.html


Cheers,
Trent

-- 
Trent Mick
[EMAIL PROTECTED]
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Komodo syntax checking for python2.4

2005-04-26 Thread Trent Mick
[George Sakkis wrote]
> I downloaded the latest Komodo (3.1) and configured it for python 2.4
> so that it doesn't show decorators and genexps as syntax errors, but
> background syntax checking doesn't seem to work at all for python 2.4.
> Even for correct files, it shows a "Syntax checking error: Error
> checking syntax: retval = 128, stderr=" alert. For python 2.3 it works
> fine (modulo the new 2.4 syntax of course). Both 2.3 and 2.4 are built
> from source on Cygwin, not ActiveState's binaries, so it might have to
> do with this, but I'm unwilling to install yet another python
> distribution. Does anyone have the same problem with background syntax
> checking on 2.4 ? Thanks,

George,

My suspicion is that the difference is that you are using a Cygwin
Python and it is using Un*x-style process return values. What do the
following return for your Python.

For me on Windows (with ActivePython 2.4):
>>> import os
>>> os.system("exit 0")
0
>>> os.system("exit 1")
1

And on Linux:
>>> import os
>>> os.system("exit 0")
0
>>> os.system("exit 1")
256

My cygwin Python is currently busted for some reason, so I can't test it
on my system.

On Unix-y/posix-y systems the retval from a process encodes both the
exit status and information on how the process was stopped (c.f. the
os.WIF* methods).

It would be helpful if you could log a bug for this in Komodo's bugdb so
we can track this and make sure it doesn't get lost:

http://bugs.activestate.com/Komodo

Cheers,
Trent

-- 
Trent Mick
[EMAIL PROTECTED]
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Progress Bar with urllib2

2005-04-26 Thread Trent Mick
> But some of these files are going to be really, really big, and I want
> to get a progress bar going.  I've tried doing a while loop like this:

Here is a little snippet that I use occassionally:

-- geturl.py ---
import os
import sys
import urllib

def _reporthook(numblocks, blocksize, filesize, url=None):
#print "reporthook(%s, %s, %s)" % (numblocks, blocksize, filesize)
base = os.path.basename(url)
#XXX Should handle possible filesize=-1.
try:
percent = min((numblocks*blocksize*100)/filesize, 100)
except:
percent = 100
if numblocks != 0:
sys.stdout.write("\b"*70)
sys.stdout.write("%-66s%3d%%" % (base, percent))

def geturl(url, dst):
print "get url '%s' to '%s'" % (url, dst)
if sys.stdout.isatty():
urllib.urlretrieve(url, dst,
   lambda nb, bs, fs, url=url: 
_reporthook(nb,bs,fs,url))
sys.stdout.write('\n')
else:
urllib.urlretrieve(url, dst)

if __name__ == "__main__":
if len(sys.argv) == 2:
url = sys.argv[1]
base = url[url.rindex('/')+1:]
geturl(url, base)
elif len(sys.argv) == 3:
url, base = sys.argv[1:]
geturl(url, base)
else:
print "Usage: geturl.py URL [DEST]"
sys.exit(1)
--- end of geturl.py ---


Save that as geturl.py and try running:

python geturl.py http://example.com/downloads/bigfile.zip


Cheers,
Trent

-- 
Trent Mick
[EMAIL PROTECTED]
-- 
http://mail.python.org/mailman/listinfo/python-list


Lists inside dictionary and how to look for particular value

2014-01-26 Thread mick verdu
z={ 'PC2': ['02:02:02:02:02:02', '192.168.0.2', '200'],
'PC3': ['03:03:03:03:03:03', '192.168.0.3', '200'],
'PC1': ['01:01:01:01:01:01', '192.168.0.1', '200'] }

My solution:

z=raw_input("Enter Host, Mac, ip and time")
t=z.split()
t[0]=z[1:]
for key in dic:
if t[2] in dic[key]:
del dic[t[0]]
else:
dic[t[0]] = t[1:]


What I really want to achieve is:


How to search for a particular value inside list. First, I want the user to 
input hostname and ip. e.g. PC1 and 192.168.0.1, then need to find out if 
192.168.0.1 has already been assigned to some host in dictionary. In this case 
I would need to skip for search inside list of user input host.

Forexample, if user inputs PC1 and 192.168.0.1 i would like to skip searching 
in above PC1's values. So it should detect matching only with different hosts 
and skip its own name.

If i input PC4 and 192.168.0.1 then it should detect conflict with PC1. So PC4 
would be deleted(As soon as user inputs new host it is saved in above database 
then if conflict with others deleted)
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Lists inside dictionary and how to look for particular value

2014-01-26 Thread mick verdu
@Peter Otten:

I have lists for keys. What I want is if host already exists it would overwrite 
otherwise add to database. And if host doesn't exist it will first add this 
host to database and then compare its IP with IPs of rest of hosts. If ip 
matches with any of the other hosts, it will delete the host that it just added 
now.I know it doesn't make sense but I need to do it.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Lists inside dictionary and how to look for particular value

2014-01-26 Thread mick verdu
I have programming course and trying to learn things. This is of no human use. 
I am just following exercises. Just have to do steps as asked.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Lists inside dictionary and how to look for particular value

2014-01-26 Thread mick verdu
ThanK you. It solved my problem.
Can someone tell me how can i print particular value inside list of key.

I know how to print J['PC2'][1] means will print IP. but I want the user to 
input some element and I will print element just before that element.

e.g. if user inputs 192.168.0.2, program will print 02:02:02:02:02:02.
If user inputs 192.168.0.1 I will print 01:01:01:01:01:01.

-- 
https://mail.python.org/mailman/listinfo/python-list


Eclipse IDE printing values automatically

2014-01-28 Thread mick verdu
I am using Pydev 2.8 on Eclipse IDE. It is printing some values that haven't 
been printed with print command. How to deal with this problem?
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Eclipse IDE printing values automatically

2014-01-29 Thread mick verdu

Thanks for reply.
I am running file via ctrl+F11 and seeing output on pyDev Console. My code has 
got nested dictionaries, lists and tuples. What you want to see?
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Difference between ActivePython and Python.org

2005-12-14 Thread Trent Mick
[S.Chang wrote]
> Anyone knows the difference(s) between the Python binaries from 
> ActiveState and Python.org?

The responses to this thread so far gave most of the differences. In
summary:

- On Windows, ActivePython includes the PyWin32 extensions.
- ActivePython rolls the core Python docs and a bunch of extra doc bits
  into one package, as detailed here:
http://aspn.activestate.com/ASPN/docs/ActivePython/2.4/about.html
- We have binary installers for more platforms:
win32-x86
linux-x86
macosx-powerpc
solaris-sparc
solaris-x86
hpux-parisc
aix-powerpc
  (And we'll likely have a few more in the future, in particular
  macosx-x86 and perhaps some newer 64-bit platforms.)
- As Neil pointed out, ActivePython does not currently have SSL bindings
  (the _ssl module) that python.org's Python builds do. We are currently
  going through the legal hurdles so that we can include those. I expect
  that by or before the Python 2.5 timeframe we'll have _ssl in
  ActivePython.
- ActivePython is free, but is not open source so, as Steve mentioned,
  you need permission if you want to *re-distribute* ActivePython.
  However, *using* ActivePython is still completely free and using tools
  like py2exe and py2app to wrap up your scripts and distribute those is
  fine.
- ActivePython provides a Windows "debug" package: a zip of the
  debug-build libs that you can install into your Python install
  (python.org installs to as of the next release[1]). This can be useful
  for some people building debug builds of Python extensions.

One of the important things is how ActivePython is NOT different:
ActivePython should be fully binary compatible with python.org builds.
This is to ensure that 3rd-party extensions built for and tested on one
will just work on the other.


[BartlebyScrivener wrote]
> The ActiveState version lags behind for a month or two in versions,

That is occassionaly true, yes, but not always. ActivePython 2.4.2 was,
I believe, a few weeks behind. 2.4.0 was released within a day or two. 


[Neil Hodgson wrote]
> It would be helpful if the ActivePython "What's Included" page listed
> which parts of the python.org distribution are not included.

Good point. I'll update those docs now for the next release.


Cheers,
Trent (the ActivePython dude at ActiveState)

[1] Distributing the Python Windows debug build libs. 
http://mail.python.org/pipermail/python-dev/2005-November/057896.html
http://mail.python.org/pipermail/python-dev/2005-December/058446.html

-- 
Trent Mick
[EMAIL PROTECTED]
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python IDE (was: PythonWin troubleshooting)

2005-12-20 Thread Trent Mick
[chuck wrote]
> What is Komodo written in?

Komodo is based on the Mozilla framework, so in many ways it is similar
to Firefox and Thunderbird. Komodo also includes PyXPCOM -- Python
bindings to Mozilla's XPCOM (cross-platform component object model)
system for componentizing parts of the framework -- so that we can
develop core Komodo logic in Python. As with any Mozilla-based app, the
UI is written in XUL (XML-based UI Language) and JavaScript. Where it
makes sense Komodo includes bits written in Perl and Tcl (also have some
PHP extension C code): for code browsing and debugging. So, Komodo is
written in: XML, JavaScript, C++, Python, CSS, C, Perl, and Tcl.

Cheers,
Trent

-- 
Trent Mick
[EMAIL PROTECTED]
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Changing a shell's current directory with python

2005-12-20 Thread Trent Mick
[Peter Hansen wrote]
> Andy B. wrote:
> > I've got a python utility that I want to change my shell's current
> > directory based on criteria it finds.  I've scoured google and the
> > python cookbook and can't seem to figure out if this is even possible.
> >  So far, all my attempts have changed the current python session only.
> >  Am I going to have to wrap this in a shell script?
> 
> As you've heard, you can't get there from here.  In fact, even just 
> wrapping with a shell script likely won't be enough, unless you are 
> willing to "source" the script every time you run it.  The only way I 
> know of (and I'd be happy to hear alternatives) to do this in a 
> _transparent_ manner is to combine an alias (which uses "source" for 
> you) with a wrapper script _and_ to have that wrapper script read from 
> some place (stdout or a temporary file or ?) to which the Python script 
> can communicate the desired new environment variables and/or current 
> directory.

I do basically this with a script I have (http://trentm.com/projects/go)
for doing exactly what Andy requested: changing directories.

On Un*x you setup a shell function (like an alias),
which calls the Python script go.py,
which writes a shell script that changes the directory,
which gets 'source'd by the shell function.

function go () 
{ 
go_is_on_path="`\which go`";
if test -e "$go_is_on_path"; then
export GO_SHELL_SCRIPT=$HOME/.__tmp_go.sh;
python `\which go` $*;
if [ -f $GO_SHELL_SCRIPT ]; then
source $GO_SHELL_SCRIPT;
fi;
else
    echo "ERROR: could not find 'go' on your PATH";
fi
}

On Windows 'go' does the same thing with a batch file.

Trent

-- 
Trent Mick
[EMAIL PROTECTED]
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Komodo IDE: '__file__' is not defined when debugging

2006-01-03 Thread Trent Mick
[fortepianissimo wrote]
> This is a question to all of you who use Komodo IDE for development:
> when I tried to debug my script which uses __file__ to get the absolute
> path to the file, Komodo complained that the variable is not defined.
> 
> Anyway to work around this? (without changing the code)
> 
> Or if I need to change the code, how do I achieve the same thing I
> wanted? Thanks in advance!

The problem is that when you run your script under the debugger (same
thing with pdb.py) __file__ isn't set automatically because running a
Python script with Python's execfile() (which is what Komodo debugger
does) works slightly differently that what Python's main() does to run a
Python script. One of the differences is the setting of __file__.

(Side note: I'm not sure if this should be a Python bug or not. The
intention of under what conditions  __file__ should be set are not clear
from the Python docs. From a quick poke I think it may be possible that
__file__ not getting set via execfile() is a bug that was introduced
with pythonrun.c changes when nested scopes were added a while back).

We've started a bug for this on Komodo:
http://bugs.activestate.com/Komodo/show_bug.cgi?id=43703

...and Shane just fixed it. I.e. Subsequent releases of Komodo will have
this fixed: __file__ will be set in the main module.

Until that release, workarounds:
1. get the main script path from sys.argv[0]; or
2. apply the patch (to .../dbgp/client.py in your Komodo install) that
   Shane attached to that bug to your Komodo installation.

Thanks for mentioning the bug.

Cheers,
Trent

-- 
Trent Mick
[EMAIL PROTECTED]
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Win32 Binary-only for 2.3.x?

2006-01-04 Thread Trent Mick
[EMAIL PROTECTED] wrote]
> So, I give.  Can someone point me to somewhere where there is a pile of
> Python 2.3 EXE and DLLs that I can happily dump somewhere on my system
> without having to install?  

ftp://ftp.activestate.com/ActivePython/windows/2.3/ActivePython-2.3.5-236-win32-ix86.zip


> In case it matters, this is for a WAMP-like
> project I'm developing that includes a working Trac installation.

I'm not sure it applies to your situation, but you cannot redistribute
ActivePython.
http://www.activestate.com/Products/ActivePython/license_agreement.plex

Cheers,
Trent

-- 
Trent Mick
[EMAIL PROTECTED]
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Win32 Binary-only for 2.3.x?

2006-01-09 Thread Trent Mick
[Fuzzyman wrote]
> Out of interest, doesn't the Python binary use the registry (and
> environment variables) for building sys.path ?

Yes, good point...

> 
> Won't you still have conflicting path issues if you use an alternative
> binary with an existing 'normal' install ?

...but it is possible to effectively disable the use of the registry by
a given pythonXY.dll -- if you know how to edit the String Table of the
DLL. Basically there is a string entry in that table that is used as
part of the registry path for registry usage.

Here is how I do it:
- open MS Visual C++ 6 (I'm sure you can do all this with VS.NET, I
  just haven't done it.)
- Ctrl+O for the open file dialog
- Files of type: Executable files (.exe;.dll;.ocx)
- Open as:   Resources
- browse to and open pythonXY.dll
- In the string table there is an entry with Value=1000 and Caption=X.Y
  (i.e. "2.3" for python23.dll, "2.4" for python24.dll, etc.). That
  "X.Y" string is what determines that part of the registry lookup path
  for:
HKLM/Software/Python/PythonCore/X.Y/PythonPath
- You could change the "Caption" value to "FuzzyWuzzyWuzzaBear" to
  effectively disable usage of the registry for sys.path building by
  that pythonXY.dll.

Cheers,
Trent


-- 
Trent Mick
[EMAIL PROTECTED]
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Building Pywin32 source code?

2006-01-09 Thread Trent Mick
[sam wrote]
> Has anyone been able to access the source code for Pywin32 at
> sourceforge? I have been able to use TortouseCVS to access other CVS
> projects,but with the Pywin32 cvs site, I can not log in.

Note that I had the same issue trying to "cvs login" to buildbot's CVS
(also on sf.net) the other day. The problem went away after a day or so.
Likely some maintenance issue with the particular box at sf.net that
happened to be hosting this one. 

http://sourceforge.net/mailarchive/forum.php?thread_id=9388321&forum_id=32301

You could make a maintenance request on SF (or whatever they call it),
or give it a little bit of time to see if it fixes itself.

Trent

-- 
Trent Mick
[EMAIL PROTECTED]
-- 
http://mail.python.org/mailman/listinfo/python-list


modifying DLL string table programatically (Was: Win32 Binary-only for 2.3.x?)

2006-01-09 Thread Trent Mick
[Thomas Heller wrote]
> py2exe also does something like this in the copy of pythonXY.dll that it
> creates, to avoid the resulting exe pulling in sys.path entries from the
> registry.

Do you have a quick pointer to the code that does this? I wasn't easily
able to automate doing this with COM code last time I tried.


Trent

-- 
Trent Mick
[EMAIL PROTECTED]
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: return values of os.system() on win32

2006-01-13 Thread Trent Mick
[rbt wrote]
> This is a corner case. I'm trying to detect if the py script is running 
> on a 'special' version of windows. I can't go into the details about 
> what makes it unique. Python installs and runs, but the windows API 
> isn't as complete as a normal Windows install... among other things, it 
> doesn't have a winver.exe file, or if it does, it's crippled... this 
> causes os.system('winver') to return a 1... while it returns 0 on 
> Windows XP, etc.

If you just want to check if winver.exe exists you could just try
os.path.exists("path\\to\\winver.exe") if you know where to expect it
(likely "C:\Windows\system32") or you could use which.py:

>>> import which
>>> which.which("winver.exe")
'C:\\WINDOWS\\system32\\winver.exe'
>>> which.which("nothere")
Traceback (most recent call last):
  File "", line 1, in ?
  File "C:\Python24\which.py", line 248, in which
raise WhichError("Could not find '%s' on the path." % command)
which.WhichError: Could not find 'nothere' on the path.

http://trentm.com/projects/which/

Trent

-- 
Trent Mick
[EMAIL PROTECTED]
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: python 2.5 & sqlite3

2006-10-12 Thread Trent Mick
> if it doesn't, it wouldn't be the first time they'd (by accident or on 
> purpose) left things out.  

Other than SSL, do you have examples?

 > trust me, it'd cause a lot less confusion if
> ActivePython was a true superset of the python.org distribution.

For every extension except SSL support (*) it is.

(*) Still working on export-control legals for that. I was hoping to 
have that ready for ActivePython 2.5. But that doesn't look like it will 
happen on time. And now I've missed getting ActivePython 2.5 out soon 
after Python 2.5 because I'm focussed on Komodo 4.0 for now.

For others, unfortunately ActivePython 2.5 will probably not be ready 
until mid-November.

Trent

-- 
Trent Mick
[EMAIL PROTECTED]
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Help: Python2.3 & Python2.4 on RHEL4 x86_64

2006-10-19 Thread Trent Mick
Christopher Taylor wrote:
> RHEL comes with Python2.3 installed.  A program I need to install
> requires Python2.4

ActivePython has a 2.4 build for Linux/x86_64:

http://www.activestate.com/Products/ActivePython/

Cheers,
Trent

-- 
Trent Mick
[EMAIL PROTECTED]
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: uninstall and Windows file associations

2006-11-02 Thread Trent Mick
Roger Miller wrote:
> When I installed Python 2.5 (on Windows XP) I left 2.4 in place "just
> in case". Today I decided to remove it. However after doing so (from
> the control panel) I found that Windows no longer knows about the
> Python file types and associations. Is this behavior expected, or was
> there something wrong with my installation? Is there a way to restore
> the file associations, short of reinstalling 2.5 or manually editing
> them?

ActivePython handles that case by providing a "Repair" functionality in the 
installer. I'm not sure if the python.org Windows installer has that 
functionality (it probably does). Just try invoking the .msi file again.

And, as Neil said, you can just reinstall.

Trent

-- 
Trent Mick
[EMAIL PROTECTED]
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Using Komodo 3.5 - Setting breakpoints in multiple *.py files

2006-06-19 Thread Trent Mick
jeem wrote:
> I am using ActiveState Komodo 3.5 to work on a large python 2.4
> application with an extensive UI...  I am attempting to debug the
> application and am setting breakpoints in 4 different *.py files..
> Breakpoints in the main file are working OK, but any breakpoints in
> imported files are not... The three imported files are open in Komodo
> and are in the same local directory as the main file (in the
> python24/Lib/site-packages tree)... The code sections I am trying to
> debug are invoked by some UI events...  When I start the debugging
> section and navigate to the features I am trying to debug, the
> breakpoint are ignored...  I can execute a "Break now" command and the
> IDE is smart enough to find and display imported *.py resources... but
> normal breakpoints are ignored...

It works for me in a trivial example:

C:\trentm\tmp\foo>cat foo.py

print "hi from foo"
import bar
bar.bar()
print "bye from foo"

C:\trentm\tmp\foo>cat bar.py

def bar():
 print "hi from bar.bar()"
 print "bye from bar.bar()"

I set breakpoints on the "import bar" line in foo.py and on the 'print 
"hi...' line in "bar.py". Started debugging "foo.py" and the debugger 
breaks on both breakpoints.

If you step into the "import" statements in your debug session, are the 
imported modules the ones you expect? I.e. in my example the breakpoint 
would not have worked if "bar.py" had been imported from another 
location on my sys.path.


Note: this might be better discussed on the komodo-discuss mailing list.
(http://listserv.activestate.com/mailman/mysubs)

Cheers,
Trent

-- 
Trent Mick
[EMAIL PROTECTED]
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Active Python versions

2006-06-19 Thread Trent Mick
Tom Del Rosso wrote:
> Why is the Windows msi install file for ActivePython-2.4.3.12 only 15MB
> whereas the older msi file for ActivePython-2.4.2.10 was 19MB?
> 
> BTW, is that the prefered Python environment?

Are you sure you are comparing the right packages? By my count:

ActivePython-2.4.2.10-win32-x86.msi 19,053 KB
ActivePython-2.4.3.12-win32-x86.msi 19,237 KB

Note that the Windows *64-bit* builds are smaller (around 15MB) because 
they do not include PyWin32.

Trent

-- 
Trent Mick
[EMAIL PROTECTED]
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Active Python versions

2006-06-19 Thread Trent Mick
Tom Del Rosso wrote:
> Can I ask you about alternative environments?  How do Active Python and IDLE
> from python.org compare?  

Both ActivePython and the Python installers from python.org install 
IDLE. They should not differ at all (AFAIK).

Trent

-- 
Trent Mick
[EMAIL PROTECTED]
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Active Python versions

2006-06-19 Thread Trent Mick
Tom Del Rosso wrote:
> [EMAIL PROTECTED] <[EMAIL PROTECTED]> typed
> in news://[EMAIL PROTECTED],
> 
>> Maybe the OP is refering to PythonWin editor (as compared to IDLE)
>> which is in ActiveState's release but not in the Python.org release...
>> makes for a very different subject, and hopefully for very different
>> answer direction.
> 
> Yes.  I just wanted to know which programming environment is prefered by
> regular users, maybe even one that I haven't heard of yet.

Ah, the PythonWin IDE/Editor is part of PyWin32 -- which is included as 
a standard part of ActivePython. IDLE is also included in ActivePython, 
BTW. ActivePython just doesn't setup a shortcut in the Start Menu for 
it. You could add your own.

As jean-marc suggests, you might want to search the python-list archives 
for peoples opinions on Python IDEs and editors. Also check out:

http://wiki.python.org/moin/IntegratedDevelopmentEnvironments
http://wiki.python.org/moin/PythonEditors

ActiveState has a Python IDE called Komodo
http://www.activestate.com/Products/Komodo/
which I work on (so I'm biased :).

Trent

-- 
Trent Mick
[EMAIL PROTECTED]

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Active State and Komodo...

2006-11-27 Thread Trent Mick
Steve Thompson wrote:
> Hello all,
> 
> I was wondering the differnced there were betwee Active State's python and
> the open source version of python. 

Here is the best answer to that:
http://groups.google.com/group/comp.lang.python/tree/browse_frm/thread/e8291fcb1418e80/16f39060f654402f?rnum=1&hl=en&q=ActivePython+trent&_done=%2Fgroup%2Fcomp.lang.python%2Fbrowse_frm%2Fthread%2Fe8291fcb1418e80%2F98c87a6a5dc8f3c0%3Ftvc%3D1%26q%3DActivePython+trent%26hl%3Den%26#doc_b6f732ab2c8434ef
http://tinyurl.com/y7r47q


> Would I have to unistall my opend souce
> python? 

No. As BartlebyScrivener wrote you shouldn't do that. You can easily install 
ActivePython side-by-side with another Python install on Linux.


 > Additonally, how does Active State's Komodo IDE vs. the eric3 IDE
> unler SuSE Linux v. 10.i?
> 
> Addionally, is the eric IDE (version 3) an acceptible IDE or are there
> more easy and more productive IDE's for perl?

*I* like Komodo, but then I am biased because I am one of its developers. :)
I presume you meant Python instead of Perl there, but if not, Komodo does 
support Perl as well as Python (and PHP, JavaScript, Ruby, Tcl and XSLT too).

This is a pretty good review of Python IDEs (although note that most, if not 
all, of the IDEs reviewed there will have advanced a few versions).

http://spyced.blogspot.com/2005/09/review-of-6-python-ides.html


Komodo 4 is currently under public beta (Komodo 4 beta 1 is out now and beta 2 
should be released later this week). Try it out:

http://www.activestate.com/products/komodo/beta.plex#features


Cheers,
Trent

-- 
Trent Mick
[EMAIL PROTECTED]
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: pyxpcom

2006-11-28 Thread Trent Mick
hg wrote:
> Hi,
> 
> Can one tell me what the status of this project is ?. I did google ...
> but not much out there.

PyXPCOM source is in the main Mozilla CVS tree. It is being maintained by Mark 
Hammond (the original developer of the extension). There isn't a lot of 
activity on it, I think, because:
1. Mark did such a good job of implementing it the first time around that it 
needs very little work :)
2. It is very high learning curve to get into playing with PyXPCOM because 
there are no conveniently packaged builds of PyXPCOM for current (or any) 
versions of Firefox or Mozilla.

Interestingly, Mark is currently working *full* support for Python in the 
Mozilla code base, i.e. being able to use Python anywhere you can currently 
use JavaScript (in 

Re: pyxpcom

2006-11-28 Thread Trent Mick
> My need is as follows: I have developed an activex component to access a
> smart card on the client side / do some web site logon.
> 
> Are xpcom / pyxpcom advanced/stable enough for such an implementation
> under Linux / Windows ?

You mean to provide the equivalent functionality for Firefox that your activex 
component does for IE? Yes, xpcom and pyxpcom are quite stable, however 
putting together a Firefox extension that gets PyXPCOM itself up and running 
in a client's Firefox install will be quite challenging.

Trent

-- 
Trent Mick
[EMAIL PROTECTED]
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: pyxpcom

2006-11-29 Thread Trent Mick
hg wrote:
> Trent Mick wrote:
>>> My need is as follows: I have developed an activex component to access a
>>> smart card on the client side / do some web site logon.
>>>
>>> Are xpcom / pyxpcom advanced/stable enough for such an implementation
>>> under Linux / Windows ?
>> You mean to provide the equivalent functionality for Firefox that your
>> activex component does for IE? Yes, xpcom and pyxpcom are quite stable,
>> however putting together a Firefox extension that gets PyXPCOM itself up
>> and running in a client's Firefox install will be quite challenging.
>>
>> Trent
>>
> Exactly ... are you saying I need to distribute Firefox compiled
> differently in order to achieve that ?

No. But you'll have to get comfortable building your own Firefox and then 
building the PyXPCOM extension and then packaging the built PyXPCOM bits that 
a normal Firefox install does not have already into a Firefox extension. This 
would also mean packaging up parts of a Python build and possible needing to 
have a custom Python build to (1) get shared library loading to work correct 
and (2) ensure there isn't crosstalk between the python that PyXPCOM uses and 
possibly other Python installations on the target machine.

> This is less a python issue clearly if that is the case: would I have
> the same issues to resolve if I were to write the module in C++ ?

A little, yes: I believe you'd need a Firefox build in a development tree to 
build a vanilla C++ XPCOM component. However, I am not sure of that.

Mostly, no: You wouldn't need to worry about all the PyXPCOM/Python 
build/install issues.


Trent

-- 
Trent Mick
[EMAIL PROTECTED]
-- 
http://mail.python.org/mailman/listinfo/python-list


ANN: ActivePython 2.4.2.10 is now available

2006-01-24 Thread Trent Mick
I'm happy to announce that ActivePython 2.4.2.10 is now available for free
download from:
http://www.ActiveState.com/Products/ActivePython/

This release is a maintenance/update release for existing platforms and adds
support for three new ones: Mac OS X/x86, Windows/x64 and Linux/x86_64.  See
below for a full list of supported platforms.

Changes in this release include:
- Add early support for Mac OS X for Intel platform (macosx-x86).
  Please see the "Mac OS X for Intel" section below for details.
- Upgrade to PyWin32 build 207 on Windows/x86
- Upgrade Tkinter to Tcl/Tk 8.4.12
- Support for Windows/x64 (win64-x64). Note that PyWin32 has not been ported
  to 64-bit Windows so this build does not include PyWin32.
- Support for Linux/x86_64 (linux-x86_64)
- Fixed a problem on Mac OS X/PowerPC that unintentionally created a
  dependency on Fink (fink.sourceforge.net) for the "bz2" and "curses"
  extensions. (Thanks, Bob!)
- The Windows "debug libraries" package now allows installation into
  non-ActivePython Python installations of the same version. This was
  requested by Dave Abrahams for the Boost folks (http://tinyurl.com/898zw).
- Changed Intel 32-bit architecture platform name from "ix86" to "x86",
  changing package names for some ActivePython builds.


Mac OS X for Intel
--

This is the first release of ActivePython for Mac OS X/Intel. It should be
considered an early release. This build is not a universal build and there
are a number of known issues:

http://aspn.activestate.com/ASPN/docs/ActivePython/2.4/relnotes.html#KI_macosx

I suspect that ultimately a universal Python build is the right answer, but 
details and issues around that should be discussed on the Python Mac mailing
list:
pythonmac-sig@python.org


What is ActivePython?
-

ActivePython is ActiveState's quality-assured binary distribution of
Python. Builds for AIX, HP-UX, Linux, Mac OS X, Solaris, and Windows 
are made freely available.

ActivePython includes the Python core and core extensions (zlib 1.2.3,
bzip2 1.0.2, bsddb 4.2.52, Tk 8.4.12, and Tix 8.1.4) and is fully
compatible with other Python distributions of the same version.

ActivePython also includes a wealth of Python documentation, including:
- the core Python docs;
- Andrew Kuchling's "What's New in Python" series;
- the Non-Programmer's Tutorial for Python;
- Mark Pilgrim's excellent "Dive into Python"; and
- a snapshot of the Python FAQs, HOWTOs, and PEPs.

An online version of the docs can be found here:
http://aspn.activestate.com/ASPN/docs/ActivePython/2.4/welcome.html

We would welcome any and all feedback to:
[EMAIL PROTECTED]

Please file bugs against ActivePython at:
http://bugs.ActiveState.com/ActivePython


On what platforms does ActivePython run?


ActivePython now includes installers for the following ten platforms:

- AIX/PowerPC
- HP-UX/PA-RISC
- Linux/x86
- (new) Linux/x86_64: "x86_64" is also known as "AMD64"
- Solaris/SPARC
- Solaris/x86
- Mac OS X/PowerPC
- (new) Mac OS X/x86:
- (new) Windows/x64: "x64" is also known as "AMD64"
- Windows/x86


Extra Bits
--

ActivePython releases also include the following packages:

- Windows "debug" package: Debug-built binaries for ActivePython
  users building debug versions of their binary Python extensions.
- ActivePython24.chm: An MS compiled help collection of the full
  ActivePython documentation set. Linux users of applications such as
  xCHM might find this useful. This package is installed by default on
  Windows.

These packages are available from:
ftp://ftp.activestate.com/ActivePython/etc/


Thanks, and enjoy!

Trent, Python Tech Lead

--
Trent Mick
TrentM at ActiveState.com
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: ActivePython & SSL

2006-01-25 Thread Trent Mick
[Fuzzyman wrote]
> Hello all,
> 
> In the past I've used the ActivePython distribution for windows.
> Particularly their chm help manual is excellent.
> 
> I have heard that the ActivePython distribution *doesn't* include SSL
> support compiled in for windows.
> 
> Can anyone confirm or deny this rumour for me ?

That is correct. More details here:

http://mail.python.org/pipermail/python-list/2005-December/315754.html
...
- As Neil pointed out, ActivePython does not currently have SSL bindings
  (the _ssl module) that python.org's Python builds do. We are currently
  going through the legal hurdles so that we can include those. I expect
  that by or before the Python 2.5 timeframe we'll have _ssl in
  ActivePython.
...

Sincerely,
Trent

-- 
Trent Mick
[EMAIL PROTECTED]
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Komodo - Will it Lock Me In?

2006-02-17 Thread Trent Mick
[EMAIL PROTECTED] wrote]
> Hi Everybody,
> 
> If I were to use Komodo to write in Python, would it add a lot of goo to my 
> code such that I would not be able to switch to another IDE without having to 
> claw my way out of a tarpit first?

Nope. Komodo adds no goo to your code (TM).
TM's my name, not a trademark on "Komodo adds no goo to your code" --
but I'm thinking about it. :)

Perhaps you are thinking of some of the C/C++ IDEs (like Visual Studio
on Windows and Xcode on the Mac) that will help you setup of projects
using their build systems that sometimes imply a number of standard
files. Komodo doesn't mandate a build system.

> Any other thoughts on Komodo? I am considering it because I am hoping to find 
> a solution to the install-packages-until-you-go-blind aspect of Python. 
> Setting up a serious, cross-platform, gui development environment is quite a 
> struggle for a newbie.

Not sure about the "install-packages-until-you-go-blind" thing. Komodo
doesn't help you install packages into your Python implementation. Nor
does Komodo have front-ends to py2app or py2exe for wrapping up Python
code into standalone executables.

GUI development, however. Komodo's GUI Builder is intended to be a GUI
designer for simple Tkinter-based UIs. It does mandate a certain style
for your *GUI* code, but I believe that all GUI designers need to do
this.

Because I work on Komodo I am biased, so won't give you an opinion on it
relative to other tools out there.

Cheers,
Trent

-- 
Trent Mick
[EMAIL PROTECTED]
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Activestate python installation

2006-02-20 Thread Trent Mick
[Chris Smith wrote]
> >>>>> "mik3" == mik3  <[EMAIL PROTECTED]> writes:
> 
> mik3> hi this is a question regarding installing Activestate
> mik3> python whenever i try to install the latest Activestate
> mik3> Python on WinXP SP2, it gives me error saying "The wizard
> mik3> was interrupted before Activestate 2.4.2 could be completely
> mik3> installed. Your system has not been modified ."  any
> mik3> ideas why this is going on?  thanks
> 
> Administrator?
> Writeable drive?
> Is there an install log file you could locate?

As "David" mentioned on activepython@listserv.activestate.com, could
this be due to an anti-virus program aborting the install on you?

You could generate an install log to see if that yields some clues:

http://aspn.activestate.com/ASPN/docs/ActivePython/2.4/installnotes.html#install_logging

Cheers,
Trent

-- 
Trent Mick
[EMAIL PROTECTED]
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: command string good in subprocess.Popen(string) fails in process.Process(string)

2005-05-16 Thread Trent Mick
[Earl Eiland wrote]
> 
> The command string consists of "filename.exe  instruction1 instruction2
> ..."  It works in subprocess, but in process, returns the error "can't
> find the file instruction1".
> 
> How do I pass command line instructions in process.Process?  I tried a
> list ['filename.exe', 'instruction1 instruction2 ...'] with the same
> result.
> 
> If you're wondering why I'm switching, it's because I'm working with a
> poorly behaved 3rd party program that causes a severe memory leak, and I
> need the process modules timed "wait(n)" method (or write my own).

Can you post a little snippet and show the exact traceback you are
getting? I suspect the problem might stem from a stupid buglet in the
latest process.py available from my starship pages because I've
neglected updating it in a long while.

Cheers,
Trent

-- 
Trent Mick
[EMAIL PROTECTED]
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: SSL (HTTPS) with 2.4

2005-05-18 Thread Trent Mick
[Bloke wrote]
> I just removed my installation of Python 2.4.1, which was the one on
> the python.org web site.  I installed the Activepython 2.4.1 and now I
> get the following error with the same code above:
> 
>  File "C:\Python24\lib\urllib2.py", line 1053, in unknown_open
> raise URLError('unknown url type: %s' % type)
> URLError: 
> 
> I'm getting a bit frustrated.  Do I need to import another library?
> Any advise is appreciated.

Unfortunately ActivePython cannot include the SSL library by default
because of crypto export regulations. For SSL support in an ActivePython
installation you'd have to add the _ssl.pyd extension separately (either
building it yourself, or finding an available binary).

Sincerely,
Trent

-- 
Trent Mick
[EMAIL PROTECTED]
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: install python 2.4.1

2005-05-24 Thread Trent Mick
[EMAIL PROTECTED] wrote]
> I use win xp pro.
> I wonder about this new version of python because I use Nummeric, pyro,
>  combine with komodo and pydev ide in my python 2.4.
> If there is compatibility isue with the new version, it is better for
> me not to install the new version.

There will be no compatibility issue with Komodo, at least. Nor should
there be with the others, as Martin mentioned.

Trent

-- 
Trent Mick
[EMAIL PROTECTED]
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: os independent way of seeing if an executable is on the path?

2005-05-26 Thread Trent Mick
> > In Windows, I can read the error file, and get something like:
> > "'' is not recognized as an internal or external
> > command,\noperable program or batch file.\n"
> > and I'm sure I could parse this, but this seems fragile, and clearly os
> > dependent.

http://starship.python.net/crew/tmick/#which

I have a 'which' implementation that looks up a command-line program
name in the same way that Windows' process launching does at the shell
(when on Windows) and in the same way the usual 'which' executable does
on Un*x (when on Un*x).

Trent

-- 
Trent Mick
[EMAIL PROTECTED]
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: prob with ActiveState and FireFox on Win32 (XP and W2K)

2005-06-01 Thread Trent Mick
[curtin wrote]
> hi,
> i just downloaded the latest version of ActiveState's IDE (pywin 2.4.X)
> and have noticed that i can't have firefox/ActiveState open at the same
> time.  if i try to  create a 'new' script, the AS IDE blocks till i
> tear down firefox. this is on an XP and W2K box.

I suspect that you mean the *Pythonwin IDE* that is part of the *PyWin32
extensions* that comes as a standard part of *ActivePython* (a distro of
Python).

I can't reproduce this problem on my machine. I'm not sure how there
could be crosstalk between Pythonwin and Firefox.

Trent

-- 
Trent Mick
[EMAIL PROTECTED]
-- 
http://mail.python.org/mailman/listinfo/python-list


ANN: ActivePython 2.4.1 for Mac OS X is now available!

2005-06-07 Thread Trent Mick

Today ActiveState is announcing support for Mac OS X.  I'm happy to
announce that ActivePython 2.4.1 for Mac OS X is now available for free
download from:

http://www.ActiveState.com/Products/ActivePython/

This brings the number of free ActivePython platforms to four -- with
the existing Linux, Solaris and Windows free downloads.

Meanwhile, some of you may be interested to know that we are busily
working on bringing Komodo to Mac OS X. We expect to offer a beta in
August and release later this year.

To keep up-to-date with our Mac OS X progress, betas and announcements,
we invite you to join our new mailing list:
[EMAIL PROTECTED]
You can join the OS X announce list on the ActiveState Programmer
Network (ASPN):
http://listserv.activestate.com/mailman/listinfo/osx-announce


What is ActivePython?
-

ActivePython is ActiveState's quality-assured binary distribution of
Python.  Builds for Linux, Mac OS X, Solaris and Windows are made freely
available.

ActivePython includes the Python core and core extensions (zlib 1.2.1,
bzip2 1.0.2, bsddb 4.2.52, Tk 8.4.9, and Tix 8.1.4) and is fully
compatible with other Python distributions of the same version.

ActivePython also includes a wealth of Python documentation, including:
- the core Python docs;
- Andrew Kuchling's "What's New in Python" series;
- the Non-Programmer's Tutorial for Python;
- Mark Pilgrim's excellent "Dive into Python"; and
- a snapshot of the Python FAQs, HOWTOs and PEPs.

Once installed on the Mac, you can find the ActivePython documentation
here:
/Library/Documentation/Help/ActivePython 2.4 Help/index.html
An online version of the docs can be found here:
 http://aspn.activestate.com/ASPN/docs/ActivePython/2.4/welcome.html

Thanks, and enjoy!

Trent, Python Tech Lead

-- 
Trent Mick
[EMAIL PROTECTED]
-- 
http://mail.python.org/mailman/listinfo/python-list


  1   2   3   >