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 o
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:
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 previou
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
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") #
I am having a problem with the next step.
thanks
--
http://mail.python.org/mailman/listinfo/python-list
Peter Otten <[EMAIL PROTECTED]> writes:
> Gary Wessle wrote:
>
> > I have a string like this
> >
> > text = "abc abc and Here and there"
> > I want to grab the first "abc" before "Here"
> >
> > import string
>
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
--
http://mail.python.org/ma
g for
the other spy. The details are left as an exercise for the reader.
:-)
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
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):
funCall(
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 p
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)
> >
> >>>> pr
thank you
--
http://mail.python.org/mailman/listinfo/python-list
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', '
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
--
http://mail.python.org/mailman/listinfo/python
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 ...
&
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 = open(
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
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.
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.
>>> import Numeric
>>
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", "copy
>10
>15
>
>Thanks.
>
>
Well, first, if you just print alist you'll get
[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
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)
http://www.pfduboi
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
F
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
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 EO
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 direc
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
>
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?
>
>Exa
"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.
> >
>
>
> When installing from source on a Debian system, you want the insta
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
>
>
>if isdefined ('st
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.
> > Howeve
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 i
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 200
ng)]
[10, 31]
And so on
Of course, if you wish, the re module can work with vastly more complex
patterns than just a constant string like your '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 o
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 t
ypting in a way compatible with thwe C# methods.
http://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): continu
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,
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 "
appreciated.
>
>Thanks
>
>
The "subprocess" module gives a (mostly) platform independent way 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
igger monitor.
>
>
The windows CreateProcess call has many of the same semantics as the
Unix fork, i.e., a new process is created sharing all the resources of
the original process. The "subprocess" modules uses CreateProcess, but
if that does not give you sufficient control ove
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()
***
that functionality.
So, putting them together, you could expect
eval(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,
>
tried to solve, your solution
attempt, and what 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
ot;confusion" stage of Lisp parentheses, so they don't bother me at all.
>
> I need advice from people who have been coding in all three, and who
> can share some views and experiences.
>
> Please, if you don't know ALL three by deep experience, don't respond
via ctypes.
If you can be more specific about your problem and how it fails, then
perhaps you'll get more specific answers.
Also, please read this: http://www.catb.org/~esr/faqs/smart-questions.html
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
der) C/C++ days -- ya, that's it.
Thankfully, this is Python and the modern era -- we don't use no
stinking POINTERS here.
Seriously, this group deals with Python. There are no pointers in
Python. Now please, what did you *really* mean to ask?
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
:
>
This sounds very much like a homework assignment, and so should probably
not be answered here. (Neither should it have been asked here.) If,
in your attempt to write this program, you have some questions about
Python, then I encourage to ask those questions here.
Gary Herron
> If n is
larger sublist.
>>> x = [1,2,3,4,5,6,7,8,9,10]
>>> y = 3
>>> s = len(x)/y
>>> s# size of normal sublists
3
>>> e = len(x) - y*s # extra elements for last sublist
>>> e
1
>>> z = [x[s*i:s*i+s] for i in
access an sqlite installation, but it does not include the
sqlite installation itself. That should be installed separately. (I
suppose a distro of Linux could package them together, but I don't know
of one that does, and such is not the intent of Python.)
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
row
into the hundreds or thousands or higher. If you want to try one of the
floating point formats, then your first number must be large enough to
account for digits (before and after) the decimal point, the 'E', and
any digits in the exponent, as well as signs for both the number and th
27;s
it not yet implemented, and mistakenly tries to call it, an error will
be raised.
It's not so useful in a small application, or a single person project,
but it does become useful if several people are writing different parts
(say a library and an application) at the same time.
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
ach won't scale very well since the whole string would be
re-created anew for each stop_list entry. In that case, I'd look into
the regular expression (re) module. You may be able to finagle a way to
find and replace all stop_list entries in one pass. (Finding them all
is easy -- not so sure you could replace them all at once though. )
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
Karthik wrote:
> How about -
>
> for s in stoplist:
> string.replace(mystr, s, "")
>
That will work, but the string module is long outdated. Better to use
string methods:
for s in stoplist:
mystr.replace(s, "")
Gary Herron
> Hope this s
hrown out by the compiler in favor of non-generic types, and
casts are inserted as necessary. Practicality wins over Purity
again.
Gary Duzan
Motorola HNM
--
http://mail.python.org/mailman/listinfo/python-list
icit (defined) limit. The amount of available address
space forms a practical limit.
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
second produces an int
value, but since one is a subclass of the other, you'd have to write
quite perverse code care about the difference.
Gary Herron
> I hope, I made clear, what I want...
>
Quite.
> CU
>
> Kristian
>
--
http://mail.python.org/mailman/listinfo/python-list
Boris Borcic wrote:
> I am surprised nobody pointed out explicitely that
>
> True==1 and False==0
>
Several of us did indeed point this out by saying that bool's are a
subclass of ints.
> so that for instance
>
> 5*(True+True)==10
>
> and even (but implementation-dependent) :
>
> 5*(True+True) i
convert it to a string within the function with str()?
>
Of course you can pass any type into a function. Then you have to write
the program to operate correctly on whatever the input type is.
> I've been at this for a while, so I may not be able to see the forest
> through the trees at this point. I'd greatly appreciate any
> suggestions or instruction on these mistakes.
>
My guess is that's why the code you show does not match the output you
present.
> Best,
>
> Jimmy
>
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
st (or iterator or
generator creating a list) of tuples. Put them together and get what
you might be tempted to call a dictionary comprehension. For instance:
>>> dict((i,i*i) for i in range(10))
{0: 0, 1: 1, 2: 4, 3: 9, 4: 16, 5: 25, 6: 36, 7: 49, 8: 64, 9: 81}
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
Ryan Ginstrom wrote:
>> On Behalf Of Daniel Fetchinson
>> What does the author mean here? What's the Preferably One Way
>> (TM) to do something analogous to a dict comprehension?
>>
>
> I imagine something like this:
>
>
keys = "a b c".split()
values = [1, 2, 3]
D = dict([(a
any other toolkit is capable of creating good-looking GUI's, like in other
> apps, for e.g, .net apps.
>
Not true! There are *many* more widget toolkits out there. Dozens!
See: http://en.wikipedia.org/wiki/List_of_widget_toolkits
Gary Herron
> i m a noob, and willing to
with the next step
# If it needs to wait for the child to complete, it can call os.waitpid
else:
# New fork continues here, independently of the original process
# doing whatever the fork was create for
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
ng, writing,
and closing.
This will keep the open/write/closes operations to a minimum, and you'll
never have more than 2 files open at a time. Both of those are wins for
you.
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
r Wars reference, which is
quite on topic for this subthread.
http://starwars.wikia.com/wiki/Kessel_Run
Gary Duzan
Motorola H&NM
--
http://mail.python.org/mailman/listinfo/python-list
final code shows that the differences in the test is a
small fraction of 1% of the total execution time -- then your time would
be better spent worrying about how to optimize the other portions of you
code.
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
]
would index the same element.
See http://docs.python.org/lib/module-sets.html for details of the set
module.
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
ot; is not a function.
>
> Thanks in advance,
>
> David
>
But import module operator, and find operator.not_ which is a function
and does what you want.
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
ff
you see in a traceback -- including file and line information. *How*
you extract that stuff, I'll leave as an exercises for the reader.
(Meaning I haven't a clue.)
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
> PS: I need it for a concrete case in a game scripting language I'm
> writing, so that I can call functions like "CHANGE_PLAYER_VALUES( "x",
> 100 )".
>
You want getattr and setattr:
setattr(ob, 'blah', 123)
and
getattr(ob, 'blah')
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
d also be helpful.
> Basically I'm trying to make a:
> if pixel == color:
> do_this()
> else:
> pass
>
> And have it do this as fast as my pc can handle (that is why only
> grabbing 1px would be helpful)
>
Try image.getpixel((x,y)) to retrieve the pixel at
gt; threads + os.system.
>
> Christian
>
That's a good answer. However, it you *do* want threads, and you don't
want the main thread to wait for the threads to quit, you can make the
threads "daemon threads". See setDaemon method on Thread objects in the
threading modul
e intent is to keep the
incompatibilities to a minimum, but subject to the larger goal of
producing a cleaner/better language unhindered by the need of absolute
compatibility.
Gary Herron
> David Blubaugh
>
>
>
>
>
>
> -Original Message-
> From: Bill Hart [ma
ted anywhere that
list is referred to.
>>> sub = [1,2,3]
>>> full = [sub,sub,sub]
>>> full
[[1, 2, 3], [1, 2, 3], [1, 2, 3]]
>>> sub[0] = 123
>>> full
[[123, 2, 3], [123, 2, 3], [123, 2, 3]]
So in you code, the single list mylist is shuffle
rds. The re module does have functions to do string substitution.
One or more occurrences of a pattern matched by an re can be replaces
with a given string. See sub and subn. Perhaps you can make one of
those do whatever it is you are trying to do.
Gary Herron
> e.g
>
>
any knowledgeable volunteers to actually
volunteer their time.
Good luck.
Gary Herron
> Thanks,
>
>Laszlo
>
>
> from simpleparse.common import numbers, strings, comments
> from simpleparse.parser import Parser
>
> declaration = r'''
> expr
> y = 'trials=32'
> x.foo(y)# doesn't work
>
Keyword args are represented during the calling process as a
dictionary, You can create the dictionary yourself, and slip it into
the calling arguments with a ** notation:
kw = {somestring:32}
x.foo(**kw)
Gar
Robert Dailey wrote:
> Hi,
>
> Currently I have the following code:
>
>
> ignored_dirs = (
> r".\boost\include"
> )
You expect this is creating a tuple (or so I see from your "in" test in
the following code), but in fact the parenthesis do *not* make a tuple.
If you look at ignored_dirs, y
o take, as a parameter, the "a" function
to call.
In mod:
def a():
...
def b(fn=a): # to set the default a to call
...
And you main program:
from mod import *
def my_a():
...
b(my_a)
Hope that helps
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
een how __str__ and __repr__ act on strings.
Here's s simpler example
>>> d=unicode("Caf\xe9", "Latin-1")
>>> repr(d)
"u'Caf\\xe9'"
>>> str(d)
Traceback (most recent call last):
File "", line 1, in
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in
position 3: ordinal not in range(128)
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
Far easier than threads.
Gary Herron
> You can have more information here.
> http://artfulcode.nfshost.com/files/multi-threading-in-python.html
>
>
> On Sat, Mar 8, 2008 at 1:11 PM, John Deas <[EMAIL PROTECTED]> wrote:
>
>> Hi,
>>
>> I would like
ght? Why? Thanks.
>
>
>
Yes that is true, but it's an implementation defined optimization and
could be applied to *any* immutable type. For larger ints, such a thing
is not true.
>>> x=1000
>>> y=1000
>>> x is y
False
If either is a surpris
)
> execfile ( node2 )
> etc..
>
> Now how do I pass the workspace created in node1, to node 2, etc ?
>
> thanks,
> Stef Mientki
>
RTFM! In particular: http://docs.python.org/lib/built-in-funcs.html#l2h-26
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
t better.
> Can anyone come with good solution, and maybe solution showing usage
> of Sets.
> --
> -=Ravi=-
This sounds like a homework problem, something you should be solving
yourself. If, however, you have any Python questions, then please ask.
We'll be glad to answe
ys. You usually see it
in test like this:
if a < b < c:
but any comparison operators work. The meaning is the same as the AND
of each individual test.
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
break # this causes the while loop to stop
elif guess < number:
print 'No, it is a little higher than that.'
else:
print 'No, it is a little lower than that.'
print 'The while loop is over.'
print 'Done'
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
kstation.
>
> Here's my little program
>
> [EMAIL PROTECTED]:~/tmp$ more < time.py
>
> import time
> *
Right there is the problem. Your program, named time.py, is hiding the
Python supplied module. So that import of time is finding and
re-importing itself. Rename
;> should work.
>>
>
> Why should I need to set shell=True? I'm not globbing anything. The
> second case still fails:
>
>
>>>> proc = subprocess.Popen (["/usr/bin/ls" "/tmp"])
>>>>
This line fails because of a
501 - 600 of 1014 matches
Mail list logo