t's the
counter). There's only one entry in the table for my system.
I used the backlinks on each of the two pages above - the backlink on
mythosweb.gr I used twice.
So, whatever behaviour you're seeing is not what I'm seeing.
--
Denis McMahon, denismfmcma...@gmail.com
--
https://mail.python.org/mailman/listinfo/python-list
ght brothers??
No, but that's not what you said.
What you said was that "the [FORTRAN] language [was] hacked together
haphazardly."
That's like me saying that when your uncle flies, he just pulls and
pushes levers and knobs randomly hoping he doesn't crash - and that w
On Thu, 31 Oct 2013 10:56:12 -0700, rusi wrote:
> On Thursday, October 31, 2013 11:20:52 PM UTC+5:30, Denis McMahon wrote:
>> On Thu, 31 Oct 2013 09:05:04 -0700, rusi wrote:
>> > If I say: "My uncle knows more about flying planes than the Wright
>> > brother
isits, downloads) )
I suspect the issue is that, as a list type, the pysql interface expects
to map "downloads" to either multiple columns, or one column in multiple
rows, ie it is expecting the list to deliver multiple data items to the
database, but the database is looking for a sing
data once it is no longer needed.
As an observation, if you are simply providing a torrent search engine,
you do not need to log or record anything at all.
--
Denis McMahon, denismfmcma...@gmail.com
--
https://mail.python.org/mailman/listinfo/python-list
tter take that up with the mysql designers.
--
Denis McMahon, denismfmcma...@gmail.com
--
https://mail.python.org/mailman/listinfo/python-list
shell a peanut.
--
Denis McMahon, denismfmcma...@gmail.com
--
https://mail.python.org/mailman/listinfo/python-list
On Sun, 03 Nov 2013 23:32:46 +, Denis McMahon wrote:
> On Sun, 03 Nov 2013 14:19:48 -0200, Renato Barbosa Pim Pereira wrote:
>
>> I have one .xls file with the values of PV MV and SP, I wanna to
>> calculate Kp Ki Kd with python from this file, can anyone give me any
>&
m for putting a
list straight into a database, because mysql does not have a "collection"
record type.
--
Denis McMahon, denismfmcma...@gmail.com
--
https://mail.python.org/mailman/listinfo/python-list
ed many times in the
past, you should stop trying to write code.
Seriously, how many other people do you see repeatedly posting "I don't
understand the error, help" messages here that have been caused by such
simple coding mistakes?
Most of us can decipher these error messages
and display the list contents, then do the same for list 2, then
retrieve all the data from the db and reproduce each list in turn.
Then you might be ready to try coding what you're trying to code.
--
Denis McMahon, denismfmcma...@gmail.com
--
https://mail.python.org/mailman/listinfo/python-list
On Tue, 05 Nov 2013 20:09:42 +0200, Nick the Gr33k wrote:
> Denis, i have already provided my code trying to do what i need and i
> need some commendation on how to make it work.
Nick, you're obviously trying to code way above your abilities.
If you want me to write your code, you w
ut 6000 Gbytes a day from and to the database.
Holy smoke batman, that's a lot of data.
Or you could use the database properly, and just write the 40 byte
torrent file name to the database with a pointer to the user's record
every time a user downloads another torrent.
--
Den
inally give up trying to help you.
I've had enough. You refuse to learn the right way to do it. You won't
listen to the opinions and suggestions of people with a great deal more
experience than you have in such matters. It's not going to work properly
in the end. I refuse t
ate
maximum salary =
people receiving =
similar for minimum
I might have missed something from the original spec, but as I recall,
you just wanted min, max and avg salaries, and to know who was getting
the min and max, yes?
--
Denis McMahon, denismfmcma...@gmail.com
--
https://mail.python.o
On Wed, 06 Nov 2013 10:34:34 -0500, Joel Goldstick wrote:
>> Okey let the hacker try again to mess with my database!!!
> Nothing like a good challenge.
I think the hacker is a figment of Nick's imagination, or rather a
consequence of his broken python code corrupting his da
cked, I'd guess it was most likely sql injection
using a hand crafted get or post request that exploited some
vulnerability that you have carelessly posted in an internet forum and
then ignored advice to make secure.
--
Denis McMahon, denismfmcma...@gmail.com
--
https://mail.python.org/mailman/listinfo/python-list
On Fri, 08 Nov 2013 01:28:19 +0200, Νίκος Αλεξόπουλος wrote:
> If i was completely incompetent i wouldn't had a working website and i
> wasn't able to design my customers' webpages.
If your website is working, why do you keep posting here asking us how to
fix it?
--
Denis
On Fri, 08 Nov 2013 01:10:37 +, Steve Simmons wrote:
> I must say that I kinda like the idea of Nick's computer gagging on his
> code and sending him messages pleading that he educated himself.
It's a more likely scenario that Nick learning to code properly.
--
Denis McMa
On Sat, 09 Nov 2013 00:01:37 +0200, Νίκος Αλεξόπουλος wrote:
> I saw the link and i'm wondering if it can be written in 1-liner.
Yes, but you have to rewrite all your code in perl to do this.
--
Denis McMahon, denismfmcma...@gmail.com
--
https://mail.python.org/mailman/listinfo/python-list
f DST happens?
Yes, but the scarcity of universal whitespace is preventing me from
posting it.
--
Denis McMahon, denismfmcma...@gmail.com
--
https://mail.python.org/mailman/listinfo/python-list
resumably an sql
variant) used by the database, and a very good understanding of how
string formatting works in python, as you'll be using python to build
command strings to send to the database.
Then you may be ready to start gluing the two together.
--
Denis McMahon, denismfmcma...@gmail
ifference in value of Checksum computed by python in
> windows and other system.?
Perhaps windows file io is padding the file to the block size? Or maybe
the windows version has different end of lines.
--
Denis McMahon, denismfmcma...@gmail.com
--
https://mail.python.org/mailman/listinfo/python-list
hem.
a = 5 '''text'''
is just as wrong as:
q = 4,5,6 [3,5,7,9]
or
k = 6-2 {56:91, 'fred': 'peter'}
or even
m = 62.3 56.7 101.2
--
Denis McMahon, denismfmcma...@gmail.com
--
https://mail.python.org/mailman/listinfo/python-list
abbtd with the text of the next td
for td in abbtds:
print td.get_text(), td.find_next_sibling().get_text()
This works for the html fragment example given, once I fixed it up by
removing the extra at the end.
--
Denis McMahon, denismfmcma...@gmail.com
--
https://mail.python.org/mailman/listinfo/python-list
On Fri, 20 Mar 2015 07:23:22 +, Denis McMahon wrote:
> print td.get_text(), td.find_next_sibling().get_text()
A slightly better solution might even be:
print td.get_text(), td.find_next_sibling("td").get_text()
--
Denis McMahon, denismfmcma...@gmail.com
--
https://ma
poses
it's just whitespace) but in the dom the text node will contain the
newline rather than a space.
bs4 tries to parse the html the same way a browser does, so you get all
the text nodes, including the whitespace between elements which includes
any newlines.
--
Denis McMahon, den
On Tue, 24 Mar 2015 11:13:41 -0700, gdotoli wrote:
> I am creating a tool to search a filesystem for one simple string.
man grep
STOP! REINVENTING! THE! WHEEL!
Your new wheel will invariably be slower and less efficient than the old
one.
--
Denis McMahon, denismfmcma...@gmail.com
--
ht
On Wed, 25 Mar 2015 14:19:39 -0700, Gregg Dotoli wrote:
> On Wednesday, March 25, 2015 at 4:36:01 PM UTC-4, Denis McMahon wrote:
>> On Tue, 24 Mar 2015 11:13:41 -0700, gdotoli wrote:
>>
>> > I am creating a tool to search a filesystem for one simple string.
>
ely internet vandalism, and your
ongoing posts are simply trolling.
--
Denis McMahon, denismfmcma...@gmail.com
--
https://mail.python.org/mailman/listinfo/python-list
opic here. Hence
its a pile of steaming excrement from a troll.
--
Denis McMahon, denismfmcma...@gmail.com
--
https://mail.python.org/mailman/listinfo/python-list
he wiki page on Web Programming
<https://wiki.python.org/moin/WebProgramming> may be more in sync with
recent development."
--
Denis McMahon, denismfmcma...@gmail.com
--
https://mail.python.org/mailman/listinfo/python-list
aries and modules are Python 3 compatible, have a suitable caveat
inserted, or be removed.
--
Denis McMahon, denismfmcma...@gmail.com
--
https://mail.python.org/mailman/listinfo/python-list
fp will result in an invalid JSON file."
Writing back to the same file as you read with json.load is the same
thing. If you want to use the same file, you need to close it after the
json.load(), and then open it again in write mode before the json.dump().
Write is "w", *NOT* "w+".
--
Denis McMahon, denismfmcma...@gmail.com
--
https://mail.python.org/mailman/listinfo/python-list
On Thu, 02 Apr 2015 18:30:42 -0700, Saran A wrote:
> Here is the program that I am trying to write (with specs):
Saran, please stop prefacing every subject with "New to programming:" -
it does not give an clue whatsoever as to what your post is about.
--
Denis McMahon
in the representation.
He's making these and other similar errors in the javascript groups too.
I suspect he's one of those people that spends his time thinking up
elaborate solutions that he has no idea how to implement as a response to
dreamt up non existent problems.
--
Denis McMahon,
erratum
>
> *** 257 (base 10) --> 01 01 (base 256) ***
Bt. Wrong.
0101(256) is 0 * 256^3 + 1 * 256^2 + 0 * 256^1 + 1 * 256^0
= 65537
The whole point of "base x" is that any number in the range 0 .. x^1 is
represented with a single characterisation, otherwise you don
re
patt = re.compile('(?Pa+(?Pb+))')
result = patt.findall('abaabbaaabbb')
print result
however if all you are doing is using .search or .find for the first
match of the pattern, then there should be no scope for confusion anyway.
--
Denis McMahon, denismfmcma...@gmail.com
--
https://mail.python.org/mailman/listinfo/python-list
2 19:46 /usr/local/lib/python2.7/dist-
packages/certifi/cacert.pem
$
--
Denis McMahon, denismfmcma...@gmail.com
--
https://mail.python.org/mailman/listinfo/python-list
On Sun, 12 Apr 2015 21:27:30 +0200, Cecil Westerhof wrote:
> When you run my script you do not get warnings?
I ran into too many issues trying to install the modules I needed to try
and run it.
--
Denis McMahon, denismfmcma...@gmail.com
--
https://mail.python.org/mailman/listinfo/python-list
[0,1,2,3,4,5,6,7,8,9,10],[0,1,2,3,4,5,6,7,8,9,10]))
And see what that produces.
If the second plot produces the line I described, try:
plot(zip(list(results.keys()), list(results.values())))
in your code.
--
Denis McMahon, denismfmcma...@gmail.com
--
https://mail.python.org/mailman/listinfo/python-list
ex
data set.
If, for example, you see a line from (1,11) to (5,5) instead of a line
from (1,5) to (11,5), then it might be that you need to combine the two
lists into a single list of co-ordinate tuples, using eg:
plot(zip(list(results.keys()), list(results.values())))
--
Denis McMahon, den
lve your problem.
If the latter, and the code doesn't work, show us the code and we might
be able to make suggestions for you.
[1] If you thought getting Offler's Tears was hard, wait until you try
reaching the altar of Cthulhu.
--
Denis McMahon, denismfmcma...@gmail.com
--
https
e same
file.
If excel recognises it's own csv exported dates, reformat your dates to
match the excel ones when you generate the csv.
Otherwise, you might need to convert the dates to a numeric value and
tell excel to format the field as date after input.
--
Denis McMahon, denismfmcma...@gm
On Tue, 05 May 2015 23:37:02 -0700, Palpandi wrote:
> What are the ways to encrypt python files?
Depends why you want to encrypt them, and what you want to do with the
encrypted files.
Do you mean executable python code files, or do you mean data files
generated by python.
--
Denis McMa
the code, it's impossible to hide the code at that
point.
Example - if I give you an encrypted binary to run on your system, it
either has to be unencryptable using tools you already have, or using a
built in unencrypter, both of which you have access to and can use to
unencrypt th
On Tue, 05 May 2015 16:37:06 -0700, bmanogna.17 wrote:
> I'm new to pyhton, can anyone suggest me how can I implement a DOS or
> DDOS attack in Beacon Controller.
Contact your nearest LEO cybercrime unit and ask them.
--
Denis McMahon, denismfmcma...@gmail.com
--
https://mail
ionaries if the sizes
are equivalent too. Here's an example why:
a = [ [a,b,c] ]
b = [ [a,b,c], [a,c,b], [b,a,c], [b,c,a], [c,a,b], [c,b,a] ]
If you compare sublists purely on the basis that they contain the same
elements, then a[0] == each of b[0..5]
Does that make a and b equa
rocess, you could try using something like
sed.
sed -i.old 's/^\d+ : //' *.ext
--
Denis McMahon, denismfmcma...@gmail.com
--
https://mail.python.org/mailman/listinfo/python-list
it, he's been a professional
dick for years in php and javascript groups, and now he's obviously
spreading himself further afield. He usually confines his wisdom to
pointing out faults in other's posts, rather than offering any
constructive input himself.
--
Denis McMahon, denism
a csv file. Perhaps you could elaborate on these.
--
Denis McMahon, denismfmcma...@gmail.com
--
https://mail.python.org/mailman/listinfo/python-list
output csv file is 1657 lines in
length, and the first and last lines are:
16,0x0800,0xCC,0x16,0x00,0x20,0x35,0x15,0x00,0x08,0x29,0x15,0x00,0x08,0x2D,0x15,0x00,0x08
12,0x08006780,0x40,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0xFF,0x00,0x00,0x00
--
Denis McMahon, denismfmcma...@gmail.com
--
r. You'll have a hard job creating a million files with timestamp
based naming inside of an hour.
--
Denis McMahon, denismfmcma...@gmail.com
--
https://mail.python.org/mailman/listinfo/python-list
On Wed, 20 May 2015 01:57:51 +, Denis McMahon wrote:
> Based on the sample you sent, the output csv file is 1657 lines in
> length, and the first and last lines are:
[snip]
Well he didn't tell me if I was generating the right output, or what was
wrong with it if it was wrong, so
ry a less ambitious learning project.
(b) Start reading the relevant documentation.
Pick one and go with it.
--
Denis McMahon, denismfmcma...@gmail.com
--
https://mail.python.org/mailman/listinfo/python-list
e is a json string, then
data maps to a list / array
data[0] maps to an object / dictionary
data[0]["Message"] maps to the string literal "tdetails"
data[0]["attr_name"] maps to a string representation of a json ob with
another level of escaping.
That string can then be loaded, eg:
attr_name = json.loads(data[0]["attr_name"])
See: http:/www.sined.co.uk/python/nested_json.py.txt
--
Denis McMahon, denismfmcma...@gmail.com
--
https://mail.python.org/mailman/listinfo/python-list
On Wed, 27 May 2015 15:23:31 -0700, Karthik Sharma wrote:
> The JSON structure is valid as shown by http://jsonlint.com/
Not when I paste it in it's not. The "data" attribute is an unterminated
string and is not followed by a comma.
--
Denis McMahon, denismfmcma...@g
oldown or (not (BotWaitForCooldown or
> CooldownDetected))
Nope, it simplifies to:
BotWaitForCooldown or not CooldownDetected
--
Denis McMahon, denismfmcma...@gmail.com
--
https://mail.python.org/mailman/listinfo/python-list
ulate them as numbers, not strings.
def bing(n):
n = int(n.replace("_", ""), base=16) # convert to numbers
if n > 0x7fff:# if 0x8000 or more
n = n + 0x0400# add 0x0400
return n # and retur
t() or create a list from
reversed and then join the result:
$ python
Python 2.7.3 (default, Dec 18 2014, 19:10:20)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> "".join(list(reversed(&qu
Now you also know that the error message:
"NameError: name '' is not defined"
means that you might have spelled differently on the line in
the error message to the word you meant, so next time you see this error
message you know to carefully check the spellings of function name
ng (IMO) basic python programming skills
in doing so.
I guess that makes OOP / classes the advanced topic in my system.
I don't consider "using library x to do y" as advanced python, it's just
gluing together existing functions with your own basic programming, no
matter wheth
e inside some simulation environment, then the best
place to look is probably forums dedicated to that simulation environment.
--
Denis McMahon, denismfmcma...@gmail.com
--
https://mail.python.org/mailman/listinfo/python-list
> "CF": "Fee",
Your json object seems to have the same key used for two elements at the
same level, are you sure this is legal json?
--
Denis McMahon, denismfmcma...@gmail.com
--
https://mail.python.org/mailman/listinfo/python-list
go straight from XML to CSV, there is
little added value in using some arbitrary intermediate format unless
you're actually going to use the data in the intermediate format for
something other than converting to the final format.
--
Denis McMahon, denismfmcma...@gmail.com
--
https://mail
en adequately describe it.
At least, it seems that every time you do try and describe it either the
data format or the task description changes.
--
Denis McMahon, denismfmcma...@gmail.com
--
https://mail.python.org/mailman/listinfo/python-list
On Sun, 21 Jun 2015 06:57:01 -0700, sahluwalia wrote:
> On Sunday, 21 June 2015 02:47:31 UTC-4, Denis McMahon wrote:
>> On Wed, 17 Jun 2015 08:00:11 -0700, Saran A wrote:
>>
>> > I would like to have this JSON object written out to a CSV file so
>> > that the ke
the problems that they face.
>
> I do agree with you Denis that this is an unconventional approach. I was
> wondering then that perhaps I should add additional functionality at the
> XML to JSON step? So far, with JSON objects without nested lists (as
> values) I have been successful wi
of what extracts from the XML
are expected to be in which positions in the CSV.
This is the sort of data conversion code I generally turn out in a day or
so, it's hardly rocket science as long as you have a clear description of
what is required. If you don't have a clear descrip
g that
object, but I don't see that generating you one line of CSV for each
Int32 in MonthDayCount.
--
Denis McMahon, denismfmcma...@gmail.com
--
https://mail.python.org/mailman/listinfo/python-list
you later use the xml.
--
Denis McMahon, denismfmcma...@gmail.com
--
https://mail.python.org/mailman/listinfo/python-list
On Sun, 28 Jun 2015 09:46:36 +0200, Stefan Behnel wrote:
> Denis McMahon schrieb am 26.06.2015 um 09:44:
>> xml data is an unordered list, and are trying to assign an order to it.
>>
>> If the xml data was ordered, either each tag would be different, or
>> each
On Sun, 28 Jun 2015 17:07:00 -0700, Ned Batchelder wrote:
> On Sunday, June 28, 2015 at 5:02:19 PM UTC-4, Denis McMahon wrote:
>>
>> string 3
>> string 2
>> string 1
>>
>> Each is just a member of the collection things, the xml does
>> not
in your current code. Is this
what you want?
You could try the following:
# step 1, limit x to the range -50 .. 50
if x < -50:
x = -50.0
ix x >= 50:
x = 50.0
# step 2, scale x to the range 0 .. 12
x = x * 0.12 + 6.0
If you want an integer value, you need to determine which method
ot;]""" % (row)
> result_rows.append(formatted)
>
> print(',\n'.join(result_rows))
>
>
> clean_json(data)
I assume you want the output as json.
The solution may be to put the data into a suitable structure and dump
the structure to json.
able to a
list.
To join the elements of a list into a string, see the join method of
strings.
--
Denis McMahon, denismfmcma...@gmail.com
--
https://mail.python.org/mailman/listinfo/python-list
On Sat, 18 Jul 2015 12:35:10 +0200, Sibylle Koczian wrote:
> Am 18.07.2015 um 02:40 schrieb Denis McMahon:
>> Having a list of words, get a copy of the list in reverse order. See
>> the reversed function (and maybe the list function).
> That won't really help, because the
On Sun, 19 Jul 2015 17:35:03 +0100, MRAB wrote:
> rsplit -> one line.
def lastWordFirst(s):
return " ".join(reversed(s.rsplit(" ", 1)))
--
Denis McMahon, denismfmcma...@gmail.com
--
https://mail.python.org/mailman/listinfo/python-list
Ingress with a new single element list sg from makesg.
I suspect you've refactored some code from processing a list of things
inside a function to processing them in the main body, or vice versa, or
have just got confused about what you're processing where.
I suggest that you rename y
put.csv", "wb") as f:
writer = csv.writer(f)
writer.writerows(tmp.values())
and lo:
$ cat output.csv
a,15
c,18
b,38
$
--
Denis McMahon, denismfmcma...@gmail.com
--
https://mail.python.org/mailman/listinfo/python-list
to a database to see what comes out.
--
Denis McMahon, denismfmcma...@gmail.com
--
https://mail.python.org/mailman/listinfo/python-list
too hard. You can construct the json query syntax
fairly easily from python once you understand it:
>>> import json
>>> query = json.dumps( { "$and":[ { "$gt": {"age": 5} }, { "$not":
{"name": "curly"} } ] } )
>>> query
'{"$and": [{"$gt": {"age": 5}}, {"$not": {"name": "curly"}}]}'
--
Denis McMahon, denismfmcma...@gmail.com
--
https://mail.python.org/mailman/listinfo/python-list
unt.sort(reverse=True) print key,val
ncount is a single key-value pair. Why are you trying to sort ncount?
Do you want results ordered by count?
First, change your dictionary into a list of tuples:
ncount = [(a,c) for a,c in count.items()]
Then sort ncount on the second field of the tuple:
ncount
rse the strings in the log file(s), incrementing counts[x]
where x is the hour field of the timestamp.
Then I'd create a list of tuples:
ncounts = [(k,v) for k,v in counts.items()]
sort it by the hour field:
ncounts.sort(key = lambda x: x[0])
and print it:
for x in ncounts:
pr
On Wed, 12 Aug 2015 09:29:50 -0700, Ltc Hotspot wrote:
> Using the attached file of a diagram as a frame, why is there an
> attribute message?
Perhaps you should read the message. It's very clear.
--
Denis McMahon, denismfmcma...@gmail.com
--
https://mail.python.org/mailman/list
can you please
transfer to floor-scrubbing 101.
[1] You have repeatedly ignored advice and instructions that you have
been given. This is de-facto proof that you are not capable of learning
to program computers.
--
Denis McMahon, denismfmcma...@gmail.com
--
https://mail.python.org/mailman/listinfo/python-list
ours record always at position Y in the
timestamp.
c = [0 for i in range(24)]
f = open(filename,'r')
for l in f:
h = int(l.strip().split()[X].split(':')[Y])
c[h] = c[h] + 1
f.close()
for i in range(24):
print '{:02d} {}'.format(i, c[i])
--
D
commands of the
actual text elements that you want to extract.
--
Denis McMahon, denismfmcma...@gmail.com
--
https://mail.python.org/mailman/listinfo/python-list
e I posted may need the addition of a line something
like:
if line.startswith("From "):
in a relevant position, as well as additional indenting to take account
of that addition.
--
Denis McMahon, denismfmcma...@gmail.com
--
https://mail.python.org/mailman/listinfo/python-list
bordinates' : ['army', 'navy', 'air force', 'jsoc'] },
'navy' : { 'superiors' : ['jcs', 'nsa', 'cia'], 'subordinates' :
['seals', 'marines', 'pacific fleet' ] },
}
The multiple parenting means that you need to use something as
references. You can't represent the hierarchy as a simple tree, because
in a simple tree a node only has one parent.
--
Denis McMahon, denismfmcma...@gmail.com
--
https://mail.python.org/mailman/listinfo/python-list
receiving and how the xml nodes and their attributes and values
should be mapped into the csv file you want to create.
Unfortunately I don't think that there is a single standard mechanism for
doing that bit, although there are some tools and libraries that can help.
--
Denis McMahon, denism
expect, you could come back here and post your code with a description of
what you think it should do, what it actually does, and why you think
that's wrong, and we'll try and help you fix.
What we won't do is write your application from scratch.
--
Denis McMahon, denismfmcma
On Sun, 06 Sep 2015 23:23:14 +1000, Chris Angelico wrote:
> WSGIScriptAlias / /path/to/scripts/MinstrelHall/mh.wsgi
One wonders if the OP has mod_wsgi installed.
https://code.google.com/p/modwsgi/wiki/WhereToGetHelp might be useful too.
--
Denis McMahon, denismfmcma...@gmail.com
--
ht
On Sun, 06 Sep 2015 16:09:42 -0700, babi pepek wrote:
> I wand update
update
There, now you have update.
--
Denis McMahon, denismfmcma...@gmail.com
--
https://mail.python.org/mailman/listinfo/python-list
On Wed, 09 Sep 2015 20:45:57 +, John Gordon wrote:
> In any case, I saved your code and ran it, and did not get an error.
+1
I think "Execution Succesful!" might be coming from his IDE?
--
Denis McMahon, denismfmcma...@gmail.com
--
https://mail.python.org/mailman/listinfo/python-list
= sum(list_a)
print (s)
And if you only want to display the answer:
print (sum(list_a))
--
Denis McMahon, denismfmcma...@gmail.com
--
https://mail.python.org/mailman/listinfo/python-list
x == func()
Would you expect the last two calls to func() to return 999 or "Awesome"?
Why? What is the material difference if any between interpreter (a)
displaying the return value and (b) comparing the return value with
another value.
Debugging nightmare!
--
Denis McMahon, den
esult:
00:16:3e:21:da:a4
00:16:3e:57:be:d2
00:16:3e:6b:e5:ae
00:16:3e:54:0e:f0
00:16:3e:57:5e:50
00:16:3e:21:99:6b
00:16:3e:12:e6:05
00:16:3e:53:02:6d
00:16:3e:79:17:1b
00:16:3e:02:ff:b8
00:16:3e:4e:ff:0d
Observation: No point in declaring mac1 as global in the global scope.
Is it possible that y
> Now in the calling function If I use that object to read or write to
> terminal I'm getting ERROR "AttributeError: 'NoneType' object has no
> attribute 'read_very_eager'".
My best guess would be that something failed and has returned None
instead of
into a float, and (I think) should leave all others as they are. It
users a helper function and a list comprehension.
>>> def tofloat(x):
... try:
... return float(x)
... except ValueError:
... return None
...
>>> l = [ '300', '"N"', '1140', '"E"' ]
>>> l = [ tofloat(x) or x for x in l ]
>>> l
[300.0, '"N"', 1140.0, '"E"']
--
Denis McMahon, denismfmcma...@gmail.com
--
https://mail.python.org/mailman/listinfo/python-list
301 - 400 of 564 matches
Mail list logo