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
(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
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()
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
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
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
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
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
(and offered) by participants, within the
constraints of having to do with Python or Zope.
Contact: Gary Poster ([EMAIL PROTECTED])
--
http://mail.python.org/mailman/listinfo/python-announce-list
Support the Python Software Foundation:
http://www.python.org/psf/donations.html
Hi
I use debian/testing linux Linux debian/testing 2.6.15-1-686
I found some duplicate files in my system, I don't if the are both
needed, should I delete one of the groups below and which one?
-rw-r--r-- 1 root root 80375 2006-01-24 00:28
/usr/lib/python2.3/site-packages/matplotlib/pylab.py
Hi
I am trying to install NumPy in my debian/testing linux
2.6.15-1-686.
with no numpy for debian/testing, I am left alone, since the
experimental version available by debian will result in a dependency
nightmares,
so after unpacking the downloaded file numpy-0.9.6.tar.gz
which crated a
Christoph Haas [EMAIL PROTECTED] writes:
On Tue, May 09, 2006 at 09:03:31PM +1000, Gary Wessle wrote:
I am trying to install NumPy in my debian/testing linux
2.6.15-1-686.
with no numpy for debian/testing, I am left alone, since the
experimental version available by debian
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'):
Erik Max Francis [EMAIL PROTECTED] writes:
chun ping wang wrote:
Hey i have a stupid question.
How do i get python to print the result in only three decimal
place...
Example round (2.9954254, 3)
2.9951
but i want to get rid of all trailing 0's..how would i do
Gary Wessle wrote:
Hi
not sure if this would be the right place to ask this question!
using the shell prompt
:~$ python
Python 2.3.5 (#2, Mar 6 2006, 10:12:24)
[GCC 4.0.3 20060304 (prerelease) (Debian 4.0.2-10)] on linux2
Type help, copyright, credits or license for more information
[1, 2, 5, 10, 15]
which may be good enough. If that's not what you want then you can suppress
the automatic RETURN that follows a print's output by adding a trailing comma
to the print statement, like this
for i in alist:
print i,
1 2 5 10 15
Gary Herron
--
http://mail.python.org
Hi
is the Numerical Python tutorial maintained?
http://www.pfdubois.com/numpy/html2/numpy.html
seams to have some errors and no email to mail them to when found.
if interested, read about the errors below
(1)
Hi
what does the i a in this code mean. because the code below is
giving False for all the iteration. isn't suppose to evaluate each
value of i to the whole list? thanks
a = range(8)
i = 0
while i 11:
print i a
i = i + 1
False
False
False
False
False
False
False
False
False
False
Robert Kern [EMAIL PROTECTED] writes:
Gary Wessle wrote:
Hi
is the Numerical Python tutorial maintained?
http://www.pfdubois.com/numpy/html2/numpy.html
seams to have some errors and no email to mail them to when found.
No, it is not since Numeric itself is no longer maintained
Hi
I have a file with data like
location pressure temp
str flootfloot
I need to read pressure and temp in 2 different variables so that I
can plot them as lines. is there a package which reads from file with
a given formate and returns desired variables? or I need to open,
while not
Hi
is there a module to do things like concatenate all files in a given
directory into a big file, where all the files have the same data
formate?
name address phone_no.
or do I have to open each, read from old/write-or-append to new ...
thanks
--
Gary Wessle wrote:
Hi
is there a module to do things like concatenate all files in a given
directory into a big file, where all the files have the same data
formate?
name address phone_no.
or do I have to open each, read from old/write-or-append to new ...
thanks
There's hardly enough
Hi
I am trying to print out the contents of a directory, sorted.
the code
1 import os, sys
2
3 if len(sys.argv) 2:
4 sys.exit(please enter a suitable directory.)
5
6 print os.listdir(sys.argv[1]).sort()
Hi
could someone help me to find out whats wrong with this code?
code
import os, sys
if len(sys.argv) 2:
sys.exit(please enter a suitable directory.)
dpath = sys.argv[1]
for name in os.listdir(dpath):
if os.isfile(dpath+name):
infile =
Gary Herron [EMAIL PROTECTED] writes:
Gary Wessle wrote:
Hi
is there a module to do things like concatenate all files in a given
directory into a big file, where all the files have the same data
formate?
name address phone_no.
or do I have to open each, read from old/write-or-append
Hi
import string
import re
accumulator = []
pattern = '(\S*)\s*(\S*)\s*(\S*)'
for each text file in dir
openfile and read into text
data = re.compile(pattern, re.IGNORECASE).findall(text)
accumulator = accumulator + data
gives a list of tuples which when printed looks like
('jack',
Ryan Forsythe [EMAIL PROTECTED] writes:
Gary Wessle wrote:
the example was an in-accuretlly representation of a the problem I am
having. my apologies.
a = []
def prnt():
print len(a)
prnt
function prnt at 0xb7dc21b4
I expect to get 0 the length of list a
You want
thank you
--
http://mail.python.org/mailman/listinfo/python-list
Hi
is the code below correct?
b = 3
def adding(a)
print a + b
it seams not to see the up-level scope where b is defined.
thanks
--
http://mail.python.org/mailman/listinfo/python-list
Steve R. Hastings [EMAIL PROTECTED] writes:
On Thu, 04 May 2006 07:02:43 +1000, Gary Wessle wrote:
b = 3
def adding(a)
print a + b
it seams not to see the up-level scope where b is defined.
Assuming you put a ':' after the def adding(a), this should work in
recent versions
Hi
I have a string like this
text = abc abc and Here and there
I want to grab the first abc before Here
import string
string.find(text, Here) # type int
I am having a problem with the next step.
thanks
--
http://mail.python.org/mailman/listinfo/python-list
Hi
I was reading the Regular Expression HowTo, it refers to redemo.py if
you have Tkinter installed. a quick #locate redemo.py returned none on
my debian/testing, however #locate Tkinter returned many.
any body out there is using it, is it a separate download?
thanks
--
.
:-)
Gary Duzan
Motorola CHS
--
http://mail.python.org/mailman/listinfo/python-list
Hi
I am having an issue with this match
tx = now 04/30/2006 then
data = re.compile('(\d{2})/\1/\1\1', re.IGNORECASE)
d = data.search(tx)
print d
Nono
I was expecting 04/30/2006, what went wrong?
thanks
--
http://mail.python.org/mailman/listinfo/python-list
Serge Orlov [EMAIL PROTECTED] writes:
Peter Otten wrote:
Gary Wessle wrote:
These days str methods are preferred over the string module's functions.
text = abc abc and Here and there
here_pos = text.find(Here)
text.rfind(abc, 0, here_pos)
4
Peter
and what
Hi
is there a way to make an assignment in the condition of if and use
it later, e.g.
nx = re.compile('regex')
if nx.search(text):
funCall(text, nx.search(text))
nx.search(text) is evaluated twice, I was hoping for something like
nx = re.compile('regex')
if x = nx.search(text):
I am getting this error when I try to run the code below
f = open(~/m, r)
print f.read()
:~$ python python/my.py
Traceback (most recent call last):
File python/my.py, line 1, in ?
f = open(~/m, r)
IOError: [Errno 2] No such file or
dear python users
I am not sure why I am getting
Traceback (most recent call last):
File my.py, line 3, in ?
urlparse('http://www.cwi.nl:80/%7Eguido/Python.html')
TypeError: 'module' object is not callable
Hi
can type conversion work to convert an int to a list?
I am trying to solve an problem in one tutorial.
a = ['spam!', 1, ['Brie', 'Roquefort', 'Pol le Veq'], [1, 2, 3]]
As an exercise, write a loop that traverses the
the output of this code below is not what one would expect, it outputs
all kind of numbers and it never stops, I want to ask the user for a
number and then print out the multiplication table up to that number.
thanks
import math
John Machin [EMAIL PROTECTED] writes:
On 28/04/2006 2:04 PM, Gary Wessle wrote:
the output of this code below is not what one would expect, it
outputs
all kind of numbers and it never stops, I want to ask the user for a
number and then print out the multiplication table up to that number
I am going through this tut from
http://ibiblio.org/obp/thinkCS/python/english/chap07.htm
I am getting errors running those 2 groups as below as is from the tut
thanks
index = 0
while index len(fruit):
letter = fruit[index]
print letter
index = index + 1
or
for char in fruit:
)
or
a = [ [0]*3 for i in range(3)]
Clear?
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
Hi
I am going through some tutorials, how do I find out about running a
script from the python prompt?
is there a online ref and how to access it?
thank you
--
http://mail.python.org/mailman/listinfo/python-list
ComputerName Message'
net send ComputerName Message
print 'net send %s %s' % (ComputerName, Message)
net send Fred HI
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
Hi python users
I am using emacs and python-mode.el under dabian testing.
is there a way to debug python code where I can step over each line
and watch the value of all the variables and be able to change
any during debugging. say you have a loop structure and want to see
what the values of your
Gary Wessle [EMAIL PROTECTED] writes:
Hi python users
I am using emacs and python-mode.el under dabian testing.
is there a way to debug python code where I can step over each line
and watch the value of all the variables and be able to change
any during debugging. say you have a loop
Dear python users
I am just wondering if python is the language to use to build a custom
charting package which is live updated from live data stream coming
through a socket. as well as dynamically execute data analysis code
on the data being fed. I have been looking at SpecTix.
thank you
--
be used to open a file
The open file has several methods to read bytes from the file:
read() gets the whole file at once
readline() return a line at a time
other possibilities exist
You can test to see if a string s is in another string t with
if s in t: ...
Hope that helps,
Gary Herron
its module's name. For a plugin
system, you'll probably want to import a module given a string
containing its name. The imp module provides this as well as access
to many of the features of the import mechanism.
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
(match.group(1))
... else:
... print No match
...
531
Hope that helps,
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
is a case where there is no fast enough. The more speed,
the better, within financial constraints.
Gary
--
Gary Robinson
VP/Innovation
Emergent Music, LLC
[EMAIL PROTECTED]
207-942-3463
Company: http://www.goombah.com
Blog:http://www.garyrobinson.net
O
Message: 2
Date: Fri, 07 Apr 2006 02:34
-- that would be shorter,
but probably not clearer.
Cheers,
Gary Herron
Every help is appreciate.
--
http://mail.python.org/mailman/listinfo/python-list
in a tuple in the
specified order:
box=(100,300,200,400)
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
)
-
| |
| |
-
(a,d) (c,d)
So the tuple would be (a, b, c, d)?
That look right.
But why be so cautious? Try it and see if it works. (I believe it will
-- but if not -- try again.)
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
function (named format --yuck--
or some such) that returns the same text as a string.
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
a WinXP box and that's where it is here. My
poor old mind can't dredge up whether it's in the same relative place
in say, a Linux installation.) IDLE isn't perfect but it'll get you
started. (Also, FWIW, if you run this under IDLE, you can omit the
trailing raw_input())
hope this helps.
gary
).
If the output is voluminous, then it's probably something else ... but I
don't know what. Perhpas you could post your code.
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
sufficient for your need.
However, if you are running Python 2.4, the I'd suggest the subprocess
module, and in particular its convenience function call.
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
Corporation parking lot; entrance on Prince Edward Street.
Topics: As desired (and offered) by participants, within the
constraints of having to do with Python or Zope.
Contact: Gary Poster ([EMAIL PROTECTED])
--
http://mail.python.org/mailman/listinfo/python-announce-list
Support the Python
:
traceback.print_exc()
and you'll get a traceback (a very short one in this case):
Traceback (most recent call last):
File stdin, line 2, in ?
AssertionError
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
that's what was asked for. That will reraise the
exception, but there is no guarantee that it will be displayed -- there
may be further excepts up stream to catch it.A
traceback.print_exc() within the except clause will print it at that
point, then execution can continue normally.
Gary Herron
to be performed.
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
LittlePython wrote:
Is this a good place to post python questions from newbie's, or would you
suggest another board?
Thx
This is the correct place. This group has the reputation of being
newbie-friendly.
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
string.ljust(PortlinkbeatInv[row[j][0]],14),
^
SyntaxError: invalid syntax
The problem here is that the previous line has unbalanced parentheses.
Fix that, and there should be no problem with this line.
Gary Herron
How should I change to printout row data [1,2,3,4,5] in one row in assigned
and standard operation procedure.The
functions from myFunctions execute in the environment of the module they
were define in, no matter how you import/reference them from another
procedure.
Just try it and you'll be please with the results.
Gary Herron
Is there
a way to make python
Russell wrote:
I want my code to be Python 3000 compliant, and hear
that lambda is being eliminated. The problem is that I
want to partially bind an existing function with a value
foo that isn't known until run-time:
someobject.newfunc = lambda x: f(foo, x)
The reason a nested function
...I have some C code (foo.c and foo.h) that I would like to be able to access
using python.
I've written my interface file (foo.i) like so:
%module foo
%{
#include foo.h
%}
%include foo.h
I then do the following on the command line:
$ swig -python foo.i
$ gcc -c foo.c foo_wrap.c -I
, including Windows.
http://www.pythonware.com/products/pil/
Gary Duzan
Motorola CHS
--
http://mail.python.org/mailman/listinfo/python-list
Florian Daniel Otel wrote:
Gary,
First of all, many thanks for the reply. Do I understand it correctly
that actually the rule has to be refined as pertaining to the (so
called) immutable types (like e.g. integers, tuples/strings)
whereas lists and dictionaries are mutable types
, not the modification of the objects to which
they refer.
Gary Duzan
Motorola CHS
--
http://mail.python.org/mailman/listinfo/python-list
')
Gary Duzan
Motorola CHS
--
http://mail.python.org/mailman/listinfo/python-list
://tinyurl.com/duoab).
Parking: Zope Corporation parking lot; entrance on Prince Edward Street.
Topics: As desired (and offered) by participants, within the
constraints of having to do with Python or Zope.
Contact: Gary Poster ([EMAIL PROTECTED])
--
http://mail.python.org/mailman/listinfo/python
this process until the file runs out of
words. (Hint:you can use ramdom.shufflefunction to scramble the letters)
Please can you answer this problem?
This sounds like a school assignment. We make it a habit here to *not*
answer such questions.
Sorry, and good luck with your studies.
Gary Herron
= os.getcwd() # Get working directory at startup
(Even if the import of Parameters in some file occurs before the
initialization code has a chance to run.)
Gary Herron
in all of the files (namespaces) where it is needed.
Is there a better way?
Are the two ideas presented above acceptable? If so
, to take over complete control
of your program. So be carefully.
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
it to the wall,
and start walking backwards. You will still be
able to discern the
structure of the code *long* after you can no
longer identify the
curly-braces. (Provided you properly indented you
C++ code -- you *do*
indent you C++ code don't you?)
Gary Herron
Note: No need to follow up with long
. That was an April Fools joke.
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
it... What's your complaint, what's your solution, and why
should we listen?
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
...
Several types would qualify as numbers: IntType, FloatType, LongType,
and ComplexType,
and several as strings: StringType and UnicodeType
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
name,
mac address, ip address and OS on that system.
The platform module can give lots of such info:
http://docs.python.org/lib/module-platform.html
Good Luck,
Gary Herron
Thanks in advance for having given a thought on my questions.
Regards
Yogi
--
http://mail.python.org/mailman/listinfo
explicit about the returned tuple would produce what
you want.
lambda x : (x/60,x%60)
Gary Herron
[EMAIL PROTECTED] ~ $ python
Python 2.4.2 (#1, Nov 18 2005, 19:32:15)
[GCC 3.3.6 (Gentoo 3.3.6, ssp-3.3.6-1.0, pie-8.7.8)] on linux2
Type help, copyright, credits or license for more
As discussed at the November Fredericksburg, VA ZPUG meeting, we are
not going to have a December 14 ZPUG because of holiday goings-on.
Andrew Sawyers will present on Squid and Zope in our January 11
meeting (other topics TBD).
Zac Bir, Benji York, and Gary Poster will present in our
really looking for
an example that will spell things out for me. There's a lot of 'wrapping'
happening under the hood in this technology and I am kind of lost between
what is done for me on each side and what I should explicitly do my self.
Thanks again for taking the time to answer.
Gary
of doing it as a python COM server but I am not familiar with COM
and I saw that implementing a COM server with events in python is not
trivial for me.
Is there a better (or simpler) solution?
What are the common ways for doing that?
Any answer would be highly appreciated.
Regards
Gary
--
http
Thanks
Its an interesting solution but I need a more closely coupled solution,
with real time events, so the communication really has to be 2 ways, and not
by polling.
Thanks for putting the time and though.
Gary
[EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
While not sure
be highly appreciated.
Regards
Gary
--
http://mail.python.org/mailman/listinfo/python-list
901 - 1000 of 1049 matches
Mail list logo