Re: Is there a Python module to parse a date like the 'date' command in Linux?

2023-05-22 Thread Mike Dewhirst
On 21/05/2023 5:53 am, Chris Green wrote: I'm converting a bash script to python as it has become rather clumsy in bash. What is the use case? However I have hit a problem with converting dates, the bash script has:- dat=$(date --date "$1" +"%Y/%m/%d") and this will accept almost anyth

RE: where is requests

2023-05-23 Thread Mike Dewhirst
Try pip install requests--(Unsigned mail from my phone) Original message From: Rich Osborne Date: 24/5/23 11:49 (GMT+10:00) To: python-list@python.org Subject: where is requests I have install Python 3.11.3 but my import requests does not work. I found documentation that refe

Re: Is there a Python module to parse a date like the 'date' command in Linux?

2023-05-24 Thread Mike Dewhirst
On 23/05/2023 7:16 pm, Chris Green wrote: Mike Dewhirst wrote: [-- multipart/mixed, encoding 7bit, 22 lines --] [-- text/plain, encoding base64, charset: UTF-8, 16 lines --] On 21/05/2023 5:53 am, Chris Green wrote: I'm converting a bash script to python as it has become rather c

Re: Is there a Python module to parse a date like the 'date' command in Linux?

2023-06-01 Thread Mike Dewhirst
On 24/05/2023 6:00 pm, Mike Dewhirst wrote: On 23/05/2023 7:16 pm, Chris Green wrote: Mike Dewhirst wrote: [-- multipart/mixed, encoding 7bit, 22 lines --] [-- text/plain, encoding base64, charset: UTF-8, 16 lines --] On 21/05/2023 5:53 am, Chris Green wrote: I'm converting a

Re: Why assert is not a function?

2021-03-11 Thread Mike Dewhirst
riately confused - but I only ever used it when I was absolutely certain the assertion was bullet-proof. And it is a long time since I did that. I prefer try-except nowadays. Mike ChrisA -- Signed email is an absolute defence against phishing. This email has been signed with my private

Re: A 35mm film camera represented in Python object

2021-04-01 Thread Mike Dewhirst
On 2/04/2021 8:47 am, D.M. Procida wrote: D.M. Procida wrote: Hi everyone, I've created - a representation of a Canonet G-III QL17 in Python. There's also documentation: . It's a pure Python model of the p

Re: Not found in the documentation

2021-04-27 Thread Mike Dewhirst
On 27/04/2021 11:24 am, elas tica wrote: Le mardi 27 avril 2021 à 01:44:04 UTC+2, Paul Bryan a écrit : From https://docs.python.org/3/reference/datamodel.html#the-standard-type-hierarchy : Thanks for the reference. I was expecting to find this information in the Built-in Types section from

Re: Definition of "property"

2021-05-30 Thread Mike Dewhirst
On 31/05/2021 2:57 am, Irv Kalb wrote: I am doing some writing (for an upcoming book on OOP), and I'm a little stuck. I understand what a "property" is, how it is used and the benefits, but apparently my explanation hasn't made the light bulb go on for my editor. The editor is asking for a de

XAMPP control panel python

2021-07-19 Thread Mike Easter
ip I have is for py3. I can put the .py file on pastebin if anyone wants. Apparently the Win v. of xampp has a CP based on Delphi someone said, so that one is being maintained. -- Mike Easter -- https://mail.python.org/mailman/listinfo/python-list

Re: Python and Ubuntu versions

2021-07-24 Thread Mike Easter
is unconventional. -- Mike Easter -- https://mail.python.org/mailman/listinfo/python-list

Re: Python and Ubuntu versions

2021-07-24 Thread Mike Easter
Mike Easter wrote: Terry Reedy wrote: Mike Easter wrote: For those who are following this thread on a conventional news server, there are missing parts which came from the python-list mailing list instead. For those who prefer an nntp access to the mailing list, the corresponding group on

Re: Python and Ubuntu versions

2021-07-24 Thread Mike Easter
Terry Reedy wrote: Mike Easter wrote: For those who are following this thread on a conventional news server, there are missing parts which came from the python-list mailing list instead. For those who prefer an nntp access to the mailing list, the corresponding group on news.gmane.io is

Re: Python and Ubuntu versions

2021-07-25 Thread Mike Easter
Mike Easter wrote: In the past, old gmane required posting w/ a good email because the gmane server required you to receive an email and self-approve your posting. The old gmane also obfuscated the email of someone posting that way. So, you needed to configure your agent to use a good email

Problem with install of Python 3.5.2 on Windows Vista

2016-10-05 Thread Mike Adams
The install seemed to be going well up to near the end when I got the msg 'Python has stopped working', I clicked the button then I got the msg 'Setup was successful'.  I then clicked 'IDLE' and it says it can't find 'api-msi-win-crt-runtime-11-1-0.dll'.  I checked Python Tracker and saw that t

Parsing a single-level JSON file

2016-11-18 Thread mike . reider
hi all, Im reading in a JSON file that looks like this [ { "name":"myField1", "searchable":true, "navigable":true, "custom":true, "clauseNames":[ "cf[10190]", "Log Details" ], "orderable":true, "id":"customfield_10190",

Re: Parsing a single-level JSON file

2016-11-18 Thread mike . reider
On Friday, November 18, 2016 at 1:23:18 PM UTC-5, mike@gmail.com wrote: > hi all, > > Im reading in a JSON file that looks like this > > > [ >{ > "name":"myField1", > "searchable":true, > &

Re: Parsing a single-level JSON file

2016-11-18 Thread mike . reider
the end result file looks like this cat fields.json {"myField1": {"id": "customfield_10600"}, "myField2": {"id": "customfield_11334"}, "myField3": {"id": "customfield_993434"}, etc etc -- https://mail.python.org/mailman/listinfo/python-list

object types, mutable or not?

2018-05-13 Thread Mike McClain
;, '2'] >>> type (obj) >>> >>> obj = dict( zip(obj[0::2],obj[1::2]) ) >>> type (obj) >>> obj {'a': '1', 'b': '2'} At what level does my understanding break down? Thanks, Mike -- One reason experience is such a good teacher is that she doesn't allow dropouts. -- https://mail.python.org/mailman/listinfo/python-list

Re: object types, mutable or not?

2018-05-15 Thread Mike McClain
On Sun, May 13, 2018 at 07:10:11PM -0400, Richard Damon wrote: > On 5/13/18 4:02 PM, Mike McClain wrote: > > I'm new to Python and OOP. > > Python en 2.7.14 Documentation The Python Language Reference > > 3. Data model > > 3.1. Objects, values and types > >

stock quotes off the web, py style

2018-05-15 Thread Mike McClain
mport get def getAquote(symbol): url = 'https://api.iextrading.com/1.0/stock/()/quote'.format(symbol) reply = module.get(url) return my_parse(reply) Thanks, Mike -- Men occasionally stumble over the truth, but most of them pick themselves up and hurry off as if nothin

Re: stock quotes off the web, py style

2018-05-16 Thread Mike McClain
For Friedrich's, Peter's and the many other responses, many thanks. I will get a handle on python eventually and the many teachers on this list are making that easier. Mike -- "There are three kinds of men. The ones who learn by reading. The few who learn by observation. The rest

Re: stock quotes off the web, py style

2018-05-16 Thread Mike McClain
but it is easy to parse. > You would do multiple symbols in a loop which you enter with an open > urllib object, rather than opening a new one for each symbol inside > the loop. At the moment I can't see how to do that but will figure it out. Thanks for the pointer. Mike -- "The

Re: object types, mutable or not?

2018-05-17 Thread Mike McClain
committee has to bear the responsibility for those > > terms. They are pretty well defined in the C world, so I think you need to > > point the finger of accusation at either Brian or Dennis. > > > > Let's be fair and blame one of them for each. > Let's be fa

decorat{or,ion}

2018-05-18 Thread Mike McClain
ave a place in bar's interface? Thanks again, Mike -- "Keep active but don't be afraid to occasionally indulge." - Jeralean Talley, America's oldest living woman -- https://mail.python.org/mailman/listinfo/python-list

Re: decorat{or,ion}

2018-05-19 Thread Mike McClain
On Sat, May 19, 2018 at 08:22:59AM +0200, dieter wrote: > Mike McClain writes: > > An "object", in general, is something that can have attributes > (holding the object state) and methods (defining often operations on > the object state but in some cases also general ope

Re: decorat{or,ion}

2018-05-19 Thread Mike McClain
On Sat, May 19, 2018 at 07:22:28AM +, Steven D'Aprano wrote: > On Fri, 18 May 2018 18:31:16 -0700, Mike McClain wrote: > > I *think* you are describing something like this: Real close! > def foo(x): > return x + 1 > > def bar(arg): > a = baz(arg) # do so

Re: decorat{or,ion}

2018-05-23 Thread Mike McClain
On Mon, May 21, 2018 at 09:11:02AM +0200, dieter wrote: < lots if good info snipped > Hi dieter, I'm still working my way through the info you posted and making sense of it (mostly) but didn't want to wait any longer to say 'Thanks.' Thanks, Mike -- Even duct tape c

'_' and '__'

2018-05-26 Thread Mike McClain
In their discussion of 'List replication operator' Steven D'Aprano and Ben Finney used these '_' and '__'. Steve said, "[[] for _ in range(5)]". Ben said, "[ [] for __ in range(5) ]". These aren't listed separately in the index,

Re: '_' and '__'

2018-05-29 Thread Mike McClain
To the many who responded, many thanks. I,too, found Nick Coghlan's answer iluminating. Mike -- There are always gossips everywhere you go and few of them limit themselves to veracity when what they consider a good story is available to keep their audience entertained. - MM --

... (ellipsis)

2018-05-31 Thread Mike McClain
ython3.2 it becomes 'Type error' but still doesn't give me anything usable. Is the ellipsis really useable in anything other than documentation or does it actually have a function in python? If the latter would someone please provide an example showing how it is used? Thanks, Mike

version

2018-05-31 Thread Mike McClain
to python3.2. Most of the errors were because I had used 'print' without parens which 2.7 liked but 3.2 doesn't. Is there a way in a script to know which version of python is being run so I can write: If (version == 2.7): do it this way elsif (version == 3.2):

Re: ... (ellipsis)

2018-06-01 Thread Mike McClain
On Thu, May 31, 2018 at 11:00:13PM -0400, Terry Reedy wrote: > On 5/31/2018 10:26 PM, Mike McClain wrote: > > I'm having understanding the use if the ellipsis. > >I keep reading that it is used in slices > > By numpy for numpy multidimensional arrays, which have thei

Re: version

2018-06-01 Thread Mike McClain
On Thu, May 31, 2018 at 07:44:35PM -0700, Mike McClain wrote: > Is there a way in a script to know which version of python is being > run so I can write: > If (version == 2.7): > do it this way > elsif (version == 3.2): > do it another way > Thanks fo

Re: version

2018-06-01 Thread Mike McClain
On Fri, Jun 01, 2018 at 08:02:27AM -0700, Mike McClain wrote: > On Thu, May 31, 2018 at 07:44:35PM -0700, Mike McClain wrote: > > > Is there a way in a script to know which version of python is being > > run so I can write: > > If (version == 2.7): > >

Re: Why list.reverse() modifies the list, but name.replace() does not modify the string?

2018-09-03 Thread Mike C
Yes, I forgot that strings are immutable. I can't change anything in the string. Silly me! Thank you very much, I appreciate it. I guess sometimes it just take an outsider to take you outside the box. And all is answered. :) From: Python-list on behalf of Mark

Re: Why list.reverse() modifies the list, but name.replace() does not

2018-09-05 Thread Mike C
Yes, I forgot that strings are immutable. I can't change anything in the string. Silly me! Thank you very much, I appreciate it. I guess sometimes it just take an outsider to take you outside the box. And all is answered. :) From: Python-list on behalf of Mark La

Re: Overwhelmed by the Simplicity of Python. Any Recommendation?

2018-11-04 Thread Mike C
Same here. Debugging in Python is annoying, I like to step through my code line by line, it's impossible to do it with object-oriented programming language. Also, there's no good REPL IDE. Spyder barely works with some basic features. PyCharm, the most popular, takes too long to start, and you

ANN: Python 201 - Intermediate Python book

2016-03-30 Thread Mike Driscoll
also written with Python 3 in mind. Let me know if you have any questions. Thanks, Mike Driscoll -- https://mail.python.org/mailman/listinfo/python-list

Re: ANN: Python 201 - Intermediate Python book

2016-03-30 Thread Mike Driscoll
as Amazon's or Google's APIs. There will probably be some kind of chapter about Selenium / Web Driver too. I have some other ideas too. I hope that answered your question. Mike -- https://mail.python.org/mailman/listinfo/python-list

Re: ANN: Python 201 - Intermediate Python book

2016-03-30 Thread Mike Driscoll
e), but I am a KickStarter fan (having purchased > more games than was probably wise ;) . > > -- > ~Ethan~ You'll also get early access to the book so you'll get to see the chapters as soon as I'm done with them (most of the time). Mike -- https://mail.python.org/mailman/listinfo/python-list

Strange urlopen error

2016-04-12 Thread Mike Driscoll
the errno is None. I expected it to be 4. Is there a better way to catch this error in Python 2? I am aware of PEP475, but we cannot upgrade to Python 3 right now. Thanks, Mike -- https://mail.python.org/mailman/listinfo/python-list

Re: Resources/pointers for writing maintable, testable Python

2016-05-19 Thread Mike Driscoll
<http://pytest.org/latest/> > > Cheers! > Andrew Farrell I was under the impression that this book is primarily aimed at Python/Django web testing. I saw "Testing Python: Applying Unit Testing, TDD, BDD and Acceptance Testing" is getting good reviews too though. Mike -- https://mail.python.org/mailman/listinfo/python-list

Re: Python 3.5.1

2016-05-19 Thread Mike Driscoll
IDLE. If there's not, then I'm guessing it didn't install correctly. I haven't had any problems installing Python 3.5 on my Windows PCs, although I have had issues getting it installed in certain locked down virtual environments. Try uninstalling and then reinstalling Python

Re: Resources/pointers for writing maintable, testable Python

2016-05-19 Thread Mike Driscoll
On Thursday, May 19, 2016 at 11:23:53 AM UTC-5, Terry Reedy wrote: > On 5/19/2016 11:33 AM, Mike Driscoll wrote: > > On Wednesday, May 18, 2016 at 4:48:28 PM UTC-5, Andrew Farrell wrote: > >> Hi Jacob, > >> > >> You are probably looking for the book Test-Drive

Re: Wanted Python programmer to join team

2016-05-20 Thread Mike Driscoll
possible terms, I end up wasting everyone's time. +1 I have had recruiters from within Company A bug me about their company, but when I asked about a salary range, they said that they wouldn't discuss that until a later stage but that I would be happy with it. How would they know? The

ANN: Creating GUI Applications with wxPython

2019-01-14 Thread Mike Driscoll
s included with the book. You can read more about it here if you are interested: https://www.blog.pythonlibrary.org/2019/01/14/creating-gui-applications-with-wxpython-kickstarter/ Feel free to ask me questions about it too. Thanks, Mike -- https://mail.python.org/mailman/listinfo/python-list

Logistic Regression Define X and Y for Prediction

2019-11-12 Thread Mike C
Hi All, I have the below code. X = df.iloc[:, [4, 403]].values​ y = df.iloc[:, 404].values Dummy Data looks like: host Mnemonic 12.234.13.6 start 22.22.44.67 something 23.44.44.14 begin When I define the X and Y values for prediction in the train and test data,

Re: Logistic Regression Define X and Y for Prediction

2019-11-14 Thread Mike C
Hi Jason, I will try it out... Nothing in the documentation tells a person. Thanks From: Python-list on behalf of Jason Friedman Sent: Wednesday, November 13, 2019 7:19 PM Cc: python-list@python.org Subject: Re: Logistic Regression Define X and Y for Predicti

Problems with Python install on Windows 10

2020-01-13 Thread Mike Weaver
file cannot be accessed by the system "C:\Users\Mike\AppData\Local\Microsoft\WindowsApps\python.exe" If I search in that directory, I find a to python.exe. I have added that directory to my Path. I can see Python 3.8.1 in the Control Panel. I've rebooted. Reinstalled. Tried just abo

Python 101 2nd Edition book

2020-02-18 Thread Mike Driscoll
-2nd-edition-kickstarter-is-live/ Feel free to ask any questions that you might have as well. Thanks, Mike -- https://mail.python.org/mailman/listinfo/python-list

RE: Python download for windows

2020-03-09 Thread Mike Dewhirst
HilaryPython isn't an ordinary program as understood by (most) Windows users.It needs a command-prompt in which to run interactively. In other words, after successful installation, open a command prompt (aka DOS prompt) and type "python". It should open, announce itself and display its character

Re: Python question

2020-03-12 Thread Mike Dewhirst
On 12/03/2020 1:47 pm, DL Neil via Python-list wrote: On 12/03/20 3:03 AM, Rhodri James wrote: On 11/03/2020 04:06, Michael Torrie wrote: On 3/10/20 6:49 PM, Souvik Dutta wrote: What about moving on to a social media app completely made in pythoj for python? No thanks. I don't want to be on

Re: How to uninstall Python3.7 in Windows using cmd ?

2020-03-28 Thread Mike Dewhirst
On 29/03/2020 5:06 am, Terry Reedy wrote: On 3/27/2020 8:07 AM, deepalee khare wrote: How to Uninstall Python3.7.3 using cmd ? i tried using cmd: Msiexec /uninstall C:\Python37\python.exe But it gives me below error: enter image description here Python is not currently installed with msi, hen

Re: How to uninstall Python3.7 in Windows using cmd ?

2020-03-29 Thread Mike Dewhirst
On 29/03/2020 10:24 pm, Terry Reedy wrote: On 3/29/2020 12:17 AM, Mike Dewhirst wrote: On 29/03/2020 5:06 am, Terry Reedy wrote: On 3/27/2020 8:07 AM, deepalee khare wrote: How to Uninstall Python3.7.3 using cmd ? i tried using cmd: Msiexec /uninstall C:\Python37\python.exe But it gives me

Re: Unable to install or operate PIP on Windows 10

2020-03-29 Thread Mike Dewhirst
python -m pip install D:\Users\mike/downloads/Pillow-6.0.0-cp37-cp37m-win_amd64.whl Don't worry about my slashes and backslashes. That part of the above line is copied from a requirements file assembled by batch file. Pip doesn't care about the angle of the slash. I think numpy

Re: How to uninstall Python3.7 in Windows using cmd ?

2020-03-29 Thread Mike Dewhirst
On 30/03/2020 2:55 pm, Michael Torrie wrote: On 3/29/20 6:41 PM, Mike Dewhirst wrote: I would first determine whether it is the 32 or 64 bit version which is installed. I would then visit www.python.org and download the exact same python executable installer. Don't know what msi is b

Re: Is there a difference between python

2020-04-05 Thread Mike Dewhirst
On 6/04/2020 8:35 am, Malcolm Greene wrote: Is there a difference between the following 2 ways to launch a console-less script under Windows? python

Re: Helping Windows first time users

2020-04-16 Thread Mike Dewhirst
t in this conversation. But it is interesting. I use Windows because I have no choice. All my production machines are non-gui Ubuntu. I started my programming on non-gui PCs which made it simple with Windows. However, on reading some of these emails from struggling Windows users it is e

Re: Pip not working on windows

2020-05-03 Thread Mike Dewhirst
: The system cannot find the file specified. But when I manually inspected the folder 📂 the files were there I even tried upgrading it by python -m pip install --upgrade pip which worked but I still can not use pip. Just thoughtI'd try it on my Windows PC ... (xxex3) D:\Users\mike\envs\

Re: Installation Error

2020-05-21 Thread Mike Dewhirst
standard place. My favourite is C:\Python36, C:\Python37, C:\Python38 etc. All the best Mike Please help, Charlie Seagraves -- https://mail.python.org/mailman/listinfo/python-list

Re: Is there some reason that recent Windows 3.6 releases don't included executable nor msi installers?

2020-05-28 Thread Mike Dewhirst
ou let it, Windows just absolutely knows what you really meant despite what you tell it. It is a necessary evil when your clients use it. Cheers Mike -- https://mail.python.org/mailman/listinfo/python-list

Re: Is there some reason that recent Windows 3.6 releases don't included executable nor msi installers?

2020-05-28 Thread Mike Dewhirst
On 29/05/2020 12:26 pm, Chris Angelico wrote: On Fri, May 29, 2020 at 11:57 AM Mike Dewhirst wrote: I am an example I installed all the Pythons on my Windows 10 dev machine (locked into Windows by having clients) but I'm also locked into Python 3.6.9 on my Ubuntu 18.04 production mac

Re: Is there some reason that recent Windows 3.6 releases don't included executable nor msi installers?

2020-05-28 Thread Mike Dewhirst
On 29/05/2020 2:59 pm, Dieter Maurer wrote: Mike Dewhirst wrote at 2020-5-29 11:55 +1000: On 29/05/2020 10:51 am, Terry Reedy wrote: ... Source only releases only block Windows/Mac users who choose not to upgrade to a released installer and who cannot or choose not to compile. I am an example

RE: Questioning the effects of multiple assignment

2020-07-07 Thread Mike Dewhirst
Original message From: dn via Python-list Date: 7/7/20 16:04 (GMT+10:00) To: 'Python' Subject: Questioning the effects of multiple assignment TLDR; if you are a Python 'Master' then feel free to skim the first part (which you should know hands-down), until the excerpts fro

Re: App for Moto e6 using Python?

2020-07-13 Thread Mike Dewhirst
en in python but I do not know how to convert it to an app. > I wonder how much of the python code will still apply. Have you looked at Beeware? I believe they have recently released for Android. Mike > When I was into this > in the past, I installed Kivy and was able to finally gene

Re: Fake news Detect

2020-07-17 Thread Mike Dewhirst
at like Wikipedia. Except editors for page 2 would need a threshold score for being correct. Everyone can criticise but you lose points for being on the wrong side of history. That'll be 2 cents Mike > > -- > Grant > signature.asc Description: OpenPGP digital signature -- https://mail.python.org/mailman/listinfo/python-list

RE: Dowloading package dependencies from locked down machine

2020-07-26 Thread Mike Dewhirst
I think your best bet is to make a formal business case to your IT people and explain what's in it for them. If they hold all the cards you defeat them at your peril.Mike -- https://mail.python.org/mailman/listinfo/python-list

Re: Dowloading package dependencies from locked down machine

2020-07-27 Thread Mike Dewhirst
On 28/07/2020 9:43 am, Andrew McLean wrote: > On 26/07/2020 14:07, Mike Dewhirst wrote: >> I think your best bet is to make a formal business case to your IT >> people and explain what's in it for them. If they hold all the cards >> you defeat them at your peril. &g

Re: Any timeline for PIL for Python 3.4

2020-08-10 Thread Mike Dewhirst
On 11/08/2020 2:35 pm, Martin wrote: > Hi, > > I am running Python 3.4.4, and would like to > use the Python Imaging Library (PIL).  This > is currently not available for Python > Version 3.  Does anybody know when it will > become available? Try Pillow https://pillow.readthedocs.io/en/stable/ins

Re: Use of a variable in parent loop

2020-09-27 Thread Mike Dewhirst
nion is genuine OO. And the community. Perl can be extremely terse, much more so than Python but that is where the "write-only" criticism comes from. Perl's terseness can only work for throwaway code.[1] Python is - or can be - quite terse but if written Pythonically is almost self-d

Re: Changing strings in files

2020-11-10 Thread Mike Dewhirst
On 10/11/2020 5:24 pm, Manfred Lotz wrote: I have a situation where in a directory tree I want to change a certain string in all files where that string occurs. My idea was to do - os.scandir and for each file - check if a file is a text file - if it is not a text file skip that file

Re: Sniffing Text Files

2005-09-22 Thread Mike Meyer
David Pratt <[EMAIL PROTECTED]> writes: > Hi. I have files that I will be importing in at least four different > plain text formats, one of them being tab delimited format, a couple > being token based uses pipes (but not delimited with pipes), another > being xml. There will likely be others as w

Re: C#3.0 and lambdas

2005-09-23 Thread Mike Meyer
"A.M. Kuchling" <[EMAIL PROTECTED]> writes: > Agreed; python-dev has gotten pretty boring with all the endless discussions > over some minor point. Of course, it's much easier and lower-effort to > propose a syntax or nitpick a small point issue than to tackle a big > complicated issue like static

Re: Sniffing Text Files

2005-09-23 Thread Mike Meyer
David Pratt <[EMAIL PROTECTED]> writes: > Thanks Mike for your reply. I am not aware of libmagic and will look > to see what it provides. and ... Skip Montanaro <[EMAIL PROTECTED]> writes: > You can also run the file(1) command and see what it says. I seem > to recall

Re: Parsing an HTML a tag

2005-09-24 Thread Mike Meyer
"beza1e1" <[EMAIL PROTECTED]> writes: > I do not really know, what you want to do. Getting he urls from the a > tags of a html file? I think the easiest method would be a regular > expression. I think this ranks as #2 on the list of "difficult one-day hacks". Yeah, it's simple to write an RE that

Re: Parsing an HTML a tag

2005-09-24 Thread Mike Meyer
"beza1e1" <[EMAIL PROTECTED]> writes: > I think for a quick hack, this is as good as a parser. A simple parser > would miss some cases as well. RE are nearly not extendable though, so > your critic is valid. Pretty much any first attempt is going to miss some cases. There libraries available that

Re: ncurses programming

2005-09-26 Thread Mike Meyer
Torsten Bronger <[EMAIL PROTECTED]> writes: > Hallöchen! > > "ncf" <[EMAIL PROTECTED]> writes: > >> [...] >> >> Py Docs: http://docs.python.org/lib/module-curses.html > > This document suggests that Python+ncurses won't work on windows. > What's the reason for this? Could it be that ncurses doe

Re: attribute error

2005-09-26 Thread Mike Meyer
"M.N.A.Smadi" <[EMAIL PROTECTED]> writes: > HI; > > I am having the following error. I am using someone else's code and > all they are doing is pass an argv to a function then > > def execute_action(manager, argv): > method_name = argv.pop(0).lower() > > > and am getting this strange error.

Re: Overhead of individual python apps

2005-09-27 Thread Mike Meyer
"Qopit" <[EMAIL PROTECTED]> writes: > When running in Windows, launching each application generates a > process, and each of those processes ends up taking up > 4MB of system > memory. This memory usage is as reported by the Windows Task manager > for the python.exe image name. The first step is

Re: Human readable number formatting

2005-09-27 Thread Mike Meyer
Alex Willmer <[EMAIL PROTECTED]> writes: > When reporting file sizes to the user, it's nice to print '16.1 MB', > rather than '16123270 B'. This is the behaviour the command 'df -h' > implements. There's no python function that I could find to perform this > formatting , so I've taken a stab at it

Re: Will python never intend to support private, protected and public?

2005-09-28 Thread Mike Meyer
Paul Rubin writes: > Chris Gonnerman <[EMAIL PROTECTED]> writes: >> -- Make it easy to do right. >> >> What you are promoting is the first philosophy: Tie the programmer's >> hands so he can't do wrong. Python for the most part follows the >> second philosophy, making

Re: Will python never intend to support private, protected and public?

2005-09-28 Thread Mike Meyer
Paul Rubin writes: > Gregor Horvath <[EMAIL PROTECTED]> writes: >> > to be able to share private variables with other classes under certain >> > circumstances, it's better to use something like C++'s "friend" >> > declaration, where you can export the variables to a spec

Re: Will python never intend to support private, protected and public?

2005-09-28 Thread Mike Meyer
Paul Rubin <http://[EMAIL PROTECTED]> writes: > Mike Meyer <[EMAIL PROTECTED]> writes: >> Note that the quoted article only applies to *writing* attributes. It >> doesn't say anything about needing accessors to *read* a >> variable. This encourages me th

Re: Will python never intend to support private, protected and public?

2005-09-28 Thread Mike Meyer
Paul Rubin <http://[EMAIL PROTECTED]> writes: > Mike Meyer <[EMAIL PROTECTED]> writes: >> > Generally that sounds reasonable. Obviously there are other examples >> > when (e.g. for security) you have to make sure that variables can't be >> > re

Re: A quick c.l.p netiquette question

2005-09-29 Thread Mike Meyer
Steve Holden <[EMAIL PROTECTED]> writes: >> I think you missed the other Peter's second post, where he points to >> his >> program: http://www.pick.ucam.org/~ptc24/yvfc.html >> I didn't read every one of his 158 lines, but his code is pure >> poetry, or >> possibly triple-distilled evil, depending

Re: attribute error

2005-09-29 Thread Mike Meyer
and', argv[2]) This should be execute_action('command', argv[2:]), with the ':' added. def execute_action(manager, argv): > method_name = argv.pop(0).lower() > > > > but i always thought that something like this will be standard stuff. >

Re: attribute error

2005-09-29 Thread Mike Meyer
telling you that string doesn't *have* a pop method. The interpreter is right. Strings are immutable, so "pop" doesn't make any sense for them. > Mike Meyer wrote: > > >In <[EMAIL PROTECTED]>, M.N.A.Smadi <[EMAIL PROTECTED]> typed: > >

Re: Will python never intend to support private, protected and public?

2005-09-29 Thread Mike Meyer
Paul Rubin writes: > Bill Mill <[EMAIL PROTECTED]> writes: >> Python is for consenting adults. > > Python might be for consenting adults, but multi-person software > projects are supposed to be done in the workplace, not the bedroom. > So there are still some software con

Re: Will python never intend to support private, protected and public?

2005-09-30 Thread Mike Meyer
Paul Rubin writes: > OTOH, "private" lets you say 100% for certain that another class > didn't clobber __xyz, and that any bug that clobbered it MUST reside > in the class that declared it. That makes auditing for __xyz-related > errors a lot simpler since you only have

Re: Hello gnome-terminal

2005-09-30 Thread Mike Meyer
egbert <[EMAIL PROTECTED]> writes: > When I start the following script in a gnome-terminal: > > #!/usr/bin/env python > import os > print "hello gnome-terminal" > print os.environ["PYTHONPATH"] > > I see the expected results in the same gnome-terminal window. > > However start

Re: Google Not Universal Panacea

2005-09-30 Thread Mike Meyer
Steve Holden <[EMAIL PROTECTED]> writes: > However, > > >> Are people really too lazy to do elementary research on Google? > > goes a bit too far in imputing motives to the enquirer and overlooking > the fact that there are some very good reasons for *not* using Google. Ok, *what* are the reasons

Re: where to post python code?

2005-09-30 Thread Mike Meyer
Alessandro Bottoni <[EMAIL PROTECTED]> writes: > [EMAIL PROTECTED] wrote: > >> the question it - where should i post the code to? >> It's not big enough to justify a source forge project, nor is it small >> enough to be considered a receipt fit for ASPN's Python Cookbook. > > Maybe "The Vaults of

Re: A Moronicity of Guido van Rossum

2005-09-30 Thread Mike Meyer
Steve Holden <[EMAIL PROTECTED]> writes: > [off-list] > > Peter Hansen wrote: >> Gerrit Holl wrote: >> >>>True. However, most mail to this mailinglist has less than 0.001 spam >>>probability. As you can see, this one had 0.048 - a vast score, almost >>>enough to put it in my unsure box. It seems t

Re: Will python never intend to support private, protected and public?

2005-09-30 Thread Mike Meyer
Paul Rubin <http://[EMAIL PROTECTED]> writes: > Mike Meyer <[EMAIL PROTECTED]> writes: >> So, fool._bar is now clobbered. Nuts, the _bar attribute is broken for >> *every* instance of Fools. According to you, the error must be in >> Fools. Care to point it

Re: Will python never intend to support private, protected and public?

2005-10-01 Thread Mike Meyer
Paul Rubin <http://[EMAIL PROTECTED]> writes: > Mike Meyer <[EMAIL PROTECTED]> writes: >> Unless your compiler detects and flags passing private variables to >> external functions all you've got is a convention that you don't pass >> private variables

Re: OT: Phases of the moon

2005-10-01 Thread Mike Meyer
Bart Lateur <[EMAIL PROTECTED]> writes: > Steven D'Aprano wrote: > >>A skeptical policeman who says he doesn't actually believe the moon >>affects behaviour nevertheless reports that "last weekend" things were >>really crazy, and it was a full moon. Somebody writes in to correct him: >>no, the ful

Re: Will python never intend to support private, protected and public?

2005-10-02 Thread Mike Meyer
Paul Rubin <http://[EMAIL PROTECTED]> writes: > Mike Meyer <[EMAIL PROTECTED]> writes: >> > Yes, the point is that it's something that you can check for by >> > examining the class in question without having to examine any other >> > classes. >>

Re: Will python never intend to support private, protected and public?

2005-10-02 Thread Mike Meyer
Paul Rubin <http://[EMAIL PROTECTED]> writes: > Well, it's a discussion of why a certain feature might be useful, not > that it's required. Mike Meyer points out some reasons it might be > hard to do smoothly without changing Python semantics in a deep way &g

Re: Program help

2005-10-02 Thread Mike Meyer
"FX" <[EMAIL PROTECTED]> writes: > can anybody write a code for a program that reads from a > /location/file & according to file contents, it execute script. e.g. if > file contains "mp" it runs media player. > I hope the code is small .. plz help me out! open http://www.mired.org/downloads/ > wi

Re: Python for search engine development

2005-10-02 Thread Mike Meyer
"corebump" <[EMAIL PROTECTED]> writes: > hi everybody, > i planinng develop a search engine and i think using the python. Python > performance is enough this project? If you're going to do the heavy lifting in Python, maybe. It depends on what you're going to search, and the performance requirem

<    1   2   3   4   5   6   7   8   9   10   >