xample of why you would not want to clean up after a
failed operation?
I've been trying to follow along, and I don't get it either. I guess
that makes me at least the third person that doesn't understand what
you're trying to get across.
--
Jerry
--
http://mail.python.org/mailman/listinfo/python-list
simple GUI automation with
pywinauto. The homepage appears to be: http://pywinauto.pbworks.com
which has installation instructions and a FAQ. You might also find
this demo useful:
http://showmedo.com/videotutorials/video?name=UsingpyWinAutoToControlAWindowsApplication
--
Jerry
--
http://mail.python.org/mailman/listinfo/python-list
> Well that link is broken so we will never know what greg said?
I think that's referring to this email:
http://mail.python.org/pipermail/python-dev/2000-October/010046.html
--
Jerry
--
http://mail.python.org/mailman/listinfo/python-list
b code)
>
For those of us who don't know Matlab, what does that code do?
--
Jerry
--
http://mail.python.org/mailman/listinfo/python-list
.org/view/python/tags/r32rc1/Lib/tkinter/simpledialog.py?view=markup
--
Jerry
--
http://mail.python.org/mailman/listinfo/python-list
ou show on the mailing list
to the problem!
Go to http://bugs.python.org
On the left hand side, there's a link to the search page (listed just below
"Issues"). Click that.
Find the list box labeled "Components" and select "Tkinter" from the drop
down.
Click Search
really isn't difficult, but you don't seem to be willing to do it. Until
you do, all you're doing is ranting, not helping.
--
Jerry
--
http://mail.python.org/mailman/listinfo/python-list
I know which one I would prefer.
--
Jerry
--
http://mail.python.org/mailman/listinfo/python-list
r(x, '__enter__'):
return false
with open('somefile') as x:
do_something()
--
Jerry
--
http://mail.python.org/mailman/listinfo/python-list
tion.
>
>
I'm sorry, I completely misunderstood your question. I thought you were
asking how you could tell if something provided a context manager. Based on
the PEP[1], I don't see any generic way to tell if you are within a context
manager.
1: http://www.python.org/
te the table, but not populate any
data? If that's the case, you probably need to call commit() after
you do your inserts.
I'm not familiar with the MySQLDB module in particular, but python
database adapters typically do not autocommit, unless you explicitly
ask for that behavior.
--
r source or destination network
drives? What does sys.getfilesystemencoding() say the encoding of
your filesystem is?
--
Jerry
--
http://mail.python.org/mailman/listinfo/python-list
On Wed, Apr 14, 2010 at 9:03 PM, Dave W. wrote:
> I thought I could get away with import print_function from __future__
> (see example code below), but my re-pointed print function never gets
> called.
-snip-
> def __enter__(self):
> print = self.printhook
That redefines the print fun
csv.writer(o, quoting=csv.QUOTE_NONNUMERIC)
w.writerow([10, 10.00, d, "10"])
print(o.getvalue())
>>>
10,10.0,10.00,"10"
That's an int, a float, a Decimal and a string, all of which appear to
be formatted as I would expect.
--
Jerry
--
http://mail.python.org/mailman/listinfo/python-list
n
> additional destroy_has_been_called attribute?
It's a documented feature:
http://docs.python.org/reference/datamodel.html#new-style-special-lookup
I'm not aware of a way to get around it, so I think you'll need to
fall back to checking a flag in the class's __del__ method.
--
Jerry
--
ht
ite a few python versions (since 2.2 maybe?), and has become the
default in python 3.
If you need to do integer division, you would use the // operator:
>>> long1 // long2
0L
Hope that helps.
--
Jerry
--
http://mail.python.org/mailman/listinfo/python-list
', 3: 'three'}
for k in d.keys():
if d[k] == 'two':
d.pop(k)
--
Jerry
--
http://mail.python.org/mailman/listinfo/python-list
instead of the front. So slicing the last
character from the string would be:
word[-1:]
--
Jerry
--
http://mail.python.org/mailman/listinfo/python-list
os.path.isfile() and os.path.isdir()
See http://docs.python.org/library/os.path.html for details.
--
Jerry
--
http://mail.python.org/mailman/listinfo/python-list
o me that if
you're setting the locale with locale.setlocale(), you should get the
encoding from locale.getlocale()[1].
You're not really interested in the system's default encoding at this
point, you're interested in the encoding of the locale you've
explicitly set.
supposed to represent. I also moved the
convert-to-string-and-sum-the-digits logic into a single generator
expression that's passed to the builtin sum function. Oh, and I tried
to use slightly more expressive variable names.
--
Jerry
--
http://mail.python.org/mailman/listinfo/python-list
On Wed, May 19, 2010 at 4:25 PM, superpollo wrote:
> Jerry Hill ha scritto:
>> sumofdigits = sum(int(char) for char in str(testval))
>
> this line gives me this:
>
> TypeError: 'int' object is not callable
>
> is it some new feature in >2.5 ?
No, s
ow the full
> context, but it seems to me that compile can deal with the lack of
> newline.
The original example was:
compile("for i in [1,2,3]:\n pass\n#end", "test_file.py", "exec")
Bug 1184112 is only triggered with an indented block followed by a
comment with no newline following the comment.
--
Jerry
--
http://mail.python.org/mailman/listinfo/python-list
k
around it. You can either append a newline to the end of any source
snippets that you are exec-ing, or if you're writing the code snippets
that are being exec-ed yourself, don't write them in such a way that
they trigger the bug.
--
Jerry
--
http://mail.python.org/mailman/listinfo/python-list
pened in this machine that
> destroyed my working python apps...?
>
My guess is that you have a file named decimal.py (and/or decimal.pyc) in
your working directory, which is shadowing the standard library's decimal
module.
--
Jerry
--
http://mail.python.org/mailman/listinfo/python-list
or call up individual items from the
class, for example:
print users['jro']['name'], users['jro']['secnum'], users['jro']['groups']
or
for keys in users:
print users[keys]['name']
for group in users[keys]['groups']:
print group
etc.
Thanks in advance,
jerry
--
http://mail.python.org/mailman/listinfo/python-list
> On 06/22/2010 12:05 PM, Jerry Rocteur wrote:
>> Sorry for the long mail but I've been searching the web for days for how to
>> do this.. I see that possibilities using
>> shelve or pickle but I don't want to do this (The source of the data changes
>> const
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> On 06/22/2010 01:32 PM, Jerry Rocteur wrote:
>> My input is NOT CSV, I used this format to try and make the question
>> shorter. Although I could create a CSV file,
>> I'd
>> like to learn how to code a
> On Tue, Jun 22, 2010 at 9:32 PM, Jerry Rocteur wrote:
> If you were able to ask us perhaps a more specific question
> and describe your problem a little more concisely perhaps
> I (and we) might have a bit more to offer you.
I have a dictionary:
users[key] = {'u
> On Tue, Jun 22, 2010 at 9:32 PM, Jerry Rocteur wrote:
> If you were able to ask us perhaps a more specific question
> and describe your problem a little more concisely perhaps
> I (and we) might have a bit more to offer you.
I have a dictionary:
users[key] = {'u
> On Tue, Jun 22, 2010 at 9:32 PM, Jerry Rocteur wrote:
> If you were able to ask us perhaps a more specific question
> and describe your problem a little more concisely perhaps
> I (and we) might have a bit more to offer you.
I have a dictionary:
users[key] = {'u
> On Tue, Jun 22, 2010 at 9:32 PM, Jerry Rocteur wrote:
> If you were able to ask us perhaps a more specific question
> and describe your problem a little more concisely perhaps
> I (and we) might have a bit more to offer you.
I have a dictionary:
users[key] = {'u
ted.
> >
Take a look at Python for Unix and Linux System Administration:
http://www.amazon.com/Python-Unix-Linux-System-Administration/dp/0596515820
I quite like the book, I learned about Ipython from this book and I'm quite
glad I did!
Jerry
--
http://mail.python.org/mailman/listinfo/python-list
to solve the
> problem.
Use the __import__ function (
http://docs.python.org/library/functions.html#__import__ ), like this:
user_module = __import__("abdc")
user_module.do_stuff()
--
Jerry
--
http://mail.python.org/mailman/listinfo/python-list
m/recipes/134892/
--
Jerry
--
http://mail.python.org/mailman/listinfo/python-list
question from the first email in this thread,
that should pretty strongly warn you that shutil.copy2 is not going to
do what you want. Not being a mac user myself, I don't know what the
right way to accomplish what you want is, though.
--
Jerry
--
http://mail.python.org/mailman/listinfo/python-list
e a for loop, like this:
for idx,item in enumerate(my_list_of_dicts):
item['position'] = idx
Is there a particular reason you want to do this with a list
comprehension? Using a list comp means you're going to create an
extra copy of your 10 million item list, just so you can ad
On Fri, Jul 17, 2009 at 11:09 AM, MRAB wrote:
> Python did always have True and False.
Only if "always" means "since python 2.2.1".
See: http://www.python.org/doc/2.3/whatsnew/section-bool.html and
http://www.python.org/dev/peps/pep-0285/ for details.
--
Jerry
--
ting function, and I don't
think that floats (or Decimal.Decimal objects) take locale into
account when you do that.
--
Jerry
--
http://mail.python.org/mailman/listinfo/python-list
he database server. I'm not sure
what the defaults are, but here at work we have DB/2 and Oracle
servers that are case sensitive, and at least one MSSQL server that is
not.
--
Jerry
--
http://mail.python.org/mailman/listinfo/python-list
/docs.python.org/library/stdtypes.html#string-formatting )
For example:
>>> from math import pi
>>> pi
3.1415926535897931
>>> "%0.3f" % pi
'3.142'
If you need it as a function, you could do something like this:
>>> def num2str(num, precision)
e first part of your
message, you might find something of use in the functools module,
particularly functools.partial [3].
1: http://docs.python.org/tutorial/controlflow.html#lambda-forms
2: http://docs.python.org/reference/simple_stmts.html
3: http://docs.python.org/library/functools.html#functools.partial
--
Jerry
--
http://mail.python.org/mailman/listinfo/python-list
odules directory.
You have a module named struct.py (or strucy.pyc) that is shadowing
the builtin struct module.
--
Jerry
--
http://mail.python.org/mailman/listinfo/python-list
?? Doesn't seem to work.
I'm not very familiar with pywinauto myself, but a quick look through
the docs says that the application looks for a window or dialog with a
"similar" name to what you put there. So, what does the title bar of
the window opened by AM.exe say
On Fri, Sep 11, 2009 at 3:31 PM, Doran, Harold wrote:
> Thanks, Jerry. Tried that, as well as various other possible names to no
> avail.
You'll need to dig into the documentation then, probably starting in
one of these two places:
http://pywinauto.openqa.org/howt
tml
>>
>> http://twistedmatrix.com/projects/conch/documentation/examples/ (the
>> insults section)
>
> what`s with all the `insult` strings? - gimmick?
I think that 'insults' is twisted's replacement for curses.
--
Jerry
--
http://mail.python.org/mailman/listinfo/python-list
(str(i))
sys.stdout.write('\n')
That allows you to bypass any of the behavior of the print builtin
that you don't want.
--
Jerry
--
http://mail.python.org/mailman/listinfo/python-list
ternal
dictionary of all of the objects in the scene.
--
Jerry
--
http://mail.python.org/mailman/listinfo/python-list
l last):
> File "", line 1, in ?
> AttributeError: 'module' object has no attribute 'rand
>
> Please advise thanks.
You have a file named random.py (and/or random.pyc) that is shadowing
the built in module. Rename it.
if you have trouble finding it, you can do the following:
import random
print random.__file__
--
Jerry
--
http://mail.python.org/mailman/listinfo/python-list
nce to making promises
about time complexity in the official docs, since that would make
those numbers part of the language, and thus binding on other
implementations.
--
Jerry
--
http://mail.python.org/mailman/listinfo/python-list
ubject, so maybe it's something that would
be worth revisiting, assuming someone wants to write the doc change.
--
Jerry
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
I want to define the relationship for my users and their groups with
declarative style (so that the relating model can inherit Timestamp
mixin and Tablename mixin):
class User(DeclarativeBase, Tablename, TimestampMixin):
'''User avatar is named after its id.
A user may be a student or
lden.me.uk/python/wmi/index.html
as well as the pywin32 module: http://sourceforge.net/projects/pywin32/
IIRC, there's been quite a bit of discussion about inventorying
installed software on the pywin32 mailing list:
http://mail.python.org/mailman/listinfo/python-win32
--
Jerry
--
http://mail.p
on that does this ?
http://stackoverflow.com/questions/35817/whats-the-best-way-to-escape-ossystem-calls-in-python
seems to cover most of the possibilities.
Particularly, do you really need shell=True? If not, you can just
call Popen([command, path], stdout=PIPE, stderr=PIPE) and not worry
about it.
Hi,
Having the following python code:
import locale
import re
locale.setlocale(locale.LC_ALL, 'zh_CN.utf8')
re.findall('(?uL)\s+', u'\u2001\u3000\x20', re.U|re.L)
re.findall('\s+', u'\u2001\u3000\x20', re.U|re.L)
re.findall('(?uL)\s+', u'\u2001\u3000\x20')
I was wondering why doesn't it find
between processes both locally and remotely, with an
interface very similar to the threading module.
http://docs.python.org/library/multiprocessing.html
Or perhaps pyro? http://www.xs4all.nl/~irmen/pyro3/manual/1-intro.html
--
Jerry
--
http://mail.python.org/mailman/listinfo/python-list
able to override how your application responds to
those messages to dock the way you want to. It'll probably take some
experimentation, though.
--
Jerry
--
http://mail.python.org/mailman/listinfo/python-list
.5]'
>>>> ({'', 1}.items())
> Traceback (most recent call last):
> File "", line 1, in
> AttributeError: 'set' object has no attribute 'items'
I don't see anything in the docs that indicates that set objects have
a .items()
h -v or -vv?
Like this:
sudo python -v -c "from gnuradio import rfid
--
Jerry
--
http://mail.python.org/mailman/listinfo/python-list
On Tue, Nov 2, 2010 at 3:33 PM, Ben Ahrens wrote:
> Jerry, thanks for the reply, I was swamped with other things for the
> better part of a week.. Anyway, I tried using the verbose flag when
> attempting the import. I didn't see anything that meant anything to
> me, b
buteError: 'NoneType' object has no attribute 'relationship'
> ---
>
> I'm leaving out all the supporting code deliberately.
Perhaps request.account is being mutated in another thread?
--
Jerry
--
http://mail.python.org/mailman/listinfo/python-list
search results,
Google does a fine job of answering python questions, at least when
you already know the key phrase to look for.
--
Jerry
--
https://mail.python.org/mailman/listinfo/python-list
thing to end up mixed in with the desired results. It goes
on in that vein out to page 11 or so, at which point things seem to
devolve a bit.
I'd be totally sympathetic with your plight if you didn't know the key
phrase 'dict comprehension' to find all of that information. I
efaultdict
frequency = defaultdict(int)
...
...
if word1 == word:
frequency[word] += 1
The defaultdict takes care of the special case for you. If the value is
missing, it's defaulted to 0.
--
Jerry
--
https://mail.python.org/mailman/listinfo/python-list
uot;, "copyright", "credits" or "license" for more information.
> >>> import math
> >>> math.sqrt(1.3)
> 1.140175425099138
> >>>
>
> This is on 64-bit Windows 10.
> --
> https://mail.python.org/mailman/listinfo/python-list
On 6/9/07, BartlebyScrivener <[EMAIL PROTECTED]> wrote:
> On Jun 9, 1:14 am, "Jerry VanBrimmer" <[EMAIL PROTECTED]> wrote:
>
> > In your vim configuration file enter:
> >
> > colorscheme
> >
> > Example:
> >
> > colorscheme el
lex things? Any recommendations? Or
am I completely missing something?
(2) Is there any plan to provide a standard python module that would
do that? (Python 4.0? ;-)
Thanks for your comments and help,
Jerry
--
http://mail.python.org/mailman/listinfo/python-list
> Which math functions? ln, log10, exp, sqrt already exist as methods of
> Decimal instances. At the end of the Decimal docs there are a few
> examples, including computing sin and cos (but apparently they naïvely use
> a McLaurin series like you noticed in other module).
Hi Gabriel - than
Hi Steven... thanks for your kind and extensive reply. Lots of good
food for thought. I know it's easy to complain about lack of
functionality, but it really was not my intention. Python is very cool
as it is and I still know too little about it to even suggest
anything. I just thought maybe I was
> - are you using Decimal for the base-10-ness or the
> extra precision Decimal provides? Or significant zeros?
> Or compatibility with existing Decimal code, or what?
Oh boy, now I will finally prove myself illiterate... well, so be it.
But i am after the extra precision:
>>> from math imp
> 1. mpmath?
> 2. sympy?
> 3. Sage?
Haven't tried those, i guess i have some studying to do.
>
> > x=Decimal.__mod__(x,Decimal('2')*pi())
>
> > Works fine for what i need, but i am sure it's not the right way to do
> > it.
>
> I don't know of any better way to deal with large arguments.
> The m
mpmath... wow... just did what i needed :-)
Thanks, Mark! Hopefully i did not waste too much of your time... and
perhaps this discussion will send other lost sheeps in the right
direction.
(Still, it would make sense to have the goniometric functions in
decimal.)
--
http://mail.python.org/mai
401 - 472 of 472 matches
Mail list logo