Re: Still off topic. Deal with it. [was Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP !]

2013-11-26 Thread Chris Angelico
On Wed, Nov 27, 2013 at 5:56 PM, Steven D'Aprano wrote: > On Tue, 26 Nov 2013 20:24:16 -0800, Rick Johnson wrote: >> Pop Quiz >> >> Your driving your car down the road when ou

Re: Completely and utterly Off Topic [was Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP !]

2013-11-26 Thread Chris Angelico
On Wed, Nov 27, 2013 at 5:48 PM, Steven D'Aprano wrote: > I completely sniglim with what you are saying. I'd go further and state > that, without exception, your argument is the most vumtigious I've ever > seen, and if there were any justice in the world, people would follow you > down the street

Still off topic. Deal with it. [was Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP !]

2013-11-26 Thread Steven D'Aprano
On Tue, 26 Nov 2013 20:24:16 -0800, Rick Johnson wrote: > Although i would strongly prefer for him to choose ubiquitous > definitions *over* regional definitions when posting to internet forums, > i would have happily ignored this thread had it not been for Stevens > emotional plea of: > > "A

Completely and utterly Off Topic [was Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP !]

2013-11-26 Thread Steven D'Aprano
On Tue, 26 Nov 2013 17:26:48 -0800, Rick Johnson wrote: > Even if you are correct that the OP is using a regional variation of > English, you fail to realize that this "regional redefinition" of the > English word: "doubts" to mean what the *majority* of English speaking > world understands as "q

Re: Cracking hashes with Python

2013-11-26 Thread Chris Angelico
On Wed, Nov 27, 2013 at 1:55 PM, Tim Delaney wrote: > Before I go look it up, I'm guessing that the etymology of "stumped" is > actually coming from the problem of a plough getting stuck on a stump (i.e. > can't progress any further). Not much of an issue anymore since the > invention of the stump

Re: Cracking hashes with Python

2013-11-26 Thread Tim Delaney
On 27 November 2013 13:28, Chris Angelico wrote: > On Wed, Nov 27, 2013 at 12:04 PM, Mark Lawrence > wrote: > > On 26/11/2013 23:06, TheRandomPast . wrote: > >> I'm stumped. > > > > Good to see another cricketer on the list :) > > May I be bowled enough to suggest that "stumped" doesn't necessar

Re: Excute script only from another file

2013-11-26 Thread Chris Angelico
On Wed, Nov 27, 2013 at 12:56 PM, Rick Johnson wrote: > Most people are unaware that life *even* exists beyond the > "point and click". Heck, If you opened a command prompt in > front of them, they'd run and hide in a closet for the next > three hours consumed with fear. They'd probably convince >

Re: Python application for rpm creation

2013-11-26 Thread Amit Saha
On Wed, Nov 27, 2013 at 1:39 AM, Unix SA wrote: > >> Sounds to me more like he is looking to package some other in house >> software, as opposed to packaging python specific libraries, etc.. > > - Yes, This is exactly i am looking at > > >> Doing an apt-cache search on my Ubuntu desktop results wi

Re: Cracking hashes with Python

2013-11-26 Thread Chris Angelico
On Wed, Nov 27, 2013 at 12:04 PM, Mark Lawrence wrote: > On 26/11/2013 23:06, TheRandomPast . wrote: >> I'm stumped. > > Good to see another cricketer on the list :) May I be bowled enough to suggest that "stumped" doesn't necessarily imply a background in cricket? *dives for cover* ChrisA --

Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP !

2013-11-26 Thread Ned Batchelder
On 11/26/13 8:26 PM, Rick Johnson wrote: On Tuesday, November 26, 2013 8:52:11 AM UTC-6, Chris Angelico wrote: On Wed, Nov 27, 2013 at 1:37 AM, Roy Smith [...] wrote: We live in an international world (otherwise we wouldn't need that annoying unicode stuff). When you say, "effort to be underst

Re: Excute script only from another file

2013-11-26 Thread Rick Johnson
On Tuesday, November 26, 2013 5:09:13 PM UTC-6, Chris Angelico wrote: > My point was that Rick had made the assumption that the GUI was > *everything* and that users were able to do nothing beyond > double-clicking on icons For some people the GUI *is* everything. Most people are unaware that li

Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP !

2013-11-26 Thread Rick Johnson
On Tuesday, November 26, 2013 8:52:11 AM UTC-6, Chris Angelico wrote: > On Wed, Nov 27, 2013 at 1:37 AM, Roy Smith [...] wrote: > > We live in an international world (otherwise we wouldn't > > need that annoying unicode stuff). When you say, > > "effort to be understandable", what you're really sa

Re: Cracking hashes with Python

2013-11-26 Thread Mark Lawrence
On 26/11/2013 23:06, TheRandomPast . wrote: This is my code import md5 import sys def chklength(hashes): if len(hashes) != 32: print '[-] Improper length for md5 hash.' sys.exit(1) characters=range(48,57)+range(65,90)+range(97,122) def checkPassword(password): #print

Re: Cracking hashes with Python

2013-11-26 Thread TheRandomPast .
This is my code import md5 import sys def chklength(hashes): if len(hashes) != 32: print '[-] Improper length for md5 hash.' sys.exit(1) characters=range(48,57)+range(65,90)+range(97,122) def checkPassword(password): #print password m = md5.new(password) if (m.hexd

Re: Access and write .mp3 metadata/tags using Python 3

2013-11-26 Thread alex23
On 27/11/2013 1:41 AM, andonefi...@gmail.com wrote: I also want to be able to read the length of the mp3. For this, try the eyed3 library: >>> import eyed3 >>> mp3 = eyed3.load(r'pygame\examples\data\house_lo.mp3') >>> mp3.info.time_secs 7 https://pypi.python.org/pypi/eyeD3/0.

Re: Python String Formatting - passing both a dict and string to .format()

2013-11-26 Thread Michael Torrie
On 11/26/2013 05:01 PM, Victor Hooi wrote: > Hi, > > I'm trying to use Python's new style string formatting with a dict > and string together. > > For example, I have the following dict and string variable: > > my_dict = { 'cat': 'ernie', 'dog': 'spot' } foo = 'lorem ipsum' > > If I want to jus

Re: Python String Formatting - passing both a dict and string to .format()

2013-11-26 Thread Chris Kaynor
On Tue, Nov 26, 2013 at 4:01 PM, Victor Hooi wrote: > Hi, > > I'm trying to use Python's new style string formatting with a dict and > string together. > > For example, I have the following dict and string variable: > > my_dict = { 'cat': 'ernie', 'dog': 'spot' } > foo = 'lorem ipsum' > >

Re: Python String Formatting - passing both a dict and string to .format()

2013-11-26 Thread Steven D'Aprano
On Tue, 26 Nov 2013 16:01:48 -0800, Victor Hooi wrote: > '{0['cat']} {1} {0['dog']}'.format(my_dict, foo) ... > SyntaxError: invalid syntax It's a syntax error because you are using the same quotes. You have: '{0['cat']} {1} {0['dog']}' which is parsed as: STR '{0[' NAME cat STR '

Re: How to determine whether client and server are on the same host

2013-11-26 Thread Michael Torrie
On 11/25/2013 12:35 PM, Malte Forkel wrote: > I have a Python application that communicates with a server via telnet. > Host and port of the server are supplied by the user when the > application is started. > > How can I determine from within the application whether the server's > host actually i

Python String Formatting - passing both a dict and string to .format()

2013-11-26 Thread Victor Hooi
Hi, I'm trying to use Python's new style string formatting with a dict and string together. For example, I have the following dict and string variable: my_dict = { 'cat': 'ernie', 'dog': 'spot' } foo = 'lorem ipsum' If I want to just use the dict, it all works fine: '{cat} and {do

Re: How to determine whether client and server are on the same host

2013-11-26 Thread Gregory Ewing
Malte Forkel wrote: One special operation is not available in the protocol, but can be implemented by a direct file-based operation if the application is run on the server itself. What would happen if you tried the file-based method when it wasn't a local connection? Is there a danger of it "su

Re: Getting the Appdata Directory with Python and PEP?

2013-11-26 Thread Mark Lawrence
On 26/11/2013 22:49, Eamonn Rea wrote: On Tuesday, November 26, 2013 7:40:50 PM UTC, Irmen de Jong wrote: On 26-11-2013 19:09, Eamonn Rea wrote: Thanks for the help on PEP, but I can't find a way to get the application support (appdata on Windows, no idea on Linux). If I do: print os.e

Re: Getting the Appdata Directory with Python and PEP?

2013-11-26 Thread Chris Angelico
On Wed, Nov 27, 2013 at 9:49 AM, Eamonn Rea wrote: >> Maybe this module is of some use to you: >> https://pypi.python.org/pypi/appdirs >> >> It provides a unified Python API to the various OS specific 'user' directory >> locations. > > I saw this, but I wanted to do it myself as I stated in the O

Re: How to determine whether client and server are on the same host

2013-11-26 Thread Chris Angelico
On Wed, Nov 27, 2013 at 10:08 AM, Walter Hurry wrote: > Easy enough with ifconfig and grep. I presume that there is also a way on > Windows, but others will have to contribute that. Since the server runs Linux, inability to run /sbin/ifconfig could safely be interpreted as "we're not running on t

Re: Tkinter: winfo_screenmmwidth discussion

2013-11-26 Thread josefg
On Tuesday, November 26, 2013 2:55:52 PM UTC-8, Dennis Lee Bieber wrote: > On Tue, 26 Nov 2013 14:13:57 -0800 (PST), jos...@gmail.com declaimed the > > following: > > > > >I am currently using Windows 7 Sp1, Tkinter 8.5, Python 2.7.4 on a laptop > >with no attached monitor. I am attempting to

Re: How to determine whether client and server are on the same host

2013-11-26 Thread Walter Hurry
On Wed, 27 Nov 2013 09:56:13 +1100, Chris Angelico wrote: > On Wed, Nov 27, 2013 at 4:26 AM, Malte Forkel > wrote: >> Thanks for the explanation. I guess I was hoping that I could use some >> property of a connection created with telnetlib or its socket to find >> out whether it was actually a ho

Re: Excute script only from another file

2013-11-26 Thread Chris Angelico
On Wed, Nov 27, 2013 at 4:25 AM, Dennis Lee Bieber wrote: > On Tue, 26 Nov 2013 13:41:07 +1100, Chris Angelico > declaimed the following: > >> >>Totally sure-fire. Absolutely prevents any execution until it's >>renamed. By the way, what does "associate" mean, and what does it have >>to do with fi

Re: Tkinter: winfo_screenmmwidth discussion

2013-11-26 Thread josefg
On Tuesday, November 26, 2013 2:55:52 PM UTC-8, Dennis Lee Bieber wrote: > On Tue, 26 Nov 2013 14:13:57 -0800 (PST), jos...@gmail.com declaimed the > > following: > > > > >I am currently using Windows 7 Sp1, Tkinter 8.5, Python 2.7.4 on a laptop > >with no attached monitor. I am attempting to

Re: How to determine whether client and server are on the same host

2013-11-26 Thread Chris Angelico
On Wed, Nov 27, 2013 at 4:26 AM, Malte Forkel wrote: > Thanks for the explanation. I guess I was hoping that I could use some > property of a connection created with telnetlib or its socket to find > out whether it was actually a host-local connection (i.e. a connection > to 'localhost', '127.xx.x

Re: Getting the Appdata Directory with Python and PEP?

2013-11-26 Thread Eamonn Rea
On Tuesday, November 26, 2013 7:40:50 PM UTC, Irmen de Jong wrote: > On 26-11-2013 19:09, Eamonn Rea wrote: > > > Thanks for the help on PEP, but I can't find a way to get the application > > support (appdata on Windows, no idea on Linux). If I do: > > > > > > print os.environ['HOME'] > > >

Tkinter: winfo_screenmmwidth discussion

2013-11-26 Thread josefg
I am currently using Windows 7 Sp1, Tkinter 8.5, Python 2.7.4 on a laptop with no attached monitor. I am attempting to use winfo_screenmmwidth, but the returned value is incorrect. Specs state 280 mm. Physical measurement is 275 mm. EDID states 280 mm. Tkinter's winfo_screenmmwidth returns 361 m

Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP !

2013-11-26 Thread Tim Delaney
On 27 November 2013 03:57, Antoon Pardon wrote: > > So I can now ask my questions in dutch and expect others to try and > understand me instead of me asking them in english? Or can I use > literal translations of dutch idioms even if I suspect that such > a literal translation could be misundersto

Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP !

2013-11-26 Thread Gene Heskett
On Tuesday 26 November 2013 10:49:07 Alister did opine: > On Wed, 27 Nov 2013 01:52:11 +1100, Chris Angelico wrote: > > On Wed, Nov 27, 2013 at 1:37 AM, Roy Smith wrote: > >> We live in an international world (otherwise we wouldn't need that > >> annoying unicode stuff). When you say, "effort to

Re: Python application for rpm creation

2013-11-26 Thread Unix SA
> Sounds to me more like he is looking to package some other in house software, as opposed to packaging python specific libraries, etc.. - Yes, This is exactly i am looking at > Doing an apt-cache search on my Ubuntu desktop results with a project, Spectacle, coincidentally written in Python. (I

Re: Periodic execution with asyncio

2013-11-26 Thread Tobias M.
Thanks Phil, now I understand! I wasn't aware of the fact that tasks are automatically attached to the event loop when they are created via their constructor. I thought I have to pass them to a run_* method explicitly. Phil Connell schrieb: >On Sat, Nov 23, 2013 at 09:30:29PM +0100, Tobias M

Re: Matplotlib. co-ordinates for scatter plot are off

2013-11-26 Thread EricGarlic
On Tuesday, November 26, 2013 7:34:31 PM UTC, EricGarlic wrote: > Correction: I meant Plot not Scatter - corrected below. Issue is with Plot statement Hi, > > > > I have been following a very good online tutorial for matplotlib: > > > > http://www.loria.fr/~rougier/teaching/matplotlib

Re: Getting the Appdata Directory with Python and PEP?

2013-11-26 Thread Irmen de Jong
On 26-11-2013 19:09, Eamonn Rea wrote: > Thanks for the help on PEP, but I can't find a way to get the application > support (appdata on Windows, no idea on Linux). If I do: > > print os.environ['HOME'] > > I get: '/Users/eamonn', as that is my home directory. But when I do: > > print os.enviro

Matplotlib. co-ordinates for scatter plot are off

2013-11-26 Thread eric . garlic
Hi, I have been following a very good online tutorial for matplotlib: http://www.loria.fr/~rougier/teaching/matplotlib/#introduction However, when I try to annotate the point where the cosine/sine graphs cross the scatter graph misses the point where it crosses the axes; green and pink colou

Re: Cracking hashes with Python

2013-11-26 Thread Denis McMahon
On Tue, 26 Nov 2013 14:18:33 +, TheRandomPast . wrote: > - Teacher has taught us nothing about MD5. This being the script he > wanted us to write came as a surprise to everyone but complaints about > projects are constantly ignored. This particular teacher is complained > about for this reason

Re: Cracking hashes with Python

2013-11-26 Thread Denis McMahon
On Tue, 26 Nov 2013 02:30:03 -0800, TheRandomPast wrote: >>for value in values: > print value ..^^^ so change this to: crackMD5Hash( value ) >> import hashlib >> def crackMD5Hash(): Nah def crackMD5Hash( hash ): print "cracking hash:", hash

Re: Getting the Appdata Directory with Python and PEP?

2013-11-26 Thread Eamonn Rea
Thanks for the help on PEP, but I can't find a way to get the application support (appdata on Windows, no idea on Linux). If I do: print os.environ['HOME'] I get: '/Users/eamonn', as that is my home directory. But when I do: print os.environ['APPDATA'] I get an error. But when I do: print os.

Re: How to determine whether client and server are on the same host

2013-11-26 Thread Malte Forkel
Am 26.11.2013 13:26, schrieb Chris Angelico: > If you deliberately create a file with a random name, the chances of > one existing with the same name on the client are infinitesimal unless > someone's deliberately trying to confuse things... in which case I > wouldn't worry about it. > I wouldn't,

Re: Access and write .mp3 metadata/tags using Python 3

2013-11-26 Thread Michael Torrie
On 11/26/2013 10:10 AM, andonefi...@gmail.com wrote: > I'm still a bit new to this. When I download a module like Mutagen > and unzip it I have a folder and tons of files within folders? I see > no file simply called mutagen? So how can I import the module? Also you can install many things usin

Re: Access and write .mp3 metadata/tags using Python 3

2013-11-26 Thread andonefilms
> > There are a couple libraries that ease that[1]. Matters are > > complicated by the fact that there are two different versions of ID3 > > tags, v1 and v2. However most of those libraries should handle them > > just fine. > > > > Also, I don't believe that the playtime length is actuall

Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP !

2013-11-26 Thread Antoon Pardon
Op 26-11-13 15:37, Roy Smith schreef: > In article , > Antoon Pardon wrote: > >> So I think we may expect more effort from the writer in trying to be >> understandable than from the readers in trying to understand. And >> that includes idiom use. > > We live in an international world (otherwi

Re: Access and write .mp3 metadata/tags using Python 3

2013-11-26 Thread Michael Torrie
On 11/26/2013 08:41 AM, andonefi...@gmail.com wrote: > I'm trying to figure out how to get python to access the properties > section of an mp3 file. When you right click an mp3 file and go to > properties you can edit the title, album, and things like that. I > also want to be able to read the len

Re: Access and write .mp3 metadata/tags using Python 3

2013-11-26 Thread Tim Chase
On 2013-11-26 07:41, andonefi...@gmail.com wrote: > Hey everyone. > > I'm trying to figure out how to get python to access the properties > section of an mp3 file. When you right click an mp3 file and go to > properties you can edit the title, album, and things like that. I > also want to be able

Access and write .mp3 metadata/tags using Python 3

2013-11-26 Thread andonefilms
Hey everyone. I'm trying to figure out how to get python to access the properties section of an mp3 file. When you right click an mp3 file and go to properties you can edit the title, album, and things like that. I also want to be able to read the length of the mp3. Is there a pythonic way to

Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP !

2013-11-26 Thread Alister
On Wed, 27 Nov 2013 01:52:11 +1100, Chris Angelico wrote: > On Wed, Nov 27, 2013 at 1:37 AM, Roy Smith wrote: >> We live in an international world (otherwise we wouldn't need that >> annoying unicode stuff). When you say, "effort to be understandable", >> what you're really saying is, "everybody

Re: parsing nested unbounded XML fields with ElementTree

2013-11-26 Thread Neil Cerutti
On Mon, Nov 25, 2013 at 5:22 PM, larry.mart...@gmail.com wrote: > I have an XML file that has an element called "Node". These can > be nested to any depth and the depth of the nesting is not > known to me. I need to parse the file and preserve the nesting. > For exmaple, if the XML file had: > >

Re: Cracking hashes with Python

2013-11-26 Thread TheRandomPast .
Thanks. I'll take that on board and let you know how I get on. Thanks for all your help. On Tue, Nov 26, 2013 at 2:46 PM, Chris Angelico wrote: > On Wed, Nov 27, 2013 at 1:18 AM, TheRandomPast . > wrote: > > This is my code. I hope it looks better? I'm sorry if it doesn't. I'm > trying > > to

Re: [Python-ideas] Using yield inside a comprehension.

2013-11-26 Thread Chris Angelico
On Wed, Nov 27, 2013 at 1:26 AM, Chris Angelico wrote: > On Wed, Nov 27, 2013 at 12:54 AM, Jonathan Slenders > wrote: >> Where do I find the PEP that describes that the following statement assigns >> a generator object to `values`? >> values = [ (yield x) for x in range(10) ] >> >> I assume it's

Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP !

2013-11-26 Thread Chris Angelico
On Wed, Nov 27, 2013 at 1:37 AM, Roy Smith wrote: > We live in an international world (otherwise we wouldn't need that > annoying unicode stuff). When you say, "effort to be understandable", > what you're really saying is, "everybody should be just like me". > > Unfortunately, that's not going to

Re: Cracking hashes with Python

2013-11-26 Thread Chris Angelico
On Wed, Nov 27, 2013 at 1:18 AM, TheRandomPast . wrote: > This is my code. I hope it looks better? I'm sorry if it doesn't. I'm trying > to get the hang of posting by email :) There are no BBCode tags here, so [code] doesn't help you at all. Other than that, looks good. Though if you're going to

Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP !

2013-11-26 Thread Roy Smith
In article , Antoon Pardon wrote: > So I think we may expect more effort from the writer in trying to be > understandable than from the readers in trying to understand. And > that includes idiom use. We live in an international world (otherwise we wouldn't need that annoying unicode stuff).

Re: [Python-ideas] Using yield inside a comprehension.

2013-11-26 Thread Chris Angelico
On Wed, Nov 27, 2013 at 12:54 AM, Jonathan Slenders wrote: > Where do I find the PEP that describes that the following statement assigns > a generator object to `values`? > values = [ (yield x) for x in range(10) ] > > I assume it's equivalent to the following: > values = (x for x in range(10)) >

Re: Cracking hashes with Python

2013-11-26 Thread TheRandomPast .
@RobertKern - Teacher has taught us nothing about MD5. This being the script he wanted us to write came as a surprise to everyone but complaints about projects are constantly ignored. This particular teacher is complained about for this reason every year but nothing ever changes. This is my code

Re: python-list history

2013-11-26 Thread Ian Kelly
On Tue, Nov 26, 2013 at 2:47 AM, Drew Crawford wrote: > Hello folks, > > I’m interested in digging up some Python mailing list archives from ages > past. Google Groups’ archive goes sporadically back to ’94, but clearly the > list is older. > > Does any one have a lead on where I could get an a

Re: parsing nested unbounded XML fields with ElementTree

2013-11-26 Thread Stefan Behnel
Larry Martell, 26.11.2013 13:23: > On Tue, Nov 26, 2013 at 2:38 AM, Stefan Behnel wrote: >> larry.martell...@gmail.com, 25.11.2013 23:22: >>> I have an XML file that has an element called "Node". These can be nested >>> to any depth and the depth of the nesting is not known to me. I need to >>> p

Re: Cracking hashes with Python

2013-11-26 Thread Robert Kern
On 2013-11-26 10:30, TheRandomPast wrote: and I've started the second part, the part to crack them. If anyone could tell me where I'd find more information on this subject and how to crack them that would be great. What resources did your teacher give you? What have you been taught in class

Re: parsing nested unbounded XML fields with ElementTree

2013-11-26 Thread alister
On 26/11/13 11:59, Larry Martell wrote: On Tue, Nov 26, 2013 at 5:41 AM, Alister wrote: On Mon, 25 Nov 2013 18:25:55 -0500, Larry Martell wrote: On Mon, Nov 25, 2013 at 6:19 PM, Chris Angelico wrote: On Tue, Nov 26, 2013 at 9:45 AM, Larry Martell wrote: On Monday, November 25, 2013 5:30:

Re: Cracking hashes with Python

2013-11-26 Thread Chris Angelico
On Tue, Nov 26, 2013 at 10:46 PM, TheRandomPast . wrote: > Thanks. From what I've been able to find online I've created a dictionary > file with words and the words I know the hash values to be and I'm trying to > get it to use that however when I run this I get no errors but it doesn't do > anyth

Re: Cracking hashes with Python

2013-11-26 Thread TheRandomPast .
Hi, Thanks. From what I've been able to find online I've created a dictionary file with words and the words I know the hash values to be and I'm trying to get it to use that however when I run this I get no errors but it doesn't do anything, like ask me to input my hash value. Am i just being stup

Re: How to determine whether client and server are on the same host

2013-11-26 Thread Chris Angelico
On Tue, Nov 26, 2013 at 11:13 PM, Malte Forkel wrote: > That is a clever idea. While I can't modify the server, I could look at > the files on the host running the application and try to determine if > they fit to information from the server about its files. If both match, > I could then conclude

Re: parsing nested unbounded XML fields with ElementTree

2013-11-26 Thread Larry Martell
On Tue, Nov 26, 2013 at 2:38 AM, Stefan Behnel wrote: > larry.martell...@gmail.com, 25.11.2013 23:22: >> I have an XML file that has an element called "Node". These can be nested to >> any depth and the depth of the nesting is not known to me. I need to parse >> the file and preserve the nesting

Re: parsing nested unbounded XML fields with ElementTree

2013-11-26 Thread Chris Angelico
On Tue, Nov 26, 2013 at 10:59 PM, Larry Martell wrote: > Sorry, didn't realize it was sending in HMTL. I had it set to plain > text, but when the awful gmail update came out it seems to have > reverted to HTML. Hopefully this is better. Yeah, I have the same trouble... but yes, this post looks fi

Re: How to determine whether client and server are on the same host

2013-11-26 Thread Malte Forkel
Am 26.11.2013 12:38, schrieb Chris Angelico: > There is another way you might be able to do this. The server could > simply create a cookie in the file system - say, a file in /tmp with a > randomly-generated name - and it can announce that to the client. If > the client sees the same file in what

Re: parsing nested unbounded XML fields with ElementTree

2013-11-26 Thread Larry Martell
On Tue, Nov 26, 2013 at 5:41 AM, Alister wrote: > > On Mon, 25 Nov 2013 18:25:55 -0500, Larry Martell wrote: > > > On Mon, Nov 25, 2013 at 6:19 PM, Chris Angelico > > wrote: > > > >> On Tue, Nov 26, 2013 at 9:45 AM, Larry Martell > >> > >> wrote: > >> > On Monday, November 25, 2013 5:30:44 PM UT

Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP !

2013-11-26 Thread Ned Batchelder
On 11/25/13 10:33 PM, Rick Johnson wrote:> On Monday, November 25, 2013 2:10:04 PM UTC-6, Ned Batchelder wrote: >> Let's please avoid veering off into rants about language >> and philosophy now. > > Hello Ned. I respect the fact that you want to keep threads > on-topic, and i greatly appreciate t

Re: How to determine whether client and server are on the same host

2013-11-26 Thread Chris Angelico
On Tue, Nov 26, 2013 at 10:26 PM, Malte Forkel wrote: > Most of the application's functionality uses the telnet connection to > communicate with the server. One special operation is not available in > the protocol, but can be implemented by a direct file-based operation if > the application is run

Re: How to determine whether client and server are on the same host

2013-11-26 Thread Malte Forkel
Am 26.11.2013 00:41, schrieb Ben Finney: > > On Unix, this is up to the person invoking the program: the “sockets > facility allows for a host-local connection to appear as though it's > going over a network. > > https://en.wikipedia.org/wiki/Localhost> > https://en.wikipedia.org/wiki/Un

Re: How to determine whether client and server are on the same host

2013-11-26 Thread Malte Forkel
Am 26.11.2013 00:07, schrieb Chris Angelico: > > Two easy ways you could do this. I would be inclined to do what > PostgreSQL and others do, and have an explicit indication that you > want to use a local method: for instance, the name "localhost". Use of > anything else (including "127.0.0.1") mea

Flattening an email message

2013-11-26 Thread Florian Lindner
Hello, I want to use some machine learning stuff on mail messages. First step is get some flattened text from a mail message, python's email package does not work as automatically as I wish. Right now I have: > def mail_preprocessor(str): > msg = email.message_from_string(str) > msg_bod

Re: parsing nested unbounded XML fields with ElementTree

2013-11-26 Thread Alister
On Mon, 25 Nov 2013 18:25:55 -0500, Larry Martell wrote: > On Mon, Nov 25, 2013 at 6:19 PM, Chris Angelico > wrote: > >> On Tue, Nov 26, 2013 at 9:45 AM, Larry Martell >> >> wrote: >> > On Monday, November 25, 2013 5:30:44 PM UTC-5, Chris Angelico wrote: >> > >> >> First off, please clarify: Ar

Re: Cracking hashes with Python

2013-11-26 Thread Chris Angelico
On Tue, Nov 26, 2013 at 9:30 PM, TheRandomPast wrote: > and I've started the second part, the part to crack them. If anyone could > tell me where I'd find more information on this subject and how to crack them > that would be great. As I print them on screen I was thinking I could write a > pro

Re: Cracking hashes with Python

2013-11-26 Thread TheRandomPast
On Tuesday, 26 November 2013 02:46:09 UTC, Frank Cui wrote: > Hi, > > > I'm assuming you are taking a computer/network security course. > > Md5 hashing operation is designed to be mathematically unidirectional, you > can only attempt to find a collision situation but it's technically > imposs

Re: Recursive generator for combinations of a multiset?

2013-11-26 Thread Oscar Benjamin
On 26 November 2013 06:18, John O'Hagan wrote: > > Thanks, that is exactly the type of thing I was after. Although it is > actually slower as is than a hack like > > def imulticombs(it, n): > last = () > for i in itertools.combinations(it,n): > if i > last: > yield i >

python 2.x and python 3 relative imports and

2013-11-26 Thread ptomulik
Hi, let say I have a legacy code with the following structure: pkg1/__init__.py pkg1/pkg2/__init__.py pkg1/pkg2/bar.py pkg1/pkg2/pkg3/__init__.py pkg1/pkg2/pkg3/foo.py In pkg1/pkg2/bar.py I have: # pkg1/pkg2/bar.py import pkg3.foo class Bar(pkg3.foo): pass in pkg1/pkg2/pkg3/foo.py: #

python-list history

2013-11-26 Thread Drew Crawford
Hello folks, I’m interested in digging up some Python mailing list archives from ages past. Google Groups’ archive goes sporadically back to ’94, but clearly the list is older. Does any one have a lead on where I could get an archive of the very oldest posts to this list? Drew -- https://ma

Re: Excute script only from another file

2013-11-26 Thread Larry Hudson
On 11/24/2013 07:20 PM, Dave Angel wrote: Are you really trying to protect against yourself accidentally invoking it or someone maliciously doing it? I would probably give scrpt2 an obnoxious name like htrerttcdrrthyyh.py or put it in an obscure directory. But if you explain the rationale we m