?
it seems like nothing is any easier (except having variables locally). Is
this right? Should I be creating more classes for different things or what?
I can upload the .py if you want.
Thanks,
Sam
--
I intend to live forever - so far, so good.
SaM
--
http://mail.python.org/mailman/listinfo/python
hello group,
Using tkinter, is there any way to have the program not showing on the
taskbar, and even better showin in the system tray?
I realise tkinter does not have that much OS specific stuff but maybe there
is a way?
Thanks,
Sam
--
I intend to live forever - so far, so good.
SaM
-1, putLabel)
v = StringVar()
current = Label(root, textvariable = v)
current.grid(row = 3, columnspan = 2, sticky = W+E, padx = 3)
root.mainloop()
[end python code]
how do i make it so it puts it into the variable *when* i click it? Any help
will be greatly appreciated!
Thanks,
Sam
--
I
Hello,
May be I misunderstand your problem, but is it not possible do link it
as follow?
import ctypes
libgaak = ctypes.CDLL(/home/me/otherLibs/libgaak.so.6)
Kind regards.
Sam
--
http://mail.python.org/mailman/listinfo/python-list
On Dec 19, 11:09 am, gDog [EMAIL PROTECTED] wrote:
Hi, Sam-
I'm not wanting to start a flame war, either, but may I ask why does
your friend want to do that? I'm always intrigued by the folks who
object to the indentation rules in Python, even though I've always
tried to keep consistent
\Notes.py, line 27, in module
v.set = (box.get(int(number[0])))
IndexError: tuple index out of range
How can i get it to only take the variable when i have selected something,
or any other solution!
Thanks,
Sam
--
I intend to live forever - so far, so good.
SaM
--
http://mail.python.org
A friend of mine is picking up some Python and is frustrated by
Python's indentation rules (http://greatbiggary.livejournal.com/
260460.html?thread=1835884#t1835884). Personally, I've never had any
issues with Python's ways of indentation, but that conversation got me
thinking about the issue.
On Dec 18, 5:28 pm, Grant Edwards [EMAIL PROTECTED] wrote:
On 2007-12-18, Sam [EMAIL PROTECTED] wrote:
A friend of mine is picking up some Python and is frustrated by
Python's indentation rules (http://greatbiggary.livejournal.com/
260460.html?thread=1835884#t1835884). Personally, I've
On Dec 18, 7:09 pm, Jonathan Gardner
[EMAIL PROTECTED] wrote:
On Dec 18, 2:16 pm, Sam [EMAIL PROTECTED] wrote:
layouts = ['column', 'form', 'frame']
cmds.window(t='gwfUI Builder')
cmds.paneLayout(configuration='vertical3', ps=((1, 25, 100), (3, 20,
100)))
cmds.paneLayout
\Notes.py, line 27, in module
v.set = (box.get(int(number[0])))
IndexError: tuple index out of range
How can i get it to only take the variable when i have selected something,
or any other solution!
Thanks,
Sam
--
I intend to live forever - so far, so good.
SaM
--
http://mail.python.org
return self.func(*args)
File C:\My Documents\My Python\Notes.py, line 6, in insert
name = ent.get()
AttributeError: 'NoneType' object has no attribute 'get'
I am puzzled as to the last line...
Help?
Sam
--
I intend to live forever - so far, so good.
SaM
--
http://mail.python.org/mailman
Hi..
I'm looking to install dual versions of python 2.3, 2.4 on the same box. I'm
trying to figure out if there's something I'm missing, some kind of gotchas
that I haven't seen.
I'm also trying to figure out how to allow my script to determine which
version to use???
Thanks
--
:48 PM
To: python-list@python.org
Subject: Re: Dual Python Installed Environments..
sam schrieb:
Hi..
I'm looking to install dual versions of python 2.3, 2.4 on the same box.
I'm
trying to figure out if there's something I'm missing, some kind of
gotchas
that I haven't seen.
THey shouldn't
New submission from sam:
from textwrap import wrap
wrap(foobarbaz reallylongwordgoeshere, width = 10)
['foobarbaz r', 'eallylongw', 'ordgoesher', 'e']
print [len(s) for s in _]
[11, 10, 10, 1]
This only seems to happen when the first word on the line is exactly one
character shorter than
I am writing some COM code in Python to control photoshop. Several
functions of PS require an Array argument. In the examples of VBscript
or javascript the Array type is used. I have tried what would appear to
be the equivalent in Python -- Lists and Tuples -- but to no avail.
Anyone
. Anyone have
any insight on what via the COM interface is equivalent to an Array in
javascript ?
Cheers
Sam
--
http://mail.python.org/mailman/listinfo/python-list
aliasing must happen in compat26.py. My suggested solution is this:
#_compat30.py
print2 = print
#compat.py
try:
from _compat30 import print2
except SyntaxErorr, ImportError):
def print2():
--Sam
--
http://mail.python.org/mailman/listinfo/python-list
and pointers), use Python, and
if you want under-the-hood pointer-fu, use C.
--Sam
--
http://mail.python.org/mailman/listinfo/python-list
Legal Consultants http://legal-rx.blogspot.com/index.html will show you how to
make 1 million in less than 6 weeks!
--
http://mail.python.org/mailman/listinfo/python-list
, perhaps, or a similar lightweight notation system if you are
only sending lists) would be a good idea.
--Sam
--
http://mail.python.org/mailman/listinfo/python-list
On 21 Jan 2007 12:49:17 -0800, Ramashish Baranwal
[EMAIL PROTECTED] wrote:
class Base:
staticvar = 'Base'
@staticmethod
def printname():
# this doesn't work
# print staticvar
# this does work but derived classes wouldn't behave as I want
print
again... :)
sam
--
http://mail.python.org/mailman/listinfo/python-list
thanks, i'll remember that. it makes sense that there should be a way
of doing it...
sam
--
http://mail.python.org/mailman/listinfo/python-list
,
Steve Bergman
I prefer to use 132 char per line, and like you I line up the = sign
for readability.
The reason for this convention arises from the fact that I am Dyslexic,
and this convention helps me double check my typing.
Sam Schulenburg
--
http://mail.python.org/mailman/listinfo/python-list
realize there is a lot of material on this subject already available,
but i am finding it difficult to make sense of, it's like trying to
take a drink from a fire hose.
any advice would be gratefully received. i will almost certainly be
coding this on windows, for what it's worth.
thank you,
sam
thanks guys,
i'll follow this up more in a couple of weeks when i know what i need
to do better.
sam
--
http://mail.python.org/mailman/listinfo/python-list
/ is quite a cool package
for doing this sort of thing. Using your example:
#untested
from pyparsing import *
splitat = Or(:=, +)
lexeme = Word(alphas)
grammar = splitat | lexeme
grammar.parseString(a:=b+c)
#returns (the equivalent of) ['a', ':=', 'b', '+', 'c'].
--Sam
--
http://mail.python.org
these first keys by the value of the 'ops' key from
highest to lowest value to give the following result:
[('2329492', {'ops': '80'}), ('2329490', {'ops': '50'}), ('2329513',
{'ops': 20.0})]
Thanks in advance for any help,
Sam.
--
http://mail.python.org/mailman/listinfo/python-list
i'd try and
contribute something for once instead of just asking questions.
sam
PS it does actually work, in case you're wondering. :-)
--
http://mail.python.org/mailman/listinfo/python-list
i forgot to mention that i'm running a version of python 2.3 (think
it's 2.3.5), as that's what was installed and i'm not hooked up to the
internet with the ultra 20 yet. that may account for some of the
difference.
sam
--
http://mail.python.org/mailman/listinfo/python-list
seconds
in terminal:
0.001 seconds
a difference of between 3 and 4 orders of magnitude is rather striking.
anyone know what's going on here? is it a python, a unix thing, or
something else?
sam
--
http://mail.python.org/mailman/listinfo/python-list
i was actually experimenting on windows on my own pc before the
workstation arrived, and IDLE printed a lot faster on windows than in
solaris for me too.
i would indeed complain to sun if i had ever got the impression that
anyone over there ever knew what was going on... : )
but on the
be of interest.
thanks again,
sam
--
http://mail.python.org/mailman/listinfo/python-list
for some fresh eyes on it.
thanks,
sam
PS making check=True just saves the code from printing 'those numbers
don't sum to 100' if they haven't all been entered, which looks kind of
silly.
--
http://mail.python.org/mailman/listinfo/python-list
you're right, of course. it occurred to me that, even if it were
manageable for a few items, it would quickly become absurd as the
number of items grew. this:
def get_pct():
while True:
pct_list=[['cash', 0], ['bond', 0], ['blue', 0], ['tech', 0],
['dev',
0]]
this does what i want, though i don't like the inner while loop having
to be there
def get_pct():
while True:
pct_list=[['cash', 0], ['bond', 0], ['blue', 0], ['tech', 0],
['dev',
0]]
total=0
for i in range(len(pct_list)):
not searching
with the right words. it's late here and my brain's switching off...
cutting and pasting it into the interpreter is a bit of a bore. any
help?
much appreciated in advance,
sam
PS i've just reached first base with classes, and i think i'm starting
to see what the big deal is about OOP. it's
should read 'definitions', of course. i hate stupid typos.
--
http://mail.python.org/mailman/listinfo/python-list
What I do:
For each new major version of python, in .../site-packages I make a
directory sdd (my initials). In it I put an empty file named
__init__.py. When I have things I want to reuse, I put them in
files named things like .../site-packages/sdd/goodidea.py, and
I get use of them in
and restored the python2.3 file to its
original position, i find the same command prompt failing to work. have
i messed it up by moving it around?
my workstation remains a shiny box which does naught but hum
malevolently. is there hope?
thank you,
sam
--
http://mail.python.org/mailman/listinfo
'there is no installed viewer capable of displaying the
document'?
i have no idea what i need, or where i can get it. any ideas?
sam
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] wrote:
i think i've tracked down the equivalent files on my pc. one opens the
interpreter in a white-backed text editor, the other at the
black-backed command prompt. i have equivalent files of the same size
on the workstation, which must be the same. does anyone know why
I would try to use the python executable located in /usr/bin if it is
exists, otherwise use the python executable in /usr/sfw/bin.
casevh
lordy lord, is that where it was. i just found it now. i had been
thinking that idle was the name of the python interpreter, not just the
IDE, hence my
returning something
else?
thanks in advance,
sam
--
http://mail.python.org/mailman/listinfo/python-list
for all the answers. it boggles the mind that one can have
access to this almost immediate help at no charge.
sam
--
http://mail.python.org/mailman/listinfo/python-list
something trivial, but i can't seem to get round it by using
while loops, and i had the same problem with cmp(), hence the explicit
comparison above, which still doesn't work. can anyone help a beginner
out with this?
many thanks in advance,
sam lynas
--
http://mail.python.org/mailman/listinfo/python
actually, that little bit of code i wrote is obscenely wrong anyway, so
please don't bother analyzing the flow.
any insight into the list index out of range error would still be
welcome, though.
--
http://mail.python.org/mailman/listinfo/python-list
yes, yes, of course, thank you. not sure what i thought i was doing
there.
i'll see if i can get it running now...
--
http://mail.python.org/mailman/listinfo/python-list
for what it's worth. and it is approx. five times quicker than the
bubblesort i wrote to begin with on a 286-word highly unordered list,
so i wasn't wasting my time after all...
__
import time
file_input = open('wordlist.txt',
're: your e-mail', or 'project stuff', or 'file
for client' or suchlike. made it kind of difficult to find anything.
figured a similar principle might apply here... ; )
thanks again all,
sam
--
http://mail.python.org/mailman/listinfo/python-list
()
}
Is there a built in way to do this? I don't much
care for:
string = function otherlang(){
string += doit()
string += }
textwrap.dedent ought to do exactly what you want.
--Sam
--
http://mail.python.org/mailman/listinfo/python-list
are fairly good at picking up unused objects. ;)
--Sam
--
http://mail.python.org/mailman/listinfo/python-list
fuzzylollipop wrote:
I got my facts straight, Ruby is not tested in production environments.
That's odd... it's running bank websites, credit-card processing, high
traffic sites like ODEO and Penny-Arcade. Seems pretty production to
me.
And I am speaking from a BIG internet site scale.
Yes
fuzzylollipop wrote:
uh, no, Python predates Ruby by a good bit
Rails might be older than Turbogears but it still JUST went 1.0
officially.
Wow that's a lot of FUD, especially since you're beating up on Rails
for it's docs and maturity, when I doubt (but couldn't prove)
turbogears comes close.
Bruno Desthuilliers wrote:
foo = lambda thing: thing and thing + 1 or -1
The and ... or trick is buggy (what if thing == -1?) and bad style. If
you -do- want a conditional expression, 2.5 provides one:
thing + 1 if thing else -1
No subtle logical bugs, and a good deal more obvious.
On the
Hello,
I've installed matplotlib recently because I want to add graphing
functionality to a GUI that i'm making. I decided to try using the
wxAgg backend instead of plain old wx because:
a) I hear it's quicker, and
b) when i use the wx backend, the axis labels don't seem to work
properly - i
Hello,
I'm currently creating a GUI, which consists of a main frame that
contains a menu bar,a toolbar and an empty panel, let's call it
main_panel.
Ideally, I'd like the following functionality: upon choosing an item
from the menu bar, a particular graph will be displayed inside
main_panel.
Now
panels...
Secondly, I stuffed up when trying to give graph_panel a parent of
main_panel. It turns out I was actually never doing this, so the
toolbar would appear, but none of the buttons would work.
Thanks again for your comments, they were very helpful,
Cheers
Sam
--
http://mail.python.org/mailman
I have been using the latest VC.net to compile my SCSIPython extension
dll for Python 2.3, 2.4, and 2.5 without any problems. I just have to
make shure that I link with the correct Python.lib
Sam Schulenburg
--
http://mail.python.org/mailman/listinfo/python-list
what I was trying to accomplish.
Sam Schulenburg
James Stroud wrote:
Fredrik Lundh wrote:
James Stroud wrote:
See the actual question:
How would you construct a generator to acheive this?
if you don't think the context provided by the subject line and the
sentence before
Very interesting, I have downloaded it,and I like what I see.
ago wrote:
I have just discovered Python Scripter by Kiriakos Vlahos and it was a
pleasant surprise. I thought that it deserved to be signalled. It is
slim and fairly fast, with embedded graphical debugger, class browser,
file
tomer:
It is my opinion that you would loose performance if the Python
interpreter had the additional task of verifying byte code. It might be
more appropriate to have a preprocessor that did the verifying as it
compiled the byte code.
Sam Schulenburg
gangesmaster wrote:
the following (random
Mel:
Wow that book brings back memories. I scanned my copy to review the
subject covered, and came to the conclusion that mind reading
algorithms are the answer.
Sam Schulenburg
Mel Wilson wrote:
sam wrote:
tomer:
It is my opinion that you would loose performance if the Python
signed the standard intellectual property
forms.
Sam Schulenburg
Jarek Zgoda wrote:
[EMAIL PROTECTED] napisa³(a):
In our field, we don't always get to program in the language we'd like
to program. So... how do you practice Python in this case?
Write code. Lots of it. Work on a project
I recommend that you also replace the NULL after the METH_VARARGS with
a valid documentations string such as:
static PyMethodDef modglMethods[] =
{
{ (char *)glVertex4f, _wrap_glVertex4f, METH_VARARGS, My
Doc String},
{ NULL, NULL, 0, NULL }
};
Sam Schulenburg
*/
const char *ml_doc;/* The __doc__ attribute, or NULL */
};
Sam Schulenburg
John Machin wrote:
On 3/06/2006 1:38 PM, sam wrote:
I recommend that you also replace the NULL after the METH_VARARGS with
a valid documentations string such as:
static PyMethodDef modglMethods
vbgunz:
When you download IronPython,the tutorial directory has some examples
of interfacing With the .NET environment i.e.:
1: IronPython - C#
2: C# - IronPython
3: IronPython - VB
4: VB - IronPython
Sam Schulenburg
--
http://mail.python.org/mailman/listinfo/python-list
The foowing code lifted from Mark Hammond Pywin32 code shows and
example of calling the Windows Kernel32 GetTickCount(),using
PyW32_BEGIN_ALLOW_THREADS and PYW32_END_ALLOW_THREADS. My Code does not
use this,but uses SetThreadAffinityMask(GetCurrentThread(),1). My
questions are:
1) What is
:
http://starship.python.net/crew/samschul
Sourceforge link:
https://sourceforge.net/projects/scsipython
Sam Schulenburg
--
http://mail.python.org/mailman/listinfo/python-announce-list
Support the Python Software Foundation:
http://www.python.org/psf/donations.html
:
http://starship.python.net/crew/samschul
Sourceforge link:
https://sourceforge.net/projects/scsipython
Sam Schulenburg
--
http://mail.python.org/mailman/listinfo/python-list
I not shure which algorithm,but I am assumeing that all Python does,is
to call the underlying C pow() function.
Sam
--
http://mail.python.org/mailman/listinfo/python-list
have tried various graphing programs,and they all
exihibit this problem.
thanks in advance Sam Schulenburg
f(x) = cosh^2(x) - sinh^2(x) = 1
from math import *
for x in range(20):
print x= %2d Sinh^2(x) = %20.3f f(x) = %2.10f
%(x,pow(cosh(x),2),pow(cosh(x),2)- pow(sinh(x),2))
x= 0
David I beg I beg
Can you answer the question?
Also thanks for the information on using the Taylor series.
Sam Schulenburg
--
http://mail.python.org/mailman/listinfo/python-list
David Treadwell wrote:
exp(x) is implemented by:
1. reducing x into the range |r| = 0.5 * ln(2), such that x = k *
ln(2) + r
2. approximating exp(r) with a fifth-order polynomial,
3. re-scaling by multiplying by 2^k: exp(x) = 2^k * exp(r)
sinh(x) is mathematically ( exp(x) - exp(-x)
) with inWaiting(),
flush etc
But no result.
Thanks Luca
Hope this helps
Sam Schulenburg
--
http://mail.python.org/mailman/listinfo/python-list
Thanks for the info Grant. It'll teach me not to read the documentation
:)
Sam
--
http://mail.python.org/mailman/listinfo/python-list
python -i source_file.py
will do what you want.
-Sam
--
http://mail.python.org/mailman/listinfo/python-list
Trent:
Thanks for the reply. I tried again today and everthing worked. I did
find a type in my CVSROOT string,and corrected it. Thanks for the
examples posted in the included link.
Sam Schulenburg
--
http://mail.python.org/mailman/listinfo/python-list
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.
Sam Schulenburg
--
http://mail.python.org/mailman/listinfo/python-list
After downloading and trying out Ironpython, I have the following
comments:
1) I like the idea of Python under .net
2) I like the support for both Microsoft math lib,and Python's math lib
Will Microsoft maintain the compatability between standard python with
the addition of their libs?
--
[EMAIL PROTECTED] wrote:
In fact, googling for referer and referrer reports a similar
number of hits, unlike most misspellings.
Terry You know, I almost mentioned that myself. Drives me crazy.
Me too. I'm one of those people who, for better or worse, is a good
speller. Words
Would this particular inconsistency be candidate for change in Py3k?
Seems to me the pos and endpos arguments are redundant with slicing,
and the re.match function would benefit from having the same arguments
as pattern.match. Of course, this is a backwards-incompatible change;
that's why I
, and SCSITOOLS24USBV1.4.zip
Sam Schulenburg
--
http://mail.python.org/mailman/listinfo/python-list
Hello
I need some help
I have a text file which changes dynamically and has
200-1800 lines. I need to replace a line , this line
can be located via a text marker like :
somelines
# THIS IS MY MARKER
This is the line to be replaced
somemorelines
My question is how to do this
rbt wrote:
Is it more appropriate to do this:
while 1:
if x:
return x
Or this:
while 1:
if x:
break
return x
Or, does it matter?
I would pick the first form if that's the only place where x would be
returned from the function. However, if there would be
Through layer. Using these routines,all mounted drives can be
accesed using SCSI Commands.
The following url will provide documentation and zip files that can be
downloaded. These zip files contain all the source code for the
libraries.
http://starship.python.net/crew/samschul
Sam Schulenburg
[EMAIL
Just a added note,that these routines will access any storage drive
that is mounted under Windows. The Scsi Pass Through layer maps all
Pcmcia,IDE,andSCSI drives to use SCSI commands. This allows a user to
access all these interfaces with a common command set.
Sam Schulenburg
--
http
I have updated my page at http://starship.python.net/crew/samschul/
These tools allow for the user to issue low level SCSI commands via the
windows SCSIPASSTHROUGH interface layer. These routines will work from
IDLE, Pythonwin,and Python.exe.
The changes include the following:
1) Deleted
I had a simular situation when I was writing Python routines to access
the the storage (SCSIPASSTHROUGH) layer provided by Windows XP. My
solution was to develope an extention in C that allocated all storage
buffers within the extension. Then I added access extensions to
controll reading and
You're not 'exploding' the dict to the param1='blah' etc form - you-re
actually passing it in as a single dict object. To solve this, add a **
to the front of a dict you want to explode in a function, just as you'd
add a * to explode a sequence.
--
It depends what you mean by 'scalar'. If you mean in the Perlish sense
(ie, numbers, strings and references), then that's really the only way
to do it in Python - there's no such thing as 'scalar context' or
anything - a list is an object just as much as a number is.
So, assuming you want a
My understanding of .*? and its ilk is that they will match as little
as is possible for the rest of the pattern to match, like .* will match
as much as possible. In the first instance, the first (.*?) did not
have to match anything, because all of the rest of the pattern can be
matched 0 or more
Daniel Crespo wrote:
Hello to all,
How can I do
new_variable = (variable) ? True : False;
in Python in one line?
I want to do something like this:
dic = {'item1': (variable) ? True-part : False-part}
Any suggestions?
Daniel
There's a trick using the short-circuiting boolean logic
self.by_name[value]
The alternative is to use some sort of database for storing these
values. It doesn't really matter which (hell, you could even reinvent a
relational wheel pretty simply in Python), as any DB worth its salt
will do exactly what you need.
Hope that helps,
-Sam
--
http
Hi,
I am new to Python, and PAMIE has been a very useful tool for my
website functionality testing.
I was wondering if anyone knows how to do the following testcases with
either PAMIE or Python.
1. Load a page http://www.prophet.net/quotes/stocknews.jsp?symbol=MSFT
Verify that the string 'News for
On the second point, a combination of sys.path, os.listdir and
__import__ should do what you're after, although sifting through the
whole of sys.path and subfolders from Python, rather than the
interpreter itself, could be slow. (And it'll be redundant as well -
__import__ will have do the same
py wrote:
From what I have seen Python does not come with an snmp module built
in, can anyone suggest some other SNMP module (preferably one you have
used/experienced)..I have googled and seen yapsnmp and pysnmp (which
seem to be the two most active SNMP modules).
Thanks
I've used pysnmp
The reason the state of obj.A and obj.B aren't preserved is because
your __getstate__ and __setstate__ don't preserve them - they only save
obj.C, and you don't make a call to the parent class's respective
methods. Here's what I mean:
import pickle
class Child(Parent):
__slots__=['C',]
Of course, in __setstate__, there should be a tup = list(tup) as well -
sheer forgetfulness and a confusing name in one.
--
http://mail.python.org/mailman/listinfo/python-list
unzip doesn't seem to work for me...
It's not a part of the standard Python distribution, but this is a
naive implementation (it doesn't react well to the list's contents
having different lengths).
def unzip(seq):
result = [[] for i in range(len(seq[0]))]
for item in seq:
for
401 - 500 of 542 matches
Mail list logo