Re: Sanitise user input for a script

2024-08-30 Thread Simon Connah via Python-list
On Friday, 30 August 2024 at 21:23, Peter J. Holzer via Python-list wrote: > > > On 2024-08-30 19:18:29 +0000, Simon Connah via Python-list wrote: > > > I need to write a script that will take some user input (supplied on a > > website) and then execute a Python

Re: Sanitise user input for a script

2024-08-30 Thread Simon Connah via Python-list
On Friday, 30 August 2024 at 23:35, Thomas Passin via Python-list wrote: > > > On 8/30/2024 3:18 PM, Simon Connah via Python-list wrote: > > > I need to write a script that will take some user input (supplied on a > > website) and then execute a Python scrip

Sanitise user input for a script

2024-08-30 Thread Simon Connah via Python-list
could do it either on the website itself or by doing it on the host machine. I'm thinking of using argparse but I'm aware it does not offer any protection itself. If someone has any suggestions I'd appreciated it. If you need more information then please let me know. Simon. signa

Re: Checking if email is valid

2023-11-06 Thread Simon Connah via Python-list
hell has a landline these days? And not accepting your mobile number in the landline number field is just when I give up. Or having a landline only field that does not accept mobile phones. Simon. signature.asc Description: OpenPGP digital signature -- https://mail.python.org/mailman/listinfo/python-list

Re: Checking if email is valid

2023-11-04 Thread Simon Connah via Python-list
> > > On 2023-11-02, Simon Connah simon.n.con...@protonmail.com wrote: > > > Valid as in conforms to the standard. Although having looked at the > > standard that might be more difficult than originally planned. > > > Yes. Almost nobody actually impleme

Re: Checking if email is valid

2023-11-04 Thread Simon Connah via Python-list
t; > What do you mean by 'What do you mean by "obviously invalid"?' > > Have you read the RFC? > > > About reading the RFC, there's this ... but read the comments too ... > > https://haacked.com/archive/2007/08/21/i-knew-how-to-validate-an-email-add

Re: Checking if email is valid

2023-11-03 Thread Simon Connah via Python-list
> > > On 11/2/23 00:42, Simon Connah via Python-list wrote: > > > Basically I'm writing unit tests and one of them passess in a string > > with an invalid email address. I need to be able to check the string > > to see if it is a valid email so that the

Re: Checking if email is valid

2023-11-02 Thread Simon Connah via Python-list
> Please re-read. > Discussion is about "closeness". > Thus, what you might expect from email servers and Admins, NOT what you > should do. That part should be quite evident by now! > My apologies for making a mistake. Simon. signature.asc Description: OpenPGP di

Re: Checking if email is valid

2023-11-02 Thread Simon Connah via Python-list
, > =dn I'm not sure that would be practical. As I'm setting up a mailing list server I don't know if someone in the future is going to need to use one of those aliases and testing manually would be tedious. Simon. signature.asc Description: OpenPGP digital signature -- https://mail.python.org/mailman/listinfo/python-list

Re: Checking if email is valid

2023-11-02 Thread Simon Connah via Python-list
> > > See https://www.linuxjournal.com/article/9585?page=0,0 > That looks painful to maintain! signature.asc Description: OpenPGP digital signature -- https://mail.python.org/mailman/listinfo/python-list

Re: Checking if email is valid

2023-11-01 Thread Simon Connah via Python-list
> > On 2023-11-01, Chris Angelico ros...@gmail.com wrote: > > > On Thu, 2 Nov 2023 at 05:21, Simon Connah via Python-list > > python-list@python.org wrote: > > > > > Could someone push me in the right direction please? I just want to > > >

Re: Checking if email is valid

2023-11-01 Thread Simon Connah via Python-list
> > > On Thu, 2 Nov 2023 at 05:21, Simon Connah via Python-list > python-list@python.org wrote: > > > Could someone push me in the right direction please? I just want to find > > out if a string is a valid email address. > > > There is only one way to

Re: Checking if email is valid

2023-11-01 Thread Simon Connah via Python-list
> > On 2023-11-01, Simon Connah via Python-list python-list@python.org wrote: > > > I'm building a simple project using smtplib and have a > > question. I've been doing unit testing but I'm not sure how to check > > if an email message is valid. >

Checking if email is valid

2023-11-01 Thread Simon Connah via Python-list
someone push me in the right direction please? I just want to find out if a string is a valid email address. Thank you. Simon. signature.asc Description: OpenPGP digital signature -- https://mail.python.org/mailman/listinfo/python-list

Re: Checking if email is valid

2023-11-01 Thread Simon Connah via Python-list
riginal Message --- On Wednesday, 1 November 2023 at 10:09, Simon Connah wrote: > > > Hi, > > I'm building a simple project using smtplib and have a question. I've been > doing unit testing but I'm not sure how to check if an email message is > valid. Usi

Re: OT: Addition of a .= operator

2023-06-09 Thread Simon Ward via Python-list
e 3, in print(math.asin(float(input("Enter a small number: " ^ ValueError: math domain error [1]: https://docs.python.org/3/whatsnew/3.11.html#whatsnew311-pep657 Regards, Simon -- A complex system that works is invariably found to have evolved from a simp

ipaddress (was: Re: for a 'good python')

2023-04-21 Thread Simon Ward
On Thu, Apr 13, 2023 at 04:00:59PM +0100, Barry wrote: Ipaddress was developed outside of the std lib and later added i recall. I used it prior to it being in the standard library: https://pypi.org/project/ipaddr/ Simon -- A complex system that works is invariably found to have evolved from

Re: Friday finking: IDE 'macro expansions'

2023-03-17 Thread Simon Ward
me colours, with the aim of helping you see them through the flow of the code. Simon -- A complex system that works is invariably found to have evolved from a simple system that works.—John Gall -- https://mail.python.org/mailman/listinfo/python-list

Re: Friday finking: IDE 'macro expansions'

2023-03-17 Thread Simon Ward
On Fri, Mar 17, 2023 at 11:55:38AM +1300, dn via Python-list wrote: Do you make use of your IDE's expansionist tendencies, and if-so, which ones? Unix (well, GNU/Linux) is my IDE ;) Simon -- https://mail.python.org/mailman/listinfo/python-list

Re: Implementing a plug-in mechanism

2023-03-16 Thread Simon Ward
e defined separately not requiring inheriting from an ABC. Simon -- A complex system that works is invariably found to have evolved from a simple system that works.—John Gall -- https://mail.python.org/mailman/listinfo/python-list

Re: Distributing program for Linux

2023-03-14 Thread Simon Ward
env to install to a custom location: https://github.com/pyenv/pyenv/wiki/Common-build-problems#installing-a-system-wide-python Simon -- https://mail.python.org/mailman/listinfo/python-list

Re: Baffled by readline module

2023-03-10 Thread Simon Ward
ing full screen applications.” (It doesn’t depend on readline or libedit.) It’s used by IPython for its history, editing, and completion features. If cmd with readline is overkill for your use case then this is even more so, but I thought it worth a mention. Simon -- https://mail.python.org/mailman/listinfo/python-list

Re: Python 3.10 Fizzbuzz

2023-03-01 Thread Simon Ward
fering opinions just results in forks or wrappers that modify the behaviours that might otherwise have been configuration options. Simon -- https://mail.python.org/mailman/listinfo/python-list

need help with a ctypes project for PyPI

2021-02-03 Thread Simon Zhang
sts.txt. I think this is something basic involving paths but could be more involved. Can anyone help!! Thanks, Simon Zhang -- https://mail.python.org/mailman/listinfo/python-list

The '-c' CLI option removes just the command str.

2020-05-05 Thread Simon Forman via Python-list
-c "import sys; print(sys.argv)" [] Or it leaves them both in: $ python -c "import sys; print(sys.argv)" ['-c', 'import sys; print(sys.argv)'] What do you think? Warm regards, ~Simon -- https://mail.python.org/mailman/listinfo/python-list

Re: Would you be interested in this Python open source project?

2019-10-09 Thread Simon Connah
tible with the Affero General Public License version 3. On the other hand I do have a desire to build something similar myself just to get the hang of things like this. Thank you for your reply. On Tue, Oct 8, 2019 at 8:33 AM Rhodri James wrote: On 08/10/2019 11:22, Simon Connah wrote:

Re: Would you be interested in this Python open source project?

2019-10-09 Thread Simon Connah
On 08/10/2019 13:17, Rhodri James wrote: On 08/10/2019 11:22, Simon Connah wrote: I'm posting this message as a way to gauge interest in the project and to see if it is worth moving forward with. There are probably hundreds of CI/CD tools out there and many more general devops tools but

Would you be interested in this Python open source project?

2019-10-08 Thread Simon Connah
I'm posting this message as a way to gauge interest in the project and to see if it is worth moving forward with. There are probably hundreds of CI/CD tools out there and many more general devops tools but what I want to build is a CI/CD tool that ONLY supports Python 3.6 or greater and only ru

Re: Looking for tips and gotchas for working with Python 3.5 zipapp feature

2019-07-01 Thread Simon
ave to bundle the C extension. How can I do that? Thx, Simon -- https://mail.python.org/mailman/listinfo/python-list

Python WebApp where Python runs on the client's machine using Pyodide

2019-05-21 Thread Simon Biggs
ar future once I fix up the freezing and I have also provided a few more example scripts. Cheers, Simon -- https://mail.python.org/mailman/listinfo/python-list

Building a statically linked Python, and pip

2019-05-07 Thread Simon Michnowicz via Python-list
l pip with a statically built Python? I enabled as many modules as possible in Modules/Setup.local but I could not see any thing for _queue thanks for any help *---Simon Michnowicz * Senior Application Specialist, High-Performance Computing *Research Support Services - eSolutions* *Monash eResearch

asyncio Question

2019-03-14 Thread Simon Connah
Hi, Hopefully this isn't a stupid question. For the record I am using Python 3.7 on Ubuntu Linux. I've decided to use asyncio to write a TCP network server using Streams and asyncio.start_server(). I can handle that part of it without many problems as the documentation is pretty good. I have

Re: Rate limiting a web crawler

2018-12-26 Thread Simon Connah
On 26/12/2018 19:04, Terry Reedy wrote: On 12/26/2018 10:35 AM, Simon Connah wrote: Hi, I want to build a simple web crawler. I know how I am going to do it but I have one problem. Obviously I don't want to negatively impact any of the websites that I am crawling so I want to impl

Re: Rate limiting a web crawler

2018-12-26 Thread Simon Connah
On 26/12/2018 18:30, Richard Damon wrote: On 12/26/18 10:35 AM, Simon Connah wrote: Hi, I want to build a simple web crawler. I know how I am going to do it but I have one problem. Obviously I don't want to negatively impact any of the websites that I am crawling so I want to implement

Rate limiting a web crawler

2018-12-26 Thread Simon Connah
Hi, I want to build a simple web crawler. I know how I am going to do it but I have one problem. Obviously I don't want to negatively impact any of the websites that I am crawling so I want to implement some form of rate limiting of HTTP requests to specific domain names. What I'd like is

Re: Python installer hangs in Windows 7

2018-03-15 Thread simon . wonng
On Monday, December 4, 2017 at 12:44:48 PM UTC-8, christian...@gmail.com wrote: > Same with me, except that I tried to install Python 3.6.3. Unchecking > "Install launcher for all users" helped, however. This worked for me, thanks! -- https://mail.python.org/mailman/listinfo/python-list

RE: Python application launcher (for Python code)

2017-02-20 Thread Simon Ward
as IDLE[2], where this is all integrated into one convenient application. From some of what you said above I suggest taking a look at Jupyter Notebook[3] and/or the underlying iPython[4] shell. [2]: https://docs.python.org/3/library/idle.html [3]: http://jupyter.org/ [4]: https://ipython.org/ Simon -- Sent from Kaiten Mail. Please excuse my brevity. -- https://mail.python.org/mailman/listinfo/python-list

Pyscripter Issues

2016-03-31 Thread Simon Martin
Hi I have been having issues trying to run python 3.5.1 and pyscripter 2.6. Giving the error message that it cannot initialize python. I have tried to re-install multiple versions of both python and pyscripter to no avail. Any advice? Thanks Simon Sent from Mail for Windows 10 -- https

Re: numpy arrays

2016-03-23 Thread Simon Ward
[4,4,4,4]] Use the transpose() method: http://docs.scipy.org/doc/numpy-1.10.0/reference/generated/numpy.ndarray.transpose.html Simon -- Sent from Kaiten Mail. Please excuse my brevity. -- https://mail.python.org/mailman/listinfo/python-list

Re: Continuing indentation

2016-03-04 Thread Simon Ward
ld aim more for consistency (the hobgoblin that may be), which is what makes code easier to grok. Stop arguing, start thinking about others who will have to read your code. What is better in your subjective opinion means very little. Having commonly understandable style is what matters, and wha

Help using Thread (or other method)

2016-02-08 Thread Brendan Simon (eTRIX)
Hi. Need some urgent help. I have a python app that uses `select` to wait for data from an arm embedded linux kernel interrupt (every second). The mainloop of the app then grabs data from some memory mapped area, processes it and then does a http post to a server. The problem is the http post c

Re: Bug!

2015-08-22 Thread Simon Ward
On 23 August 2015 00:06:44 BST, Chris Angelico wrote: >Precisely. Every time you support multiple versions of some >dependency, you have to test your code on all of them, and in the >common case (new features added in newer versions), you have to target >the oldest and weakest version. Just don

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

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, 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, 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 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

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

Python 3.5.0b3(64 bit) - idle refused to work on windows 7 desktop pc.

2015-07-11 Thread Simon Ball
Good morning, Everything else appeared to work though. Kept getting the windows 'donut' telling me it was doing something, but then the program did not appear. Windows 7 Home Premium Service Pack 1 intel 64 bit pc. Kind regards Simon Ball Luton Bedfordshire UK -- Using Opera

Re: Query on Python 3.2 and supported OpenSSL Versions

2015-05-25 Thread Simon Ward
d 1.0.1 and it should build against any version in these branches. I also have pyOpenSSL built against these branches. Simon -- A complex system that works is invariably found to have evolved from a simple system that works.—John Gall -- https://mail.python.org/mailman/listinfo/python-list

Re: Python Worst Practices

2015-02-27 Thread Simon Ward
On 27 February 2015 20:06:25 GMT+00:00, Simon Ward wrote: > >I mentioned the true and false. OK, so it's a meme, but it's based on a >false (pun intended) understanding of exit status codes. That success >evaluates to true and failure evaluates to false does not mean th

Re: Python Worst Practices

2015-02-27 Thread Simon Ward
ruth and falseness are inverted. No programming language >other than that provided by system shells I have used evaluates 0 to >true. I hope the following examples from bash illustrate this: $ (( 0 )) && echo success $ (( 1 )) && echo success success $ (( 0 )) ; echo

Re: Python Worst Practices

2015-02-27 Thread Simon Ward
On 26 February 2015 21:23:34 GMT+00:00, Ben Finney wrote: >Simon Ward writes: >> 0 = success and non-zero = failure is the meme established, rather >> than 0 = true, non-zero = false. > >That is not the case: the commands ‘true’ (returns value 0) and ‘false’ >(r

Re: Python Worst Practices

2015-02-26 Thread Simon Ward
or level is higher than N. None of the above is a good reason to use error *or* success return values in Python--use exceptions!--but may be encountered when running other processes. Simon -- https://mail.python.org/mailman/listinfo/python-list

Re: Python Worst Practices

2015-02-26 Thread Simon Ward
the ease of avoiding it makes the extra character a practical defensive technique. I agree it is not a worst case. Simon -- https://mail.python.org/mailman/listinfo/python-list

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
rompt to that folder (re: cd Soup)as instructed on page 30, and put a duplicate file of 'EcologicalPyramid.html' in the python 2.8 directory. I therefore am wondering where I ought put this html file where the Python console will recognize it ? Thank you for your attent

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

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-14 Thread Simon Evans
ne which comes after, again I get an error return, my only point is that with the above input, console return does not seem to infer that soup has not been defined. You recommend that I put all the code into a file then run it - how do I do that ? I am new to Python, as you might have gathered. Thank you for your help. Yours Simon -- https://mail.python.org/mailman/listinfo/python-list

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
given (according to the book) the output: --- plants Maybe that is getting a bit far ahead, but I can't quite see where I have gone wrong - 'soup' has been defined as an object made of file 'EcologicalPyramid.html I hope you can help me on this point. Yours Simon -- https://mail.python.org/mailman/listinfo/python-list

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

2014-12-14 Thread Simon Evans
ow if its related to the above or not. Yours Simon. -- https://mail.python.org/mailman/listinfo/python-list

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: Tabs for indentation & Spaces for alignment in Python 3?

2014-12-06 Thread Simon Ward
d) style guides (or rather policies) exist. Maybe we should sack such programmers regardless of their other abilities instead of forcing all, including the conscientious, programmers to adhere to strict style policies? While I like the idea, I think that a slap on the wrist and a bit of re-indentation/re-alignment is all that is necessary (although I have worked with people who consider pure style changes to be a sin too). Simon -- https://mail.python.org/mailman/listinfo/python-list

Re: python 2.7 and unicode (one more time)

2014-12-02 Thread Simon Evans
7;>Home</a> <a href=" http=""> >>> atag.name = 'p' >>> print(soup) Test html a tag example http://www.packtpub.com'>Home</a> <a href=" http=""> >>> atag.name = 'a' >>> print(soup) Test html a tag example http://www.packtpub.com'>Home</a> <a href=" http=""> >>> soup_atag = soup >>> atag = soup_atag.a >>> print (atag['href']) http://www.packtpub.com'>Home >> Thank you. Yours Simon. -- https://mail.python.org/mailman/listinfo/python-list

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: 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

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: 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

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-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-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
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
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 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 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

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: OS X Menubar in Tkinter

2014-10-28 Thread Simon Kennedy
On Thursday, 23 October 2014 20:02:43 UTC+1, Chris Angelico wrote: > I don't think it's possible to auto-solve the Google Groups formatting > issues at the mailing list level, as the fundamental problem is that > information isn't being transmitted. (Forcing everything to be wrapped > and forcing

Re: Truthiness

2014-10-23 Thread Simon Kennedy
Thanks everyone. That's a thorough enough explanation for me. -- https://mail.python.org/mailman/listinfo/python-list

Truthiness

2014-10-23 Thread Simon Kennedy
Just out of academic interest, is there somewhere in the Python docs where the following is explained? >>> 3 == True False >>> if 3: print("It's Twue") It's Twue i.e. in the if statement 3 is True but not in the first -- https://mail.python.org/mailman/listinfo/python-list

Re: setuptools + data_files = 2

2014-10-23 Thread Simon Kennedy
On Wednesday, 22 October 2014 19:43:25 UTC+1, luc2 wrote: > hello, would you know how to make data_files work in setuptools ? > i can't figure out how to put datas in the generated .tar.gz If you're creating an sdist then you'll need to create a MANIFEST.in file in the same folder as setup.py wi

Re: Is there an easy way to control indents in Python

2014-10-21 Thread Simon Kennedy
On Monday, 20 October 2014 18:56:05 UTC+1, Ian wrote: > Rather, I'm saying that where the blank line is should be the start of > a new function. There would still be a blank line, just no longer > inside the function. > > Now, maybe you think there should be more blank lines in the above, in > wh

Re: Is there an easy way to control indents in Python

2014-10-20 Thread Simon Kennedy
On Saturday, 18 October 2014 11:53:16 UTC+1, Steven D'Aprano wrote: > I'm curious what aspect of idiomatic Perl code you are referring to. When > people talk about Perl code dismissively, I normally think of three things: > > - excessively long one-liners; > - excessive use of symbols and sigils

Re: Creating a counter

2014-10-16 Thread Simon Kennedy
On Thursday, 16 October 2014 15:05:47 UTC+1, Ian wrote: > I would have suggested a Counter if I thought it fit the OP's use > case. If you're listing directory contents, you're not going to have > any repeated strings, so all the counts will be 1, and your Counter > might as well be a list, which

Re: Is there an easy way to control indents in Python

2014-10-16 Thread Simon Kennedy
On Wednesday, 15 October 2014 20:31:15 UTC+1, Ian wrote: > I agree. I very rarely use blank lines inside functions. As I see it, > if you feel you need a blank line for separation within a function, > that's an indication your function is overly complex and should be > broken up. Whereas I feel t

Re: Creating a counter

2014-10-16 Thread Simon Kennedy
On Wednesday, 15 October 2014 19:39:43 UTC+1, Shiva wrote: > I am trying to search a string through files in a directory - however while > Python script works on it and writes a log - I want to present the user with > count of number of strings found. So it should increment for each string > foun

Re: [OT] spelling colour / color was Re: Toggle

2014-10-11 Thread Simon Ward
tionaries online is not just British English, it derives common usage from a corpus of English used around the world: http://www.oxforddictionaries.com/words/what-are-the-main-differences-between-the-oed-and-odo http://www.oxforddictionaries.com/words/the-oxford-english-corpus Simon -- https://mail.python.org/mailman/listinfo/python-list

How donwnload youtube videos?

2014-10-04 Thread Dymond Simon
Hi guys .. Uhm, ı have to download youtube videos ı was tried urlretrive but doesn't work ı have no idea that's why.So there is my question, "we cant donwload youtube videos directly ? ". -- https://mail.python.org/mailman/listinfo/python-list

Re: Teaching Python

2014-09-29 Thread Simon Ward
o Think Like a Computer Scientist - Learning with Python 3": http://openbookproject.net/thinkcs/python/english3e/ If you're after a printed book, the original (I believe) author's current version is here: http://www.greenteapress.com/thinkpython/thinkpython.html Simon -- https://mail.python.org/mailman/listinfo/python-list

Re: Global indent

2014-08-22 Thread Simon Ward
selected text rather than replacing it with a tab character. Shift-tab probably out dented too. Simon -- Sent from Kaiten Mail. Please excuse my brevity. -- https://mail.python.org/mailman/listinfo/python-list

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

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

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: PEP8 and 4 spaces

2014-07-04 Thread Simon Ward
to highlight tabs and trailing spaces. Simon -- https://mail.python.org/mailman/listinfo/python-list

Re: PEP8 and 4 spaces

2014-07-03 Thread Simon Ward
f spaces. If you don't use such an editor, and you really can't tolerate the different style, you can use another tool to reindent your code. Simon -- https://mail.python.org/mailman/listinfo/python-list

Re: Python's re module and genealogy problem

2014-06-11 Thread Simon Ward
Regular_expression#Patterns_for_non-regular_languages [3]: https://en.wikipedia.org/wiki/Regular_language Simon -- Sent from Kaiten Mail. Please excuse my brevity. -- 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-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: 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 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-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-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

  1   2   3   4   5   6   7   8   9   10   >