,
and import params from all over the rest of the program. Once the
interpreter has imported it for the first time, everyone else just gets
a link to the same instance of the module rather than running it all
over and over again.
--
Rob Gaddi, Highland Technology -- www.highlandtechnology.com
Email
of my codebase on
Python 2.x., and didn't feel like wxPython Phoenix was ready for prime
time.
To the best of my knowledge, PySide is still under active
development, including as the day job for Robin Dunn, the lead
developer of wxPython.
--
Rob Gaddi, Highland Technology
to talk
about the function itself rather than the value thereof. No more
help from the interactive console. No more passing the function as an
argument. All to save '()', which is what tells other programmers that
you're calling a function.
--
Rob Gaddi, Highland Technology
No, no. Options use up commas, not parentheses. Maybe equals signs if
you're feeling particularly verbose.
Clearly there's a market for some sort of well-diversified punctuation
fund. The only problem becomes listing it.
--
Rob Gaddi, Highland Technology -- www.highlandtechnology.com
Email address
(sessionVar)
p3 = ctypes.c_int (1)
p4 = ctypes.c_int (0)
hllApi (ctypes.byref (p1), p2, ctypes.byref (p3), ctypes.byref (p4))
Great. And that fails in what way, on which line, with what error message?
--
Rob Gaddi, Highland Technology -- www.highlandtechnology.com
Email address domain
web scraping, you want to use
http://www.crummy.com/software/BeautifulSoup/ . End of story.
--
Rob Gaddi, Highland Technology -- www.highlandtechnology.com
Email address domain is currently out of order. See above to fix.
--
https://mail.python.org/mailman/listinfo/python-list
to do with the coding work itself. Don't say something to prove
you're so noble.
Hai guyz I am new to biochemistry and so I need lots of help with
things.can you tell me how to make anthrax?
I need it for stuff, so dont worry
--
Rob Gaddi, Highland Technology -- www.highlandtechnology.com
.')
--
Rob Gaddi, Highland Technology -- www.highlandtechnology.com
Email address domain is currently out of order. See above to fix.
--
https://mail.python.org/mailman/listinfo/python-list
those were pretty dead on
even. Any idea what I'm seeing here?
--
Rob Gaddi, Highland Technology -- www.highlandtechnology.com
Email address domain is currently out of order. See above to fix.
--
https://mail.python.org/mailman/listinfo/python-list
it looks like I might have to try Emacs.
Thanks everyone
Emacs and vim both have huge learning curves that I've decided aren't
worth climbing. Notepad++ is an excellent GUI text editor for Windows.
Geany is nearly as good, and runs on anything.
--
Rob Gaddi, Highland Technology
it to spend.
Actually do all that and you'll understand as much about circuits as
anyone they're giving an EE degree to these days. Then you can start.
--
Rob Gaddi, Highland Technology -- www.highlandtechnology.com
Email address domain is currently out of order. See above to fix.
--
https
in steve. This would have
been clear if you were to add a print(x) into the loop.
--
Rob Gaddi, Highland Technology -- www.highlandtechnology.com
Email address domain is currently out of order. See above to fix.
--
https://mail.python.org/mailman/listinfo/python-list
item in the list.
. . .
Keep persisting!
--
~Ethan~
Python 'for' is better read as 'for each'.
--
Rob Gaddi, Highland Technology -- www.highlandtechnology.com
Email address domain is currently out of order. See above to fix.
--
https://mail.python.org/mailman/listinfo/python-list
go into that bin, but 2.1 would go into a different one.
TL;DR you need to think very hard about your problem definition and
what you want to happen before you actually try to implement this.
--
Rob Gaddi, Highland Technology -- www.highlandtechnology.com
Email address domain is currently out
On Tue, 23 Sep 2014 22:01:51 -0700 (PDT)
Miki Tebeka miki.teb...@gmail.com wrote:
On Tuesday, September 23, 2014 7:33:06 PM UTC+3, Rob Gaddi wrote:
While you're at it, think
long and hard about that definition of fuzziness. If you can make it
closer to the concept of histogram bins
On Fri, 26 Sep 2014 15:10:43 -0400
random...@fastmail.us wrote:
On Fri, Sep 26, 2014, at 14:30, Rob Gaddi wrote:
The histogram bin solution that everyone keeps trying to steer you
towards is almost certainly what you really want. Epsilon is your
resolution. You cannot resolve any
is substantially less error-prone. People
are fundamentally not as good at thinking about inverted logic.
--
Rob Gaddi, Highland Technology -- www.highlandtechnology.com
Email address domain is currently out of order. See above to fix.
--
https://mail.python.org/mailman/listinfo/python-list
On Mon, 13 Oct 2014 09:26:57 -0700 (PDT)
Rustom Mody rustompm...@gmail.com wrote:
On Monday, October 13, 2014 9:43:03 PM UTC+5:30, Rob Gaddi wrote:
On Mon, 13 Oct 2014 09:56:02 +1100
Steven D'Aprano wrote:
When you have multiple clauses in the condition, it's easier to reason
about
there is no age. This is
because you are trying to call a function of the class object, rather
than a function of an instance of the class.
pax=pet()
--
Rob Gaddi, Highland Technology -- www.highlandtechnology.com
Email address domain is currently out of order. See above to fix.
--
https://mail.python.org
nothing.
Figuring out how to hunt down the syntax errors your retyping has
induced teaches much.
--
Rob Gaddi, Highland Technology -- www.highlandtechnology.com
Email address domain is currently out of order. See above to fix.
--
https://mail.python.org/mailman/listinfo/python-list
and width remain locked, and that perimeter() and area() work
correctly.
--
Rob Gaddi, Highland Technology -- www.highlandtechnology.com
Email address domain is currently out of order. See above to fix.
--
https://mail.python.org/mailman/listinfo/python-list
On Fri, 31 Oct 2014 14:24:11 -0700 (PDT)
sohcahto...@gmail.com wrote:
On Friday, October 31, 2014 1:51:23 PM UTC-7, Chris Angelico wrote:
On Sat, Nov 1, 2014 at 4:43 AM, Rob Gaddi
rgaddi@technologyhighland.invalid wrote:
Define a Square class, subclassed from Rectangle. Use getters
-2.30am everyday. Is this possible?
I would appreciate any help. Thank you for your time.
Regards
Mary-Frances
Your keyword search is 'cron'.
--
Rob Gaddi, Highland Technology -- www.highlandtechnology.com
Email address domain is currently out of order. See above to fix.
--
https
-discipline.
assert obj.read_accesses 10
--
Rob Gaddi, Highland Technology -- www.highlandtechnology.com
Email address domain is currently out of order. See above to fix.
--
https://mail.python.org/mailman/listinfo/python-list
, and really that concerned about the extra
memory used by zip returning a list rather than an iterator, you can
use itertools.izip
--
Rob Gaddi, Highland Technology -- www.highlandtechnology.com
Email address domain is currently out of order. See above to fix.
--
https://mail.python.org/mailman
the things that you want to do in
some defined order.
--
Rob Gaddi, Highland Technology -- www.highlandtechnology.com
Email address domain is currently out of order. See above to fix.
--
https://mail.python.org/mailman/listinfo/python-list
simplifies knowing where to start looking
for documentation.
--
Rob Gaddi, Highland Technology -- www.highlandtechnology.com
Email address domain is currently out of order. See above to fix.
--
https://mail.python.org/mailman/listinfo/python-list
Rob Gaddi added the comment:
I was just working on similar things, and found the same problem. I can
confirm failure on both Python 2.7.4 and Python 3.3.1 running on 64-bit Linux,
and that the Windows builds do not have this problem.
My code:
from __future__ import print_function
from
.
def docs(dicts):
return map(Doc, dicts)
Or, if you really wanted to be crazy
for d in client.db.radios.find({’_id': {’$regex’: ‘^[ABC]'}}):
doc = Doc(d)
pprint(doc)
I mean, I realize linefeeds don't grow on trees and all...
--
Rob Gaddi, Highland Technology
up
with an elegant solution, but does anyone already have one?
--
Rob Gaddi, Highland Technology -- www.highlandtechnology.com
Email address domain is currently out of order. See above to fix.
--
https://mail.python.org/mailman/listinfo/python-list
On Fri, 06 Feb 2015 16:44:26 -0500, Dave Angel wrote:
On 02/06/2015 04:35 PM, Ben Finney wrote:
Rob Gaddi rgaddi@technologyhighland.invalid writes:
So I'm trying to wrap my head around packaging issues
Congratulations on tackling this. You will likely find the Python
Packaging User Guide
On Thu, 05 Feb 2015 11:25:42 -0800, Paul Moore wrote:
On Thursday, 5 February 2015 16:57:07 UTC, Rob Gaddi wrote:
You don't need the whole scipy stack, numpy will let you do everything
you want. The trick to working in numpy is to parallelize your
problem;
you don't do a thing a thousand
(axis=1)
--
Rob Gaddi, Highland Technology -- www.highlandtechnology.com
Email address domain is currently out of order. See above to fix.
--
https://mail.python.org/mailman/listinfo/python-list
)
methods to say Alright, well when you do finally have to make a
decision on this thing, here's how you make it. And obviously, you can
add on as many additional data members to carry additional information
as your heart desires.
--
Rob Gaddi, Highland Technology -- www.highlandtechnology.com
Email
= then)
--
Rob Gaddi, Highland Technology -- www.highlandtechnology.com
Email address domain is currently out of order. See above to fix.
--
https://mail.python.org/mailman/listinfo/python-list
:
do_something_to(x)
--
Chris Warrick https://chriswarrick.com/
Sent from my Galaxy S3.
Or the somewhat less indenty
for x in seq:
if not some_predicate: continue
do_something_to(x)
--
Rob Gaddi, Highland Technology -- www.highlandtechnology.com
Email address domain is currently out of order
).
--
Rob Gaddi, Highland Technology -- www.highlandtechnology.com
Email address domain is currently out of order. See above to fix.
--
https://mail.python.org/mailman/listinfo/python-list
of the freeze.
I'm pretty much out of ideas at this point. Anyone have any advice?
--
Rob Gaddi, Highland Technology -- www.highlandtechnology.com
Email address domain is currently out of order. See above to fix.
--
https://mail.python.org/mailman/listinfo/python-list
():
if invalid_argument_combination:
raise ValueError('Hey jerk, read the documentation.')
# otherwise you do your thing in here.
--
Rob Gaddi, Highland Technology -- www.highlandtechnology.com
Email address domain is currently out of order. See above to fix.
--
https://mail.python.org/mailman/listinfo
? Is it really as
complicated as all this, or is there something trivial and stupid that
I'm just missing?
--
Rob Gaddi, Highland Technology -- www.highlandtechnology.com
Email address domain is currently out of order. See above to fix.
--
https://mail.python.org/mailman/listinfo/python-list
to be code for code's
sake.
--
Rob Gaddi, Highland Technology -- www.highlandtechnology.com
Email address domain is currently out of order. See above to fix.
--
https://mail.python.org/mailman/listinfo/python-list
Python only. I do have dummy files with the
regex string.
Thanks again,
Gregg
Gregg --
First, please don't top-post. Secondly, os.listdir only does exactly
that; it lists everything on one directory. You're looking for os.walk.
-- Rob
--
Rob Gaddi, Highland Technology
the entire thing as
$ find . -type f | xargs grep DECRYPT_I
--
Rob Gaddi, Highland Technology -- www.highlandtechnology.com
Email address domain is currently out of order. See above to fix.
--
https://mail.python.org/mailman/listinfo/python-list
out to disk, one page per
file, and then use something like pdftk to stitch them all together after
the fact.
--
Rob Gaddi, Highland Technology -- www.highlandtechnology.com
Email address domain is currently out of order. See above to fix.
--
https://mail.python.org/mailman/listinfo/python-list
legacy support. I'd understand if you were trying to maintain an old
codebase with lots of legacy code that was having problematic
migrations, but with the opportunity to start fresh? Start fresh.
You'll be happier for it.
--
Rob Gaddi, Highland Technology -- www.highlandtechnology.com
Email
haven't written a line of it in 20 years. It's the ability to
read a map. A lack of C is the person blindly following their GPS and
hoping for the best.
--
Rob Gaddi, Highland Technology -- www.highlandtechnology.com
Email address domain is currently out of order. See above to fix.
--
https
avoided using features I know are newer, like yield from and Enums,
but I won't swear it'll work on 3.0 if I can't test it that way.
--
Rob Gaddi, Highland Technology -- www.highlandtechnology.com
Email address domain is currently out of order. See above to fix.
--
https://mail.python.org/mailman
On Wed, 13 May 2015 08:35:02 +1000, Ben Finney wrote:
Rob Gaddi rgaddi@technologyhighland.invalid writes:
B) If I can't manage that, what's the etiquette behind having later
versions of a module break compatibility with older versions of Python.
Consult your user community, tell them
for making dead horses fly [33 posts in 13 hours and going strong]
Catapult and a dream, man. Catapult and a dream.
--
Rob Gaddi, Highland Technology -- www.highlandtechnology.com
Email address domain is currently out of order. See above to fix.
--
https://mail.python.org/mailman/listinfo
On Tue, 14 Apr 2015 23:41:56 +0100, Paulo da Silva wrote:
Supposing I have 2 vectors v1 and v2 and a value (constant) k.
I want to build a vector r with all values of v1 greater than k and the
others from v2.
You're looking for numpy.where() .
--
Rob Gaddi, Highland Technology
On Thu, 04 Jun 2015 16:15:20 -0700, stephenppraneel7 wrote:
hey, i really need help, im a straight up beginner in scripting and i
need to figure out how to make an inverted particle emitter using python
in maya
This is why we can't have nice large hadron colliders.
--
Rob Gaddi, Highland
to enumerate the (hopefully finite)
elements of someotheriterable. This is common enough that the built-in
enumerate function does exactly that.
Make sense yet?
--
Rob Gaddi, Highland Technology -- www.highlandtechnology.com
Email address domain is currently out of order. See above to fix
email id s...@theappliedthought.com or you
can reach me on 407-574-7610.
Please feel free to send unsolicited offers for genital enlargement and
30% APR credit cards to the above addresses.
--
Rob Gaddi, Highland Technology -- www.highlandtechnology.com
Email address domain is currently out
implementation, which is neither here nor there.
If I remember right, numpy does dynamic loading of one of a couple
different (FORTRAN?) algebra libraries depending on which ones it can
find installed. That would be a pretty clear use case for libffi.
--
Rob Gaddi, Highland Technology
steps, but at that point I
wouldn't be able to vouch for the process.
--
Rob Gaddi, Highland Technology -- www.highlandtechnology.com
Email address domain is currently out of order. See above to fix.
--
https://mail.python.org/mailman/listinfo/python-list
code_executed_unconditionally
finally:
if need_cleanup:
do_cleanup
if condition:
try:
do_something_needing_cleanup()
code_executed_unconditionally()
finally:
do_cleanup()
else:
do_something_else()
code_executed_unconditionally()
--
Rob Gaddi, Highland Technology
with a
powered nailgun at your feet. Search is an inefficient way to try to
split a string into parts based on a delimiter.
--
Rob Gaddi, Highland Technology -- www.highlandtechnology.com
Email address domain is currently out of order. See above to fix.
--
https://mail.python.org/mailman/listinfo/python
to the inline docs for that entire set of
libraries; it'll make your life easier.
--
Rob Gaddi, Highland Technology -- www.highlandtechnology.com
Email address domain is currently out of order. See above to fix.
--
https://mail.python.org/mailman/listinfo/python-list
level by the same entry point. Anything in the
genre is hosed until they get it back under control.
Personally, I'm so upset that I'm going to call Linux and demand my money
back. But until then I'm regressed to -63.
--
Rob Gaddi, Highland Technology -- www.highlandtechnology.com
Email addres
ndows machine I long
ago switched the default editor to Notepad++ for everything and was far
happier for it.
--
Rob Gaddi, Highland Technology -- www.highlandtechnology.com
Email address domain is currently out of order. See above to fix.
--
https://mail.python.org/mailman/listinfo/python-list
can get really wonky on this stuff.
More generally, is there any good way to introspect ctypes derived
classes? I have to figure out whether things are derived from Structure,
Union, Array etc. through some ugly indirect methods, and have no idea
why.
--
Rob Gaddi, Highland Technology
and not enough cups of coffee to compensate.
Thanks for the help, my stupid mistake.
--
Rob Gaddi, Highland Technology -- www.highlandtechnology.com
Email address domain is currently out of order. See above to fix.
--
https://mail.python.org/mailman/listinfo/python-list
check if a value is out of certain
> range?
> Example - To check if x is either less than zero or greater than ten?
> Right now I am using x < 0 or x > 10.
>
> Regards,
> Laxmikant
not (0 <= x <= 10)
--
Rob Gaddi, Highland Technology -- www.highlandtechnology.com
Emai
.'
That one's not always true, but any time you're debating a regex solution
it should at least come to mind. Lots of people have posted lots of pure
Python solutions. I will simply comment that using any of them will make
you fundamentally happier as time goes on than trying to shoehorn a r
try to report this one to?
Thanks,
Rob
--
Rob Gaddi, Highland Technology -- www.highlandtechnology.com
Email address domain is currently out of order. See above to fix.
--
https://mail.python.org/mailman/listinfo/python-list
On Sat, 03 Oct 2015 11:12:28 +0200, Laura Creighton wrote:
> In a message of Sat, 03 Oct 2015 11:07:04 +0200, Laura Creighton writes:
>>In a message of Fri, 02 Oct 2015 22:36:23 -0000, Rob Gaddi writes:
>>>So, this is odd. I'm running Ubuntu 14.04, and my system did a kern
can make it work. Sometimes, in non-contrived
examples, you get a situation where you can't avoid blending information
around in both directions. In that case, your Monty instance is already
acting as a factory for Actors. Keep going with that; have the Actor be
init'ed with a .monty that refers back
than "why you write the code". Paying money
for books is acceptable; this is all on the company's time/dime.
Thanks,
Rob
--
Rob Gaddi, Highland Technology -- www.highlandtechnology.com
Email address domain is currently out of order. See above to fix.
--
https://mail.python.org/mailman/listinfo/python-list
(len(fortunes))
print(i, fortunes[i])
Or to be lazier still, just use random.choice
fortunes = ('happy', 'horny', 'messy', 'sad', 'lool', 'buggy')
print(random.choice(fortunes))
None of which actually addresses the OP's issue with input(), but it's
nice to get the back half clean as well.
--
Rob Gaddi, Highland Technology -- www.highlandtechnology.com
Email address domain is currently out of order. See above to fix.
--
https://mail.python.org/mailman/listinfo/python-list
the _canonical_ use case for
for loopvar in range(initial_value, limit+1):
processing
if found_what_im_looking_for:
break
else:
do_whatever_it_is_you_do_when_its_not_found
The limited variable scoping is the only thing missing, and you can get
around that by telling yourself
/www.eurion.net/python-snippets/snippet/Calendar_Date%20picker.html
>
> - Nick.
I use PySide rather than PyQt, but definitely count me as another vote
for Qt as the toolkit of choice. I started out on wx, but when I needed
to move to Python3 it wasn't able to come with me.
--
Rob Gaddi, Hig
Lawrence D’Oliveiro wrote:
> On Friday, June 3, 2016 at 8:09:21 AM UTC+12, Rob Gaddi wrote:
>> Although your loop is really the _canonical_ use case for
>>
>> for loopvar in range(initial_value, limit+1):
>> processing
>> if found_what_im_look
eged
> information or confidential information or both. If you are not the intended
> recipient please delete it and notify the sender.
You're looking for numpy.
--
Rob Gaddi, Highland Technology -- www.highlandtechnology.com
Email address domain is currently out of order. See above to fix.
--
https://mail.python.org/mailman/listinfo/python-list
(
reg = region, meas = p, chan = self.name
)))
inner.__name__ = fnname
inner.__doc__ = "Channel {} measurement".format(fnname)
return inner
setattr(Channel, fnname, measmaker(measparam))
--
Rob Gaddi, Highland Technology -- www.highlandtech
sample.
Are you going to be trying to use this data realtime, or are you just
trying to datalog it and deal with it offline? Because at some point
you'll need to decide, all in, how much data you're willing to try to
hold in memory and what you intend to do with the rest of it.
--
Rob Gaddi, Highlan
Random832 wrote:
> On Wed, Jun 15, 2016, at 13:37, Rob Gaddi wrote:
>> I've got a whole lot of methods I want to add to my Channel class, all
>> of which following nearly the same form. The below code works, but
>> having to do the for loop outside of the main class defini
Steven D'Aprano wrote:
> On Thu, 16 Jun 2016 04:39 am, Rob Gaddi wrote:
>
>>> class Channel:
>>> frequency = mkmeasure('frequency', 'FREQ')
>>> falltime = mkmeasure('falltime', 'FTIM')
>>
>> Thought about it, but whenever I'm dropping 20-someodd of t
Chris Angelico wrote:
> Start by coding things in the
> simple and obvious way, and then fix problems only when you see them.
Is that statement available in 10 foot letters etched into stone?
--
Rob Gaddi, Highland Technology -- www.highlandtechnology.com
Email address domain is current
t's not worth doing.
Now, if you do really have a million entries, one thing that would help
with memory is setting __slots__ for MyFile rather than letting it
create an instance dictionary for each one.
--
Rob Gaddi, Highland Technology -- www.highlandtechnology.com
Email address domain is currently out of order. See above to fix.
--
https://mail.python.org/mailman/listinfo/python-list
ut if you're actually making that check it's because you've
got a bunch of 2/3 compatibility crap you're having to work out; six
will help will all of that too.
--
Rob Gaddi, Highland Technology -- www.highlandtechnology.com
Email address domain is currently out of order. See above to fix.
--
htt
nt wrong" or
> the
> equivalent without any accompanying context information.
>
> Cheers,
> Cameron Simpson <c...@zip.com.au>
Or, for that matter:
logging.exception('something went wrong')
Which gives you the whole traceback as well and doesn't require you to
explictly grab the exception.
--
Rob Gaddi, Highland Technology -- www.highlandtechnology.com
Email address domain is currently out of order. See above to fix.
--
https://mail.python.org/mailman/listinfo/python-list
two dozen languages. None of them turn out correct code more quickly
than Python; few even come close.
--
Rob Gaddi, Highland Technology -- www.highlandtechnology.com
Email address domain is currently out of order. See above to fix.
--
https://mail.python.org/mailman/listinfo/python-list
Sushanth wrote:
> i need to convert r data frame to pandas dataframe and vise versa
>
Now, now, let's at least _try_ to help.
http://lmgtfy.com/?q=convert+r+data+frame+to+pandas
--
Rob Gaddi, Highland Technology -- www.highlandtechnology.com
Email address domain is currently out of
nversation. Think long and hard on it.
--
Rob Gaddi, Highland Technology -- www.highlandtechnology.com
Email address domain is currently out of order. See above to fix.
--
https://mail.python.org/mailman/listinfo/python-list
ou have been badly misled. Python local variables are frame local, and
recursion just works.
--
Rob Gaddi, Highland Technology -- www.highlandtechnology.com
Email address domain is currently out of order. See above to fix.
--
https://mail.python.org/mailman/listinfo/python-list
Rob Gaddi wrote:
> Does anyone know the history of why relative imports are only available
> for packages and not for "programs"? It certainly complicates life.
>
Really, no one? It seems like a fairly obvious thing to have included;
all of the reasons that you want to be
Chris Angelico wrote:
> On Sat, Apr 9, 2016 at 2:59 AM, Rob Gaddi
> <rgaddi@highlandtechnology.invalid> wrote:
>> Rob Gaddi wrote:
>>
>>> Does anyone know the history of why relative imports are only available
>>> for packages and not for
e got a sequence in which you only care about the first hit,
either because you only want one or because you know from everything
else going on in the program there can only be one.
for fn in self._containedfunctions:
if fn.__doc__ is not None:
self.__doc__ = fn.__doc__
break
else:
about half of the classes I write. I think
I've needed __new__ all of twice in the years I've been writing Python.
--
Rob Gaddi, Highland Technology -- www.highlandtechnology.com
Email address domain is currently out of order. See above to fix.
--
https://mail.python.org/mailman/listinfo/python-list
of modules there's a
clear distinction of:
import thingfromstdlib
from . import thingfromlocal
A bit of a nuisance at first, but once you get used to it everything
just makes unambiguous sense.
The problem is that this same distinction doesn't get made for
"programs", only for "mod
on_action();
else {
alternate action();
}
But the principle remains. Syntactic whitespace has its ups and downs
on the leading edge of the line, but at least it's visible there. On
the trailing end of the line it's actively inviting trouble in for
coffee and eggs.
--
Rob Gaddi, Highland Technology -- www.highlandtechnology.com
Email address domain is currently out of order. See above to fix.
--
https://mail.python.org/mailman/listinfo/python-list
start=1):
will save you maintaining your own counter. But other than that, nah,
that's pretty much the approach you're looking for.
--
Rob Gaddi, Highland Technology -- www.highlandtechnology.com
Email address domain is currently out of order. See above to fix.
--
https://mail.python.org/mailman/listinfo/python-list
formedLineError(Exception): pass
for line in file:
try:
for part in line.split('\t'):
if thispartisbadforsomereason:
raise MalformedLineError()
otherwisewedothestuff
except MalformedLineError:
pass
--
Rob Gaddi, Highland Technology -- www.h
ing at a moving target.
How about:
newlist = (
[x for x in mylist if x.startswith(key)] +
[x for x in mylist if not x.startswith(key)]
)
return newlist
Or if you really insist on mutating the original list (which seems less
clean to me, but you do you), then:
newlist = blahblahblah
y point. All (well-behaved) iterators are iterables,
with their __iter__ method returning themselves.
for x in y:
...
implies:
try:
_it = iter(y)
while True:
x = next(_it)
...
except StopIteration:
pass
That's true for any iterable y, including a y which is itself an
iterator.
> Howeve, it doesnt seem to be working. It doesnt calculate the bill. I dont
> know what to do, as I'm less than average at this.
> it comes up as IndexError: list index out of range at line42
>
> Please help
Don't know which one is line 42; but I'd bet your problem is there.
As a rough guess, it might be the line that says:
pizza_cost = pizzatype[menu]
You're bounding that to the range 1-5. A Python list of length 5 has
indices 0-4.
But the error message is telling you everything you need to know; you're
trying to get a list index that's out of range in line 42. Find line
42, figure out what index you're asking it for, and you'll have your
answer. If you don't have an editor that shows you line numbers then
your editor is fundamentally terrible and you should not use it (I
personally like Notepad++ for Windows or Geany for Linux).
--
Rob Gaddi, Highland Technology -- www.highlandtechnology.com
Email address domain is currently out of order. See above to fix.
--
https://mail.python.org/mailman/listinfo/python-list
actual values of variables that you're
creating.
Also, as a mailing list/Usenet etiquette note: You get to have one name
you go by. Going around changing the name you're posting under in the
middle of the thread is a guaranteed way to piss folks off. You didn't
know. You now do.
--
Rob Gaddi, Hi
5.1459024715818.javamail.ya...@mail.yahoo.com>
>
Just read on Usenet instead of through the mailing list. That way
you can accept broken threading as a given rather than wonder why it's
happening in a particular case.
--
Rob Gaddi, Highland Technology -- www.highlandtechnology.com
Email address dom
list source code.
print list(block['relative_chart1']['vessel_names']) should work.
--
Rob Gaddi, Highland Technology -- www.highlandtechnology.com
Email address domain is currently out of order. See above to fix.
--
https://mail.python.org/mailman/listinfo/python-list
Does anyone know the history of why relative imports are only available
for packages and not for "programs"? It certainly complicates life.
--
Rob Gaddi, Highland Technology -- www.highlandtechnology.com
Email address domain is currently out of order. See above to fix.
1 - 100 of 262 matches
Mail list logo