n = n + 0x0400# add 0x0400
return n # and return result
newnums = [ bing(x) for x in oldnums ]
It could probably be done as a single list comprehension, but it might
get a bit messy.
--
Denis McMahon, denismfmcma...@gmail.com
--
https
:/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...@gmail.com
--
https
, it simplifies to:
BotWaitForCooldown or not CooldownDetected
--
Denis McMahon, denismfmcma...@gmail.com
--
https://mail.python.org/mailman/listinfo/python-list
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
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 I guess he
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
, 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
--
https://mail.python.org/mailman/listinfo/python
you could elaborate on these.
--
Denis McMahon, denismfmcma...@gmail.com
--
https://mail.python.org/mailman/listinfo/python-list
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, denismfmcma...@gmail.com
--
https://mail.python.org/mailman/listinfo/python-list
with line numbers as
ascii text and you're trying to strip the line numbers before decoding
the file.
Are you looking for a one-off solution, or do you have a lot of these
files?
If you have a lot of files to process, you could try using something like
sed.
sed -i.old 's/^\d+ : //' *.ext
--
Denis
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 the encrypted executable code.
--
Denis McMahon, denismfmcma
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 McMahon
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.python.org/mailman
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 equal?
--
Denis McMahon, denismfmcma...@gmail.com
--
https
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://mail.python.org
.
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...@gmail.com
--
https
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, denismfmcma
],[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
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
$
--
Denis McMahon, denismfmcma...@gmail.com
--
https://mail.python.org/mailman/listinfo/python-list
to understand -
base x notation is a human readability and representation thing, not an
inherent feature of numbers.
--
Denis McMahon, denismfmcma...@gmail.com
--
https://mail.python.org/mailman/listinfo/python-list
('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
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, denismfmcma...@gmail.com
--
https://mail.python.org/mailman
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, denismfmcma...@gmail.com
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
/WebProgramming may be more in sync with
recent development.
--
Denis McMahon, denismfmcma...@gmail.com
--
https://mail.python.org/mailman/listinfo/python-list
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
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.
man grep
STOP! REINVENTING! THE! WHEEL
internet vandalism, and your
ongoing posts are simply trolling.
--
Denis McMahon, denismfmcma...@gmail.com
--
https://mail.python.org/mailman/listinfo/python-list
its a pile of steaming excrement from a troll.
--
Denis McMahon, denismfmcma...@gmail.com
--
https://mail.python.org/mailman/listinfo/python-list
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
--
https
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 tr 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://mail.python.org
newlines.
--
Denis McMahon, denismfmcma...@gmail.com
--
https://mail.python.org/mailman/listinfo/python-list
)
---
http://pypi.python.org/pypi/lea
With the hope that Lea can make your happiness less uncertain,
Pierre Denis
--
https://mail.python.org/mailman/listinfo/python-announce-list
Support the Python Software Foundation:
http://www.python.org/psf/donations/
]
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
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
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.com
--
https
. ;)
--
Denis McMahon, denismfmcma...@gmail.com
--
https://mail.python.org/mailman/listinfo/python-list
to have
that makes it better than all the existing ones?
--
Denis McMahon, denismfmcma...@gmail.com
--
https://mail.python.org/mailman/listinfo/python-list
\WebMD\getWebMDExperts.py, line
119, in getExpertInfoLinks
fid = open(health-experts.htm,rb)
This line tried to open a file called health-experts.htm
IOError: [Errno 2] No such file or directory: 'health-experts.htm'
This error says the file does not exist.
--
Denis McMahon, denismfmcma
On Fri, 20 Feb 2015 02:08:49 +1100, Chris Angelico wrote:
On Fri, Feb 20, 2015 at 1:16 AM, Denis McMahon
denismfmcma...@gmail.com
wrote:
2. no files match the given pattern
Return either None, 0, False or an empty string.
In both cases, it is then a matter for the calling code to catch
respond to (1) the same as to (2).
2. no files match the given pattern
Return either None, 0, False or an empty string.
In both cases, it is then a matter for the calling code to catch the
exception or handle the return value appropriately.
--
Denis McMahon, denismfmcma...@gmail.com
--
https
the responses to his post to see the answers that are provided
it's a bit stupid to post asking for help in the first place.
--
Denis McMahon, denismfmcma...@gmail.com
--
https://mail.python.org/mailman/listinfo/python-list
efficiency, python really isn't
the language in which to solve your problem.
Perhaps it's time to take a step back and redefine the problem a bit more
clearly, because at the moment I'm not sure you're solution will ever
solve anything that needs solving.
--
Denis McMahon, denismfmcma...@gmail.com
].lower() == p.lower():
would be a better comparison to use?
--
Denis McMahon, denismfmcma...@gmail.com
--
https://mail.python.org/mailman/listinfo/python-list
=
.. more indented code should probably follow
Getting the indentation correct is absolutely critical in Python.
--
Denis McMahon, denismfmcma...@gmail.com
--
https://mail.python.org/mailman/listinfo/python-list
With the hope that Lea can make your happiness less uncertain,
Pierre Denis
--
https://mail.python.org/mailman/listinfo/python-announce-list
Support the Python Software Foundation:
http://www.python.org/psf/donations/
Denis Sukhonin added the comment:
It returns an integer.
import os
os.open('/tmp/test', os.O_RDONLY)
3
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23346
Denis Sukhonin added the comment:
No, it throws 22.
os.listdir(os.open('/tmp/test', os.O_RDONLY))
Traceback (most recent call last):
File stdin, line 1, in module
OSError: [Errno 22] Invalid argument
--
___
Python tracker rep...@bugs.python.org
Denis Sukhonin added the comment:
The same problem.
os.listdir(os.open('/tmp/test/', os.O_RDONLY))
Traceback (most recent call last):
File stdin, line 1, in module
OSError: [Errno 22] Invalid argument
--
___
Python tracker rep...@bugs.python.org
New submission from Denis Sukhonin:
shutil.rmtree doesn't work correctly on FreeBSD 9.1.
For example if I create a path /tmp/test and try to remove it, I get an
exception:
shutil.rmtree('/tmp/test')
Traceback (most recent call last):
File stdin, line 1, in module
File /usr/local/lib
as the permutations
example already given.
--
Denis McMahon, denismfmcma...@gmail.com
--
https://mail.python.org/mailman/listinfo/python-list
is the zero
indexed element you wish to refer to.
d) Note point b. l[len(l)!] (or l[Factorials(len(l))]) will always fail.
--
Denis McMahon, denismfmcma...@gmail.com
--
https://mail.python.org/mailman/listinfo/python-list
to OPs original code and not introduce [too
many] additional complications to his learning exercise.
--
Denis McMahon, denismfmcma...@gmail.com
--
https://mail.python.org/mailman/listinfo/python-list
that simply ignores any posting
with no lower case in the subject.
--
Denis McMahon, denismfmcma...@gmail.com
--
https://mail.python.org/mailman/listinfo/python-list
routers are configured to handle icmp than the tracert
application itself. Unless you're doing this purely as an exercise in
socket programming with python, it might be better to find a new problem
to solve.
--
Denis McMahon, denismfmcma...@gmail.com
--
https://mail.python.org/mailman/listinfo
On Mon, 19 Jan 2015 16:12:57 -0800, Luke Tomaneng wrote:
I have been having a bit of trouble with the things mentioned in the
title.
I've uploaded a slightly different approach to your code at:
http://www.sined.co.uk/tmp/shop.py.txt
--
Denis McMahon, denismfmcma...@gmail.com
--
https
assignments at all, TypeError is raised.)
Given your description of the problem, the best guess I can make is that
you are trying to reference a non existent attribute, possibly because
you have mistyped the name of the attribute you are trying to access.
--
Denis McMahon, denismfmcma...@gmail.com
)
type 'NoneType'
patt = re.compile(r'[0-z]+')
res = patt.match(str)
res
print res
None
type(res)
type 'NoneType'
patt = re.compile(r'[ -~]+')
res = patt.match(str)
res
print res
None
type(res)
type 'NoneType'
--
Denis McMahon, denismfmcma...@gmail.com
--
https://mail.python.org
, sequence: 0},
{data: blah blah blah, sequence: 1}, {data: blah blah blah,
sequence: 2}], dateCreated: 1417713299}}'
--
Denis McMahon, denismfmcma...@gmail.com
--
https://mail.python.org/mailman/listinfo/python-list
generation entirely.
After the main function definition:
f = open(filename, 'r')
rdr = csv.reader(f)
for row in rdr:
makeimg(int(row[0]), int(row[1]))
Also please note that you only need to quote the bits of the post that
you are replying to to give context, not the whole post.
--
Denis McMahon
be much easier to help you with your problem if you
stated the problem you're trying to solve, eg I wish to create a
snapshot of process memory and cpu use every 5 minutes and send it to
another server.
--
Denis McMahon, denismfmcma...@gmail.com
--
https://mail.python.org/mailman/listinfo
have already created lists, you don't need to wrap them inside
another list.
# using lists of values
for length in a:
for orientation in b:
makeimg(length, orientation)
--
Denis McMahon, denismfmcma...@gmail.com
--
https://mail.python.org/mailman/listinfo/python-list
On Thu, 08 Jan 2015 22:07:03 +, Denis McMahon wrote:
On Thu, 08 Jan 2015 09:09:18 -0800, semeon.risom wrote:
Simple question. I hope. .
To follow up, below is a solution to the problem you stated.
#!/usr/bin/python
import Image, ImageDraw, math
def makeimg(length, orientation
different
ways to loop through your variables.
--
Denis McMahon, denismfmcma...@gmail.com
--
https://mail.python.org/mailman/listinfo/python-list
are correct, i will only increment if watch or watches are
found. Your last but 1 item doesn't match these strings (chronograph
instead of watch).
It would still be better as others have posted to use a for loop.
--
Denis McMahon, denismfmcma...@gmail.com
--
https://mail.python.org/mailman
On Sun, 28 Dec 2014 16:27:20 -0700, Vincent Davis wrote:
On Fri, Dec 26, 2014 at 12:15 PM, Denis McMahon
denismfmcma...@gmail.com
wrote:
Note, I think the 1981 model year ran KCA - DCA prefixes, not as shown
on the website you quoted.
​Denis,
Regarding the KCA - DCA prefixes, do you
Lea could be helpful in this uncertain universe... !
Pierre Denis
--
https://mail.python.org/mailman/listinfo/python-announce-list
Support the Python Software Foundation:
http://www.python.org/psf/donations/
enabled.'
^^ have a guess what these messages in the traceback mean.
--
Denis McMahon, denismfmcma...@gmail.com
--
https://mail.python.org/mailman/listinfo/python-list
prefixes, not as shown on
the website you quoted.
--
Denis McMahon, denismfmcma...@gmail.com
--
https://mail.python.org/mailman/listinfo/python-list
the existing pointer to the existing string object.
Maybe a 2 character string is faster to locate in the object table than a
1 character string, so that in the 2 character case, the lookup is faster.
--
Denis McMahon, denismfmcma...@gmail.com
--
https://mail.python.org/mailman/listinfo/python-list
re.search('\[prev 0 , now 1\]','[prev 0 , now 1]') # matches
--
Denis McMahon, denismfmcma...@gmail.com
--
https://mail.python.org/mailman/listinfo/python-list
.
--
Denis McMahon, denismfmcma...@gmail.com
--
https://mail.python.org/mailman/listinfo/python-list
of users and having the users as the keys in
mess suggests redundancy, and the potential for errors if the two data
items get out of synch. Better imo to just have the data in one place.
--
Denis McMahon, denismfmcma...@gmail.com
--
https://mail.python.org/mailman/listinfo/python-list
.
--
Denis McMahon, denismfmcma...@gmail.com
--
https://mail.python.org/mailman/listinfo/python-list
]
--
Denis McMahon, denismfmcma...@gmail.com
--
https://mail.python.org/mailman/listinfo/python-list
On Wed, 19 Nov 2014 13:43:17 -0800, Novocastrian_Nomad wrote:
On Wednesday, November 19, 2014 2:08:27 PM UTC-7, Denis McMahon wrote:
So what I'm looking for is a method to create an html5 document using
dom manipulation, ie:
doc = new htmldocument(doctype=HTML)
html = new html5element(html
/a
...^
--
Denis McMahon, denismfmcma...@gmail.com
--
https://mail.python.org/mailman/listinfo/python-list
. Where should I be looking?
--
Denis McMahon, denismfmcma...@gmail.com
--
https://mail.python.org/mailman/listinfo/python-list
!*
--
Denis McMahon, denismfmcma...@gmail.com
--
https://mail.python.org/mailman/listinfo/python-list
messages are. For example, are these imports of code
that you've written yourself, or part of the standard library modules, or
third party modules.
--
Denis McMahon, denismfmcma...@gmail.com
--
https://mail.python.org/mailman/listinfo/python-list
. by appending
an item to a list), the default value is in effect modified.
[1] ie when the function is 'compiled', not each time it executes.
--
Denis McMahon, denismfmcma...@gmail.com
--
https://mail.python.org/mailman/listinfo/python-list
and perhaps
http://www.lmgtfy.com/?q=python+parse+html
Personally I think last time I wanted to do we scraping in python I used
requests and beautifulsoup, but ymmv.
--
Denis McMahon, denismfmcma...@gmail.com
--
https://mail.python.org/mailman/listinfo/python-list
On Tue, 11 Nov 2014 01:37:21 -0800, satishmlmlml wrote:
What does ?s do in the following piece of code?
It tells you to learn about regex.
--
Denis McMahon, denismfmcma...@gmail.com
--
https://mail.python.org/mailman/listinfo/python-list
On Tue, 11 Nov 2014 01:18:02 -0800, satishmlmlml wrote:
What does \1 do in the following piece of code(fourth line)?
It tells you to learn about regex.
http://www.pcre.org/pcre.txt
--
Denis McMahon, denismfmcma...@gmail.com
--
https://mail.python.org/mailman/listinfo/python-list
On Sun, 09 Nov 2014 11:58:49 -0800, Syed Khalid wrote:
Python script that does batch find and replace in txt files Need a
python script that opens all .txt files in a folder find replace/delete
text and save files.
Sounds like you need sed, not python.
--
Denis McMahon, denismfmcma
method to
create a list of tuples just to split them up into key:value pairs.
However the zip method handles the inequal length list problem. Granted
it would probably be advisable to check that x and y are the same length
before starting anyway.
--
Denis McMahon, denismfmcma...@gmail.com
engineers do need to do, so it sounds as if you'd be better off signing
up with an escort agency.
--
Denis McMahon, denismfmcma...@gmail.com
--
https://mail.python.org/mailman/listinfo/python-list
methods index vs rindex.
yes, those fall under point 2 of my earlier post. something and
something else would be the complete means of calculating the value to
assign to variable.
--
Denis McMahon, denismfmcma...@gmail.com
--
https://mail.python.org/mailman/listinfo/python-list
is a bit trickier, the best I
came up with was:
while direction and condition_a or (not direction) and condition_b
But I'm sure someone has something better
--
Denis McMahon, denismfmcma...@gmail.com
--
https://mail.python.org/mailman/listinfo/python-list
Denis Bilenko added the comment:
gevent's ssl support is also broken by 2.7.9.
https://github.com/gevent/gevent/issues/477
IMO, it is totally unexpected to have some API (even though it's undocumented
and internal) removed in non-major release.
Even though both gevent and eventlet can
of a string.
The maximum length of a repeated word in a string can not be more than
half the length of the string.
However, the examples you give do not match the way you describe it. The
examples you give assume the first word ends when the letter that started
it is found again.
--
Denis
On Tue, 04 Nov 2014 21:30:06 -0500, Dennis Lee Bieber wrote:
If you have an old system with front-panel toggle switches, you
set the
switches for binary values, and then push the enter switch.
You've booted a PDP-8 then ;)
--
Denis McMahon, denismfmcma...@gmail.com
--
https
,
barbaz, dibdibdobdibdibdob]
and my output is:
$ ./words.py
python DOLORIUMD HELLOLHELLO thewordword barbaz dib
python DOLORIUM HELLOL thewordword bar dib
python DOLORIUM HELLOL thewordword barbaz dibdibdob
$
I wonder which of these three is actually the algorithm the OP wants.
--
Denis McMahon
the solutions to the
students.
I'm quite proud of a 2 line solution to the third algorithm that I
implemented, although it might be considered as somewhat obfuscated code
by some. ;)
--
Denis McMahon, denismfmcma...@gmail.com
--
https://mail.python.org/mailman/listinfo/python-list
On Thu, 06 Nov 2014 03:36:40 +, Denis McMahon wrote:
On Wed, 05 Nov 2014 18:49:01 +, MRAB wrote:
It doesn't work for the final example or barbaz.
Oh, and we really need a private python homework answers list where we
can discuss the most pythonic solution we can think of for all
On Thu, 06 Nov 2014 15:14:05 +1100, Chris Angelico wrote:
On Thu, Nov 6, 2014 at 3:00 PM, Denis McMahon denismfmcma...@gmail.com
wrote:
def baseword(s):
find shortest sequence which repeats to generate s
return s[0:[.join([s[0:x]for k in range(int(len(s)/x)+1)])[0:len
(s)]for x
expected it to
do, and what it actually did.
--
Denis McMahon, denismfmcma...@gmail.com
--
https://mail.python.org/mailman/listinfo/python-list
201 - 300 of 677 matches
Mail list logo