Re: Are there any other better ways to access a single bit of string of digits?

2015-05-31 Thread Denis McMahon
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

Re: Decoding JSON file using python

2015-05-28 Thread Denis McMahon
:/www.sined.co.uk/python/nested_json.py.txt -- Denis McMahon, denismfmcma...@gmail.com -- https://mail.python.org/mailman/listinfo/python-list

Re: Decoding JSON file using python

2015-05-28 Thread Denis McMahon
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

Re: Logic problem: need better logic for desired thruth table.

2015-05-28 Thread Denis McMahon
, it simplifies to: BotWaitForCooldown or not CooldownDetected -- Denis McMahon, denismfmcma...@gmail.com -- https://mail.python.org/mailman/listinfo/python-list

Re: Extract email address from Java script in html source using python

2015-05-25 Thread Denis McMahon
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

Re: Convert c file to csv file(unix format) in python

2015-05-22 Thread Denis McMahon
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

Re: Best approach to create humongous amount of files

2015-05-20 Thread Denis McMahon
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

Re: Convert c file to csv file(unix format) in python

2015-05-19 Thread Denis McMahon
, 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

Re: Convert c file to csv file(unix format) in python

2015-05-19 Thread Denis McMahon
you could elaborate on these. -- Denis McMahon, denismfmcma...@gmail.com -- https://mail.python.org/mailman/listinfo/python-list

Re: Rule of order for dot operators?

2015-05-17 Thread Denis McMahon
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

Re: Fastest way to remove the first x characters from a very long string

2015-05-16 Thread Denis McMahon
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

Re: Encrypt python files

2015-05-08 Thread Denis McMahon
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

Re: Encrypt python files

2015-05-08 Thread Denis McMahon
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

Re: Beacon controller

2015-05-08 Thread 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

Re: Json Comaprision

2015-05-08 Thread Denis McMahon
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

Re: CHALLENGE HELP - GOOGLE DEVELOPER DAY

2015-05-06 Thread Denis McMahon
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

Re: Writing list of dictionaries to CSV

2015-05-06 Thread Denis McMahon
. 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

Re: [Matplotlib] Ploting an exponential distribution frequency curve

2015-04-26 Thread Denis McMahon
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

Re: [Matplotlib] Ploting an exponential distribution frequency curve

2015-04-25 Thread Denis McMahon
],[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

Re: Getting rid of

2015-04-12 Thread Denis McMahon
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

Re: Getting rid of

2015-04-12 Thread Denis McMahon
$ -- Denis McMahon, denismfmcma...@gmail.com -- https://mail.python.org/mailman/listinfo/python-list

Re: Best search algorithm to find condition within a range

2015-04-08 Thread Denis McMahon
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

Re: Get nesting of regex groups

2015-04-08 Thread Denis McMahon
('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

Re: Best search algorithm to find condition within a range

2015-04-07 Thread Denis McMahon
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

Re: New to Programming: Adding custom functions with ipynotify classes

2015-04-03 Thread Denis McMahon
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

Re: Error in processing JSON files in Python

2015-03-31 Thread Denis McMahon
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

Re: Python 3 lack of support for fcgi/wsgi.

2015-03-30 Thread Denis McMahon
/WebProgramming may be more in sync with recent development. -- Denis McMahon, denismfmcma...@gmail.com -- https://mail.python.org/mailman/listinfo/python-list

Re: Python 3 lack of support for fcgi/wsgi.

2015-03-30 Thread Denis McMahon
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

Re: Regex Python Help

2015-03-26 Thread Denis McMahon
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

Re: test1

2015-03-26 Thread Denis McMahon
internet vandalism, and your ongoing posts are simply trolling. -- Denis McMahon, denismfmcma...@gmail.com -- https://mail.python.org/mailman/listinfo/python-list

Re: test1

2015-03-26 Thread Denis McMahon
its a pile of steaming excrement from a troll. -- Denis McMahon, denismfmcma...@gmail.com -- https://mail.python.org/mailman/listinfo/python-list

Re: Regex Python Help

2015-03-25 Thread Denis McMahon
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

Re: beautifulSoup 4.1

2015-03-20 Thread Denis McMahon
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

Re: beautifulSoup 4.1

2015-03-20 Thread Denis McMahon
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

Re: beautifulSoup 4.1

2015-03-20 Thread Denis McMahon
newlines. -- Denis McMahon, denismfmcma...@gmail.com -- https://mail.python.org/mailman/listinfo/python-list

ANN: Lea 2.1.1 released

2015-03-18 Thread Pierre Denis
) --- 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/

Re: A simple single line, triple-quoted comment is giving syntax error. Why?

2015-03-18 Thread Denis McMahon
] 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

Re: Md5 is different in Windows and Linux

2015-03-02 Thread Denis McMahon
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

Re: requesting you all to please guide me , which tutorials is best to learn redis database

2015-02-28 Thread Denis McMahon
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

Re: progress bar

2015-02-25 Thread Denis McMahon
. ;) -- Denis McMahon, denismfmcma...@gmail.com -- https://mail.python.org/mailman/listinfo/python-list

Re: How to design a search engine in Python?

2015-02-21 Thread Denis McMahon
to have that makes it better than all the existing ones? -- Denis McMahon, denismfmcma...@gmail.com -- https://mail.python.org/mailman/listinfo/python-list

Re: urgent help

2015-02-20 Thread Denis McMahon
\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

Re: What behavior would you expect?

2015-02-19 Thread Denis McMahon
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

Re: What behavior would you expect?

2015-02-19 Thread Denis McMahon
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

Re: urgent help

2015-02-19 Thread Denis McMahon
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

Re: python implementation of a new integer encoding algorithm.

2015-02-19 Thread Denis McMahon
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

Re: Varable parsing error with python

2015-02-10 Thread Denis McMahon
].lower() == p.lower(): would be a better comparison to use? -- Denis McMahon, denismfmcma...@gmail.com -- https://mail.python.org/mailman/listinfo/python-list

Re: Indentation issues with python

2015-02-05 Thread Denis McMahon
= .. 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

ANN: Lea 2.0.0 released

2015-02-03 Thread Pierre Denis
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/

[issue23346] shutil.rmtree doesn't work correctly on FreeBSD.

2015-01-29 Thread Denis Sukhonin
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

[issue23346] shutil.rmtree doesn't work correctly on FreeBSD.

2015-01-29 Thread Denis Sukhonin
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

[issue23346] shutil.rmtree doesn't work correctly on FreeBSD.

2015-01-29 Thread Denis Sukhonin
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

[issue23346] shutil.rmtree doesn't work correctly on FreeBSD.

2015-01-28 Thread Denis Sukhonin
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

Re: Python simple Code

2015-01-27 Thread Denis McMahon
as the permutations example already given. -- Denis McMahon, denismfmcma...@gmail.com -- https://mail.python.org/mailman/listinfo/python-list

Re: Python simple Code

2015-01-24 Thread Denis McMahon
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

Re: Concerning Dictionaries and += in Python 2.x

2015-01-21 Thread Denis McMahon
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

Re: Random ALL CAPS posts on this group

2015-01-20 Thread Denis McMahon
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

Re: python traceroute

2015-01-20 Thread Denis McMahon
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

Re: Concerning Dictionaries and += in Python 2.x

2015-01-20 Thread Denis McMahon
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

Re: Attribute error

2015-01-18 Thread Denis McMahon
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

Re: what would be the regular expression for null byte present in a string

2015-01-13 Thread Denis McMahon
) 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

Re: how can I create a class and decode/encode as json?

2015-01-13 Thread Denis McMahon
, 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

Re: Generate jpg files using line length (pixels) and orientation (degrees)

2015-01-11 Thread Denis McMahon
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

Re: Few coding suggestions

2015-01-11 Thread 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

Re: Generate jpg files using line length (pixels) and orientation (degrees)

2015-01-10 Thread Denis McMahon
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

Re: Generate jpg files using line length (pixels) and orientation (degrees)

2015-01-08 Thread Denis McMahon
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

Re: Generate jpg files using line length (pixels) and orientation (degrees)

2015-01-08 Thread Denis McMahon
different ways to loop through your variables. -- Denis McMahon, denismfmcma...@gmail.com -- https://mail.python.org/mailman/listinfo/python-list

Re: Why For Loop Skips the Last element?

2015-01-01 Thread Denis McMahon
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

Re: suggestions for VIN parsing

2014-12-29 Thread Denis McMahon
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

ANN: Lea 2.0.0 (beta.2) released

2014-12-27 Thread Pierre Denis
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/

Re: smtplib not working as expected

2014-12-27 Thread Denis McMahon
enabled.' ^^ have a guess what these messages in the traceback mean. -- Denis McMahon, denismfmcma...@gmail.com -- https://mail.python.org/mailman/listinfo/python-list

Re: suggestions for VIN parsing

2014-12-26 Thread Denis McMahon
prefixes, not as shown on the website you quoted. -- Denis McMahon, denismfmcma...@gmail.com -- https://mail.python.org/mailman/listinfo/python-list

Re: question on string object handling in Python 2.7.8

2014-12-25 Thread Denis McMahon
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: Python re.search simple question

2014-12-08 Thread Denis McMahon
re.search('\[prev 0 , now 1\]','[prev 0 , now 1]') # matches -- Denis McMahon, denismfmcma...@gmail.com -- https://mail.python.org/mailman/listinfo/python-list

Re: Nested dictionaries from a list ?

2014-12-07 Thread Denis McMahon
. -- Denis McMahon, denismfmcma...@gmail.com -- https://mail.python.org/mailman/listinfo/python-list

Re: Nested dictionaries from a list ?

2014-12-07 Thread Denis McMahon
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

Re: Help needed

2014-11-30 Thread Denis McMahon
. -- Denis McMahon, denismfmcma...@gmail.com -- https://mail.python.org/mailman/listinfo/python-list

Re: FW: Unexpexted behaviot of python operators on list

2014-11-25 Thread Denis McMahon
] -- Denis McMahon, denismfmcma...@gmail.com -- https://mail.python.org/mailman/listinfo/python-list

Re: Working with HTML5 documents

2014-11-20 Thread Denis McMahon
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

Re: Tag objects in Beautiful Soup

2014-11-20 Thread Denis McMahon
/a ...^ -- Denis McMahon, denismfmcma...@gmail.com -- https://mail.python.org/mailman/listinfo/python-list

Working with HTML5 documents

2014-11-19 Thread Denis McMahon
. Where should I be looking? -- Denis McMahon, denismfmcma...@gmail.com -- https://mail.python.org/mailman/listinfo/python-list

Re: Error when trying to open an image

2014-11-19 Thread Denis McMahon
!* -- Denis McMahon, denismfmcma...@gmail.com -- https://mail.python.org/mailman/listinfo/python-list

Re: caught in the import web again

2014-11-15 Thread Denis McMahon
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

Re: Curious function argument

2014-11-12 Thread Denis McMahon
. 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

Re: Communicating with a PHP script (and pretending I'm a browser)

2014-11-11 Thread Denis McMahon
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

Re: What is ?s here?

2014-11-11 Thread Denis McMahon
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

Re: What is \1 here?

2014-11-11 Thread Denis McMahon
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

Re: Python script that does batch find and replace in txt files

2014-11-11 Thread Denis McMahon
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

Combining lists to dictionary

2014-11-11 Thread Denis McMahon
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

Re: I don't read docs and don't know how to use Google. What does the print function do?

2014-11-10 Thread Denis McMahon
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

Re: How do i reduce this to a single function - the code is largely similar, just a direction of search toggle.

2014-11-07 Thread Denis McMahon
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

Re: How do i reduce this to a single function - the code is largely similar, just a direction of search toggle.

2014-11-07 Thread Denis McMahon
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

[issue22438] eventlet broke by python 2.7.x

2014-11-07 Thread Denis Bilenko
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

Re: I need algorithm for my task

2014-11-05 Thread Denis McMahon
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

Re: [OFF-TOPIC] It is true that is impossible write in binary code, the lowest level of programming that you can write is in hex code?

2014-11-05 Thread Denis McMahon
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

Re: I need algorithm for my task

2014-11-05 Thread Denis McMahon
, 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

Re: I need algorithm for my task

2014-11-05 Thread 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

Re: I need algorithm for my task

2014-11-05 Thread Denis McMahon
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

Re: I need algorithm for my task

2014-11-05 Thread Denis McMahon
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

Re: generating unique variable name via loops

2014-11-04 Thread Denis McMahon
expected it to do, and what it actually did. -- Denis McMahon, denismfmcma...@gmail.com -- https://mail.python.org/mailman/listinfo/python-list

<    1   2   3   4   5   6   7   >