Search the web
Sign In
New User? Sign Up
python-list · Python List
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Want your group to be featured on the Yahoo! Groups website? Add a group photo to Flickr.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Messages 122038 - 122067 of 122067   Newest  |  < Newer  |  Older >  |  Oldest
Messages: Show Message Summaries   (Group by Topic) Sort by Date v  
#122067 From: python-list-bounces@...
Date: Wed Dec 3, 2003 9:33 am
Subject: You have been unsubscribed from the Python-list mailing list
python-list-bounces@...
Send Email Send Email
 
#122066 From: python-list-request@...
Date: Wed Dec 3, 2003 6:15 am
Subject: confirm bdcdafcfdbf1421966925b532b7e62024b981c89
python-list-request@...
Send Email Send Email
 
Mailing list removal confirmation notice for mailing list Python-list

We have received a request for the removal of your email address,
"listsaver-of-python-list@..." from the
python-list@... mailing list.  To confirm that you want to be
removed from this mailing list, simply reply to this message, keeping
the Subject: header intact.  Or visit this web page:

    
http://mail.python.org/mailman/confirm/python-list/bdcdafcfdbf1421966925b532b7e6\
2024b981c89


Or include the following line -- and only the following line -- in a
message to python-list-request@...:

     confirm bdcdafcfdbf1421966925b532b7e62024b981c89

Note that simply sending a `reply' to this message should work from
most mail readers, since that usually leaves the Subject: line in the
right form (additional "Re:" text in the Subject: is okay).

If you do not wish to be removed from this list, please simply
disregard this message.  If you think you are being maliciously
removed from the list, or have any other questions, send them to
python-list-owner@....

#122065 From: python-list-request@...
Date: Tue Dec 2, 2003 2:00 pm
Subject: confirm 0171c16e746e5173d96d7e3fea5d43d4b71f4aac
python-list-request@...
Send Email Send Email
 
Your membership in the mailing list Python-list has been disabled due
to excessive bounces The last bounce received from you was dated
25-Nov-2003.  You will not get any more messages from this list until
you re-enable your membership.  You will receive 2 more reminders like
this before your membership in the list is deleted.

To re-enable your membership, you can simply respond to this message
(leaving the Subject: line intact), or visit the confirmation page at

    
http://mail.python.org/mailman/confirm/python-list/0171c16e746e5173d96d7e3fea5d4\
3d4b71f4aac


You can also visit your membership page at

    
http://mail.python.org/mailman/options/python-list/listsaver-of-python-list%40fi\
ndmail.com


On your membership page, you can change various delivery options such
as your email address and whether you get digests or not.  As a
reminder, your membership password is

     YScq

If you have any questions or problems, you can contact the list owner
at

     python-list-owner@...

#122064 From: python-list-request@...
Date: Tue Nov 25, 2003 1:10 pm
Subject: confirm 0171c16e746e5173d96d7e3fea5d43d4b71f4aac
python-list-request@...
Send Email Send Email
 
Your membership in the mailing list Python-list has been disabled due
to excessive bounces The last bounce received from you was dated
25-Nov-2003.  You will not get any more messages from this list until
you re-enable your membership.  You will receive 3 more reminders like
this before your membership in the list is deleted.

To re-enable your membership, you can simply respond to this message
(leaving the Subject: line intact), or visit the confirmation page at

    
http://mail.python.org/mailman/confirm/python-list/0171c16e746e5173d96d7e3fea5d4\
3d4b71f4aac


You can also visit your membership page at

    
http://mail.python.org/mailman/options/python-list/listsaver-of-python-list%40fi\
ndmail.com


On your membership page, you can change various delivery options such
as your email address and whether you get digests or not.  As a
reminder, your membership password is

     YScq

If you have any questions or problems, you can contact the list owner
at

     python-list-owner@...

#122063 From: Tim Howarth <tim@...>
Date: Tue Nov 25, 2003 12:58 pm
Subject: Re: win32com (VBScript to Python) problem
tim@...
Send Email Send Email
 
In message <bpvho4$kon$1@...>
           "Michel Claveau" <No.Spam.mc@...> wrote:

> import win32com.client
> WMIService =
> win32com.client.GetObject(r"winmgmts:{impersonationLevel=impersonate,(Shutdo
> wn)}!\\CPU01\root\cimv2")
>
> objs = WMIService.ExecQuery(r"Select * from Win32_OperatingSystem")
> for obj in objs:
>     obj.Reboot()



This gives me the same error 'int'  is not callable.

Maybe it's something to do with late/early binding ??

What version of Python/win32all have you used this on ?

--
___
  |im    ---- ARM Powered ----
--
http://mail.python.org/mailman/listinfo/python-list

#122062 From: Tim Howarth <tim@...>
Date: Tue Nov 25, 2003 12:53 pm
Subject: Re: win32com (VBScript to Python) problem
tim@...
Send Email Send Email
 
In message <Xns943E7EB585A78duncanrcpcouk@...>
           Duncan Booth <duncan@...> wrote:

> Tim Howarth <tim@...> wrote in
> news:6e24de564c.tim@...:
>
> > I want to use this to shutdown all machines in the school in which I
> > work from a schedule on a server.
>
> This isn't a Python solution at all, but have you looked at PsTools
> (http://www.sysinternals.com)?

Yes, very handy tools.

It's just that I'd like to do the shutting down myself - why call
pshutdown if I can call the shut down mechanism directly.


--
___
  |im    ---- ARM Powered ----
--
http://mail.python.org/mailman/listinfo/python-list

#122061 From: Rony <bucodi@...>
Date: Tue Nov 25, 2003 12:54 pm
Subject: Re: Running another application from within Python
bucodi@...
Send Email Send Email
 
Peter Sparkes wrote:

> Please, how do I run another application from within Python
>
> Regards
>
> Peter Sparkes
>
>

Have a look at the os module, it may contain what you need.

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

#122060 From: Tim Golden <tim.golden@...>
Date: Tue Nov 25, 2003 12:40 pm
Subject: RE: win32com (VBScript to Python) problem
tim.golden@...
Send Email Send Email
 
> I'm (very non expert) trying to use a snippet of VBScript (to
> shut down
> Windows workstations) converted to Python but have hit a problem.
>
>
> The VBScript below work fine;

[... snip VB script culminating in obj.Win32shutdown 12 ...]

> but my translation results in "'int' object is not callable" with the
> attempted call to Win32Shutdown.

[... snip Python translation of same ...]

I'm not going to attempt to describe what you need to do to send WMI
  methods and parameters back and forth, because it's a pain in the neck,
  which is why I hid all the hard work under the covers here:

http://tgolden.sc.sabren.com/python/wmi.html

and can even offer a comparable example here:

http://tgolden.sc.sabren.com/python/wmi_cookbook.html
(search for "Reboot a remote machine" -- I really must put anchors on that
page)

If you follow that example, all you need to change is the final line
  to read something like:

os.Win32Shutdown (Flags=12)

and it works! (Well, it did for me, anyway).

HTH
Tim

PS If you read the source of the module you'll understand why I
  didn't want to try to explain how it works. Feel free to tinker
  and offer improvements. TJG


________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

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

#122059 From: "Michel Claveau/Hamster" <No.Spam.mc@...>
Date: Tue Nov 25, 2003 12:45 pm
Subject: Re: win32com (VBScript to Python) problem
No.Spam.mc@...
Send Email Send Email
 
Sorry for the multi-post, my FAI is too much lazy...



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

#122058 From: Peter Hansen <peter@...>
Date: Tue Nov 25, 2003 12:40 pm
Subject: Re: import freeze
peter@...
Send Email Send Email
 
Colin Brown wrote:
>
> I have never really got into pdb, it has always seemed too clunky and is
> difficult to use with multithreaded code. Somehow I think my time will be
> better spent working through other avenues.

Your call.  I don't really know much about PDB either.  In fact,
all I ever do with it is hit "s" (step), "r" (return), "n" (next),
and sometimes I evaluate an expression with "!expr".

I also use it to troubleshoot problems in multithreaded code
from time to time, as I recall, never with any particular problem.
I'm surprised more people don't use it because it's really rather
trivial to fire up and step through a few lines of code.  Clunky?
Maybe... but it works, and it's very very convenient.

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

#122057 From: Duncan Booth <duncan@...>
Date: Tue Nov 25, 2003 12:35 pm
Subject: Re: win32com (VBScript to Python) problem
duncan@...
Send Email Send Email
 
Tim Howarth <tim@...> wrote in
news:6e24de564c.tim@...:

> I want to use this to shutdown all machines in the school in which I
> work from a schedule on a server.
>
> I could use the VBscript version but there are long delays if a machine
> is switched off - in Python I can thread the communication with
> individual machines (to achieve this in VBScript I have to call a new
> instance of w(c)script for each machine), effectively shutting them
> down in parallel.

This isn't a Python solution at all, but have you looked at PsTools
(http://www.sysinternals.com)? It includes a command to remotely shutdown a
machine including options to specify whether to log the user off, poweroff,
reboot, hibernate etc. There is also a timeout so you can give users a
chance to save their work (it displays a popup on their screen telling them
the system is shutting down). You could just spawn a bunch of psshutdown
processes off in parallel. It is free, although you cannot further
redistribute it.

PsTools also includes other programs which could be useful in a classroom
environment (useful for teachers, devastating if the pupils get their hands
on them and you don't have security set up right).

--
Duncan Booth                                             duncan@...
int month(char *p){return(124864/((p[0]+p[1]-p[2]&0x1f)+1)%12)["\5\x8\3"
"\6\7\xb\1\x9\xa\2\0\4"];} // Who said my code was obscure?
--
http://mail.python.org/mailman/listinfo/python-list

#122056 From: "Jason Tesser" <JTesser@...>
Date: Tue Nov 25, 2003 12:37 pm
Subject: RE: Web Authentication to AD
JTesser@...
Send Email Send Email
 
HI,

<snip>

> If it must run on Unix, you could probably let your web service run
> under Apache and use mod_ntlm for authentication.

That is an old project though with no work being done on it.  Plus it doesn't
do exactly what I am trying to do. I think the best thing for me to do is as
follows: I am just not sure how to do it all yet :-)

Maybe make a python web service talk use pam.  That should work as pam can
do the rest I think.  Maybe something with oldap.  There has to be a good way
in python to accomplish this.

<snip>
http://mail.python.org/mailman/listinfo/python-list

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

#122055 From: "Michel Claveau" <No.Spam.mc@...>
Date: Tue Nov 25, 2003 12:28 pm
Subject: Re: win32com (VBScript to Python) problem
No.Spam.mc@...
Send Email Send Email
 
Hi !

This code "reboot" the computer 'CPU01' (if rights are OK) :


import win32com.client
WMIService =
win32com.client.GetObject(r"winmgmts:{impersonationLevel=impersonate,(Shutdo
wn)}!\\CPU01\root\cimv2")

objs = WMIService.ExecQuery(r"Select * from Win32_OperatingSystem")
for obj in objs:
     obj.Reboot()




Perhaps this sample can help you ?

@-salutations
--
Michel Claveau
site : http://mclaveau.com



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

#122054 From: Gerhard Häring <gh@...>
Date: Tue Nov 25, 2003 12:25 pm
Subject: Re: Web Authentication to AD
gh@...
Send Email Send Email
 
Gerhard Häring wrote:
> Jason Tesser wrote:
>
>> Has nobody tried to do this kind of thing? [...]
>
> Not me. However, the easiest solution probably to use the integrated
> Windows authentication of IIS on win32.

If it must run on Unix, you could probably let your web service run
under Apache and use mod_ntlm for authentication.

A freshmeat.net search for ntlm might also provide useful software for
your task.

I haven't tried any of these yet, though.

-- Gerhard


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

#122053 From: "Michel Claveau/Hamster" <No.Spam.mc@...>
Date: Tue Nov 25, 2003 12:23 pm
Subject: Re: win32com (VBScript to Python) problem
No.Spam.mc@...
Send Email Send Email
 
Hi !

This code "reboot" the computer 'CPU01' (if rights are OK) :


import win32com.client
WMIService =
win32com.client.GetObject(r"winmgmts:{impersonationLevel=impersonate,(Shutdo
wn)}!\\CPU01\root\cimv2")

objs = WMIService.ExecQuery(r"Select * from Win32_OperatingSystem")
for obj in objs:
     obj.Reboot()




Perhaps this sample can help you ?

@-salutations
--
Michel Claveau
mél : http://cerbermail.com/?6J1TthIa8B
site : http://mclaveau.com
NG : news://news.zoo-logique.org/programmation.Paradox



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

#122052 From: "Michel Claveau/Hamster" <No.Spam.mc@...>
Date: Tue Nov 25, 2003 12:20 pm
Subject: Re: win32com (VBScript to Python) problem
No.Spam.mc@...
Send Email Send Email
 
Hi !

This code "reboot" the computer 'CPU01' (if rights are OK) :


import win32com.client
WMIService =
win32com.client.GetObject(r"winmgmts:{impersonationLevel=impersonate,(Shutdo
wn)}!\\CPU01\root\cimv2")

objs = WMIService.ExecQuery(r"Select * from Win32_OperatingSystem")
for obj in objs:
     obj.Reboot()




Perhaps this sample can help you ?

@-salutations
--
Michel Claveau
mél : http://cerbermail.com/?6J1TthIa8B
site : http://mclaveau.com
NG : news://news.zoo-logique.org/programmation.Paradox


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

#122051 From: "Jimmy Retzlaff" <jimmy@...>
Date: Tue Nov 25, 2003 12:18 pm
Subject: RE: import _winreg does not work. How do I fix?
jimmy@...
Send Email Send Email
 
John Sellers wrote:
> Miki Tebeka wrote:
> > There is no _winreg on cygwin, only on "true" win32 python.
> > If you must use cygwin you can either patch _winreg to work for you
or
> > use cygwin's regtool (try regtool --help)
>
> Sounds reasonable, but if what you say is true, I am surprised that
not
> all Python 2.3.2 releases are not equal.
>
> How good is your information?  Is it authorative?

While Miki's information may or may not be authorative, it does appear
to be true.

Python has different modules available on different platforms. See
http://www.python.org/doc/current/modindex.html for a list of modules.
The modules with one or more platforms in parenthesis next to them are
platform specific.

_winreg is documented as being a Windows specific module. As far as
Python is concerned, cygwin is a Unix platform, not a Windows platform.
As evidence of this try importing modules which the Python documentation
calls Unix specific and modules called Windows specific on cygwin Python
and on Windows Python:


Python 2.2.3 (#1, Jun 19 2003, 12:10:13)
[GCC 3.2 20020927 (prerelease)] on Cygwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import crypt
>>> crypt
<module 'crypt' from '/usr/lib/python2.2/lib-dynload/crypt.dll'>
>>> import _winreg
Traceback (most recent call last):
   File "<stdin>", line 1, in ?
ImportError: No module named _winreg


And on "true" Win32 Python:


Python 2.3.2 (#49, Oct  2 2003, 20:02:00) [MSC v.1200 32 bit (Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import _winreg
>>> _winreg
<module '_winreg' from 'C:\Python23\DLLs\_winreg.pyd'>
>>> import crypt
Traceback (most recent call last):
   File "<stdin>", line 1, in ?
ImportError: No module named crypt


If you don't like Miki's suggestion of using regtool, then you could run
win32 Python side-by-side with cygwin Python and use an IPC mechanism to
communicate between the two.

Jimmy


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

#122050 From: Gerhard Häring <gh@...>
Date: Tue Nov 25, 2003 12:17 pm
Subject: Re: Web Authentication to AD
gh@...
Send Email Send Email
 
Jason Tesser wrote:
> Has nobody tried to do this kind of thing? [...]

Not me. However, the easiest solution probably to use the integrated
Windows authentication of IIS on win32.

-- Gerhard


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

#122049 From: "Jason Tesser" <JTesser@...>
Date: Tue Nov 25, 2003 12:10 pm
Subject: RE: Web Authentication to AD
JTesser@...
Send Email Send Email
 
Has nobody tried to do this kind of thing?

-----Original Message-----
From: python-list-bounces+jtesser=nbbc.edu@...
[mailto:python-list-bounces+jtesser=nbbc.edu@...]On Behalf Of
Jason Tesser
Sent: Monday, November 24, 2003 7:00 AM
To: Python List (E-mail)
Subject: Web Authentication to AD


I would like to write a python web service that would take a username and
password entered on a
web form and authenticate to Active directory.  A few questions about this.

1. How can I do it :-)
2. I would like the script to be in the same server as the websites which is a
linux box.  So I need it to call active
directory on a M$ box.  If this is too hard could someone at least explain the
process if I make this a service
on the M$ box. Which I guess I can do if keeping it on the Linux box is too
much.
3.  I would like to expand the service so that I could check the computer the
user is on and not make them enter a
username and password if they are already logged in to the domain.  I huess I
would have to use Java Script for
this.  Any ideas here?

Thank you in advance.

Jason Tesser
Web/Multimedia Programmer
Northland Ministries Inc.
(715)324-6900 x3050


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

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

#122048 From: Alan Kennedy <alanmk@...>
Date: Tue Nov 25, 2003 11:59 am
Subject: Re: Execution state persistence for workflow application
alanmk@...
Send Email Send Email
 
[Serge Orlov]
>> The problem is that one day you will
>> have to upgrade your program and your last dumpexec won't be
>> compatible with your next loadexec(). You will have to separate
>> code from data to do it. So it means execution persistence is not
>> enough for real life use. Why not just use data persistence alone?

[Paolo Losi]
> In fact data persistence is not sufficient to stop and resume scripts
> in case, for example, system reboot.
> I do want my workflow scripts to resume exactly (and with the same
> globals/locals setup) where they left...
>
> The real alternative would be to define a new script language
> with standard constructs (for, while,...) but again... i don't want
> to reinvent the wheel.
>
> I do not seen execution persistence as an alternative to data
> persistence: I would need both.

You might want to investigate Stackless python, an excellent research
work which can save and resume execution state, to some degree. Try
the following google query

http://www.google.com/search?q=pickling+site%3Astackless.com

HTH,

--
alan kennedy
-----------------------------------------------------
check http headers here: http://xhaus.com/headers
email alan:              http://xhaus.com/mailto/alan
--
http://mail.python.org/mailman/listinfo/python-list

#122047 From: jjl@... (John J. Lee)
Date: Tue Nov 25, 2003 11:58 am
Subject: Re: rotor alternative?
jjl@...
Send Email Send Email
 
mlh@... (Magnus Lie Hetland) writes:

> In article <87smkitutw.fsf@...>, John J. Lee wrote:
[...]
> How about using rot13? At least it's build-in ;)

Built in to emacs, too, unfortunately (though I've admitted all this
probably doesn't matter, see my earlier post).


> Wasn't the Adobe encryption for eBooks (which Sklyarov was imprisoned
> for "cracking") something close to rot13?
[...]

That was XOR, I think.


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

#122046 From: "Peter Sparkes" <peter@...>
Date: Tue Nov 25, 2003 11:55 am
Subject: Running another application from within Python
peter@...
Send Email Send Email
 
Please, how do I run another application from within Python

Regards

Peter Sparkes


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

#122045 From: Michael Hudson <mwh@...>
Date: Tue Nov 25, 2003 11:47 am
Subject: Re: 'from __future__ import ...' overview
mwh@...
Send Email Send Email
 
Logan <logan@...> writes:

> Is there a list with all 'from __future__ import ...' statements
> (which lists all the statements, in which version of Python the
> feature was introduced and in which version of Python it will become
> the default behavior)?

Yes: in __future__.py :-)

Cheers,
mwh

--
   Lisp does badly because we refuse to lie.  When people ask us if
   we can solve insoluble problems we say that we can't, and because
   they expect us to lie to them, they find some other language
   where the truth is less respected.   -- Tim Bradshaw, comp.lang.lisp
--
http://mail.python.org/mailman/listinfo/python-list

#122044 From: Michael Hudson <mwh@...>
Date: Tue Nov 25, 2003 11:45 am
Subject: Re: Adding new methods at runtime to a class
mwh@...
Send Email Send Email
 
mis6@... (Michele Simionato) writes:

> I was thinking about an even more frightening possibility: changing the
> class of the stateful object! I.e. there would be a different class
> for each state (hopefully collected in a common hierarchy) and one
> would change the class of "self" according to some condition. This
> would automatically accomplish the change of the methods according
> to the state, and would give the additional benefit of inheritance
> (i.e. methods could call they supermethods quite easily).
>
> I haven't written anything yet, since I am not sure if it would be
> a good idea in practice, however I wonder if somebody ever tried it.
>
> The message is "We got a dynamic language: let use it!"

I *think* I'd rather change an attribute of the instance for each
state change and forward onto that:

     def move_state(self):
         self.state = State()

     def do_something_dependent_on_state(self):
         self.state.do_something()

Cheers,
mwh

--
   Premature optimization is the root of all evil.
        -- Donald E. Knuth, Structured Programming with goto Statements
--
http://mail.python.org/mailman/listinfo/python-list

#122043 From: Tim Howarth <tim@...>
Date: Tue Nov 25, 2003 11:38 am
Subject: Re: win32com (VBScript to Python) problem
tim@...
Send Email Send Email
 
In message <bpve3m$shg$1@...>
           "Rony Steelandt" <bucodi@...> wrote:

> Not knowing exactly what you want to do, just a question.
>
> Why use COM, shutdown is an exe so why not just execute it?

Using this method you can shutdown and poweroff (the 12 value) a
machine, shutdown.exe from the reskit leaves a machine at "You may now
switch off".


I want to use this to shutdown all machines in the school in which I
work from a schedule on a server.

I could use the VBscript version but there are long delays if a machine
is switched off - in Python I can thread the communication with
individual machines (to achieve this in VBScript I have to call a new
instance of w(c)script for each machine), effectively shutting them
down in parallel.

--
___
  |im    ---- ARM Powered ----
--
http://mail.python.org/mailman/listinfo/python-list

#122042 From: Duncan Booth <duncan@...>
Date: Tue Nov 25, 2003 11:31 am
Subject: Re: Parsing strings -> numbers
duncan@...
Send Email Send Email
 
tuanglen@... (Tuang) wrote in
news:df045d93.0311250127.67395ae@...:

>>>> locale.getdefaultlocale()
> ('en_US', 'cp1252')
>>>> locale.atoi("-12345")
> -12345
>
> Given the locale it thinks I have, it should be able to parse
> "-12,345" if it can handle formats containing thousands separators,
> but apparently it can't.
>
> If Python doesn't actually have its own parsing of formatted numbers,
> what's the preferred Python approach for taking taking data, perhaps
> formatted currencies such as "-$12,345.00" scraped off a Web page, and
> turning it into numerical data?
>

The problem is that by default the numeric locale is not set up to parse
those numbers. You have to set that up separately:

>>> import locale
>>> locale.getlocale(locale.LC_NUMERIC)
(None, None)
>>> locale.getlocale()
['English_United Kingdom', '1252']
>>> locale.setlocale(locale.LC_NUMERIC, "English")
'English_United States.1252'
>>> locale.atof('1,234')
1234.0
>>> locale.setlocale(locale.LC_NUMERIC, "French")
'French_France.1252'
>>> locale.atof('1,234')
1.234

Unless I've missed something, it doesn't support ignoring currency symbols
when parsing numbers, so you still can't handle "-$12,345.00" even if you
do set the numeric and monetary locales.

--
Duncan Booth                                             duncan@...
int month(char *p){return(124864/((p[0]+p[1]-p[2]&0x1f)+1)%12)["\5\x8\3"
"\6\7\xb\1\x9\xa\2\0\4"];} // Who said my code was obscure?
--
http://mail.python.org/mailman/listinfo/python-list

#122041 From: "Rony Steelandt" <bucodi@...>
Date: Tue Nov 25, 2003 11:27 am
Subject: Re: win32com (VBScript to Python) problem
bucodi@...
Send Email Send Email
 
Not knowing exactly what you want to do, just a question.

Why use COM, shutdown is an exe so why not just execute it?

Rony


"Tim Howarth" <tim@...> a écrit dans le message de news:
d715dc564c.tim@....
>
>
> I'm (very non expert) trying to use a snippet of VBScript (to shut down
> Windows workstations) converted to Python but have hit a problem.
>
>
> The VBScript below work fine;
>
>
>  pc="MyPC"
>
>  Set
oWMI=GetObject("winmgmts:{impersonationLevel=impersonate,(Shutdown)}!\\"_
>  & pc & "\root\cimv2")
>
>  Set colOperatingSystems = oWMI.ExecQuery("Select * from
Win32_OperatingSystem")
>
>  For Each obj in colOperatingSystems
>      obj.Win32shutdown 12
>  Next
>
>
>
> but my translation results in "'int' object is not callable" with the
> attempted call to Win32Shutdown.
>
> This is with Python 2.3.2 win32all 1.57 or Active Python 2.3.2
>
> print type(obj.Win32ShutDown)
> gives int
>
> print obj.Win32ShutDown
> gives 87 - the ASCII code of "W" - coincidentally ?
>
>
>
>
>  import win32com.client, sys
>
>
>  pc='MyPC'
>
>  oWMI =
>  win32com.client.GetObject(r"winmgmts:{impersonationLevel=impersonate,\
>  (Shutdown)}!\\" + pc + r"\root\cimv2")
>
>  colOperatingSystems = oWMI.ExecQuery(r"Select * from
Win32_OperatingSystem")
>
>  for obj in colOperatingSystems:
>      obj.Win32ShutDown(12)
>
>
>
>
> --
> ___
>  |im    ---- ARM Powered ----


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

#122040 From: Tim Howarth <tim@...>
Date: Tue Nov 25, 2003 11:16 am
Subject: win32com (VBScript to Python) problem
tim@...
Send Email Send Email
 
I'm (very non expert) trying to use a snippet of VBScript (to shut down
Windows workstations) converted to Python but have hit a problem.


The VBScript below work fine;


  pc="MyPC"

  Set oWMI=GetObject("winmgmts:{impersonationLevel=impersonate,(Shutdown)}!\\"_
  & pc & "\root\cimv2")

  Set colOperatingSystems = oWMI.ExecQuery("Select * from Win32_OperatingSystem")

  For Each obj in colOperatingSystems
      obj.Win32shutdown 12
  Next



but my translation results in "'int' object is not callable" with the
attempted call to Win32Shutdown.

This is with Python 2.3.2 win32all 1.57 or Active Python 2.3.2

print type(obj.Win32ShutDown)
gives int

print obj.Win32ShutDown
gives 87 - the ASCII code of "W" - coincidentally ?




  import win32com.client, sys


  pc='MyPC'

  oWMI =
  win32com.client.GetObject(r"winmgmts:{impersonationLevel=impersonate,\
  (Shutdown)}!\\" + pc + r"\root\cimv2")

  colOperatingSystems = oWMI.ExecQuery(r"Select * from Win32_OperatingSystem")

  for obj in colOperatingSystems:
      obj.Win32ShutDown(12)




--
___
  |im    ---- ARM Powered ----
--
http://mail.python.org/mailman/listinfo/python-list

#122039 From: Andrei <project5@...>
Date: Tue Nov 25, 2003 10:48 am
Subject: Re: String Regex problem
project5@...
Send Email Send Email
 
Skip Montanaro wrote on Mon, 24 Nov 2003 21:35:48 -0600:

>     >> Since I am very poor in regex, can someone show me how to do it using
>     >> a few examples?
>
<snip>
>     Don> http://kodos.sourceforge.net
>
> If you're a Mac Python person there's also Dinu Gherman's excellent
> RegexPlor:
>
>     http://starship.python.net/crew/gherman/RegexPlor.html
<snip>

I'm biased here, but Kiki (but http://project5.freezope.org/kiki) is
cross-platform and doesn't depend on Qt but on wxPy which is much easier
for Windows users.

Anyway, here's a regex I ripped out of my own code - you might want to
simplify it though:

"""Regex for finding URLs:
    URL's start with http(s)/ftp/news ((http)|(ftp)|(news))
    followed by ://
    then any number of non-whitespace characters including
    numbers, dots, forward slashes, commas, question marks,
    ampersands, equality signs, dashes, underscores and plusses,
    but ending in a non-dot and non-plus!

    Result:

(?:http|https|ftp|news)://(?:[@a-zA-Z0-9,/%:\&+#\?=\-_~;]+\.*)+[a-zA-Z0-9,/%:\&#\
\?=\-_]

    Tests:
       Plain old link: http://www.mail.yahoo.com.
       Containing numbers: ftp://bla.com/di~ng/co.rt,39,%93 or other
       Go to news://bl_a.com/?ha-h+a&query=tb for more info.
       A real link: <a href="http://x.com">http://x.com</a>.
       ftp://verylong.org/url/must/be/chopped/to/pieces/oritwontfit.html
(long one)
       <IMG src="http://b.com/image.gif" /> (a plain image tag)
       <a href=http://fixedlink.com/orginialinvalid.html>fixed</a> (original
invalid HTML)
       Link containing an anchor
<b>"http://myhomepage.com/index.html#01"</b>.
"""

--
Yours,

Andrei

=====
Mail address in header catches spam. Real contact info (decode with rot13):
cebwrpg5@.... Fcnz-serr! Cyrnfr qb abg hfr va choyvp cbfgf. V ernq
gur yvfg, fb gurer'f ab arrq gb PP.


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

#122038 From: steven.green3@... (S Green)
Date: Tue Nov 25, 2003 10:44 am
Subject: Shared Memory Module on Windows Platform
steven.green3@...
Send Email Send Email
 
Any one now of a module to access shared memory, written in python on
a windows platform? I now one exists for unix.


Cheers

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

Messages 122038 - 122067 of 122067   Newest  |  < Newer  |  Older >  |  Oldest
Advanced
Add to My Yahoo!      XML What's This?

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help