2011/8/22 守株待兔 <1248283...@qq.com>:
> from Tkinter import *
> fields = 'Name', 'Job', 'Pay'
>
> def fetch(event,entries):
> for entry in entries:
> print 'Input => "%s"' % entry.get() # get text
> print event.widget
>
>
> def makeform(root, fields):
> entries = []
> fo
On 08/18/2011 01:24 PM, Ethan Furman wrote:
> Alec Taylor wrote:
>> wow, people still use WordPerfect?
>
> Them's fightin' words right there! :)
>
> Yes, we still use Word Perfect, and will as long as it is available.
> The ability to see the codes in use (bold, margins, columns, etc) has so
>
from Tkinter import *
fields = 'Name', 'Job', 'Pay'
def fetch(event,entries):
for entry in entries:
print 'Input => "%s"' % entry.get() # get text
print event.widget
def makeform(root, fields):
entries = []
for field in fields:
row =
On 8/22/2011 11:51 AM, Matthew Brett wrote:
Hi,
I recently ran into this behavior:
import sys import apkg.subpkg del sys.modules['apkg'] import
apkg.subpkg as subpkg
Traceback (most recent call last): File "", line 1,
in AttributeError: 'module' object has no attribute 'subpkg'
where 'apkg'
On Aug 22, 9:39 am, Miki Tebeka wrote:
> HTH
Yes it helps, thank you!
-- Gnarlie
http://Gnarlodious.com
--
http://mail.python.org/mailman/listinfo/python-list
On Tue, 23 Aug 2011 10:55 am John O'Hagan wrote:
>> > # Untested
>> > class MySeq(object):
>> > methods_to_delegate = ('__getitem__', '__len__', ...)
>> > pitches = ... # make sure pitches is defined
>> > def __getattr__(self, name):
>> > if name in self.__class__.methods_to_d
On Mon, 22 Aug 2011 23:08:50 +1000
John O'Hagan wrote:
> On Mon, 22 Aug 2011 15:27:36 +1000
> Steven D'Aprano wrote:
[..]
> > Looks like a call for (semi-)automatic delegation!
> >
> > Try something like this:
> >
> >
> > # Untested
> > class MySeq(object):
> > methods_to_delegate = ('__g
On Mon, Aug 22, 2011 at 5:17 PM, Yingjie Lin wrote:
> Hi Python users,
>
> I have a question about the instance of closeable_response in module
> Mechanize.
>
> from mechanize import ParseResponse, urlopen
> url = "http://wwwsearch.sourceforge.net/mechanize/example.html";
> r
Hi Python users,
I have a question about the instance of closeable_response in module Mechanize.
from mechanize import ParseResponse, urlopen
url = "http://wwwsearch.sourceforge.net/mechanize/example.html";
r = urlopen(url)
forms = ParseResponse(r, backwards_compat
I'm looking for comments and/or URLs to discussions on this topic.
I use my own MVC system. A component of this system generates
documentation from python docstrings. Of course this system also
comprises many non-python filetypes : css, html, txt, js, xml etc.
Views, which are txt or html files ca
On 22Aug2011 04:29, Tomas Lid�n wrote:
| On 22 Aug, 12:06, Cameron Simpson wrote:
| > It would not surprise me if the order was related to the order a scan of
| > the system interfaces yields information, and I would imagine that may
| > be influenced by the order in which the interfaces were ini
On Mon, Aug 22, 2011 at 12:14 PM, Matthew Brett wrote:
> Yes, sorry, I should have mentioned that I explored these kind of
> variations.
>
> I think I see that there isn't an obvious way for del sys.modules['apkg']
> to know to delete or modify 'apkg.subpkg', because sys.modules is just a
> dict.
Heh, of course, I forgot the setuptools-git extension to make
"include_package_data=True" work, so this release was pretty useless,
other than the docs on packages.python.org/testfixtures ;-)
Anyway, 3.4.1 has now been released which fixes this!
cheers,
Chris
On 17/08/2011 23:37, Chris Withe
Several people have been hacking away on this computer we are testing
on, so I'm not sure what settings -- other than all of them -- have
been messed with, but popen("time ...") seems to work, but system("time
...") does not. I'm going to restore the machine to its original state
and see what
On Sun, 21 Aug 2011 23:37:42 -0700, Tomas Lidén wrote:
> In what order are the addresses returned by socket.gethostbyname_ex()?
>
> We know that gethostbyname() is indeterministic but hope that
> gethostbyname_ex() has a specified order.
It doesn't. In fact, the order of the IP addresses may hav
On Monday, August 22, 2011 12:06:44 PM UTC-7, Stephen Hansen wrote:
> On 8/22/11 11:51 AM, Matthew Brett wrote:
> > Hi,
> >
> > I recently ran into this behavior:
> >
> import sys
> import apkg.subpkg
> del sys.modules['apkg']
> import apkg.subpkg as subpkg
> > Traceback (most
On 8/22/11 11:51 AM, Matthew Brett wrote:
> Hi,
>
> I recently ran into this behavior:
>
import sys
import apkg.subpkg
del sys.modules['apkg']
import apkg.subpkg as subpkg
> Traceback (most recent call last):
> File "", line 1, in
> AttributeError: 'module' object has no at
Hi,
I recently ran into this behavior:
>>> import sys
>>> import apkg.subpkg
>>> del sys.modules['apkg']
>>> import apkg.subpkg as subpkg
Traceback (most recent call last):
File "", line 1, in
AttributeError: 'module' object has no attribute 'subpkg'
where 'apkg' and 'subpkg' comprise empty _
Hi!
Yup. I've been from one end of that article to the other with no luck.
It must be something to do with the shell that the system() call
creates not having permission to set the time, but I can't figure out
how to get around it. Just using the GUI the account where the user is
running th
John O'Hagan wrote:
> On Mon, 22 Aug 2011 11:32:18 +0200
> Peter Otten <__pete...@web.de> wrote:
>
>> John O'Hagan wrote:
>>
>> > I have a class like this:
>> >
>> > class MySeq():
>> > def __init__(self, *seq, c=12):
>> > self.__c = c
>> > self.__pc = sorted(set([i % __c fo
Hi,
I'm trying to use the apt_pkg module but it seems to me really hard and
i didn't find samples for what i'm trying to do.
Actually it should be simple :
- Installing a package like 'aptitude install mypackage'
- test if a package is already installed
Thank you all for your help,
Sam
--
htt
On Aug 20, 4:36 am, Phil Thompson wrote:
> On Fri, 19 Aug 2011 14:32:12 -0700 (PDT), Edgar Fuentes
>
>
>
>
>
>
>
>
>
> wrote:
> > On Aug 19, 4:21 pm, Carl Banks wrote:
> >> On Friday, August 19, 2011 12:55:40 PM UTC-7, Edgar Fuentes wrote:
> >> > On Aug 19, 1:56 pm, Phil Thompson
> >> > wrote:
If memory serves, you need to enable a specific privilege to
set the time in Vista+. Just a moment...
Have a look here:
http://support.microsoft.com/kb/300022
and look for SeSystemtimePrivilege generally. Sorry; I'm
a bit rushed at the moment. Feel free to post back if
that isn't clear
TJG
On 8/22/2011 7:39 AM, Tomas Lidén wrote:
On 22 Aug, 13:26, Roy Smith wrote:
In article
<356978ef-e9c1-48fd-bb87-849fe8e27...@p5g2000vbl.googlegroups.com>,
Tomas Lidén wrote:
In what order are the addresses returned by socket.gethostbyname_ex()?
We know that gethostbyname() is indetermin
On 8/22/2011 9:35 AM Emile van Sebille said...
On 8/22/2011 2:55 AM Richard D. Moores said...
Coincidence?
Naaa.. I just ran it twice -- once per ... _this_ is coincidence. :)
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\Documents and Settings\Emile>pyt
Permissions!
We're running in an account as an administrator (the only account on
the laptops) and the program just calls system(time ) and
system(date ) after reading it from a connected GPS receiver. I've
fiddled with everything I could find in the registry and with the
secpol.msc
On 8/22/2011 2:55 AM Richard D. Moores said...
I couldn't resist giving it a try. Using Python 3.2.1 on a 64-bit
Windows 7 machine with a 2.60 gigahertz AMD Athlon II X4 620
processor, I did 18 tests, alternating between n=n+1 and n+=1 (so 9
each).
The fastest for n+=1 was
C:\Windows\System32>
Tomas Lidén wrote:
> In this particular case we have a host with several connections (LAN,
> WIFI, VmWare adapters etc). When using gethostbyname() we got a VmWare
> adapter but we wanted to get the LAN (or the "best" connection to our
> server).
Define "best" connection.
If I tell you that my
On Mon, Aug 22, 2011 at 4:41 PM, Stephen Hansen
wrote:
> Not exactly. Python has two somewhat different object models, "old style
> classes" and "new style classes", with slightly different behavior and
> internal structure.
>
> class Foo: pass
>
> is an "old-style class", dated back to Python's
On 8/22/11 3:02 AM, Amirouche B. wrote:
> A) type vs object
> -
>
> 1) object is the base object, it has no bases : len(object.__bases__)
> == 0
> 2) every object in python inherit object :
> any_object_except_object.__bases__[-1] is object
Not exactly. Python has two somewhat dif
> Is there an easy way to limit updates to
> ONLY variables in the allowedVariables dict?
allowedVariables = ['eeny', 'meeny', 'miny', 'mo']
form = cgi.FieldStorage()
safe_input = dict((key, form.getvalue(key)) for key in allowedVariables)
> And in addition, maybe return an error so the attacke
In my last post I learned of the necessity of filtering CGI input, so
what I want to do is set a dict of allowable variable names:
allowedVariables = {'eeny':None, 'meeny':None, 'miny':None, 'mo':None}
# Set up a FieldStorage object:
import cgi
inputVariables = cgi.FieldStorage()
for name, value
On Aug 19, 11:06 pm, Javier wrote:
> Never used it, but I think you can try this:
>
> Pexpect - a Pure Python Expect-like module
> Pexpect is a pure Python Expect-like module. Pexpect makes
> Python...www.noah.org/python/pexpect/
>
>
>
>
>
>
>
> lzlu123 wrote:
> > I have an instrument that has a
On Aug 19, 6:38 pm, aspineux wrote:
> On Aug 19, 5:00 pm, lzlu123 wrote:
>
>
>
>
>
>
>
>
>
> > I have an instrument that has a RS232 type serial comm port and I need
> > to connect to and control. I use Python 3.2 in Windows XP, plus
> > pySerial module. I have a problem when I execute a script c
On Mon, 22 Aug 2011 11:32:18 +0200
Peter Otten <__pete...@web.de> wrote:
> John O'Hagan wrote:
>
> > I have a class like this:
> >
> > class MySeq():
> > def __init__(self, *seq, c=12):
> > self.__c = c
> > self.__pc = sorted(set([i % __c for i in seq]))
> > self.orde
Sorry, if I missed some further specification in the earlier thread or
if the following is oversimplification of the original problem (using
3 numbers instead of 32),
would something like the following work for your data?
>>> import re
>>> data = """2.201000e+01 2.15e+01 2.199000e+01 : (instan
On 22/08/2011 14:21, aba ca wrote:
How can I send to cmd.exe "netstat -an"?
Look at the subprocess module, and especially the .check_output
convenience function:
http://docs.python.org/library/subprocess.html#subprocess.check_output
TJG
--
http://mail.python.org/mailman/listinfo/python-list
Hi all!
How can I send to cmd.exe "netstat -an"?
Thanks.
--
http://mail.python.org/mailman/listinfo/python-list
Hyun-su wrote:
> I have a file which is 3D data ([pixel_x, pixel_y, pixel_z])
>
> I want to plot and write into other file as 1 dimension ([:, y_cut,
> z_cut])
>
> How can I do it?
I'd write a loop along these lines:
with open(outputfile, 'w') as o:
for pixel_x, pixel_y, pixel_z in inpu
On 2011-08-22, Peter Otten <__pete...@web.de> wrote:
> Ya??ar Arabac?? wrote:
>> I originally posted this question on stackoverflow, you can find it here:
>> http://stackoverflow.com/q/7133350/886669
>>
>> I just want people check what I am doing and express their opinion about
>> the thing I am d
On Mon, 22 Aug 2011 15:27:36 +1000
Steven D'Aprano wrote:
> On Mon, 22 Aug 2011 03:04 pm John O'Hagan wrote:
>
> > The "pitches" attribute represents the instances and as such I found
> > myself adding a lot of methods like:
> >
> > def __getitem__(self, index):
> > return self.pitches[inde
Chris, thank you for the information. Focusing on Active Directory, I reviewed
the info at the following site:
http://technet.microsoft.com/en-us/library/cc961766.aspx
Based on this, I need to find a module that implements the LDAP APIs. By
default, it does not appear that Python can speak th
przemol...@poczta.fm wrote:
> How about this format:
> ',1'
> (the local zero is also not printed)
>
> (I know this is strange but I need compatibility with local requirements)
I believe you have to do it yourself:
>>> locale.format("%f", 0.123)
'0,123000'
>>> locale.format("%f", 0.123).strip("
Yaşar Arabacı wrote:
> I originally posted this question on stackoverflow, you can find it here:
> http://stackoverflow.com/q/7133350/886669
>
> I just want people check what I am doing and express their opinion about
> the thing I am doing is acceptable, or are there some expects of it that
> co
OK - thank you all for your contributions.
/T
--
http://mail.python.org/mailman/listinfo/python-list
Am 22.08.2011 13:37, schrieb Roy Smith:
In article
,
Tomas Lidén wrote:
A cross-platform deterministic order would be excellent for us.
"A cross-platform deterministic X would be excellent" is a true
statement for almost any value of X. Many people have wasted much of
their lives trying to
In article
<034ff4bf-e3e4-47ff-9a6c-195412431...@s20g2000yql.googlegroups.com>,
Tomas Lidén wrote:
> Basically I was asking about the contract for this method.. hoping
> that it is deterministic.
The contract for socket.gethostbyname_ex() is described at
http://docs.python.org/library/socket.
Amirouche B. wrote:
> A) type vs object
> -
>
> 1) object is the base object, it has no bases : len(object.__bases__)
> == 0
Correct, but for reference, a more direct test is:
object.__bases__ == ()
(no need for len).
> 2) every object in python inherit object :
> any_object_
Hi,
I have a file which is 3D data ([pixel_x, pixel_y, pixel_z])
I want to plot and write into other file as 1 dimension ([:, y_cut,
z_cut])
How can I do it?
--
http://mail.python.org/mailman/listinfo/python-list
In article
,
Tomas Lidén wrote:
> In this particular case we have a host with several connections (LAN,
> WIFI, VmWare adapters etc). When using gethostbyname() we got a VmWare
> adapter but we wanted to get the LAN (or the "best" connection to our
> server).
Figuring out which is the best con
On 22 Aug, 13:26, Roy Smith wrote:
> In article
> <356978ef-e9c1-48fd-bb87-849fe8e27...@p5g2000vbl.googlegroups.com>,
> Tomas Lidén wrote:
>
> > In what order are the addresses returned by socket.gethostbyname_ex()?
>
> > We know that gethostbyname() is indeterministic but hope that
> > gethostb
On 22 Aug, 12:36, Chris Angelico wrote:
>
> Explicit is better than implicit. Instead of using the order, have a
> config file that chooses the one(s) you want by name or IP address. Of
> course, if you're on Unix/Linux, you can use the interface name (eth0,
> eth1, etc) with a fair degree of reli
On 22 Aug, 12:06, Cameron Simpson wrote:
>
> It would not surprise me if the order was related to the order a scan of
> the system interfaces yields information, and I would imagine that may
> be influenced by the order in which the interfaces were initialised.
>
> So getting the LAN first may mer
In article
<356978ef-e9c1-48fd-bb87-849fe8e27...@p5g2000vbl.googlegroups.com>,
Tomas Lidén wrote:
> In what order are the addresses returned by socket.gethostbyname_ex()?
>
> We know that gethostbyname() is indeterministic but hope that
> gethostbyname_ex() has a specified order.
Why would yo
On Mon, Aug 22, 2011 at 11:48:46AM +0200, Peter Otten wrote:
> przemol...@poczta.fm wrote:
>
> import locale
> locale.setlocale(locale.LC_ALL, "pl_PL")
> > 'pl_PL'
> i=0.20
> j=0.25
> locale.format('%f', i)
> > '0,20'
> locale.format('%f', j)
> > '0,25'
> >
>
Thanks Chris!
I tried using "!" instead of "run". It works but with a significant
performance penalty.
Best regards,
Johan
On Fri, Aug 19, 2011 at 5:11 PM, Chris Rebert wrote:
> On Fri, Aug 19, 2011 at 6:00 AM, Johan Ekh wrote:
> > Hi all,
> > I have a script "myscript.py" located in "/usr/lo
On Mon, Aug 22, 2011 at 11:48:46AM +0200, Peter Otten wrote:
> przemol...@poczta.fm wrote:
>
> import locale
> locale.setlocale(locale.LC_ALL, "pl_PL")
> > 'pl_PL'
> i=0.20
> j=0.25
> locale.format('%f', i)
> > '0,20'
> locale.format('%f', j)
> > '0,25'
> >
>
przemol...@poczta.fm writes:
> Hello,
>
import locale
locale.setlocale(locale.LC_ALL, "pl_PL")
> 'pl_PL'
i=0.20
j=0.25
locale.format('%f', i)
> '0,20'
locale.format('%f', j)
> '0,25'
>
> I need to print the numbers in the following format:
> '0,2' (i)
> '0,25'
On Mon, Aug 22, 2011 at 11:06 AM, Cameron Simpson wrote:
> What if you queried your routing table instead? Usually there's just one
> default route, and hopefully it would be configured to use the "best"
> interface.
>
I wouldn't necessarily trust even this, on Windows. I've lately had
the most i
On 22Aug2011 02:06, Tomas Lid�n wrote:
| On 22 Aug, 10:15, Steven D'Aprano wrote:
| > On Mon, 22 Aug 2011 04:37 pm Tomas Lidén wrote:
| > > In what order are the addresses returned by socket.gethostbyname_ex()?
| >
| > > We know that gethostbyname() is indeterministic but hope that
| > > gethostb
I'm learning a bit of python internals lately and I'm trying to figure
out the
relationship between type, objects, class, callables and
__getattribute__ resolution.
While understanding Python mechanics/concepts, I'm trying to figure
how it
translates in CPython. This post is Python centric. Questi
On Sun, Aug 21, 2011 at 18:12, Steven D'Aprano
wrote:
> But really, we're talking about tiny differences in speed. Such trivial
> differences are at, or beyond, the limit of what can realistically be
> measured on a noisy PC running multiple processes (pretty much all PCs
> these days). Here are
przemol...@poczta.fm wrote:
import locale
locale.setlocale(locale.LC_ALL, "pl_PL")
> 'pl_PL'
i=0.20
j=0.25
locale.format('%f', i)
> '0,20'
locale.format('%f', j)
> '0,25'
>
> I need to print the numbers in the following format:
> '0,2' (i)
> '0,25'(j)
Hello,
>>> import locale
>>> locale.setlocale(locale.LC_ALL, "pl_PL")
'pl_PL'
>>> i=0.20
>>> j=0.25
>>> locale.format('%f', i)
'0,20'
>>> locale.format('%f', j)
'0,25'
I need to print the numbers in the following format:
'0,2' (i)
'0,25' (j)
So the last trailing zeros are not printed.
John O'Hagan wrote:
> I have a class like this:
>
> class MySeq():
> def __init__(self, *seq, c=12):
> self.__c = c
> self.__pc = sorted(set([i % __c for i in seq]))
> self.order = ([[self.__pc.index(i % __c), i // __c] for i in seq])
> #other calculated attrib
Hi,
I originally posted this question on stackoverflow, you can find it here:
http://stackoverflow.com/q/7133350/886669
I just want people check what I am doing and express their opinion about the
thing I am doing is acceptable, or are there some expects of it that could
change.
--
http://mail.p
On 22 Aug, 10:15, Steven D'Aprano wrote:
> On Mon, 22 Aug 2011 04:37 pm Tomas Lidén wrote:
>
> > In what order are the addresses returned by socket.gethostbyname_ex()?
>
> > We know that gethostbyname() is indeterministic but hope that
> > gethostbyname_ex() has a specified order.
>
> Did you want
On Mon, 22 Aug 2011 04:37 pm Tomas Lidén wrote:
> In what order are the addresses returned by socket.gethostbyname_ex()?
>
> We know that gethostbyname() is indeterministic but hope that
> gethostbyname_ex() has a specified order.
Did you want a particular order, or just any deterministic order?
On 21 août, 18:31, Emile van Sebille wrote:
> On 8/18/2011 5:02 AM Makiavelik said...
>
> > Hi,
> > Here is a sample code that reproduces the issue :
>
> Not really 'sample' enough to allow others to investigate...
>
> ImportError: No module namedgobject
> ImportError: No module nameddbus
> Import
69 matches
Mail list logo