In mod1 set var to a value. Lets use 5.
Now, in mod2 we do:
from mod1 import var
And, yes, var is equal to 5. But, to the folks like me who are not complete
pythonistas, we'd think it worked and was wonderful.
But, if we change the variable in mod1 whit a function in mod1, the value
doesn
xt)
> --
> https://mail.python.org/mailman/listinfo/python-list
>
Sorry if I'm late to this party, but I use pdf2txt for this. Works just
fine. It has options for different encodings, page range, etc. On Linux
just "apt install python-pdfminer" to install.
--
Li
o my program.
Doing
z=json.load (open("mybuffer", "r"))
loads a dictionary ... which makes sense since that is what I saved. So,
can I now reset the values in Opts from a saved dictionary?
Best,
--
Listen to my FREE CD at http://www.mellowood.ca/music/cedars
Bob v
t;
>
> --
> Steve
> “Cheer up,” they said, “things could be worse.” So I cheered up, and sure
> enough, things got worse.
>
> --
> https://mail.python.org/mailman/listinfo/python-list
>
--
Listen to my FREE CD at http://www.mellowood.ca/music/cedars
Bob van
easurements differ drastically from mine (and my manual
> measurements match what I'd expect given results of timeit/time.time
> whereas yours don't...).
>
> Paul
> --
> https://mail.python.org/mailman/listinfo/python-list
>
--
Listen to my FREE CD at http://www.me
mane.org (without the news prefix)
does work.
--
**** Listen to my FREE CD at http://www.mellowood.ca/music/cedars
Bob van der Poel ** Wynndel, British Columbia, CANADA **
EMAIL: b...@mellowood.ca
WWW: http://www.mellowood.ca
--
https://mail.python.org/mailman/listinfo/python-list
t; item = get_next_item()
> if not item:
>break
> process_item(item)
>
> Here 'wrong syntax' occurs after the "break".
>
> How is it possible? Bad version of Python? Which version to use?
>
>
ect, with possible multiple
> names to it. We can change the object, using one of the names. That is one
> and only one operation on one and only one object. Since the different
> names refer to the same object, that change will of course be visible
> through all of them.
> >> Note that 'name' in that sentence doesn't just refer to variables (mx1,
> arr1, ...) but also things like indexed lists (mx1[0], mx1[[0][0], ...),
> loop variables, function arguments.
> >>
> >> The correct mental model is important here, and I do think you're on
> track or very close to it, but the way you phrase things does give me that
> nagging feeling that you still might be just a bit off.
> >>
> >> --
> >> "Peace cannot be kept by force. It can only be achieved through
> understanding."
> >> -- Albert Einstein
> >>
> >> --
> >> https://mail.python.org/mailman/listinfo/python-list
> >>
> >
> > --
> > https://mail.python.org/mailman/listinfo/python-list
> >
>
> --
> https://mail.python.org/mailman/listinfo/python-list
>
--
Listen to my FREE CD at http://www.mellowood.ca/music/cedars
Bob van der Poel ** Wynndel, British Columbia, CANADA **
EMAIL: b...@mellowood.ca
WWW: http://www.mellowood.ca
--
https://mail.python.org/mailman/listinfo/python-list
web browsing was "a
> thing", but I'm sure he found a way to do that inside emacs also.
>
Of course there is a mode for that:
https://www.emacswiki.org/emacs/CategoryWebBrowser
--
Listen to my FREE CD at http://www.mellowood.ca/music/cedars
Bob van der Poel **
> ============
> Ian Pilcher arequip...@gmail.com
> "I grew up before Mark Zuckerberg invented friendship"
>
>
> --
> https://mail.python.org/mailman/listinfo/python-list
>
--
Listen to my FREE CD at http://www.mellowood.ca/music/cedars
Bob van der Poel ** Wynndel, British Columbia, CANADA **
EMAIL: b...@mellowood.ca
WWW: http://www.mellowood.ca
--
https://mail.python.org/mailman/listinfo/python-list
an/listinfo/python-list
--
Listen to my FREE CD at http://www.mellowood.ca/music/cedars
Bob van der Poel ** Wynndel, British Columbia, CANADA **
EMAIL: b...@mellowood.ca
WWW: http://www.mellowood.ca
--
https://mail.python.org/mailman/listinfo/python-list
a
few times in the past. I used lots of hex over the years, but don't recall
ever using octal ... except in frustrating moments when I needed to change
permission bits.
--
Listen to my FREE CD at http://www.mellowood.ca/music/cedars
Bob van der Poel ** Wynndel, British Columbia, CANADA **
EMAIL: b...@mellowood.ca
WWW: http://www.mellowood.ca
--
https://mail.python.org/mailman/listinfo/python-list
On Thu, May 17, 2018, 8:45 PM Ben Finney,
wrote:
> Steven D'Aprano writes:
>
> > If you want to *really* see code that is hard to port, you should try
> > porting an Inform 7 program to another language. Any other language.
>
> Does porting Inform 7 code to Inform 6 count? They are very differen
e 'first
> line\nlast line\n'.
>
> If you want additional indentation, then provide a string literal:
>
> def func():
> foobar
> data = >> '':
> first line
> last line
> foobar
>
> for 'f
ve code, is
> there any way to call foo?
>
> Python 2.7
>
>
> Thanks,
> --
> https://mail.python.org/mailman/listinfo/python-list
>
Use the magic of staticmethod :)
class A:
@staticmethod
def foo():
... do foo stuff
Hope this helps.
--
**** Listen to my FREE CD
that this won't scale all that well. Am I missing
something?
--
Listen to my FREE CD at http://www.mellowood.ca/music/cedars ****
Bob van der Poel ** Wynndel, British Columbia, CANADA **
EMAIL: b...@mellowood.ca
WWW: http://www.mellowood.ca
--
https://mail.python.org/mailman/listinfo/python-list
is
> > empty, 'all' will return True anyway.
>
> Neat! I expected that a[0] would be executed in that case,
> but it is not.
>
> --
> Neil Cerutti
> --
> https://mail.python.org/mailman/listinfo/python-list
>
--
Listen to my FREE CD at http://w
Please, is there something similar for python2 ?
>
> Cheers
> --
> Alex
> --
> https://mail.python.org/mailman/listinfo/python-list
>
try this:
http://stackoverflow.com/questions/566746/how-to-get-console-window-width-in-python
--
Listen to my FREE CD at http://www.mellowood.c
>MaxNum = N2
> > > elif N1 > >MaxNum = N3
> >
> > No. Assuing that you meant to include colons where I think you did, what
> > if (N1, N2, N3) == (5, 4, 6)?
> >
> > --
> > https://mail.python.org/mailman/listinfo/python-list
> >
> --
> https://mail.python.org/mailman/listinfo/python-list
>
Isn't the easiest way to do this is:
sorted( [n1,n2,n3] )[-1]
to get the largest value?
--
Listen to my FREE CD at http://www.mellowood.ca/music/cedars
Bob van der Poel ** Wynndel, British Columbia, CANADA **
EMAIL: b...@mellowood.ca
WWW: http://www.mellowood.ca
--
https://mail.python.org/mailman/listinfo/python-list
t!
>
>
> >>> That said, I am aware that I am not in any way a "normal person".
> >>> Using month names as per your other example is probably a fair
> >>> compromise with other humans.
>
> In this life, one does have to make allowances...
>
On Sun, Feb 3, 2019 at 2:15 PM Chris Angelico wrote:
> On Mon, Feb 4, 2019 at 8:02 AM Bob van der Poel wrote:
> >
> > I'm surprised that no one has yet addressed the year 1 problem.
> Hopefully we're doing numeric, not alpha sorts on the stuff before the 1st
>
nd, but that is just a guess.
Maybe I need to set my sights on bigger, slower programs to see a
difference :)
--
Listen to my FREE CD at http://www.mellowood.ca/music/cedars ****
Bob van der Poel ** Wynndel, British Columbia, CANADA **
EMAIL: b...@mellowood.ca
WWW: http://www.mellowo
ny
> time, so if it's processor-intensive, it's better to use multiprocessing.
>
> Of course, if it's already maxing out the disk, then using more cores
> won't make it faster.
> --
> https://mail.python.org/mailman/listinfo/python-list
>
--
Listen to my FREE CD at http://www.mellowood.ca/music/cedars
Bob van der Poel ** Wynndel, British Columbia, CANADA **
EMAIL: b...@mellowood.ca
WWW: http://www.mellowood.ca
--
https://mail.python.org/mailman/listinfo/python-list
Ahh, 2 really excellent ideas! I'm reading about parallel right now. And, I
know how to use make, so I really should have thought of -j as well. Thanks
for the ideas.
On Fri, May 24, 2019 at 12:02 AM Christian Gollwitzer
wrote:
> Am 23.05.19 um 23:44 schrieb Paul Rubin:
> > Bo
no one else has brought it up yet, that rather
> than manually creating threads and/or process pools for all these
> things, this is exactly what the standard concurrent.futures module is
> for. It's a fairly brilliant wrapper around all this stuff, and I feel
> like it often
On Sun, May 26, 2019 at 11:05 AM Grant Edwards
wrote:
> On 2019-05-23, Chris Angelico wrote:
> > On Fri, May 24, 2019 at 5:37 AM Bob van der Poel
> wrote:
> >>
> >> I've got a short script that loops though a number of files and
> >> processes them
decided that using the work of others was more
productive. I've been using parallel with good success. Depends on how much
you need to share with the different components. For details see
https://www.gnu.org/software/parallel/
--
**** Listen to my FREE CD at http://www.mellowood.ca/music/c
oping for a guideline!
Thanks.
--
Listen to my FREE CD at http://www.mellowood.ca/music/cedars
Bob van der Poel ** Wynndel, British Columbia, CANADA **
EMAIL: b...@mellowood.ca
WWW: http://www.mellowood.ca
--
https://mail.python.org/mailman/listinfo/python-list
On Sat, Dec 7, 2019 at 4:00 AM Barry Scott wrote:
>
>
> > On 6 Dec 2019, at 18:17, Bob van der Poel wrote:
> >
> > I have some files which came off the net with, I'm assuming, unicode
> > characters in the names. I have a very short program which takes the
On Sat, Dec 7, 2019 at 12:47 PM DL Neil via Python-list <
python-list@python.org> wrote:
> On 8/12/19 5:50 AM, Bob van der Poel wrote:
> > On Sat, Dec 7, 2019 at 4:00 AM Barry Scott
> wrote:
> >>> On 6 Dec 2019, at 18:17, Bob van der Poel wrote:
> >>>
/python-list
>
--
Listen to my FREE CD at http://www.mellowood.ca/music/cedars
Bob van der Poel ** Wynndel, British Columbia, CANADA **
EMAIL: b...@mellowood.ca
WWW: http://www.mellowood.ca
--
https://mail.python.org/mailman/listinfo/python-list
Does this make as much sense as anything else? I need to track calls to a
function to make sure it doesn't get called to too great a depth. I had a
global which I inc/dec and then check in the function. Works fine, but I do
need to keep a global around just for this.
So ... instead I wrote a short
e in a
function? Is there a PEP?
Best,
On Sun, Apr 26, 2020 at 8:47 PM Chris Angelico wrote:
> On Mon, Apr 27, 2020 at 1:39 PM Bob van der Poel wrote:
> >
> > Does this make as much sense as anything else? I need to track calls to a
> > function to make sure it doesn't
t; On 4/27/20 10:39 AM, Bob van der Poel wrote:
> > Thanks Chris!
> >
> > At least my code isn't (quite!) as bad as the xkcd example :)
> >
> > Guess my "concern" is using the initialized array in the function:
> >
> >def myfunct(a, b, c=a
turn f
> return deco
>
> @static(called=0)
> def other_function():
> me.called += 1
> ...
>
> Obviously the name "me" can't be used, as it'd break a bunch of code,
> but conceptually this would be incredibly helpful. It'd also be a
>
les from Python's
> standard library? Or do you mean installing third party libraries
> using pip?
>
> > ...But now I am not able to open IDLE after multiple tries.
>
> Have you looked in your start menu in the list of installed programs
> for Python? If it is there d
rame, df.
> > > >
> > > > A strange thing is that it worked perfectly in the same Jupyter
> > > notebook
> > > > this morning.
> > > > But all of a sudden, it started not doing the replacement any
> more.
> > > >
Listen to my FREE CD at http://www.mellowood.ca/music/cedars ****
Bob van der Poel ** Wynndel, British Columbia, CANADA **
EMAIL: b...@mellowood.ca
WWW: http://www.mellowood.ca
--
https://mail.python.org/mailman/listinfo/python-list
On Wed, Nov 25, 2020 at 10:59 AM Chris Angelico wrote:
> On Thu, Nov 26, 2020 at 4:36 AM Bob van der Poel wrote:
> >
> > I've got a program which accepts an optional env variable listing a
> single
> > or multiple directory for the app to use. I've done a
On Wed, Nov 25, 2020 at 11:00 AM dn via Python-list
wrote:
> On 26/11/2020 05:46, Bob van der Poel wrote:
> > I've got a program which accepts an optional env variable listing a
> single
> > or multiple directory for the app to use. I've done a bit of a search
On Wed, Nov 25, 2020 at 12:43 PM Eryk Sun wrote:
> On 11/25/20, Bob van der Poel wrote:
> > I've got a program which accepts an optional env variable listing a
> single
> > or multiple directory for the app to use.
>
> In Unix one would use colon as the preferred de
On Wed, Nov 25, 2020 at 2:22 PM dn via Python-list
wrote:
> > Ahha! Didn't know about os.pathsep. Seems simple enough to use that and
> be
> > done with it.
> >
> > I'm just using str.split() just now. Is there a os.splitpath()? I don't
> see
> > anything in the docs.
>
>
> https://docs.python.or
On Fri, Nov 27, 2020 at 1:41 PM dn via Python-list
wrote:
> On 26/11/2020 05:46, Bob van der Poel wrote:
> > I've got a program which accepts an optional env variable listing a
> single
> > or multiple directory for the app to use. I've done a bit of a search
line 1, in
NameError: name 'z' is not defined
I understand "z in not defined" ... but what's with the warnings?
--
Listen to my FREE CD at http://www.mellowood.ca/music/cedars
Bob van der Poel ** Wynndel, British Columbia, CANADA **
EMAIL: b...@mellowood.ca
WWW: http://www.mellowood.ca
--
https://mail.python.org/mailman/listinfo/python-list
peated over and over again after every error.
Could this be a bug in requests?
On Fri, Jan 1, 2021 at 3:03 AM Peter Otten <__pete...@web.de> wrote:
> On 31/12/2020 23:46, Bob van der Poel wrote:
>
> > When I run python from the command line and generate an error I get the
>
On Thu, Dec 31, 2020 at 9:25 PM DL Neil via Python-list <
python-list@python.org> wrote:
> On 1/1/21 11:46 AM, Bob van der Poel wrote:
> > When I run python from the command line and generate an error I get the
> > following:
> >
> > Python 3.8.5 (default, Jul
ink!).
>
>
> That is where "python3.8 -m pip install --user" puts the packages you
> install.
>
> Barry
>
>
>
> Okay ... I'll take your word for it. But, I really don't think I've every
run that command :)
--
**** Listen to my FREE CD at http:/
On Fri, Jan 1, 2021 at 12:17 PM DL Neil via Python-list <
python-list@python.org> wrote:
> On 1/2/21 6:35 AM, Bob van der Poel wrote:
> > Found it!
>
> Well done!
>
>
> >> I had the proper urllib3 installed. But, in my .local/lib/ a
> previous
> >
that it's not 100%.
>
> There are multiple reasons for this, but the first time that code is
> run, a .pyc will (presumably) be created - and we're back to
> considerations of Python environments, Python cf C, perhaps even
>
>
Oh no! Not these damned dragons again :)
But, seriously. No, I have no idea of moving installed stuff around between
/usr /.local and /usr/local. There lies no dragons but madness :) I meant
that I will pay more attention as to what the installer(s) are doing.
Thanks for the input.
--
Listen to my FREE CD at http://www.mellowood.ca/music/cedars
Bob van der Poel ** Wynndel, British Columbia, CANADA **
EMAIL: b...@mellowood.ca
WWW: http://www.mellowood.ca
--
https://mail.python.org/mailman/listinfo/python-list
solo voice methods, and general cleanups/fixes.
Comments appreciated!
--
Bob van der Poel ** Wynndel, British Columbia, CANADA **
EMAIL: [EMAIL PROTECTED]
WWW: http://mypage.uniserve.com/~bvdp
--
http://mail.python.org/mailman/listinfo/python-announce-list
Support the Python Software
to enter
notes and play them back. After trying out half a dozen of these, I
ended rolling my own solution in just 400 lines of Python, plus a Python
module to read/write MIDI files.
Regards,
Jan
Just as a side note, I remember reading somewhere that the Casio WK3000
Keyboard uses Python. N
> For a one-liner:
>
> x[slice(*map(int, x[1:-1].split(':')))]
Thanks.
Almost works :)
For s="[2]" and s="[1:2]" it's fine. But, if I have
s = "[:2]" then I get:
>>> x[slice(*[int(i) for i in s.strip("[]").split(":")])]
Traceback (most recent call last):
File "", line 1, in
ValueError:
> Of course, you could also do something like this:
>
> eval('x' + s)
> or
> eval(str(x) + s)
>
Yes, I have user inputed 's'. So, if I can't get the generalized list
version from Robert working I'll have to use this. Speed is not a big
deal in this. As to malicious input, I could pretty
On Sep 2, 4:16 pm, "Rhodri James" wrote:
> On Wed, 02 Sep 2009 23:57:48 +0100, Bob van der Poel
> wrote:
>
>
>
> >> Of course, you could also do something like this:
>
> >> eval('x' + s)
> >> or
> >> e
On Sep 2, 4:43 pm, "Jan Kaliszewski" wrote:
> 03-09-2009 o 00:55:10 Bob van der Poel wrote:
>
>
>
> >> For a one-liner:
>
> >> x[slice(*map(int, x[1:-1].split(':')))]
>
> > Thanks.
>
> > Almost works :)
>
> >
On Sep 2, 5:16 pm, Steven D'Aprano wrote:
> On Wed, 02 Sep 2009 16:41:34 -0700, Bob van der Poel wrote:
>
> > But, translating 1, 2 or 3 ints into a valid splice isn't quit that
> > easy? I could figure each value, and convert them to either int or None
> > (key
On Sep 2, 4:27 pm, Ethan Furman wrote:
> Bob van der Poel wrote:
>
>
>
> >>For a one-liner:
>
> >> x[slice(*map(int, x[1:-1].split(':')))]
>
> > Thanks.
>
> > Almost works :)
>
> > For s="[2]" and s="[1:2]"
On Sep 2, 8:52 pm, Steven D'Aprano
wrote:
> On Wed, 02 Sep 2009 17:32:09 -0700, Bob van der Poel wrote:
>
> > Actually, nither this or Jan's latest is working properly. I don't know
> > if it's the slice() function or what (I'm using python 2.5). But
58 matches
Mail list logo