Re: Free to a good home - Python Pocket Reference

2008-10-11 Thread Evans
ge. > > -- > Skip Montanaro - [EMAIL PROTECTED] -http://www.webfast.com/~skip/ I was giving away a few weeks ago myself, but none them was a Python book. http://www.jroller.com/evans/entry/giving_away_unused_books I wouldn't mind having it... will mail you directly. -- http://mail.pyt

Re: Is Python a commercial proposition ?

2012-07-29 Thread Aled Evans
On Sunday, July 29, 2012 5:01:00 PM UTC+1, lipska the kat wrote: > Pythoners > > > > Firstly, thanks to those on the tutor list who answered my questions. > > > > I'm trying to understand where Python fits into the set of commonly > > available, commercially used languages of the moment. >

Re: Parse a Wireshark pcap file

2013-01-23 Thread John Evans
can't find it... I am not clear on how to point Python > > there... > > > "libdnet" is likely a shared object binary... What I /think/ you > are > missing is the Python library that interfaces with that binary... > > Could http://pypi.python.org/pypi/dnet answer the question? > -- > Wulfraed Dennis Lee Bieber AF6VN > wlfr...@ix.netcom.comHTTP://wlfraed.home.netcom.com/ > > -- > http://mail.python.org/mailman/listinfo/python-list > -- John Evans -- http://mail.python.org/mailman/listinfo/python-list

Re: Parse a Wireshark pcap file

2013-01-23 Thread John Evans
2013 at 7:25 AM, John Evans wrote: > >> The import "from scapy.all import *" does work for me with macports and >> 10.6.8 When I installed the scapy port, I did see that macports installed >> the py27-libdnet package as well. >> >> >>  >> >&

builtin max() and weak ordering

2011-03-03 Thread Stephen Evans
, Alexander and Paul McJones. 2009. Elements of Programming. Addison Wesley. Pages 52-53 The code below demonstrates the issue. Using the total key gives the correct result. Using the weak key returns the "incorrect" result. Tested with Python 2.7.1 and 3.1.2 (applies to 3.2) Ste

Re: Aborting Python from C code

2011-04-30 Thread Dylan Evans
I think i see what you are trying to do but it depends on the environment and your goals. Generally i think you need to separate your code by forking (or perhaps you have already done that?), then you can run a check to see if the process died as expected. I don't know though, this not much inform

Re: Python enabled gdb on Windows and relocation

2011-05-13 Thread Doug Evans
On Thu, May 12, 2011 at 9:19 AM, Ruben Van Boxem wrote: > (now in plain-text as required by gdb mailing list) > > Hi, > > I am currently trying to integrate Python support into my toolchain > build (including GDB of course). It is a sysrooted > binutils+GCC+GDB+mingw-w64 toolchain. > > I currently

Re: Python enabled gdb on Windows and relocation

2011-05-14 Thread Doug Evans
On Sat, May 14, 2011 at 2:09 AM, Ruben Van Boxem wrote: > 2011/5/14 Doug Evans : >> On Thu, May 12, 2011 at 9:19 AM, Ruben Van Boxem >> wrote: >>> (now in plain-text as required by gdb mailing list) >>> >>> Hi, >>> >>> I am currently tr

Re: Python enabled gdb on Windows and relocation

2011-05-14 Thread Doug Evans
On Sat, May 14, 2011 at 2:29 AM, Eli Zaretskii wrote: >> Date: Sat, 14 May 2011 11:09:13 +0200 >> From: Ruben Van Boxem >> Cc: g...@sourceware.org, python-list@python.org >> >> 1. Check hardcoded path; my suggestion would be "> executable>/../lib/python27" >> 2. If this fails to find the necessar

Re: Python enabled gdb on Windows and relocation

2011-05-14 Thread Doug Evans
On Sat, May 14, 2011 at 11:30 AM, Doug Evans wrote: > Note that --exec-prefix is the runtime location of python. > GCC uses this to tell libpython where to find its support files. > [grep for Py_SetProgramName in gdb/python/python.c] Oops. s/GCC/GDB/ -- http://mail.python.org/mailman

Re: Python enabled gdb on Windows and relocation

2011-05-17 Thread Doug Evans
On Sun, May 15, 2011 at 6:26 AM, Ruben Van Boxem wrote: > Wow, I think I have a partial solution. Delving into the Python docs, > for example here: > http://docs.python.org/using/windows.html#finding-modules, you can see > that PYTHONPATH is used first, then the Windows registry, then > PYTHONHOME

Re: Python enabled gdb on Windows and relocation

2011-05-17 Thread Doug Evans
On Sun, May 15, 2011 at 9:11 AM, Ruben Van Boxem wrote: > I am sorry for the repeated messages that no one cares about, but I > may have discovered GDB in its current form already allows what I > want: I tried to figure out what exact paths the snake in gdb was > using to search for its modules, a

Installation Problems with Python 3.7.3

2019-05-20 Thread Carolyn Evans
I am having trouble with re-installing python 3.7.3. I keep getting the following message: Modify Repair Remove I have tried all three numerous times and can not complete the setup I am working on a Windows 8 system, 64 bit OS, 4GB ram. How can this be fixed? Thanks C. Evans -- https

Re: Installation Problems with Python 3.7.3

2019-05-23 Thread Carolyn Evans
I got it working. Thanks On Mon, May 20, 2019 at 3:17 PM Igor Korot wrote: > Hi, > > On Mon, May 20, 2019 at 1:53 PM Carolyn Evans wrote: > > > > I am having trouble with re-installing python 3.7.3. > > Why do you need to reinstall? > What seems to be the probl

Re: stderr writting before stdout

2020-05-24 Thread Dylan Evans
Hi, This data is being line buffered, so either a newline or flush is required to get it to actually write to the terminal / file. On Sun, May 24, 2020 at 2:34 PM Souvik Dutta wrote: > Also this code maintains order i.e. writting is displayed before no errors. > Why is that? > > import sys > sys

some pointers for a newbie

2004-12-04 Thread John Evans
Hi, I have decided to play around with python, for the simple reason there appears nothing better to do at 2am on a sunday morning ;) Anyway I am familiar with languages similar to PHP, javaa script, and also languages which have similarities on the surface to python such as Lingo (macromedia D

Organising data within a program

2004-12-13 Thread Nick Evans
Hey all, I am currently working on a simple program (small group membership database) just to get to grips with the language (bit of a newbie here :-)) and am wondering about the best way of organising the data within the program. >From my understanding I would have something like person1 =("name"

Installing Parsers/Tree Builders to, and accessing these packages from Python2.7

2014-11-01 Thread Simon Evans
orXML/lxml but best to cross that bridge when gotten to, as they say. Thank you for reading.I look forward to hearing from you. Yours Simon Evans -- https://mail.python.org/mailman/listinfo/python-list

Re: Installing Parsers/Tree Builders to, and accessing these packages from Python2.7

2014-11-02 Thread Simon Evans
Dear Terry Reedy I am using operating system Windows 7. I put the HTML TreeBuilder / htm5 library into the Python2.7 folder. I read that the LXML Treebuilder /lmxl installs itself automatically to the Python2.7 installation, so that is why I am not having difficulty with that installation. I

Re: Installing Parsers/Tree Builders to, and accessing these packages from Python2.7

2014-11-02 Thread Simon Evans
I have proceeded to click on the 'setup.py' in the html5-0.999 lib and got a python console for a few seconds, this may have been the installation of the HTML5 parser/ treebuilder - I will have to put the code that did not work to it previously to it again, hopefully it will. -- https://mail.

Re: Installing Parsers/Tree Builders to, and accessing these packages from Python2.7

2014-11-02 Thread Simon Evans
Dear Mark Lawrence, I have tried inputting the code in the first link, re: >>> import lxml >>> import lxml.etree >>> import bs4.builder.htmlparser Traceback (most recent call last): File "", line 1, in ImportError: No module named htmlparser >>> import bs4.builder._lxml >>> import bs4.builder.h

Re: Installing Parsers/Tree Builders to, and accessing these packages from Python2.7

2014-11-02 Thread Simon Evans
I have got the html5lib-0.999.tar.gz and the HTMLParser-0.0.2.tar.gz files in my Downloads the problem is how I install them to Python2.7. The lxml-3.3.3.win32-py2.7 is an exe file, which upon clicking will install but obviously the html and the html5 installations are not so straightforwa

Re: Installing Parsers/Tree Builders to, and accessing these packages from Python2.7

2014-11-02 Thread Simon Evans
Oh I don't mind quoting console output, I just thought I'd be sparing you unnecessary detail. output was going nicely as I input text from my 'Getting Started with Beautiful Soup' even when the author reckoned things would go wrong - due to lxml not being installed, things went right, becau

Re: Installing Parsers/Tree Builders to, and accessing these packages from Python2.7

2014-11-02 Thread Simon Evans
What I meant to say was I can't get the html5 or the html parsers to install, I have got their downloads in their respective directories in the downloads directory. -- https://mail.python.org/mailman/listinfo/python-list

Re: Installing Parsers/Tree Builders to, and accessing these packages from Python2.7

2014-11-03 Thread Simon Evans
I input 'pip install html5lib' to the Python 2.7 console and got : >>> pip install html5lib File "", line 1 pip install html5lib ^ SyntaxError: invalid syntax >>> I am not sure what you mean about 'single line paragraphs'. I put my text into double line spacing in my last mi

Re: Installing Parsers/Tree Builders to, and accessing these packages from Python2.7

2014-11-03 Thread Simon Evans
I input to the cmd console 'pip install html5lib' but again got an error return. I thought one of the participants was unhappy about single line spacing (re: single line paragraphs') Okay I will go back to single line spacing, I don't think it is all that important, really. Anyway this is my co

How do you download and install HTML5TreeBuilder ?

2014-11-18 Thread Simon Evans
hen please decline to respond, seeing as far as I'm concerned such trivialities are besides the point, and are of no help, so vent your ire elsewhere. YOurs Simon Evans. -- https://mail.python.org/mailman/listinfo/python-list

Re: How do you download and install HTML5TreeBuilder ?

2014-11-18 Thread Simon Evans
re: Microsoft Windows [Version 6.1.7601] Copyright (c) 2009 Microsoft Corporation. All rights reserved. C:\Users\Intel Atom>pip install html5lib Downloading/unpacking html5lib Running setup.py (path:c:\users\intela~1\appdata\local\temp\pip_build_Intel At om\html5lib\setup.py) egg_info for pac

Tag objects in Beautiful Soup

2014-11-20 Thread Simon Evans
urns at the first line re:- >>> atag = soup_atag.a Traceback (most recent call last): File "", line 1, in NameError: name 'soup_atag' is not defined >>> ---- Can anyone tell me where I am going wrong or where the text is wrong ? So far the given code has run okay, I have put to the console everything the text tells you to. Thank you for reading. Simon Evans -- https://mail.python.org/mailman/listinfo/python-list

Re: python 2.7 and unicode (one more time)

2014-12-02 Thread Simon Evans
Hi Peter Otten re: There is no assignment soup_atag = whatever but there is one to atag. The whole session should when you omit the offending line > atag = soup_atag.a or insert soup_atag = soup before it. -

Text Code(from 'Getting Started in Beautiful Soup' re: cd Soup , returns 'Syntax Error, invalid syntax'

2014-12-11 Thread Simon Evans
SC v.1500 32 bit (Intel)] on win 32 Type "help", "copyright", "credits" or "license" for more information. >>> cd Soup File "", line 1 cd Soup ^ SyntaxError: invalid syntax >>> ------

Re: Text Code(from 'Getting Started in Beautiful Soup' re: cd Soup , returns 'Syntax Error, invalid syntax'

2014-12-14 Thread Simon Evans
Thanks Guys This book keeps swapping from the Python console to the Windows - without telling you, but it is the only book out there on 'Beautiful Soup' so I have got to put up with it. There's more problems with it, but I will start a new thread in regard of, I don't know if its related to the

Python console rejects an object reference, having made an object with that reference as its name in previous line

2014-12-14 Thread Simon Evans
Dear Python programmers, Having input the line of code in text: cd Soup to the Windows console, and having put the file 'EcologicalPyramid.html' into the Directory 'Soup', on the C drive, in accordance with instructions I input the following code to the Python console, as given on page 30 of 'G

Re: Python console rejects an object reference, having made an object with that reference as its name in previous line

2014-12-14 Thread Simon Evans
I had another attempt at inputting the code perhaps with the right indentation, I still get an error return, but not one that indicates that the code has not been read, as you suggested. re:- Python 2.7.6 (default, Nov

Re: Python console rejects an object reference, having made an object with that reference as its name in previous line

2014-12-14 Thread Simon Evans
Dear Jussi, and Billy I have changed the input in accordance with your advice, re: -- Python 2.7.6 (default, Nov 10 2013, 19:24:18) [MSC v.1500 32 bit (Intel)] on win 32 Type "help", "copyright", "credits" or "license" for

Re: Python console rejects an object reference, having made an object with that reference as its name in previous line

2014-12-18 Thread Simon Evans
@Steven D'Aprano, I input the following to Python 2.7, which got the following:- >>> from bs4 import BeautifulSoup >>> with open("ecologicalpyramid.html","r") as ecological_pyramid: ... soup= next(ecological_pyramid,

Re: Python console rejects an object reference, having made an object with that reference as its name in previous line

2015-01-04 Thread Simon Evans
Dear Michael Torrie, Thanks for pointing that out to me re: it not being a syntax problem. The thing is there is a file called 'EcologicalPyramid.html'. I put it in a folder called 'Soup' as the text advised on page 28. For what its worth I also shifted the Windows Command Prompt to that folder (

How do I access 'Beautiful Soup' on python 2.7 or 3.4 , console or idle versions.

2014-05-10 Thread Simon Evans
I am new to Python, but my main interest is to use it to Webscrape. I have downloaded Beautiful Soup, and have followed the instruction in the 'Getting Started with Beautiful Soup' book, but my Python installations keep returning errors, so I can't get started. I have unzipped Beautiful Soup to

Re: How do I access 'Beautiful Soup' on python 2.7 or 3.4 , console or idle versions.

2014-05-11 Thread Simon Evans
Thank you everyone who replied, for your help. Using the command prompt console, it accepts the first line of code, but doesn't seem to accept the second line. I have altered it a little, but it is not having any of it, I quote my console input and output here, as it can probably explain things

Re: How do I access 'Beautiful Soup' on python 2.7 or 3.4 , console or idle versions.

2014-05-11 Thread Simon Evans
Dear Chris Angelico, Yes, you are right, I did install Python 3.4 as well as 2.7. I have removed Python 3.4, and input the code you suggested and it looks like it has installed properly, returning the following code:- --

Re: How do I access 'Beautiful Soup' on python 2.7 or 3.4 , console or idle versions.

2014-05-11 Thread Simon Evans
I have downloaded Beautiful Soup 3, I am using Python 2.7. I understand from your message that I ought to use Python 2.6 or Python 3.4 with Beautiful Soup 4, the book I am using 'Getting Started with Beautiful Soup' is for Beautiful Soup 4. Therefore I gather I must re-download Beautiful Soup an

Re: How do I access 'Beautiful Soup' on python 2.7 or 3.4 , console or idle versions.

2014-05-11 Thread Simon Evans
Yeah well at no point does the book say to start inputting the code mentioned in Python command prompt rather than the Windows command prompt, but thank you for your guidance anyway. I have downloaded the latest version of Beautiful Soup 4, but am again facing problems with the second line of c

Re: How do I access 'Beautiful Soup' on python 2.7 or 3.4 , console or idle versions.

2014-05-11 Thread Simon Evans
On Monday, May 12, 2014 12:19:24 AM UTC+1, Simon Evans wrote: > Yeah well at no point does the book say to start inputting the code mentioned > in Python command prompt rather than the Windows command prompt, but thank > you for your guidance anyway. > > I have downloaded the la

Re: How do I access 'Beautiful Soup' on python 2.7 or 3.4 , console or idle versions.

2014-05-11 Thread Simon Evans
- but wait a moment 'BeautifulSoup4 works with 2.6+ and 3.x'(Terry Reedy) - doesn't 2.6 + = 2.7, which is what I'm using with BeautifulSoup4. -- https://mail.python.org/mailman/listinfo/python-list

Re: How do I access 'Beautiful Soup' on python 2.7 or 3.4 , console or idle versions.

2014-05-12 Thread Simon Evans
Hi Ian, thank you for your help. Yes that is the book by Vineeth J Nair. At the top of page 12, at step 1 it says : 1.Download the latest tarball from https://pypi.python.org/packages/source/b/beautifulsoup4/. So yes, the version the book is dealing with is beautiful soup 4. I am using Pyhon 2

Re: How do I access 'Beautiful Soup' on python 2.7 or 3.4 , console or idle versions.

2014-05-12 Thread Simon Evans
The version of Python the book seems to be referring to is 2.7, re: bottom of page 10- 'Pick the Path variable and add the following section to the Path variable: ;C:\PythonXY for example C:\Python 27' The version of Beautiful Soup seems to be Beautiful Soup 4 as at the top of page 12 it states

Re: How do I access 'Beautiful Soup' on python 2.7 or 3.4 , console or idle versions.

2014-05-12 Thread Simon Evans
Thank you for your advice. I did buy a book on Python, 'Hello Python' but the code in it wouldn't run, so I returned it to the shop for a refund. I am going to visit the local library to see if they have any books on Python. I am familiar with Java and Pascal, and looking at a few You tubes on t

Re: How do I access 'Beautiful Soup' on python 2.7 or 3.4 , console or idle versions.

2014-05-12 Thread Simon Evans
Dear Ian, The book does recommend to use Python 2.7 (see bottom line of page 10). The book also recommends to use Beautiful Soup 4. You are right that in that I have placed the unzipped BS4 folder within a folder, and I therefore removed the contents of the inner folder and transferred them to

Re: How do I access 'Beautiful Soup' on python 2.7 or 3.4 , console or idle versions.

2014-05-12 Thread Simon Evans
I did download the latest version of Beautiful Soup 4 from the download site, as the book suggested. -- https://mail.python.org/mailman/listinfo/python-list

Re: How do I access 'Beautiful Soup' on python 2.7 or 3.4 , console or idle versions.

2014-05-13 Thread Simon Evans
I have removed the original Beautiful Soup 4 download, that I had unzipped to my Beautiful Soup directory on the C drive. I downloaded the latest version of Beautiful Soup 4 from the Crummy site. I unzipped it, and removed the contents of the unzipped directory and placed contents in my Beautif

Re: How do I access 'Beautiful Soup' on python 2.7 or 3.4 , console or idle versions.

2014-05-13 Thread Simon Evans
Dear Ian, and other programmers, thank you for your advice. I am resending the last message because this twattish cut and paste facility on my computer has a knack of chopping off ones original message, I will try to convey the right message this time : I have removed the original Beautiful

Re: How do I access 'Beautiful Soup' on python 2.7 or 3.4 , console or idle versions.

2014-05-14 Thread Simon Evans
I downloaded the get-pip.py file. I installed it to the same folder on my C drive as the Beautiful Soup one in which the Beautiful Soup 4 downloads was unzipped to. I changed directory to the folder on the Command Prompt, as you instructed in step 2. I input the code to the console you gave on s

Re: How do I access 'Beautiful Soup' on python 2.7 or 3.4 , console or idle versions.

2014-05-14 Thread Simon Evans
I have input the above code by copy and pasting to the Idle python console, as the python 2.7 command prompt is fussy about the indentation on the eleventh line down, if I then indent it, it replies that the indentation is unnecessary of unexpected, and if I don't it says an indentation is expec

Re: How do I access 'Beautiful Soup' on python 2.7 or 3.4 , console or idle versions.

2014-05-15 Thread Simon Evans
Dear Programmers, I downloaded Peazip, which doesn't remove file/ folder hierarchy. I unzipped it and input the same code to the console and it installed Beautiful Soup 4 okay re:- - Microsoft Windows [Version 6.1.76

Re: How do I access 'Beautiful Soup' on python 2.7 or 3.4 , console or idle versions.

2014-05-15 Thread Simon Evans
Dear Programmers, As anticipated, it has not been to long before I have encountered further difficulty. At the top of page 16 of 'Getting Started with Beautiful Soup" it gives code to be input, whether to the Python or Windows command prompt I am not sure, but both seem to be resistant to

Re: How do I access 'Beautiful Soup' on python 2.7 or 3.4 , console or idle versions.

2014-05-15 Thread Simon Evans
Dear Programmers, I noticed a couple of typos in my previous message, so have now altered them thus :- Dear Programmers, As anticipated, it has not been to long before I have encountered further difficulty. At the top of page 16 of 'Getting Started with Beautiful Soup" it gives code to be in

Re: Is it possible to deliver different source distributions for different Python versions?

2015-04-06 Thread Dylan Evans
y. This will run 2to3 on the code when it installs it. I don’t know whether this is good style but it does work. I got it from the feedparser source code.  --  Dylan Evans On 6 April 2015 at 11:05:47, python-list-requ...@python.org (python-list-requ...@python.org) wrote: Send Python-list mailing

Re: Python-list Digest, Vol 139, Issue 7

2015-04-06 Thread Dylan Evans
understanding and my apologies once again. I hope my attempt at help was at least readable. (Also sorry if I’m committing another faux pas by clogging up the list but I had to apologise!) — Dylan Evans -- https://mail.python.org/mailman/listinfo/python-list

Why doesn't input code return 'plants' as in 'Getting Started with Beautiful Soup' text (on page 30) ?

2015-07-11 Thread Simon Evans
Dear Programmers, Thank you for your advice regarding giving the console a current address in the code for it to access the html file. The console seems to accept the code to that extent, but when I input the two lines of code intended to access the location of a required word, the console re

Re: Why doesn't input code return 'plants' as in 'Getting Started with Beautiful Soup' text (on page 30) ?

2015-07-12 Thread Simon Evans
Dear Mark Lawrence, thank you for your advice. I take it that I use the input you suggest for the line : soup = BeautifulSoup("C:\Beautiful Soup\ecological_pyramid.html",lxml") seeing as I have to give the file's full address I therefore have to modify your : soup = BeautifulSoup(ecological_py

Re: Why doesn't input code return 'plants' as in 'Getting Started with Beautiful Soup' text (on page 30) ?

2015-07-12 Thread Simon Evans
Dear Peter Otten, thank you for your reply that I have not gone very far into the detail of which, as it seems Python console cannot recognise the name 'f' as given it, re output below : Python 2.7.6 (default, Nov 10 2013, 19:24:18) [MSC v.1500 32 bit (Intel)] on win 32 Type "help", "copyright"

Re: Why doesn't input code return 'plants' as in 'Getting Started with Beautiful Soup' text (on page 30) ?

2015-07-12 Thread Simon Evans
Dear Peter Otten, Incidentally, you have discovered a fault in that there is an erroneous difference in my code of 'ecologicalpyramid.html' and that given in the text, in the first few lines re: plants 1000

Re: Why doesn't input code return 'plants' as in 'Getting Started with Beautiful Soup' text (on page 30) ?

2015-07-12 Thread Simon Evans
Dear Peter Otten, Yes, I have been copying and pasting, as it saves typing. I do get 'indented block' error responses as a small price to pay for the time and energy thus saved. Also Console seems to reject for 'indented block' reasons better known to itself, copy and pasted lines that it accep

Re: Why doesn't input code return 'plants' as in 'Getting Started with Beautiful Soup' text (on page 30) ?

2015-07-12 Thread Simon Evans
Dear Peter Otten, I typed in (and did not copy and paste) the code as you suggested just now (6.28 pm, Sunday 12th July 2015), this is the result I got: Python 2.7.6 (default, Nov 10 2013, 19:24:18) [MSC v.1500 32 bit

Suitable Python code to scrape specific details from web pages.

2014-08-12 Thread Simon Evans
f you could tell me where I am going wrong. Yours faithfully Simon Evans. >>>import urllib >>>import re >>>htmlfile = urllib.urlopen("http://www.racingpost.com/horses2/cards/card.sd?

Re: Suitable Python code to scrape specific details from web pages.

2014-08-12 Thread Simon Evans
On Tuesday, August 12, 2014 9:00:30 PM UTC+1, Simon Evans wrote: > Dear Programmers, > > I have been looking at the You tube 'Web Scraping Tutorials' of Chris Reeves. > I have tried a few of his python programs in the Python27 command prompt, but > altered them from a

Code to Python 27 prompt to access a html file stored on C drive

2014-08-14 Thread Simon Evans
'RacingPost.com' 'SportingLife.com''Oddschecker.com' and 'Bestbetting.com' which is what I am interested in working on. Hope you can help. Yours Simon Evans. -- https://mail.python.org/mailman/listinfo/python-list

Dynamically Cause A Function To Return

2011-09-19 Thread Jordan Evans
I want dynamically place the 'return' statement in a function via user input or achieve the same through some other means. If some other means, the user must be able initiate this at runtime during a raw_input(). This is what I have so far, this would be an awesome command line debugging tool if

Announcing Mii (My) Chat

2011-11-19 Thread Andrew Evans
e for that matter. I am self taught and consider myself a hobbyist programmer. It would be great if some one could suggest a library for TCP Nat Traversal. As well I am open to any and all suggestions! I appreciate any feedback *cheers Andrew Evans Here is the link http://code.google.com/p/mii

Re: error in except

2013-02-04 Thread John Evans
, wget doesn't time out for 3 minutes, which is > possibly overkill.) > > But either way, I don't think RuntimeError is the right exception to use. I > expect that a socket error would be more relevant. > > > except: > > raise > > What this does is: > > "Unconditionally catch anything. Then raise it again." > > Don't do this. The right thing to do here is, just delete it and don't > catch > it at all. > > > > > -- > Steven > > -- > http://mail.python.org/mailman/listinfo/python-list > -- John Evans -- http://mail.python.org/mailman/listinfo/python-list

Re: HTTPserver: how to access variables of a higher class?

2013-04-05 Thread Dylan Evans
On 05/04/2013 9:09 PM, "Tom P" wrote: > > First, here's a sample test program: > > import sys > from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler > > class MyRequestHandler(BaseHTTPRequestHandler, object): > def do_GET(self): > top_self = super(MyRequestHandler, self) # tr

Re: Run python script with ./

2013-04-05 Thread Dylan Evans
On Sat, Apr 6, 2013 at 1:04 AM, LubanWorks wrote: > > > > My question is: > > Why when I use #!/home/luban/Linux/Python/2.7.3/bin/python at the > beginning of myscript.py, *./*myscript.py can work, > > but if I use the wrapper #!/home/luban/bin/python in my python script, use > *./* to run the s

Re: Trying to understand working with dicts

2013-04-05 Thread Dylan Evans
On Fri, Apr 5, 2013 at 10:34 PM, inshu chauhan wrote: > Hello everyone, > > Here in my part of the code where cc is a dictionary. I want to understand > what actually cc.iterkeys() and cc[k] actually doing. > I am already reading > http://docs.python.org/2/library/stdtypes.html#dict.items > and ht

Re: I hate you all

2013-04-05 Thread Dylan Evans
On Sat, Apr 6, 2013 at 7:41 AM, wrote: > Hello > > I just tried python 3.3 with some simple script meant for unit test. > > How can python authors be so arrogant to impose their tabs and spaces > options on me ? It should be my choice if I want to use tabs or not ! > > Don't like it? Use ruby.

Re: HTTPserver: how to access variables of a higher class?

2013-04-06 Thread Dylan Evans
On Sun, Apr 7, 2013 at 1:05 AM, Tom P wrote: > On 04/05/2013 02:27 PM, Dylan Evans wrote: > >> On 05/04/2013 9:09 PM, "Tom P" wrote: >> >>> >>> First, here's a sample test program: >>> >>> import sys >>&g

Re: I hate you all

2013-04-06 Thread Dylan Evans
pretty happy to adopt a language which defines a sane style. This is a nice flame war you have stirred up. On Sat, Apr 6, 2013 at 3:13 PM, wrote: > On Saturday, April 6, 2013 7:28:55 AM UTC+3, Dylan Evans wrote: > > On Sat, Apr 6, 2013 at 7:41 AM, wrote: > > > > Hell

Re: parse the file

2013-04-07 Thread Dylan Evans
You can read the fantastic manual at http://docs.python.org/2/library/xml.etree.elementtree.html or i'm sure someone will do it for a modest fee. On Sat, Apr 6, 2013 at 3:11 PM, 水静流深 <1248283...@qq.com> wrote: > I have an xml file . http://s.yunio.com/bmCS5h > > It is

Re: subprocess question re waiting

2013-04-08 Thread Dylan Evans
On Mon, Apr 8, 2013 at 9:48 PM, Alain Ketterlin wrote: > loial writes: > > > I want to call a child process to run a shell script and wait for that > > script to finish. Will the code below wait for the script to finish? > > If not then how do I make it wait? > [...] > > process = subprocess.Pop

Re: Can anyone please help me in resolving the error => AttributeError: Array instance has no attribute '__trunc__'

2013-04-08 Thread Dylan Evans
On Mon, Apr 8, 2013 at 8:07 PM, wrote: > I am trying to create 2D arrays without using advanced features like > numpy, for this I have created 2 separate modules arrays.py and array2D.py. > Here's the code for that: > > arrays.py module: > == > import ctypes > > class Array: > > #

Re: subprocess question re waiting

2013-04-08 Thread Dylan Evans
On Mon, Apr 8, 2013 at 10:22 PM, Dave Angel wrote: > On 04/08/2013 08:01 AM, Dylan Evans wrote: > >> On Mon, Apr 8, 2013 at 9:48 PM, Alain Ketterlin < >> al...@dpt-info.u-strasbg.fr >> >>> wrote: >>> >> >> loial writes: >>> >

Re: is "_io.py" missing from 2.7.4 ?

2013-04-08 Thread Dylan Evans
On Mon, Apr 8, 2013 at 11:12 PM, dbv wrote: > In 2.7.4, io.py shows: > > import _io > import abc > > from _io import (DEFAULT_BUFFER_SIZE, BlockingIOError, > UnsupportedOperation, > open, FileIO, BytesIO, StringIO, BufferedReader, > BufferedWriter, BufferedRWPair

Re: USBLock : lock/unlock your computer with a USB key

2013-04-11 Thread Dylan Evans
This looks cool, would actual be pretty useful. I see you did it as a usb project but probably bluetooth would be better so you could just pair it to your phone and know that your PC will lock when you walk away. On Tue, Apr 9, 2013 at 1:21 AM, Sven wrote: > I've been working on a little proje

Re: USBLock : lock/unlock your computer with a USB key

2013-04-12 Thread Dylan Evans
On Fri, Apr 12, 2013 at 6:16 AM, Ian Kelly wrote: > On Thu, Apr 11, 2013 at 9:23 AM, Ethan Furman wrote: > > On 04/11/2013 04:13 AM, Sven wrote: > >> > >> Yes, I had the idea to add bluetooth too, removes the whole plugging and > >> unplugging spiel. I might start work on that, > >> and if anyon

Linking to Python for Windows CE

2006-01-16 Thread Martin Evans
I've just been tasked with porting our desktop embedded Python support onto our existing CE offering. I've managed to compile the Python sources and have produced an armdbg420\python23.lib file. When I come to link to the Python library though from our one of our DLLs, I am getting the followin

Re: Linking to Python for Windows CE

2006-01-16 Thread Martin Evans
Sorry, false alarm. It turned out one of my own files was using fopen/fclose and this was upseting things. After removing those it linked fine. Martin Evans wrote: > I've just been tasked with porting our desktop embedded Python support > onto our existing CE offering. I&#x

Adding private tags to a tiff file.

2006-08-11 Thread O Evans
Hi there, I'm manipualating tiff images captured by a program that insists on using annoying private tags. I want to be able to import an image that I have created into the program but I cannot get PIL to save the private tag. Here is a simplified version of the code I am using: import Image orig

Newbie: datetime conversion question

2006-10-17 Thread kevin evans
Hi, I'm trying to convert some code from Ruby to Python, specifically.. timestamp = "%08x" % Time.now.to_i Make a hex version of the current timestamp. Any ideas how best to do this in python gratefully received.. -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie: datetime conversion question

2006-10-17 Thread kevin evans
Great stuff - many thanks hg wrote: > Carsten Haese wrote: > > On Tue, 2006-10-17 at 08:49, hg wrote: > >> import time > >> "%08X"% (int)(time.mktime(time.localtime())) > > > > Have you not had your coffee yet or are you trying to win an obfuscated > > python programming competition? ;) > > > >

Python 2.5 Core Dump on Solaris 8

2006-11-10 Thread Melissa Evans
Hi. I'm new to Python. :) I've modified grappy.py, http://www.stacken.kth.se/~mattiasa/projects/grappy/, a postfix policy daemon for greylisting. to use LDAP as a backend instead of SQL (with python-ldap.) The daemon runs fine when testing but when I put it under load it core dumps quickly.

RegEx conditional search and replace

2006-07-05 Thread Martin Evans
Sorry, yet another REGEX question. I've been struggling with trying to get a regular expression to do the following example in Python: Search and replace all instances of "sleeping" with "dead". This parrot is sleeping. Really, it is sleeping. to This parrot is dead. Really, it is dead. But n

Re: RegEx conditional search and replace

2006-07-06 Thread Martin Evans
"Juho Schultz" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Martin Evans wrote: >> Sorry, yet another REGEX question. I've been struggling with trying to >> get >> a regular expression to do the following example in Python: >>

Re: RegEx conditional search and replace

2006-07-06 Thread Martin Evans
"mbstevens" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Thu, 06 Jul 2006 08:32:46 +0100, Martin Evans wrote: > >> "Juho Schultz" <[EMAIL PROTECTED]> wrote in message >> news:[EMAIL PROTECTED] >>> Martin Evan

Invalid thread state for this thread

2007-05-24 Thread Martin Evans
I know this has been seen before but it is not making too much sense (after reading many posts). It all appears to work fine but then dies after about 40 invocations. My app has Python embedded, it is embedded as part of a dll which initializes python and finalizes on load and unload (see below

Re: Invalid thread state for this thread

2007-05-25 Thread Martin Evans
Just in case anyone else has seen this problem, after upgrading to 2.4.4 the problem appears to have resolved itself. >I know this has been seen before but it is not making too much sense (after >reading many posts). It all appears to work fine but then dies after about >40 invocations. > > My

Re: Parser Generator?

2007-08-22 Thread Jason Evans
On Aug 18, 3:22 pm, "Jack" <[EMAIL PROTECTED]> wrote: > Hi all, I need to do syntax parsing of simple naturual languages, > for example, "weather of London" or "what is the time", simple > things like these, with Unicode support in the syntax. > > In Java, there are JavaCC, Antlr, etc. I wonder wha

Re: Parser Generator?

2007-08-26 Thread Jason Evans
On Aug 24, 1:21 pm, "Jack" <[EMAIL PROTECTED]> wrote: > "Jason Evans" <[EMAIL PROTECTED]> wrote in message > >http://www.canonware.com/Parsing/ > > Thanks Jason. Does Parsing.py support Unicode characters (especially CJK)? > I'll take

py2exe, library.zip and python.exe

2007-02-28 Thread Martin Evans
I have converted a Python script using py2exe and have it set to not bundle or compress. The result is my exe and all the support files including library.zip (exactly as planned - nice job py2exe). Question: My py2exe application needs to be able to execute extra copies of python.exe. I have p

Re: py2exe, library.zip and python.exe

2007-02-28 Thread Martin Evans
"Thomas Heller" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Martin Evans schrieb: >> I have converted a Python script using py2exe and have it set to not >> bundle >> or compress. The result is my exe and all the support files including >

Cast to a method pointer in ctypes

2011-01-31 Thread Andrew Evans
How can I cast to a method pointer in ctypes. for example this in C int (*func)(); func = (int (*)()) expl; (int)(*func)(); How can I do this in ctypes using Python? I couldn't find the info I needed to be able to do this *cheers -- http://mail.python.org/mailman/listinfo/python-list

Striving for PEP-8 compliance

2010-04-07 Thread Tom Evans
[ Please keep me cc'ed, I'm not subscribed ] Hi all I've written a bunch of internal libraries for my company, and they all use two space indents, and I'd like to be more consistent and conform to PEP-8 as much as I can. My problem is I would like to be certain that any changes do not alter the

  1   2   >