On 07/18/2015 04:36 PM, Terry Reedy wrote:
I would like more viewpoints from 2.7 users.
I read that (incorrectly of course) and just had to ask:
How do you intend to extract a viewpoint from that last 7/10 of a user?
With apologies,
Gary Herron
--
Dr. Gary Herron
Department of
) lines to print(...) (without the colon) and
try again. If there is further trouble, ask another question, but
please cut and paste the actual and *exact* results into the email.
Gary Herron
--
Dr. Gary Herron
Department of Computer Science
DigiPen Institute of Technology
(425) 895-4418
--
https://mail.python.org/mailman/listinfo/python-list
han a Python question. (Or rather a
question about some Python/Cplex interface.) Do you have access to any
kind of a CPLEX forum or a Cplex-via-Python forum? I think that's much
more likely to get you an answer.
Luck,
Gary Herron
--
https://mail.python.org/mailman/listinfo/python-list
string ...
Gary Herron
--
https://mail.python.org/mailman/listinfo/python-list
lways been there.
See https://docs.python.org/2/tutorial/floatingpoint.html for more details.
Gary Herron
fresh install of
https://www.python.org/ftp/python/3.4.1/python-3.4.1.amd64.msi
and a fresh install of
https://www.python.org/ftp/python/2.7.7/python-2.7.7.amd64.msi
to compare it to.
On 06/20/2014 06:11 PM, FraserL wrote:
Ok I've seen https://docs.python.org/2/tutorial/floatingpoint.html now
thanks to Yhg1s on #python
I bet you get this kind of thing a lot, sorry :-/
Yes, often, but it's not a problem. :-)
FraserL wrote in
news:XnsA35313E634BA0fraserlonggmailcom34@21
.
So you have to ask yourself: What do you gain from using Python if you
eliminate all the tools Python provides?
Gary Herron
-
Paul S. LaFollette, Jr
CIS Department
Temple University
+1 215 204 6822
paul.lafolle...@temple.edu <mailto:paul.lafolle...@tem
583 module.
Do you know how to contact the developers of the ISO8583 package?
Gary Herron
If I send it incorrect parameter, the server will reply but if I send it
correctly, the server didn't response.
The original client is in java using ISOMUX, I have been trying to use the
pyMux
n!!!
It's not quite self-contained, as you still need to have Python
installed, but otherwise it's a good way to distribute a Python
application as a single file that users can just copy and run.
Really! 20 years of Pythoning, and I'd never seen this! When was this
introduced?
ou are just learning Python, you should probably use the
*newer* formatting operations. See
https://docs.python.org/3.3/library/string.html#formatspec for details
of that.
Gary Herron
--
https://mail.python.org/mailman/listinfo/python-list
for line in lines:
line = re.sub("#.*", "", line)
line = line.strip()
The *strip* method on strings removes all whitespace from both ends.
There goes your indentation.
policy_lines.append(line)
print line
Cheers
Example:
>&g
e. Please cut and paste.
Second, saying it doesn't work us useless. Please tell us what the code
is supposed to do, and what it actually does, what you expected... If
there is output, cut and paste it. If there is an error traceback, cut
and paste it.
While you are at it, tell u
1440)
>>> a.shape = (480,1440)
>>> a.shape
(480, 1440)
Gary Herron
--
https://mail.python.org/mailman/listinfo/python-list
programming language).
I'm not sure where you would find information about face detection, but
I'm sure you could find a better forum with a little searching.
Gary Herron
--
Dr. Gary Herron
Department of Computer Science
DigiPen Institute of Technology
(425) 895-4418
--
https://mail.
ed:
x**2 ? or perhaps x^2 ? or something else like some Unicode
characters or HTML to get a small superscript 2 above an x.
Once you give an example of what your input looks like, we can start
hashing out how to read it.
Gary Herron
--
Dr. Gary Herron
Department of Computer Science
DigiP
you know how to test for evenness? (Use count%2 will be zero
for even count values.)
* Do you know how to write lines to an output file?
Gary Herron
--
https://mail.python.org/mailman/listinfo/python-list
unter, '\r', # The ending comma means do NOT output the usual \n
Python3:
print(counter, end='\r')
Gary Herron
--
https://mail.python.org/mailman/listinfo/python-list
On 09/12/2011 12:49 AM, Alec Taylor wrote:
Good evening,
I have converted ODT to HTML using LibreOffice Writer, because I want
to convert from HTML to Creole using python-creole. Unfortunately I
get this error: "File "Convert to Creole.py", line 17
SyntaxError: Non-ASCII character '\xe2' in file
st an internal loop for filling an array) is probably
more efficient, certainly less code, and arguably more Pythonic.
A = [ [None,None] for i in range(1000) ]
Gary Herron
--
Gary Herron, PhD.
Department of Computer Science
DigiPen Institute of Technology
(425) 895-4418
--
http://mail.python.org/mailman/listinfo/python-list
t; a[3:6]
array([3, 4, 5])
If you mean something else, please be more specific, and we'll try again.
Gary Herron
--
Gary Herron, PhD.
Department of Computer Science
DigiPen Institute of Technology
(425) 895-4418
--
http://mail.python.org/mailman/listinfo/python-list
w list to be a numpy array then
numpy.array([ x for x in A if 3.0 <= x <= 8.0 ])
On Thu, Sep 15, 2011 at 10:54 PM, Gary Herron <mailto:gher...@digipen.edu>> wrote:
On 09/15/2011 09:40 AM, neeru K wrote:
Dear Python Users,
I am trying to write a code for visu
:
sum(map(int,str(2**1000)))
1366
Here's another one-liner using a generator instead of map:
sum(int(c) for c in str(2**1000))
Gary Herron
--
Gary Herron, PhD.
Department of Computer Science
DigiPen Institute of Technology
(425) 895-4418
--
http://mail.python.org/mailman/listinfo/python-list
e incorrect result -- then we
have a real bug. However, the chance of that is really really tiny.
Gary Herron
--
Gary Herron, PhD.
Department of Computer Science
DigiPen Institute of Technology
(425) 895-4418
--
http://mail.python.org/mailman/listinfo/python-list
essentially ignored.
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
On 10/13/2011 07:19 PM, Roy Smith wrote:
I've got to write some tests in python which simulate getting a page of
HTML from an http server, finding a link, clicking on it, and then
examining the HTML on the next page to make sure it has certain features.
I can use urllib to do the basic fetching,
;
Strings aren't mutable in Python; you can't assign to slices of them.
So you'll get a TypeError on the previous line.
Cheers,
Chris
Also, the statement
for i in nome:
does not loop through indices, but rather it loops through the actual
characters of the string.
Gary H
help, please put more time into the
quality of your question.As it is stated, we really don't know what
you want help with.
Gary Herron
PS: Sorry for previous mail !!
Thank you :)
--
Dr. Gary Herron
Department of Computer Science
DigiPen Institute of Technology
(425) 895-441
1.53075794228e-15
is the (scientific notation) representation of .00153075794228. Is
that not close enough to zero for your purposes? (Or is it that you don't
understand the 'e-15' portion of the output?)
--
Dr. Gary Herron
Department of Computer Science
DigiPen Institut
On 02/18/2013 11:42 AM, leonardo selmi wrote:
pls i need help:
i have copied the following from a book and tried to make it work:
import math
def area(radius):
return math.pi * radius**2
def circumference(radius):
return 2 * math.pi * radius
i saved the above program from python shell into a
On 02/18/2013 12:14 PM, leonardo wrote:
thanks guys and sorry for my incomplete datas, here is the error message:
Traceback (most recent call last):
File "", line 1, in
import circle
File "circle.py", line 1
Python 2.7.3 (v2.7.3:70274d53c1dd, Apr 9 2012, 20:52:43)
^
Sy
973095679, 3.113889114931214,
3.05408169326, 2.360224809741029, 2.026697918525358,
1.322913986495805, 4.341848866805052, 0.970311202088483,
2.002058149505537, 0.07453277198439523, 1.9633241018322773,
4.22967258746455]
--
Dr. Gary Herron
Department of Computer Science
DigiPen Institute of Technology
collection immediately after the loop finishes.
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
line connecting (0,4) and (7,3) and so on.
Are you asking a MATH question, or a Python question.
This is, do you need the (linear) equation which performs the
evaluation, or help in producing a program to do the calculation?
Gary Herron
--
Dr. Gary Herron
Department of Computer Science
loops?
for p in sorted(segments.iterkeys()):
for k in sorted(class_count.iterkeys()):
for j in sorted(pixel_count.iterkeys()):
# This will be run with all possible combinations of p,k,
and t.
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
et the information of a machine like "computer 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
... whatever ...
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
gt;-
>
>I have around one year to await.
>
>
You don't appear to understand Open Source very well.
Python is the way it is because we, the community, *like* it that way.
It evolves in directions that we (all) decide it is to evolve. Guido is
our leader in this because we trust him and *choose* to follow his lead.
If you want something changed you don't wait and you don't whine, you
join the community with a reasoned argument for why your idea would make
it a better language in *our* eyes.
So how about it... What's your complaint, what's your solution, and why
should we listen?
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
them somewhat more
visible.)
Try this experiment: Print out a page of C++ code,
tape 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 --
me, it makes
>sense, just like Python makes sense. Any time-line on implementing this?
>
>
Look at the date. That was an April Fools joke.
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
ple as that is, I'd still recommend the cPickle module.
As always, this security warning applys: Evaluating arbitrary text
allows anyone, who can change that text, to take over complete control
of your program. So be carefully.
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
erever Parameters is imported:
Parameters.xyzzy = 'whatever'
Parameters.startDirectory = 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 i
nd good luck with your studies.
Gary Herron
>thanks...
>Aysun
>
>
>
>
--
http://mail.python.org/mailman/listinfo/python-list
thing for any function you wish
to apply across the list.So then its only a matter of giving it a
function that "and"s two arguments:
Either:
reduce(lambda a,b: a and b, logFlags)
or
def and2(a,b):
return a and b
reduce(and2, logFlags)
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
aw_records.pos_records"
> r_table = eval(tmp)
>
> works great thanks for the help!
>
Yes, it works, but this is not a good place to use eval. Now that we see
how you want to use it, we can find a *much* better way to do it.
If you want to lookup an attribute of an object, but the attribute name
is a string in a variable, then use getattr to do the lookup.
If in interpret your code correctly:
attrname = state + "_raw_records"
obj = getattr(h5file.root, attrname)
r_table = obj.pos_records
These, of course, could be combined into a single (but not necessarily
clearer) line.
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
tly unmaintainable, and not noticeably more
efficient than code that is readable and maintainable.
Moreover, all the work of creating the outer list seems to be wasted
since that list is just thrown out.
This is worse than "overly clever". Loops are for looping, list
comprehensi
lso be in the dictionary -- I have no idea how you plan to specify
*which* local variable you want the name of.
Anyway, the dictionary is:
self.__dict__
and the list of variable names is the dictionary's keys:
self.__dict__.keys()
and one of the elements in that list will be the string:
named imp. It
allows you to import a file whose name is specified in a string -- that
should work for you.
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
18)]
>>> print bar.data
[(-74.0014993, 1), (123.450999, 18)]
>>> bar.a_count()
[(-74.0014993, 1), (123.450999, 18)]
>>>
You effort to reduce your real code to a simple demonstration of the
problem is appreciated, but I don't think it worked in this case.
Want to try again?
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
= A() # create an instance
>>> a.__dict__ # It has no attributes
{}
>>> a.__dict__ = {'c':1, 'b':2} # Give it some
>>> a.b # Verify
2
>>> a.c
1
>>> a.__class__ # Examine its class
>>> class B:
... pass
...
>
tem executes any command given as a string (which you can build
however you want). Or you might use the newer "subprocess" module.
Gary Herron
> TIA.
>
>
--
http://mail.python.org/mailman/listinfo/python-list
Andre Poenitz wrote:
> Hi all.
>
> Is there a way to load a module given a full path to the module
> without extending sys.path first?
>
> Andre'
>
>
The standard module named "imp" can help you with this.
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
ar4': '', 'var1': 'blah', 'var3': 'blahblahblah', 'var2':
'blahblah', '__builtins__': ,
'__file__': '/home/gherron/.startup.py', '__name__': '__main__',
'__doc__': None}
>>> for v,k in locals().items():
... if v.startswith('var'):
... print k
...
blah
blahblahblah
blahblah
>>>
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
sent a string and reinterpret those bits as an integer, then ...
perhaps you'd like to check out the struct module.
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
or
that print. For example, here are several ways to convert an int to a
printable string with and without leading zeros:
>>> i = 123
>>> '%d' % i
'123'
>>> '%5d' % i
' 123'
>>> '%05d' % i
'00123'
Hope that helps,
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
ion of
finite digit arithmetic. Python makes the opposite assumption that we
are are adults here and can handle the full knowledge, slight
imprecision and all.
Dr. Gary Herron
> Python refuses to guess what you want, and gives you the information
> available.
>
>
--
http://mail.python.org/mailman/listinfo/python-list
dictionary in place rather
than returning a new dictionary.
>>> a={'a':1}
>>> b={'b':2}
>>> a.update(b)
>>> a
{'a': 1, 'b': 2}
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
ou tried coding a solution and failed, or are you just expecting
> people to code for free?
>
>
>
>
Right. This thread begins to look like someone with a homework
assignment asking for code rather than attempting to try programming it
up himself. I was happy to answer th
. global g
... g = 123
...
>>> x()
>>> g
123
>>>
Gary Herron
> ive tried simply adding the variables in:
>
> def function(atom, Xaa, Xab):
> Xaa = onefunction(atom)
> Xab = anotherfunction(atom)
>
> if i can give something
一首诗 wrote:
> Is there any simple way to solve this problem?
>
>
Yes, strings have a replace method:
>>> s = "abc def"
>>> s.replace(' ',' ')
'abc def'
Also various modules that are meant to deal with web and xml and s
Frederic Rentsch wrote:
> A few Cheese Shop upload problems have been solved with the help of this
> creative group. Thank you all!
>
> Version 2.2 beta should be phased out. It has a functional defect,
> missing matches with a very low statistical probability. Version 2.3 has
> this fixed.
>
>
and
# Also works because files are reopened for each use:
print [(i1.strip(),i2.strip(),i3.strip())
for i1 in open('word1.txt')
for i2 in open('word2.txt')
for i3 in open('word3.txt')]
Hope that's clear!
Gary Herron
&
[EMAIL PROTECTED] wrote:
>Gary Herron wrote:
>
>
>>List comprehension is a great shortcut, but when the shortcut starts
>>causing trouble, better to go with the old ways. You need to reopen each
>>file each time you want to iterate through it. You should be able to
]
> [1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 7, 7,
> 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8]
>
> Thanks,
> Levi
Sure. Try:
[i+1 for i in range(8) for j in range(i+1)]
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
culate an answer today (or even this week).
I doubt that you really *want* all 3.4 million digits. So what is it you
really want? A scientific or engineering result as a floating point
number accurate to some reasonable number of digits? That integer value
modulo some other integer (as used in v
ws* its length at all times. len() is a
constant time lookup of an internal attribute.
Gary Herron
> The best I could come up with is sum(itertools.imap(lambda x: 1, g)) --
> but that does look a bit ugly ...
>
>
--
http://mail.python.org/mailman/listinfo/python-list
ithmetic between infinities and real
values. The production of, and arithmetic on, infinities is a choice
that any application may want allow or not.
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
ue
>>> 100 is 100
True
This is highly implementation dependent. The current (C) implementation
of Python has a cache for small integers, so the attempt to compare
values with "is" works for some small integers, and fails for some large
integers, but curiously, not all insta
the Python-UNO bridge). This might (eventually) get you
what you want.
Here's a URL for it:
http://udk.openoffice.org/python/python-bridge.html
Good luck,
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
But what's the point? This does the same as a for loop but slower.
If you don't want any kind of a loop (again, What's the point?) you
could write something recursive:
def proc(i, ...):
# ... do something with i
if i < whatever:
proc(i+1, ...)
But this wo
s a number of very general operations that can be performed
across arrays.
Good luck
Gary Herron
>
> /Sheldon
>
> Gary Herron wrote:
>
>
>> Sheldon wrote:
>>
>>> Hi,
>>>
>>> I have two arrays that are of the same dimension but havin
any uses of the name from enclosing scopes.)
If that last makes sense, good. If not, then just follow this rule:
Choose your variable names to be different than any builtin names -- or
at least different than any of the builtin names you intend to use.
Gary Herron
> high=[]
> lo
waiting to be read, and select always inform you of that fact by
returning stdin in the rr list.
If you want select to start blocking again, you must read all bytes from
stdin whenever select says there are bytes to be read.
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
;missing fields"?
What's a "shape file"?
On what object to you wish to check "attribute values"?
I'm not sure I can help even if I have those answers, but I'm sure I
can't help if I don't.
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
Lisp and another in Python. I know *nothing*
about either one.
http://packages.debian.org/unstable/devel/cl-rsm-genetic-alg.html
http://home.gna.org/oomadness/en/genetic/
Enjoy,
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
imitive
functionality back with the dinosaurs (C and its relatives) when we
moved into the world of tje modern sophisticated programming language
Python. Tell us why you are contemplating such a thing, and someone
here will help you implement it the "Pythonic" way.
Gary Herro
>
> Thanks,
> Ken
>
I don't believe that information is out-of-date. I use the python-bridge
with the OpenOffice version 2.0.3 quite successfully. In my case I open
a spread sheet and search around for and extract various values. It
works just fine for me.
Gary Herron
--
http:
ever create a
copy of the object. If you *do* want to create an object, you may
consider using the copy module:
http://docs.python.org/lib/module-copy.html
(But I must point out, that in 12 years of programming Python, I've
hardly ever used that module.)
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
someone into changing it, but if we've gone
this long without caring to fix it, then I'd 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 compla
that function with
your parameters. This is done directly in Python and ctypes without the
need for building any extension module.
Gary Herron
> Thank you.
>
>
--
http://mail.python.org/mailman/listinfo/python-list
refer to it.
Here's some working code which manipulates a reference to a function
then calls it:
>>> def fn():
... print "Hello world!"
...
>>> 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
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 funct
ions they need.
>
That's not true. Have you actually tried this? It works perfectly, and
is, in fact, the expected 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
:
>python -c "import compileall; compileall.compile_dir('.',0)"
>Listing . ...
>Compiling ./Ciscoports.py ...
> File "./Ciscoports.py", line 753
>print string.ljust(PortlinkbeatInv[row[j][0]],14),
>^
>SyntaxError: invalid syntax
>
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
se 1, no matter how
many times an import causes phase two to be performed.
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
ck
try:
assert False
except:
traceback.print_exc()
and you'll get a traceback (a very short one in this case):
Traceback (most recent call last):
File "", line 2, in ?
AssertionError
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
A
traceback.print_exc() within the "except" clause will print it at that
point, then execution can continue normally.
Gary Herron
>
>
>- Bill
>
>
--
http://mail.python.org/mailman/listinfo/python-list
;t
>work, so it must be some other syntax.
>
>
Not with tuples, lists or dictionaries. However a more recent addition
to the language is Sets, and they support set differences:
>>> from sets import Set
>>> Set([1,2,3,4,5,6]) - Set([2,3,6])
Set([1, 4, 5])
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
hat
doesn't invalidate the claim that the value *is* a dimensioned
quantity. In lieu of a name, we'd have to label such a quantity as
"sqrt of degrees" or "sqrt of radians". After all, we do the same
thing for measures of area. We have some units of area like &
Wildemar Wildenburger wrote:
> Gary Herron wrote:
>
>> Of course not! Angles have units, commonly either degrees or radians.
>>
>> However, sines and cosines, being ratios of two lengths, are unit-less.
>>
>>
>>> To understand it: sin()
directories.
After giving you a chance to modify that list, ow.walk then goes through
the list (whatever contents it has at that point) and visits any
subdirectory.
I'd guess your trouble with understanding this has to do with wondering
how the modified list gets from your code back to os.wa
you can iterate through that list of lines. Like this:
import urllib2
url = urllib2.urlopen('http://www.google.com')
for line in url.readlines():
print line
url.close()
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
with sizes that are
putting a serious strain on your memory footprint, then one of the other
suggestions might be indicated.
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
laces
> **weights_array(randomizing_counter) = small_randomized_int
>
If weights_array is a list or dictionary then use
weights_array[randomizing_counter] = ...
to choose which element of the list gets the assignment.
If weights_array is a function, then
weights_array(rand
jolly wrote:
> Hey guys,
>
> I'm rather new to python and i'm have trouble(as usual)
>
> I want to know if it is possible to change where 'import' looks
> this will save me clogging up my python directory
>
> Thanks
>
Easily done. The value of sys.path is a list of directories that import
.
However, there are software packages that represent numbers (integer and
floating point) with larger collections of bit.
Try looking at GMP at for one such package: http://gmplib.org/
Good luck,
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
s than 0 (and probably less than
any integer). Given that, your two observations above are consistent.
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
if type( x ) == NoneType:
>> # true
>> < code >
>> else:
>> # false; do something else.
>> < more code >
>>
>> Steven Howe
>>
>
> Is that any better than this?
>
> if x is None:
> # do something
> else
ere?
>
>
Obviously? Conditions? What conditions?
We do things like this constantly, and in fact, it *does* work.
Please tell us how it fails, or what is unsatisfactory about it.
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
local* to that function. And like all local variables, they
can be set and used within the function, but are independent of objects outside
the function.
If you want to assign to a global object from within a function, then you must
explicitly say so:
def setExitCode():
global _exitco
201 - 300 of 779 matches
Mail list logo