Re: Problem in uninstalling python

2021-04-09 Thread Paul Bryan
Please describe your problem in detail. Paul On Fri, 2021-04-09 at 11:03 +0530, arishmallick...@gmail.com wrote: >    I am encountering problem in uninstalling python. Please help me > in this. > > > >    Sent from [1]Mail for Windows 10 > > > > Reference

Re: question about basics of creating a PROXY to MONITOR network activity

2021-04-10 Thread Paul Bryan
There is absolutely nothing wrong with building your own reverse proxy in front of your own service, as long as you control both. This constitutes a tiered network/application architecture, and it's a common practice. There's no man in the middle; there's no imposter; its all "you".  If your proxy

Re: question about basics of creating a PROXY to MONITOR network activity

2021-04-10 Thread Paul Bryan
outsourcing a part of your service network infrastructure to Cloudflare. Paul  On Sat, 2021-04-10 at 13:35 -0500, Christian Seberino wrote: > > > > a) your reverse proxy must be colocated with the service it fronts > > on the same machine; > > b) your network infrastructur

Re: port to PDOS (especially mainframe)

2021-04-14 Thread Paul Edwards
nt" _bootstrap.py but I don't know what it needs to satisfy that. It's a bit strange that it can only be posix or nt when VMS is supported in 3.3 too. BFN. Paul. Index: Modules/main.c === RCS file: c:\cvsroot/pyt

Re: Website

2021-04-14 Thread Paul Bryan
Yes. On Wed, 2021-04-14 at 15:41 +0200, Rainyis wrote: > Hello, > I am Sergio Llorente, and I want to create a web about python. I > will publish apps, scripts.. made by python. I will like to put > python in > the domain. The domain will be like all-about-python.com but in > Spanish( > todosobrep

Re: port to PDOS (especially mainframe)

2021-04-14 Thread Paul Edwards
On Thursday, April 15, 2021 at 4:32:51 AM UTC+10, Alan Gauld wrote: > On 14/04/2021 11:35, Paul Edwards wrote: > > I have succeeded in producing a Python 3.3 executable > ... > > However, the executable doesn't work yet. > Late to this party but how big is the assembl

Re: port to PDOS (especially mainframe)

2021-04-16 Thread Paul Edwards
On Wednesday, April 14, 2021 at 8:35:59 PM UTC+10, Paul Edwards wrote: > ImportError: importlib requires posix or nt > but I don't know what it needs to satisfy that. > > It's a bit strange that it can only be posix or nt when VMS is supported in > 3.3 too. The r

Re: port to PDOS (especially mainframe)

2021-04-16 Thread Paul Edwards
On Saturday, April 17, 2021 at 5:13:31 AM UTC+10, Paul Rubin wrote: > Paul Edwards writes: > > I have succeeded in producing a Python 3.3 executable despite being > > built with a C library that only supports C90. > It seems to me that you might have an easier time porting M

Re: port to PDOS (especially mainframe)

2021-04-16 Thread Paul Edwards
et security fixes anymore. Ok, thanks. I'll consider doing that as well. BFN. Paul. -- https://mail.python.org/mailman/listinfo/python-list

Re: port to PDOS (especially mainframe)

2021-04-16 Thread Paul Edwards
port all those features. It only supports C90-compliant applications. Meanwhile, 35,000 lines (or more) of lovingly handcrafted Python code are going to waste. :-) BFN. Paul. -- https://mail.python.org/mailman/listinfo/python-list

Re: port to PDOS (especially mainframe)

2021-04-17 Thread Paul Edwards
Note that Java (and Python for that matter) are available for later versions of z/OS, but as far as I am aware, they are not available for the free MVS that hobbyists use, ie MVS 3.8J, and it's definitely not available for the environment I'm actually interested in, which is PD

Re: port to PDOS (especially mainframe)

2021-04-17 Thread Paul Edwards
important flat file which PDOS-generic will access to provide a FAT facility to any applications running under PDOS-generic. Those applications will need to be specific to PDOS-generic and they may well be a.out/ELF/COFF - I haven't reached that point yet. I'm still preparing the assembler, I can't do what I want without that. :-) BFN. Paul. -- https://mail.python.org/mailman/listinfo/python-list

Re: port to PDOS (especially mainframe)

2021-04-17 Thread Paul Edwards
E and I can see that on 2014-08-13 he cited 3.3 as an explicit requirement. BFN. Paul. -- https://mail.python.org/mailman/listinfo/python-list

Re: Current thinking on required options

2021-04-19 Thread Paul Bryan
Calling them options—when they're required—seems like a problem. 🙂 On Mon, 2021-04-19 at 09:04 -0700, Dan Stromberg wrote: > On Mon, Apr 19, 2021 at 2:55 AM Loris Bennett > > wrote: > > > However, the options -o, -u, and -g are required, not optional. > > > > The documentation > > > >   https:

Re: Not found in the documentation

2021-04-26 Thread Paul Bryan
after a >decimal point, are not shown. > * A sign is shown only when the number is negative. Paul On Mon, 2021-04-26 at 16:24 -0700, elas tica wrote: > > Python documentation doesn't seem to mention anywhere what is the str > value of an int: is it right?  the same for f

Re: Not found in the documentation

2021-04-26 Thread Paul Bryan
I agree. I would be useful for it to be documented elsewhere, especially in docstrings. I wonder if this is/was a conscious decision to keep Python runtime smaller? Paul On Mon, 2021-04-26 at 18:24 -0700, elas tica wrote: > Le mardi 27 avril 2021 à 01:44:04 UTC+2, Paul Bryan a écrit : >

Proposal: Disconnect comp.lang.python from python-list

2021-05-05 Thread Paul Bryan
Given the ease of spoofing sender addresses, and its propensity for use in anonymous spamming and trolling (thanks python-list-owner for staying on top of that!), I propose to disconnect comp.lang.python from the python-list mailing list. Both would then operate independently. Paul -- https

Re: Proposal: Disconnect comp.lang.python from python-list

2021-05-05 Thread Paul Bryan
What's involved in moderating c.l.p? Would there be volunteers willing to do so? On Thu, 2021-05-06 at 00:43 +, Jon Ribbens via Python-list wrote: > On 2021-05-06, Chris Angelico wrote: > > On Thu, May 6, 2021 at 10:32 AM Paul Bryan wrote: > > > > > > G

Re: Proposal: Disconnect comp.lang.python from python-list

2021-05-06 Thread Paul Bryan
I will also add that it can get confusing when someone replies to a newsgroup posting that was originally suppressed to the mailing list. This has happened as recently as today. On Thu, 2021-05-06 at 14:36 +, Grant Edwards wrote: > On 2021-05-06, Chris Angelico wrote: > > On Thu, May 6, 2021

Re: Proposal: Disconnect comp.lang.python from python-list

2021-05-06 Thread Paul Bryan
I do not believe my proposal has reached—or will reach—consensus. It seems there are some who still value the linkage between the two, and the S/N ratio is indeed low enough it doesn't warrant changing from the status quo. Thanks everyone for the consideration and discussion.  Paul On Thu,

Re: Replacement for Mailman

2021-06-08 Thread Paul Bryan
How about Mailman 3.x on Python 3.x? On Tue, 2021-06-08 at 15:08 -0400, D'Arcy Cain wrote: > Given that mailman still runs under 2.7 and that's being deprecated, > does > anyone have a suggestion for a replacement? > -- https://mail.python.org/mailman/listinfo/python-list

Re: Where to keep local Python modules?

2021-07-23 Thread Paul Bryan
On my Arch Linux box, slightly different path, but still in .local/bin: pbryan@dynamo:~$ python3 Python 3.9.6 (default, Jun 30 2021, 10:22:16) [GCC 11.1.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path ['', '/usr/lib/python39.zip', '/u

Re: a simple question

2021-07-26 Thread Paul Bryan
It would help to know the error message you get every time. On Mon, 2021-07-26 at 22:19 +, Glenn Wilson via Python-list wrote: > I recently downloaded the latest version of python, 3.9.6. Everything > works except, the turtle module. I get an error message every time , > I use basic commands l

Re: port to PDOS (especially mainframe)

2021-08-20 Thread Paul Edwards
On Saturday, April 17, 2021 at 11:12:38 PM UTC+10, Paul Edwards wrote: > https://github.com/s390guy/SATK/commits/master/README > > and I can see that on 2014-08-13 he cited 3.3 as an > explicit requirement. Note that the work I was doing to make a C90-compliant version of Pytho

Re: src layout for projects seems not so popular

2021-08-31 Thread Paul Bryan
An interesting thread in PyPA (with links to other threads) discussing src layout: https://github.com/pypa/packaging.python.org/issues/320 On Tue, 2021-08-31 at 10:53 +0400, Abdur-Rahmaan Janhangeer wrote: > Greetings list, > > Just an observation. Out of Github's trending repos for > Python for

Re: Request for argmax(list) and argmin(list)

2021-08-31 Thread Paul Bryan
Why not: >>> l = [1, 3, 5, 9, 2, 7] >>> l.index(max(l)) 3 >>> l.index(min(l)) 0 On Tue, 2021-08-31 at 21:25 -0700, ABCCDE921 wrote: > I dont want to import numpy > > argmax(list) >    returns index of (left most) max element > >  argmin(list) >    returns index of (left most) min element --

Re: Python script seems to stop running when handling very large dataset

2021-10-29 Thread Paul Bryan
With so little information provided, not much light will be shed. When it stops running, are there any errors? How is the dataset being processed? How large is the dataset? How large a dataset can be successfully processed? What libraries are being used? What version of Python are you using? On wha

Re: Advantages of Default Factory in Dataclasses

2021-11-16 Thread Paul Bryan
mples: dicts, lists, other dataclasses. Paul -- https://mail.python.org/mailman/listinfo/python-list

Re: Advantages of Default Factory in Dataclasses

2021-11-21 Thread Paul Bryan
On Sun, 2021-11-21 at 21:51 +0400, Abdur-Rahmaan Janhangeer wrote: > > On Tue, Nov 16, 2021 at 7:17 PM Paul Bryan wrote: > > On Tue, 2021-11-16 at 17:04 +0400, Abdur-Rahmaan Janhangeer wrote: > > > > > A simple question: why do we need field(default_fac

Re: Urllib.request vs. Requests.get

2021-12-07 Thread Paul Bryan
pyter-server/";, method="GET", headers={"User-Agent": "Workaround/1.0"}, ) res = urllib.request.urlopen(req) Paul On Tue, 2021-12-07 at 12:35 +0100, Julius Hamilton wrote: > Hey, > > I am currently working on a simple program which scrapes t

Re: Isn't TypeError built in?

2021-12-12 Thread Paul Bryan
Yes, TypeError is built in. The only thing I can think of is that something has deleted `TypeError` from `__builtins__`? It would be interesting to see what's in `__builtins__` when `__del__` is called. On Mon, 2021-12-13 at 12:22 +1100, Mike Dewhirst via Python-list wrote: > Obviously something i

Re: Custom designed alarm clock

2021-12-18 Thread Paul Bryan
Suggested reading: https://pypi.org/project/python-for-android/ https://play.google.com/store/apps/details?id=org.qpython.qpy3 https://www.androidauthority.com/an-introduction-to-python-on-android-759685/ https://data-flair.training/blogs/android-app-using-python/ On Sat, 2021-12-18 at 18:36 -050

Re: A Newspaper for Python Mailing Lists

2022-01-08 Thread Paul Bryan
+1 to RSS. On Sun, 2022-01-09 at 10:28 +0400, Abdur-Rahmaan Janhangeer wrote: > Well yes XD though LWN covers Py topics well when it wants > > > 1. Yes sure, did not expect RSS interest > 2. Excuse my blunder, will do! > > On Sun, 9 Jan 2022, 01:15 Peter J. Holzer, wrote: > > > On 2021-12-26

Re: A Newspaper for Python Mailing Lists

2022-01-11 Thread Paul Bryan
Subscribed. 🙂️ On Wed, 2022-01-12 at 00:35 +0400, Abdur-Rahmaan Janhangeer wrote: > Added RSS: > > 2.0 unless later versions have some advantages: > > https://pyherald.com/rss.xml > > Kind Regards, > > Abdur-Rahmaan Janhangeer > about | blog  > github > Mauritius > -- https://mail.python.or

Re: for convenience

2022-03-21 Thread Paul Bryan
Assuming `bpy` is a module, you're creating a new attribute in your module, `context`, that contains a reference to the same object that is referenced in the `context` attribute in the `bpy` module. On Mon, 2022-03-21 at 22:12 +0100, Paul St George wrote: > > When I am writing code,

Re: for convenience

2022-03-21 Thread Paul Bryan
No, nor did I suggest that you did. `context` is presumably an attribute in the `bpy` module, for which you are creating a `context` attribute in your module. On Mon, 2022-03-21 at 22:31 +0100, Paul St George wrote: > Hi, > I do not (knowingly) have a module called ‘context'. > &

Re: Why does datetime.timedelta only have the attributes 'days' and 'seconds'?

2022-04-14 Thread Paul Bryan
I think because minutes and hours can easily be composed by multiplying seconds. days is separate because you cannot compose days from seconds; leap seconds are applied to days at various times, due to irregularities in the Earth's rotation. On Thu, 2022-04-14 at 15:38 +0200, Loris Bennett wrote:

Re: What's the best way to minimize the need of run time checks?

2016-08-09 Thread Paul Rubin
Juan Pablo Romero Méndez writes: > In online forums sometimes people complain that they end up having to > test constantly for None That's something of a style issue. You can code in a way that avoids a lot of those tests (not all of them). > Do you guys have any resources you like that address

Re: Vectorized functions

2016-08-10 Thread Paul Rubin
Steven D'Aprano writes: > Is there any other functionality which would make this more useful? Cute, but map or listcomps work ok. Here's the Haskell equivalent to your example, fwiw, using the <$> operator from the Control.Applicative module: (+2) <$> [1,2,3] => [3,4,5] If you haven't trie

Re: Asynchronous programming

2016-08-10 Thread Paul Rubin
Steven D'Aprano writes: > Is there a good beginner's tutorial introducing the basics of asynchronous > programming? Starting with, why and where would you use it? You might look at some node.js tutorials since there are about a gazillion of them and some of them must be good. Also twistedmatrix.

Re: Asynchronous programming

2016-08-10 Thread Paul Rudin
Steven D'Aprano writes: > > Is there a good beginner's tutorial introducing the basics of asynchronous > programming? Starting with, why and where would you use it? You could do worse than watch Dave Beazley's pycon talk: https://www.youtube.com/watch?v=lYe8W04ERnY -- https://mail.python.org/ma

Re: Generate reports in Python

2016-08-10 Thread Paul Rubin
"Ernest Bonat, Ph.D." writes: > I'm looking for best modules/practices to generate reports (HTML, PDF, etc) > in Python. Good ideas are very appreciated. See: http://www.reportlab.com/ for a well regarded package -- https://mail.python.org/mailman/listinfo/python-list

Re: Asynchronous programming

2016-08-11 Thread Paul Rubin
Christian Gollwitzer writes: > I'm convinced that it is possible to integrate Tcl's event loop with > asyncio's loop without regular update polling. This might require a > patch to Tkinter at the C level. For example, an easy way is to put > Tcl/Tk in it's own thread. ... I did something like tha

Re: Asynchronous programming

2016-08-11 Thread Paul Rudin
Chris Angelico writes: > On Thu, Aug 11, 2016 at 7:45 PM, Steven D'Aprano > wrote: >> I don't know whether you would call that a callback. I suppose it could be, >> in >> the sense that you might say: >> >> button.set_mouseup_function(mouseUp) >> >> but I'm used to thinking of it as a prope

Re: Asynchronous programming

2016-08-11 Thread Paul Rudin
Steven D'Aprano writes: > > But what's the point in doing it asynchronously if I have to just wait for > it to complete? > > begin downloading in an async thread > twiddle thumbs, doing nothing > process download If you have nothing else to do, then there's no point. But suppose you're im

Re: Asynchronous programming

2016-08-11 Thread Paul Rubin
Steven D'Aprano writes: > But what's the point in doing it asynchronously if I have to just wait for > it to complete? > begin downloading in an async thread > twiddle thumbs, doing nothing > process download Suppose the remote server is overloaded so it sends files much slower than your in

Re: Asynchronous programming

2016-08-11 Thread Paul Rubin
Steven D'Aprano writes: > How do I write work() so that it cooperatively multi-tasks with other ... > threads? processes? what the hell do we call these things? What does this > example become in the asynchronous world? If it's heavily computational then you have to yield to the scheduler frequen

Re: Call for Assistance

2016-08-11 Thread Paul Rubin
Charles Ross writes: > Well, I’ve been convinced. The license for the book is now Creative > Commons Attribution-ShareAlike. That means you can post it on wikibooks.org and let people edit it directly, if you want. Wikibooks is nowhere near as crazy as wikipedia. -- https://mail.python.org/mail

Re: Asynchronous programming

2016-08-11 Thread Paul Rudin
Steven D'Aprano writes: > Thanks to everyone who has answered, I think I'm slowly starting to get it > now. Let's see if we can come up with a toy example that doesn't involve > low-level socket programming :-) > > Let me simulate a slow function call: > > > import random, time > > def work(id):

Re: Asynchronous programming

2016-08-12 Thread Paul Rubin
Steven D'Aprano writes: >> await asyncio.sleep(0.2) # pretend to do some real work > That is *awesome*. Thank you for the example! Keep in mind that the above basically takes the task off the list of runnables for 0.2 seconds, so it sits doing nothing and doesn't interfere with other tas

Re: Asynchronous programming

2016-08-13 Thread Paul Rubin
Marko Rauhamaa writes: > Also, one must be careful with file access, which is necessarily > blocking on linux (unless Python takes Linux's AIO API into use, which > would be groundbreaking). AIO is a possibility for i/o on an already-open file and I think there may be other ways to do it too. Bu

Re: Anyone here running Python on a PowerPC?

2016-08-13 Thread Paul Rubin
Steven D'Aprano writes: > Is there anyone here running Python on a PowerPC willing to help me > diagnose and fix this issue? http://bugs.python.org/issue27761 https://duckduckgo.com/?q=powerpc+emulator gets a few hits, one on sourceforge and one in QEMU. I don't know if those would exhibit the

Re: What's the best way to minimize the need of run time checks?

2016-08-13 Thread Paul Rubin
Steven D'Aprano writes: > If the Python community rallies around this "record" functionality and > takes to it like they took too namedtuple I like namedtuple and I think that it's a feature that they're modified by making a new copy. I know that has overhead but it's palpably bug-avoidant. I'v

Re: What's the best way to minimize the need of run time checks?

2016-08-14 Thread Paul Rubin
MRAB writes: >> I don't know many untyped languages apart from machine code or maybe >> assembly. Perhaps Forth? (Maybe not -- some Forths include a separate >> floating point stack as well as the usual stack.) Forth is essentially untyped. There's no distinction between integers, characters, a

Re: I am new to python. I have a few questions coming from an armature!

2016-08-15 Thread Paul Rubin
Sickfit92 writes: > 1. How long did it take you guys to master the language or, let me put > it this way to completely get the hang and start writing code? Just a day or two, but I was already experienced with several similar languages. It would take longer for a beginning programmer. > 2. What

Re: I am new to python. I have a few questions coming from an armature!

2016-08-15 Thread Paul Rudin
sohcahto...@gmail.com writes: > On Monday, August 15, 2016 at 8:07:32 AM UTC-7, alister wrote: >> On Mon, 15 Aug 2016 07:00:47 -0700, Sickfit92 wrote: >> >> > 1. How long did it take you guys to master the language or, let me put >> > it this way to completely get the hang and start writing code?

Re: I am new to python. I have a few questions coming from an armature!

2016-08-16 Thread Paul Rudin
Lawrence D’Oliveiro writes: > On Tuesday, August 16, 2016 at 6:26:01 PM UTC+12, Paul Rudin wrote: >> sohcahtoa82 writes: >>> squared_plus_one_list = map(lambda x: x**2 + 1, some_list) >> >> I realise that this is about understanding lambda, but it's worth n

Re: Python 3: Launch multiple commands(subprocesses) in parallel (but upto 4 any time at same time) AND store each of their outputs into a variable

2016-08-23 Thread Paul Rubin
Dale Marvin writes: > The best way is a matter of opinion, I have had success using Celery > with Redis. I generally use GNU Parallel for stuff like that. Celery looks interesting though much fancier. -- https://mail.python.org/mailman/listinfo/python-list

Re: Multimeter USB output

2016-08-29 Thread Paul Rubin
Larry Hudson writes: >> with BDS-C under CP/M. Somebody remenbering this no-fp compiler from >> the dark age before PC und Linux? > I remember it well. It's what I used to initially learn C. Source code is online here: http://www.bdsoft.com/resources/bdsc.html I've looked at it a little. I do

Re: Multimeter USB output

2016-08-30 Thread Paul Rubin
Larry Hudson writes: > Actually "Brain Dead Software" it was not! Brain Damage Software, apparently: https://en.wikipedia.org/wiki/BDS_C -- https://mail.python.org/mailman/listinfo/python-list

Re: The Joys Of Data-Driven Programming

2016-08-31 Thread Paul Moore
actions (maybe with prerequisite/successor type interdependencies), and less on building file dependency graphs? Paul -- https://mail.python.org/mailman/listinfo/python-list

Re: The Joys Of Data-Driven Programming

2016-08-31 Thread Paul Moore
for this except for the annoying "must use tabs" rule, and the need to rely on shell (= non-portable, generally unavailable on Windows) constructs for any non-trivial logic. In the days when make was invented, not compiling a source file whose object file was up to date was a worthwhile tim

Re: [python-committers] [RELEASE] Python 3.6.0b1 is now available

2016-09-14 Thread Paul Moore
of four planned beta releases of Python 3.6, the next major >> release of Python, and marks the end of the feature development phase >> for 3.6. > > > There is no mention on https://www.python.org/news/. The last release mentioned there is 3.4.0rc1... Paul -- https://mail.python.org/mailman/listinfo/python-list

Re: Why don't we call the for loop what it really is, a foreach loop?

2016-09-14 Thread Paul Rubin
Travis Griggs writes: > for each in ['cake'] + ['eat', 'it'] * 2: > print(each) https://pbs.twimg.com/media/Cr-edT2VUAArpVL.jpg -- https://mail.python.org/mailman/listinfo/python-list

Re: Why don't we call the for loop what it really is, a foreach loop?

2016-09-14 Thread Paul Rubin
Christian Gollwitzer writes: > http://www.azlyrics.com/lyrics/queen/bohemianrhapsody.html Alt version, https://www.youtube.com/watch?v=hpvlTVgeivU -- https://mail.python.org/mailman/listinfo/python-list

Re: how to automate java application in window using python

2016-09-18 Thread Paul Rubin
Lawrence D’Oliveiro writes: >> The term "automation" is frequently used in the Windows world to mean >> programming something that you would otherwise do manually through a GUI... > Which is not something that GUIs are designed for. Therefore it is at > best an unreliable exercise, at worst futile

Re: how to automate java application in window using python

2016-09-18 Thread Paul Rubin
Lawrence D’Oliveiro writes: >> lot of ways: OLE and COM objects back in the day, .NET currently, > None of the different ways of which are either a) compatible or b) > widely supported. Particularly not in Java, as the OP was asking. I'm quite sure there are Java bindings for all those protocols.

Re: how to automate java application in window using python

2016-09-18 Thread Paul Rubin
Steve D'Aprano writes: >> Automation doesn't simulate button presses > Rather than saying that it *doesn't*, it might be better to say that it > doesn't *necessarily* simulate button presses. I'm no Windoze guru but I always understood Automation (sometimes written with a capital A) to refer to a

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

2016-09-19 Thread Paul Moore
s) and you have a standalone application. I'm currently working on such a wrapper - the prototype is at https://github.com/pfmoore/pylaunch. If I can get it into a suitable state, I may look at adding the wrapper to the zipapp module for Python 3.7. Paul -- https://mail.python.org/mailman/listinfo/python-list

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

2016-09-23 Thread Paul Moore
x27;t catch dependencies that don't like being zipped, but it will save you having to go through zip/test/unzip/fix/rezip cycles during development. Anyway, I hope this is useful. Paul -- https://mail.python.org/mailman/listinfo/python-list

Re: How to reduce the DRY violation in this code

2016-09-27 Thread Paul Rubin
Steve D'Aprano writes: > class Spam: > def __init__(self, bashful=10.0, doc=20.0, dopey=30.0, > grumpy=40, happy=50, sleepy=60, sneezy=70): > # the usual assign arguments to attributes dance... > self.bashful = bashful > self.doc = doc > # etc.

Re: Case insensitive replacement?

2016-09-27 Thread Paul Rubin
> needle = "World" > haystack = "Hello, world!" > replacement = "THERE" > result = haystack.replace(needle, replacement, ignore_case=True) > # result would be "Hello, THERE!" >>> import re >>> re.sub('(?i)world','THERE','Hello World') 'Hello THERE' -- https://mail.python.org/mailman/listinfo

Re: How to reduce the DRY violation in this code

2016-09-27 Thread Paul Rubin
Chris Angelico writes: > Can you elaborate on what "GoF builder" means? Presumably it's a > special case of the builder pattern, I think it just means the usual builder pattern, from the Design Patterns book by the so-called Gang of Four (GoF). -- https://mail.python.org/mailman/listinfo/python

Re: Can this be easily done in Python?

2016-09-27 Thread Paul Rubin
TUA writes: > TransactionTerms = > that sets the variable TransactionTerms to its own name as string It's conceivably possible using messy introspection hackery, but if you're asking that question you don't want to think about doing it that way. If you describe the actual goal (application) you

Re: How to call a method returning a value from a main function

2016-09-28 Thread Paul Moore
t to do with it. Otherwise Python will assume you weren't interested in the return value and simply throw it away. Try something like tok = GenAccessToken("This_is_a_Test_QED_MAC_Key_Which_Needs_to_be_at_Least_32_Bytes_Long", "default", "default", 6, "g,m,a,s,c,p,d") print(tok) Paul -- https://mail.python.org/mailman/listinfo/python-list

Using the Windows "embedded" distribution of Python

2016-09-28 Thread Paul Moore
ch are likely to be run by absolute path, and so don't need to be on PATH myself). But I'd really like to be able to promote the embedded distribution as an alternative to tools like py2exe or cx_Freeze, so it would be good to know if a solution is possible (hmm, how come py2exe, and tools like Mercurial, which AFIK use it, don't have this issue too?) Paul -- https://mail.python.org/mailman/listinfo/python-list

Re: How to make a foreign function run as fast as possible in Windows?

2016-09-28 Thread Paul Moore
is it actually not CPU-bound for a single call? To give specific suggestions, we really need to know a bit more about your issue. Paul -- https://mail.python.org/mailman/listinfo/python-list

Re: Is there a way to change the closure of a python function?

2016-09-28 Thread Paul Moore
a completely informal and personal interpretation of what's going on, and Haskell users might not agree with it[1]. But for me the key point in working out what Haskell was doing was when I realised that their execution model wasn't the naive "evaluate the main function" mod

Re: Using the Windows "embedded" distribution of Python

2016-09-29 Thread Paul Moore
On Wednesday, 28 September 2016 21:50:54 UTC+1, eryk sun wrote: > On Wed, Sep 28, 2016 at 2:35 PM, Paul Moore wrote: > > So I thought I'd try SetDllDirectory. That works for python36.dll, but if I > > load > > python3.dll, it can't find Py_Main - the export shows

Re: Using the Windows "embedded" distribution of Python

2016-09-29 Thread Paul Moore
On Thursday, 29 September 2016 10:39:10 UTC+1, eryk sun wrote: > On Thu, Sep 29, 2016 at 8:35 AM, Paul Moore wrote: > > PS It's a shame there's no way to put the embedded distribution in a > > subdirectory > > *without* needing to use dynamic loading, but I gu

Re: Using the Windows "embedded" distribution of Python

2016-09-29 Thread Paul Moore
"win32" > processorArchitecture="amd64" /> > > Thanks for your help on this. My C skills are *very* rusty (going much beyond "cl /c foo.c" sends me to the manuals these days) so I appreciate all the help. I'm off n

Re: Using the Windows "embedded" distribution of Python

2016-09-30 Thread Paul Moore
When I run ssh.exe, it fails with the message "The program cannot start because python3.dll is missing from your computer". I tried running it with sxstrace active, but the resulting log file is empty. I'm not sure where to go next debugging this. Do you have any suggestions? Paul -- https://mail.python.org/mailman/listinfo/python-list

Re: How to make a foreign function run as fast as possible in Windows?

2016-09-30 Thread Paul Moore
On Thursday, 29 September 2016 02:23:13 UTC+1, jf...@ms4.hinet.net wrote: > Paul Moore at 2016/9/28 11:31:50PM wrote: > > Taking a step back from the more detailed answers, would I be right to > > assume that you want to call this external function multiple times from > >

Re: Using the Windows "embedded" distribution of Python

2016-09-30 Thread Paul Moore
On Friday, 30 September 2016 12:50:45 UTC+1, eryk sun wrote: > On Fri, Sep 30, 2016 at 11:02 AM, Paul Moore wrote: > > When I run ssh.exe, it fails with the message "The program cannot start > > because > > python3.dll is missing from your computer". I trie

Re: Lawrence D'Oliveiro

2016-09-30 Thread Paul Rubin
Chris Angelico writes: >> Why can't you block "PEDOFILO"? > I've no idea who you're talking about That's the weird Italian spam that the newsgroup has been getting for a while. I've been wondering for a while if anyone knows what the story is, i.e. why it's on comp.lang.python but not on other n

Re: Copying a compiled Python from one system to another

2016-10-01 Thread Paul Rubin
Steve D'Aprano writes: > However I do have access to another machine (actually a VM) which can > compile Python 3.6. It's not practical for me to use it as a my main > development machine, but as a temporary measure, I thought I could > compile 3.6 on this VM, then copy the python binary to my usu

Re: Byte code descriptions somewhere?

2016-10-01 Thread Paul Rubin
Cem Karan writes: > how do I create a stream of byte codes that can be interpreted by > CPython directly? Basically, study the already existing code and do something similar. The CPython bytecode isn't standardized like JVM bytecode. It's designed for the interpreter's convenience, not officiall

Re: Copying a compiled Python from one system to another

2016-10-01 Thread Paul Rubin
Steve D'Aprano writes: > Yes, this. You need gcc 4.8 or better to build CPython 3.6, and the most > recent any of my systems support is 4.4. Building gcc takes a while but it's reasonably simple. Just start it going and read a book for a while. -- https://mail.python.org/mailman/listinfo/python

Re: Copying a compiled Python from one system to another

2016-10-03 Thread Paul Rubin
Steve D'Aprano writes: > The dependencies needed to build 4.8 aren't available for my system. And > there's no supported upgrade path. If you're system runs 4.4 it should be able to build 4.8 I'd hope. I have Debian 7 which comes with 4.7, and I was able to download and build 6.1 with any signif

Re: Assignment versus binding

2016-10-05 Thread Paul Rubin
Anuradha Laxminarayan writes: > it Would be great to stay within the Python world if I could cover > the key computational monadic ideas without the rest of Haskell. It's useful to write some Python things in monadic style, but monads make the most sense as type operators, which don't map onto Py

Re: Question on multiple Python users in one application

2016-10-06 Thread Paul Rubin
"Jolly Good Spam" writes: > Can someone please suggest what I should be looking at and doing to be > able to effectively run multiple independent Pythons in a single > program? Put each Python in a separate process and communicate by IPC. -- https://mail.python.org/mailman/listinfo/python-list

Re: Question on multiple Python users in one application

2016-10-06 Thread Paul Rubin
"Loren Wilton" writes: > While it is certianly possible to marshall every variable access > through IPC, it isn't real efficient. I would much perfer to avoid > this if I possibly can. Maybe you could use Python proxy objects accessing a shared memory segment. Though as Chris Angelico mentions,

Re: Question on multiple Python users in one application

2016-10-06 Thread Paul Rubin
"Loren Wilton" writes: > I don't think my main concern here is being able to call the CPython > interpreter routines, but instead it is to be able to provide separate > sandboxes for the various programs ("stacks", in B6500 terminology) > that might have their own Python sessions or programs. Thi

Re: Question on multiple Python users in one application

2016-10-06 Thread Paul Rubin
"Loren Wilton" writes: > I've read that Python supports 'threads', and I'd assumed (maybe > incorrectly) that these were somewhat separate environments that could > be operating concurrently (modulo the GC lock). I assume that data can > be shared between the threads, Threads all run in the same

Re: A newbie doubt on methods/functions calling

2016-10-06 Thread Paul Rubin
"Loren Wilton" writes: > strength of Python is that there are many existing 3rd party libraries > that do lots of useful things. Since a lot of them are distributed as > binaries, they would not work in this mainframe environment. Python libraries are usually available as source, either in Python

Re: Python-based monads essay (Re: Assignment versus binding)

2016-10-09 Thread Paul Rubin
Gregory Ewing writes: > http://www.cosc.canterbury.ac.nz/greg.ewing/essays/monads/DemystifyingMonads.html https://byorgey.wordpress.com/2009/01/12/abstraction-intuition-and-the-monad-tutorial-fallacy/ -- https://mail.python.org/mailman/listinfo/python-list

Re: Python-based monads essay (Re: Assignment versus binding)

2016-10-09 Thread Paul Rubin
Gregory Ewing writes: > http://www.cosc.canterbury.ac.nz/greg.ewing/essays/monads/DemystifyingMonads.html Erratum in Haskell section: Lists in Haskell are linked lists, and [h|t] represents a list whose first element is h and the rest of the list is t. [h|t] should say h:t . -- https:/

Re: Python-based monads essay (Re: Assignment versus binding)

2016-10-09 Thread Paul Rubin
Gregory Ewing writes: > Not sure where I got [h|t] from -- maybe I was thinking of Prolog?) I've never used Prolog. Erlang is said to have Prolog-like syntax and it uses [h|t], so maybe Prolog uses it too. (Erlang was originally written in Prolog). -- https://mail.python.org/mailman/listinfo/p

Re: Signals and Threads in Python 3.5 or so

2016-10-09 Thread Paul Rubin
Dan Stromberg writes: > That bug is: if you control-C the top-level process, all the > subprocesses are left running. Are you setting the daemon flag? -- https://mail.python.org/mailman/listinfo/python-list

Re: Python-based monads essay (Re: Assignment versus binding)

2016-10-09 Thread Paul Rubin
> Well, at least I refrained from saying that monads are like burritos! But they are! See: http://blog.plover.com/prog/burritos.html -- https://mail.python.org/mailman/listinfo/python-list

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