Gary John Salerno wrote:
How do you make a single string span multiple lines, but also allow
yourself to indent the second (third, etc.) lines so that it lines up
where you want it, without causing the newlines and tabs or spaces to be
added to the string as well?
Example (pretend this is all
Raymond L. Buvel [EMAIL PROTECTED] writes:
Gary Wessle wrote:
Hi
I am trying to install NumPy in my debian/testing linux
2.6.15-1-686.
snip
When installing from source on a Debian system, you want the installed
package to wind up in /usr/local/lib/python2.x/site-packages (where
Michael Yanowitz wrote:
Hello:
Many times, people are warning things like
Don't use 'str' as a variable name as it will shadow the
built in str function.
Is there some way to determine if a string is already
defined in some higher scope?
Maybe something like
code
if isdefined ('str'):
Robert Kern [EMAIL PROTECTED] writes:
Raymond L. Buvel wrote:
Since you are a new Linux user, you should definitely follow Robert's
advice about building as an ordinary user separately from the install.
I sometimes take a shortcut and just do the install as user root.
However, I then
Eric Deveaud [EMAIL PROTECTED] writes:
Gary Wessle wrote:
I need to traverse those files in the order they were created
chronologically. listdir() does not do it, is there a way besides
build a list then list.sort(), then for element in list_of_files open
element?
are the name
thanks
I followed your suggestions, it built the package ok, while it was
building, I noticed lots of lines going by the screen in groups of
different colors, white, yellow, red.
the red got my attention:
Could not locate executable gfortran
Could not locate executable f95
Hi
I am about to order 2 books, and thought I should talk to you first.
I am getting Python Cookbook by Alex Martelli, David Ascher, Anna
Martelli Ravenscroft, Anna Martelli Ravenscroft, since Bruce Eckel's
Thinking in Python is not finished and didn't have any new revisions
since some time in
'1234'.
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
Paul Rubin wrote:
[EMAIL PROTECTED] writes:
say i have string like this
astring = 'abcd efgd 1234 fsdf gfds abcde 1234'
if i want to find which postion is 1234, how can i achieve this...? i
want to use index() but it only give me the first occurence. I want to
know the positions of both 1234
Hi
I just finished with 1.5 tutorials about Tkinter, my thought is to use
a table maybe TkTable to gather info from the user as to what file
to chart data from, as well as info provided by the TkTable
properties.
each cell of the table will be either empty or contains a file path,
let x=1 be
://twhiteman.netfirms.com/des.html
Regards,
Gary.
--
http://mail.python.org/mailman/listinfo/python-list
Hi
the second argument in the functions below suppose to retain its value
between function calls, the first does, the second does not and I
would like to know why it doesn't? and how to make it so it does?
thanks
# it does
def f(a, L=[]):
L.append(a)
return L
print f('a')
print f('b')
Hi
I am looping through a directory and appending all the files in one
huge file, the codes below should give the same end results but are
not, I don't understand why the first code is not doing it.
thanks
combined = open(outputFile, 'wb')
for name in flist:
if os.path.isdir(file):
Hi
using the debugger, I happen to be on a line inside a loop, after
looping few times with n and wanting to get out of the loop to the
next line, I set a break point on a line after the loop structure and
hit c, that does not continue out of the loop and stop at the break
line, how is it down, I
thanks, I was able 'using pdb' to fix the problem as per Edward's
suggestion.
--
http://mail.python.org/mailman/listinfo/python-list
Paul McGuire [EMAIL PROTECTED] writes:
Gary Wessle [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Hi
using the debugger, I happen to be on a line inside a loop, after
looping few times with n and wanting to get out of the loop to the
next line, I set a break point on a line
for
one process to start another. It provides a number of bells and
whistles, and is the latest module on a long history of older modules to
provide such functionality.
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
in the
win32all package.
However, I still don't understand *what* the MQSeries trigger monitor
is or *how* it would create the need for such a solution.
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
Hi
how can I using pdb get a value of an attribute?, read the docs and
played around with pdb 'p' for no avail.
thanks
class main:
def __init__(self, master):
self.master = master
self.master.title('parent')
self.master.geometry('200x150+300+225')
...
root = Tk()
(repr(a))
to reproduce a, and in fact it does so.
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] wrote:
hello,
i have a problem. i would like to import python files above and below
my current directory.
i'm working on /home/foo/bar/jar.py
i would like to import /home/foo/car.py and
/home/foo/bar/far.py
how can i do this?
thank you,
bob
ps: i
failed, you will likely get lots of useful answers here.
But you have to take the first step. P.S. The re module is really not
all *that* difficult.
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
Hi
I am going through a tutorial on Tkinter
http://doctormickey.com/python/pythontutorial_201.html, it referees to
Tk.iconname() but I could not locate one after googleing and browsed
and searched the Tkinter On-line reference material in the Tkinter
reference: a GUI for Python, 84 pp. pdf from
not hold out much hope for
that. Python and the whole open source movement is a volunteer effort by
people who care enough to contribute. Your contributions would be
welcome, but your complaints are likely to be ignored.
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
exception EINTR which is 5 -- but that's 5, not -5.
Any help on this would be most appreciated.
--
Gary Robinson
CTO
Emergent Music, LLC
[EMAIL PROTECTED]
207-942-3463
Company: http://www.goombah.com
Blog:http://www.garyrobinson.net
--
http://mail.python.org/mailman/listinfo/python-list
the
need for building any extension module.
Gary Herron
Thank you.
--
http://mail.python.org/mailman/listinfo/python-list
!
...
x = fn
y = [fn,fn]
z = {1:fn, 2:fn}
x()
Hello world!
y[0]()
Hello world!
y[1]()
Hello world!
z[1]()
Hello world!
z[2]()
Hello world!
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
.
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
in a modern language.
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
the basic
components of the traceback message into strings. Here's what I want
to do:
The traceback module provides a wealth of ways to get at the exception
information, formated and usable in various ways.
See: http://docs.python.org/lib/module-traceback.html
Gary Herron
Suppose I have 3 modules that belong to a project, 'A', 'A.a' and 'B',
and each module has its own logger, created with:
module1logger = logging.getLogger('project.A')
and
module2logger = logging.getLogger('project.A.a')
and
module3logger = logging.getLogger('project.B')
And I want to
, the poor programmer is forced to go
and edit every module in the source tree to selectively turn on/off
their respecitve loggers. Or am I missing something really obvious
about how this is done with the logging module?
thanks,
Gary
--
http://mail.python.org/mailman/listinfo/python-list
enlighten me as to how to
effectively use addFilter/removeFilter?
many thanks,
Gary
--
http://mail.python.org/mailman/listinfo/python-list
which you
can access and iterate through the names (keys) and values.
If you want more capabilities, you should also look at the inspect module.
Gary Herron
--
Gary Herron, PhD.
Department of Computer Science
DigiPen Institute of Technology
(425) 895-4418
--
http://mail.python.org/mailman
, as MatchFilter (log_test18.py) seems to do what I was thinking
I need the list of logger names for... most excellent.
Thanks,
Gary
BTW, the python logging module is one of the best readily available
loggers I've come across in any language.
--
http://mail.python.org/mailman/listinfo/python
getattr(person, info_I_need)
Related to getattr are setattr and hasattr.
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
function level static variables.
However, I usually use module level attributes for such things.
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
function level static variables.
However, I usually use module level attributes for such things.
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
does something with logging. Is there any way to
make these work together?
Gary
--
http://mail.python.org/mailman/listinfo/python-list
it for just
getting client or server msgs), etc. So I would really like to figure
out how to do 'a.*.c'.
Any ideas?
Thanks again,
Gary
On Jan 23, 3:01 am, Vinay Sajip [EMAIL PROTECTED] wrote:
Glad the tests/examples (log_testxx.py) helped. When I get a
chance, I will try to work some of them
Peter Otten wrote:
Peter Otten wrote:
Gary Jefferson wrote:
I've written a logging.filter and would like to use doctest on it
(using a StreamHandler for stdout), but this doesn't seem possible.
Output from the logger seems to disappear (running the doctest strings
through
Gary Jefferson wrote:
So maybe I don't have all this figured out quite as well as I thought.
What I really want to do is set an environment variable, MYDEBUG, which
contains a list of wildcarded logger names, such as a.*.c a.d (which
becomes ['a.*.c', 'a.d'], and then selectively crank
I fear your regular expression is incorrect.
Cheers,
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
. Is there a ZIP utilty
already stored with a basic PYTHON download?
Thanks all.
The module you want is called zipfile, and its part of the standard library.
See: http://docs.python.org/lib/module-zipfile.html for documentation.
Gary Herron
--
http://mail.python.org/mailman/listinfo/python
vithi wrote:
Hi
Any one tell me where I can get (or download) python modules win32com
or win32com.client because I have to use Dispatch thanks
You want the python for windows extension, available from
http://sourceforge.net/projects/pywin32/
Gary Herron
--
http://mail.python.org
it's scritable from Python so you can
automate some tasks if you wish.
Gary Herron
Thank you very much for every hint.
Andrea.
Imagination Is The Only Weapon In The War Against Reality.
http://xoomer.virgilio.it/infinity77/
--
http://mail.python.org/mailman/listinfo/python-list
put your find in a loop, starting the search one past the previously
found occurrence.
i = string.find(mystring, i+1)
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
,
Deniz Dogan
Not only *can* it be done, but it *has* been done and well: See IPython at:
http://ipython.scipy.org/moin/
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
being imported is not the one you printed? (Run Python with a
-v switch to test for this possibility.)
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
sys.append(path2)
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
. The number of methods/functions may slow things
up, but it will affect either name space equally.
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
your code to not rely on the global statement. Do
something like this if you can:
def test():
return 123
colorIndex = test()
Gary Herron
My question is why do I have to explicit declaring 'global' for
'colorIndex'? Can't python automatically looks in the global scope
when i access
, we'll see if we can find a way to do it from within Python.
Things you might want to tell us:
What OS.
What device(s)
Exactly what disable means for each.
How the OS allows you to enable/disable each.
Anything else that might help us.
Gary Herron
--
http://mail.python.org/mailman/listinfo
imports are
often a sign that your software design is not very well thought out.
It's usually better to have your thought process, your design and your
imports organized in a hierarchal fashion.
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
tonyr1988 wrote:
I'm a complete python n00b writing my first program (or attempting to,
anyway). I'm trying to make the transition from Java, so if you could
help me, it would be greatly appreciated. Here's the code I'm stuck on
(It's very basic):
class DemoClass:
def __init__(self):
://groups.google.com/groups/search?q=group%3Acomp.lang.python+squisherqt_s=Search
Gary Duzan
Motorola CHS
--
http://mail.python.org/mailman/listinfo/python-list
to be
installed on the remote site, and just one file to copy.
Gary Duzan
Motorola CHS
--
http://mail.python.org/mailman/listinfo/python-list
]
or
... probably other ways can be found ...
but what's wrong with you original code?
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
--
http://mail.python.org/mailman/listinfo/python-list
. (And then the problem will
most likely be in your expectations, not in the find method.)
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
--
http://mail.python.org/mailman/listinfo/python-list
here to obscure things. Try this:
Here b is a list that contains three references to a. Modify a, and
all three references to a show the modification:
a = [1,2,3]
b = [a,a,a]
a.append(4)
b
[[1, 2, 3, 4], [1, 2, 3, 4], [1, 2, 3, 4]]
Gary Herron
nn=3*[[]]
nn
So either way, *something* is returned, and in the case of the recursive call,
the innermost result is returned back up through all levels of the recursion.
Is that what you wanted?
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
Lie Ryan wrote:
On Tue, 16 Dec 2008 12:07:14 -0300, Federico Moreira wrote:
Hi all,
Im parsing a 4.1GB apache log to have stats about how many times an ip
request something from the server.
The first design of the algorithm was
for line in fileinput.input(sys.argv[1:]):
ip =
)# Reinterpret as a ?? by 3 array
b=a[...,::-1] # reverse the second dimension
print b.tostring() # Convert back to a string.
rgbRGBabcABC
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
'
'a' u'b'
u'ab'
So there you have it. Your mystery is the (automatic) concatenation of
two empty strings.
Gary Herron
Regards,
Harish
--
http://mail.python.org/mailman/listinfo/python-list
--
http
to me
Gary
_
Accept no assertions without evidence. --Goompah wisdom from Omega by
Jack McDevitt--
_
Nature is complete because it does not serve itself. --Tao De Jing by
Lao Tze--
--
http://mail.python.org/mailman/listinfo/python-list
, but rather it is a (singleton)
object that can be referenced. Setting something *equal* to None is
accomplished by making it refer to the single None object, at which
point it *is* None.
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
definition suggests)
object-fascist. We use objects to great effect in Python, when it is
natural to do so, but the language does not force it on us.
Gary Herron
--
Regards,
Maneesh KB
Comat Technologies
Bangalore
Mob: 9740-192309
We work with the underprivileged and in rural
todp...@hotmail.com wrote:
How can you make python round numbers to the nearest 5:
Example:
3 = 0
8 = 10
23.2 = 20
36 = 35
51.5 = 50
round(n,-1) rounds to the nearest 10, so
round(n*2,-1)/2 will round to the nearest five.
Gary Herron
Thanks
.
Gary Duzan
--
http://mail.python.org/mailman/listinfo/python-list
of its own name, but the classes have identical
interfaces, then try
if ...:
from horse import Horse as Ridable
else:
from buffalo import Buffalo as Ridable
# Then instantiate
animal = Ridable(...)
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
that will work.
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
Vincent Davis wrote:
Do to laking knowledge my google searches have not turned up an answer for me.
I know this is wrong it uses the items in the list as the filename,
how do I refer to the dataname and not the items in it.
def savedata(dataname):
filename = str(dataname) # this does
like this:
import a
ob = UsefulClass(...)
a.UsefulFn()
Good luck,
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
--
http://mail.python.org/mailman/listinfo/python-list
greg wrote:
SuPy 1.0
SuPy is a plugin for the Sketchup 3D modelling application
that lets you script it in Python.
http://www.cosc.canterbury.ac.nz/SuPy/
That URL fails with a 404 - not found. (At least for me at this moment
in time.)
This is a first version and is highly
for Python.
pyglet provides an object-oriented programming interface for
developing games and other visually-rich applications for Windows, Mac
OS X and Linux.
You might also consider SDL and its python bindings.
Gary Herron
Thanks Guy's
--
http://mail.python.org/mailman/listinfo
n...@stinemates.org wrote:
Gary
Your email client is set to HTML mode and looks terrible for those of us
who prefer plain view. It also appears your client is not properly
sending your message in text/plain encoding.
--
http://mail.python.org/mailman/listinfo/python-list
Understood
could I fix this?
It looks like you have it installed incorrectly, How did you install
it. What platform/system are you on?
PIL usually uses a PIL.pth file. Does that exist? Where? And what are
its contents?
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
Can someone recommend a good tutorial for Python 3, ideally that has tasks or
assignments at the end of each chapter.
Please,
--
http://mail.python.org/mailman/listinfo/python-list
I'm stuck on a tutorial Hands on Python3
Exercise 1.13.7.3. ** Complete the following function. This starting code is in
joinAllStub.py. Save it to the new name joinAll.py. Note the way an example is
given in the documentation string. It simulates the use of the function in the
Shell. This is
. And you do want an equality check here.
Gary Herron
Regards,
mk
--
http://mail.python.org/mailman/listinfo/python-list
the ability of a float:
int(float('1e20'))
1L
int(float('1e30'))
119884624838656L
Gary Herron
I'm wondering what
function to use to convert '1e7' to an integer?
int('1e7')
int(1e7)
1000
Traceback (most recent
noydb wrote:
Hi All,
I want to pause my script before it terminates, just so a user can
have a moment to read some print statements I include at the end. How
can this be accomplished?
Thanks!
If your IO is to/from a command line window, try this:
raw_input('Hit ENTER to exit: ')
Gary
:41)
[GCC 4.3.3]
al
NEW AND IMPROVED AL!
bob
bob
It's the difference between old-style and new-style classes. Type dict
and therefore OnlyBob are new style. OnlyAl defaults to old-style. If
you derive OnlyAl from type object, you'll get consistent results.
Gary Herron
identify and solve the real problem you're having.
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
Susan Day wrote:
On Mon, Nov 23, 2009 at 2:26 PM, Gary Herron
gher...@islandtraining.com mailto:gher...@islandtraining.com wrote:
print 'A Message From %s:\n\n %s' % ('someone','some message')
A Message From someone:
some message
So... *Exactly* what are you doing with msg
) what version does it start with?
1) Syntax is just as you have it.
(Not including the period you have at the end.)
2) Python 3.0
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
word struct, let's start with this:
Python has a module named struct:
http://docs.python.org/library/struct.html#module-struct
Is that what you wanted?
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
is important, you could use a set -- where a
second insertion will have no effect.
s = set()
s.add(1)
s.add(2)
s.add(1)
print s
set([1, 2])
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
mattia wrote:
Il Sun, 13 Dec 2009 16:37:20 +, mattia ha scritto:
How can I insert non-duplicate data in a list? I mean, is there a
particular option in the creation of a list that permit me not to use
something like:
def append_unique(l, val):
if val not in l:
l.append(val)
Dotan Barak wrote:
Hi.
I'm trying to evaluate a string and getting a NameError
(it is expected, since the variable my_number wasn't provided in the
locals dictionary).
--snip start--
eval(my_number 10, {__builtins__:None}, {})
Traceback (most recent call last):
File stdin, line 1, in ?
Dotan Barak wrote:
On 25/12/2009 19:27, Gary Herron wrote:
Dotan Barak wrote:
Recover the exception, and examine the tuple of args or the message
string.
try:
... eval(my_number 10, {__builtins__:None}, {})
... except NameError,e:
... print e.args
... print
simultaneously.
See http://docs.python.org/library/asyncore.html
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
this:
import datetime
today = datetime.datetime.today
or
from datetime import datetime
today = datetime.today
Then you'll be able to call
today()
at any time.
Gary Herron
Josh
--
http://mail.python.org/mailman/listinfo/python-list
of
the string if it's a string and the length of the list if it's a list.
TIA,
beno
Like this:
if isinstance(var, list):
... join ...
else:
... ??? ...
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
be
clearer to some.
x = [1,2,3]
print [ifor i in xfor k in range(3)]
[1, 1, 1, 2, 2, 2, 3, 3, 3]
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
print x
or
from sfdata import author_list # Import individual attribute from
module.
for x in author_list:
print x
Gary Herron
FILE: sfdata.py (i'm trying to import it)
==
author_list = {
'829337
is more efficient than x**2.
So.
print [x**2 for x in xrange(1,11,2)]
Gary Herron
Kit.
On 1月19日, 上午12時30分, Steven D'Aprano st...@remove-this-
cybersource.com.au wrote:
On Mon, 18 Jan 2010 08:07:41 -0800, Kit wrote:
Hello Everyone, I am not sure if I have posted this question
as normal.
* Check out the imp module which allows you to
import from files specified via a path.
Straighten that out, then we can examine the following (suspicious) clams:
* that you must evaluate *before* some import
* that you must use globals
* python's problem with globals
Gary Herron
cwd
It's naive to think this question even makes sense. There are many ways
f can be called which don't involve a parameter:
f(42)
f(time())
f(a+123)
f(sin(a))
f(f(1))
and so on.
Cheers,
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
Gary Herron wrote:
Hellmut Weber wrote:
Hi,
consider the following piece of code, please
- -
def f(param):
nameOfParam = ???
# here I want to access the name of the variable
# which was given as parameter to the function
print nameOfParam, param
return
if __name__
501 - 600 of 1049 matches
Mail list logo