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 Dale Marvin via Python-list
On 8/23/16 8:15 PM, [email protected] wrote: > I am trying to: > > 1) Use Python 3+ (specifically 3.4 if it matters) > 2) Launch N commands in background (e.g., like subprocess.call would for individual commands) > 3) But only limit P commands to run at same time > 4

Re: Multimeter USB output

2016-08-29 Thread Larry Hudson via Python-list
completely self-taught, hobby programmer. Been around since the MITS Altair. How many remember that beast?? (And yes -- as you already corrected yourself -- that's CP/M not CM/M.) -- -=- Larry -=- -- https://mail.python.org/mailman/listinfo/python-list

Re: Multimeter USB output

2016-08-30 Thread Larry Hudson via Python-list
On 08/30/2016 04:01 AM, D'Arcy J.M. Cain wrote: On Mon, 29 Aug 2016 21:21:05 -0700 Larry Hudson via Python-list wrote: I remember it well. It's what I used to initially learn C. I'm a completely self-taught, hobby programmer. Been around since the MITS Altair. How many reme

Re: [OT] Altair

2016-08-30 Thread Larry Hudson via Python-list
On 08/30/2016 11:51 AM, Joe wrote: Am 30.08.2016 um 17:52 schrieb D'Arcy J.M. Cain: On Tue, 30 Aug 2016 15:56:07 +0200 Joe wrote: Am 30.08.2016 um 13:01 schrieb D'Arcy J.M. Cain: On Mon, 29 Aug 2016 21:21:05 -0700 Larry Hudson via Python-list wrote: I remember it well. It's

Re: Multimeter USB output

2016-08-30 Thread Larry Hudson via Python-list
ly used at the time. -- -=- Larry -=- -- https://mail.python.org/mailman/listinfo/python-list

Re: Extend unicodedata with a name/pattern/regex search for character entity references?

2016-09-04 Thread Larry Hudson via Python-list
://mail.python.org/mailman/listinfo/python-list

Re: How to split value where is comma ?

2016-09-08 Thread Larry Hudson via Python-list
wlist = a.split(",") for x in newlist: print(x) Even easier... for x in a.split(','): print(x) -- -=- Larry -=- -- https://mail.python.org/mailman/listinfo/python-list

Re: Oh gods can we get any more off-topic *wink* [was Re: [Python-ideas] Inconsistencies]

2016-09-14 Thread Dale Marvin via Python-list
e same false history that I was taught at college. There's much evidence that medieval scholars did not believe the earth was flat. <https://en.wikipedia.org/wiki/Myth_of_the_flat_Earth> Dale -- https://mail.python.org/mailman/listinfo/python-list

Re: Oh gods can we get any more off-topic *wink* [was Re: [Python-ideas] Inconsistencies]

2016-09-14 Thread Dale Marvin via Python-list
istory Professors, one in particular seemed to make it his life's purpose to say bad things about religion/bible etc. I should have known better than to get into such an off-topic quagmire. Dale -- https://mail.python.org/mailman/listinfo/python-list

Re: Data Types

2016-09-22 Thread Larry Hudson via Python-list
lex) that is zero is falsey. Any empty collection (list, string, dictionary...) is falsey. EVERYTHING else is truthy. -- -=- Larry -=- -- https://mail.python.org/mailman/listinfo/python-list

Re: strings and ints consistency - isinstance

2016-09-22 Thread Larry Hudson via Python-list
milar. -- -=- Larry -=- -- https://mail.python.org/mailman/listinfo/python-list

RE: [E] ANN: asciimatics v1.7.0

2016-09-26 Thread Scherer, Bill via Python-list
ady satisfied (use --upgrade to upgrade): Pillow>=2.7.0 in /usr/local/lib/python3.5/site-packages (from asciimatics) Collecting pypiwin32 (from asciimatics) Using cached pypiwin32-219.zip Complete output from command python setup.py egg_info: Traceback (most recent call last):

Re: Nested for loops and print statements

2016-09-26 Thread Larry Hudson via Python-list
On 09/26/2016 08:25 AM, Cai Gengyang wrote: I just wanted to note that sometimes the code works, sometimes it doesn't. (even though both are exactly the same code) ... Weird , dum dum dum It is NOT weird. Python is being consistent, YOU are not. These examples are NOT "exactl

Re: Nested for loops and print statements

2016-09-27 Thread Larry Hudson via Python-list
d incorrectly/inconsistently in newsgroup postings. But if you read the Traceback error message, it is telling you that you have a mix of tabs and spaces _in your original_. READ the error messages, they are important! -- -=- Larry -=- -- https://mail.python.org/mailman/listinfo/python-list

Re: Nested for loops and print statements

2016-09-28 Thread Larry Hudson via Python-list
-=- Larry -=- -- https://mail.python.org/mailman/listinfo/python-list

ANN: distlib 0.2.4 released on PyPI

2016-09-30 Thread Vinay Sajip via Python-list
s not available. * Changed project name comparisons to follow PEP 503. * Changed manifest and resources logic to work correctly under (upcoming) Python 3.6. * Updated Windows launchers with fixes to bugs related to argument-passing in shebang lines. A more detailed change log is available

I can't run python on my computer

2016-10-05 Thread Camille Benoit via Python-list
Hi,it has been about a week since the last time I was able to use Python. Most of the time, the interpreter doesn't show up and when it does and I am trying to run a program it displayed the following message: "IDLE's subprocess didn't make connection. Either IDLE can

Re: Function to take the minimum of 3 numbers

2016-10-09 Thread Larry Hudson via Python-list
-- https://mail.python.org/mailman/listinfo/python-list

Re: Need help with coding a function in Python

2016-10-31 Thread Larry Hudson via Python-list
ives [1,2,3] etc... -- -=- Larry -=- -- https://mail.python.org/mailman/listinfo/python-list

What is currently the recommended way to work with a distutils-based setup.py that requires compilation?

2016-11-06 Thread Ivan Pozdeev via Python-list
#L849 ): python -u -c "import setuptools, tokenize;__file__=path>; exec(compile(getattr(tokenize, 'open', open)(__file__).read() .replace('\\r\\n', '\\n'), __file__, 'exec'))" They can't possibly expect me to type that on

Re: Confused with installing per-user in Windows

2016-11-06 Thread Ivan Pozdeev via Python-list
On 07.11.2016 4:11, ddbug wrote: Dear experts, I need to install some scripts for current user (to skip sudo, UAC popups and whatever). So I make a sdist and use python -m pip install --user This should work for either Python 2 or 3. On Linux, pip installs the scripts into ~/.local/bin

Re: Windows: subprocess won't run different Python interpreter

2016-11-11 Thread Gisle Vanem via Python-list
Thorsten Kampe wrote: > My goal is to verify that other shells/interpreters on Windows work > the same way as Python when running an application or creating a sub- > process. Cmd does not. What's else there? I have Bash here but that's > a Cygwin executable. And Cygwin Pyt

Re: A question about sprite rendering in game development

2016-11-16 Thread Larry Hudson via Python-list
On 11/16/2016 12:16 AM, shadecelebi wrote: thanx a lot you guys. I'm slightly familiar with pygame from before so I'll make sure to utilize it. and no I don't have any of the characters yet as I've yet to start. I just wanted to know if I should keep learning python or if

modify screen pop up

2016-11-17 Thread John Zayatz via Python-list
when running pycharm the modify setup window keep coming on the screen. I have uninstalled and reinstalled python and pycharm multiple times. Do you have a solution? Thank You" -- https://mail.python.org/mailman/listinfo/python-list

key and ..

2016-11-17 Thread Val Krem via Python-list
939 759939 0 0 2345 154571 345 154571 0 0 3251 350711 251 350711 0 0 file4 key c1 p1 6 46 756 file5 key p1 p2 7 256 4562 Thank you in advance -- https://mail.python.org/mailman/listinfo/python-list

Re: need help to get my python image to move around using tkinter

2016-11-18 Thread Thomas Grops via Python-list
thankyou so much, that is the exact help I required to put me in the right direction :D -- https://mail.python.org/mailman/listinfo/python-list

Re: Can somebody tell me what's wrong wrong with my code? I don't understand

2016-11-23 Thread Larry Hudson via Python-list
assumes the option number is part of the strings for opt in options: print(opt) print()# If you really want the double-spacing, personally I don't think it's needed Here's a bit more advanced version of the for loop, this one assumnes the option numbers are not in the strings in the list... for num, opt in enumerate(options, 1): print('({}) {}'.format(num, opt))# OR print('(%d) %s' % (num, opt)) print()# Again, double-spacing is optional A similar approach could be used for your classNum section. Just some suggestions to read/study/adapt... or ignore. Whatever you feel like. ;-) -- -=- Larry -=- -- https://mail.python.org/mailman/listinfo/python-list

Re: How to you convert list of tuples to string

2016-11-23 Thread Larry Hudson via Python-list
d" % item # Format it in the way you like. print msg Greetings, Or using the new string formatting syntax: msg = '{},{},{}:{}'.format(*item) The *item in the format() unpacks the tuple. -- -=- Larry -=- -- https://mail.python.org/mailman/listinfo/python-list

Random number help

2016-11-23 Thread Thomas Grops via Python-list
an integer too so not a list unless there is a way to convert list to int Many Thanks Tom -- https://mail.python.org/mailman/listinfo/python-list

Re: Random number help

2016-11-23 Thread Thomas Grops via Python-list
On Wednesday, 23 November 2016 19:30:04 UTC, Thomas Nyberg wrote: > On 11/23/2016 02:17 PM, Thomas Grops via Python-list wrote: > > I need a way of generating a random number but there is a catch: > > > > I don't want to include certain numbers, is this possible? &g

Re: Random number help

2016-11-23 Thread Thomas Grops via Python-list
On Wednesday, 23 November 2016 19:30:21 UTC, Chris Kaynor wrote: > On Wed, Nov 23, 2016 at 11:17 AM, Thomas Grops via Python-list > wrote: > > I need a way of generating a random number but there is a catch: > > > > I don't want to include cert

Re: Random number help

2016-11-23 Thread Thomas Grops via Python-list
Thankyou for all your help I have managed to pick a way that works from your suggestions :D -- https://mail.python.org/mailman/listinfo/python-list

Re: How to you convert list of tuples to string

2016-11-23 Thread Larry Hudson via Python-list
obably should have said "newer" or "other".:-) -- -=- Larry -=- -- https://mail.python.org/mailman/listinfo/python-list

Re: Random number help

2016-11-23 Thread Larry Hudson via Python-list
- Here's the results I got for 3 runs... 4 4 4 8 10 6 8 2 4 8 8 4 2 4 6 8 2 4 8 8 10 6 6 4 4 4 8 2 8 4 Of course, the not-wanted list can be a single int, or even empty. -- -=- Larry -=- -- https://mail.python.org/mailman/listinfo/python-list

Help with two issues, buttons and second class object

2016-11-24 Thread Thomas Grops via Python-list
nk(950,650,950+40,650+40) #testing features '''tank1.attack() tank1.attack() tank1.checkLife() tank1.medic() tank1.checkLife() tank1.move()''' tank1.move() canvas.pack(padx=10,pady=10) #Complete the GUI main.mainloop() -- https://mail.python.org/mailman/listinfo/python-list

Re: Help with two issues, buttons and second class object

2016-11-24 Thread Thomas Grops via Python-list
attack and medic. I will upload the code when I am done with it or get stuck again to see what your feedback is :D -- https://mail.python.org/mailman/listinfo/python-list

Re: Help with two issues, buttons and second class object

2016-11-24 Thread Larry Hudson via Python-list
On 11/24/2016 06:53 AM, Peter Otten wrote: Thomas Grops via Python-list wrote: [snip...] Instead of repeating your code with copy-and-past make a helper function like the randx() posted by Larry Hudson. By the way, randint(min, max) may return max so there are 9 possible outcomes while you

Re: Help with two issues, buttons and second class object

2016-11-25 Thread Thomas Grops via Python-list
Peter, in your code what does that self.root = root mean in the __init__ function of the class -- https://mail.python.org/mailman/listinfo/python-list

Re: Help with two issues, buttons and second class object

2016-11-25 Thread Thomas Grops via Python-list
Also I am struggling to understand: def move_tank(self, dx, dy): self.x += dx self.y += dy self.canvas.move(self.id, dx, dy) Where does the dx and dy values get input? -- https://mail.python.org/mailman/listinfo/python-list

Re: python 2.7.12 on Linux behaving differently than on Windows

2016-12-05 Thread Larry Hudson via Python-list
definitely subject to "senior moments" and not too reliable, but IIRC it was Windows prior to 9x (Win 3 and earlier) that were 16 bit and ran on top of DOS. Win95 was the first 32 bit version and was independent from DOS. -- -=- Larry -=- -- https://mail.python.org/mailman/listinfo/python-list

Re: python 2.7.12 on Linux behaving differently than on Windows

2016-12-05 Thread Larry Hudson via Python-list
but... they are ONE person's opinions and are no more than opinions and they ain't gonna change nothin', no how, no way, not ever. [Sorry, I'm in a bad mood today and just had to let off a little steam...] -- -=- Larry -=- -- https://mail.python.org/mailman/listinfo/python-list

Re: python 2.7.12 on Linux behaving differently than on Windows

2016-12-06 Thread Larry Hudson via Python-list
"ain't gonna change nothin', no how, no way, not ever" is that for someone who claims to be such an expert and experienced programmer, your posts frequently show an amazing lack of knowledge. For example, quoting from another recent post of yours: >>Read the Python d

Last call for the Call For Proposals of PythonFOSDEM 2017

2016-12-16 Thread Stephane Wirtel via Python-list
phane Call For Proposals == This is the official call for sessions for the Python devroom at FOSDEM 2017. FOSDEM is the Free and Open source Software Developers' European Meeting, a free and non-commercial two-day week-end that offers open source contributors a place to meet, s

data frame

2016-12-23 Thread Val Krem via Python-list
Hi all, #!/usr/bin/env python import sys import csv import numpy as np import pandas as pd a= pd.read_csv("s1.csv") print(a) size w1 h1 0 512 214 26 1 123 250 34 2 234 124 25 3 334 213 43 4 a45 223 32 5 a12 214 26 I wanted to create a new column by

Re: data frame

2016-12-23 Thread Val Krem via Python-list
ntel/intelpython35/lib/python3.5/site-packages/pandas/indexes/base.py", line 1393, in __getitem__ return getitem(key) IndexError: only integers, slices (`:`), ellipsis (`...`), numpy.newaxis (`None`) and integer or boolean arrays are valid indices On Friday, December 23, 2016 3:09 PM, P

Re: data frame

2016-12-24 Thread Val Krem via Python-list
Thank you Peter and Christ. It is was a white space and the fix fixed it. Many thanks. On Friday, December 23, 2016 5:26 PM, Peter Otten <[email protected]> wrote: Val Krem via Python-list wrote: > Here is the first few lines of the data > > > s1.csv > size,w1,h1 >

data

2016-12-29 Thread Val Krem via Python-list
rue) and got ID,10's,20's all 1,4,3,7 2,4,4,8 but I want get the class count as well like as follows ID,class,10's,20's,all 1,3,4,3,7 2,4,4,4,8 how do I do it in python? thank you in advance -- https://mail.python.org/mailman/listinfo/python-list

RE: Clickable hyperlinks

2017-01-03 Thread Dan Strohl via Python-list
gt; url = url_class("mysite.com/coolpage.html") >> print(url) "http://mysite.com/coolpage.html";) >> print(url.plain) "mysite.com/coolpage.html" >> print(url.html('My Site")) 'http://mysite.com/coolpage.html";>My Site

RE: Re: Clickable hyperlinks

2017-01-03 Thread Dan Strohl via Python-list
Keeping mind how this all works... Python is providing the data, the console/terminal/app handles how that data is displayed. There is no specification for text output to be hyperlinked (that I know about at least), so while some apps may handle specific coding to tell them that "this

Re: Hey, I'm new to python so don't judge.

2017-01-03 Thread Larry Hudson via Python-list
sing an on-line version in a browser. To get the proper Python error messages (called Tracebacks) you MUST run the program in a terminal on your own computer. These tracebacks are VERY informative (once you get used to them). :-) And these tracebacks are what WE need to see to help you. You

RE: Clickable hyperlinks

2017-01-05 Thread Dan Strohl via Python-list
gt; url = url_class("mysite.com/coolpage.html") >> print(url) "http://mysite.com/coolpage.html";) >> print(url.plain) "mysite.com/coolpage.html" >> print(url.html('My Site")) 'http://mysite.com/coolpage.html";>My Site' (or wha

RE: Re: Clickable hyperlinks

2017-01-05 Thread Dan Strohl via Python-list
Keeping mind how this all works... Python is providing the data, the console/terminal/app handles how that data is displayed. There is no specification for text output to be hyperlinked (that I know about at least), so while some apps may handle specific coding to tell them that "this

Re: Hey, I'm new to python so don't judge.

2017-01-06 Thread Larry Hudson via Python-list
ax > Exactly HOW are you running this? If you are getting a popup, I suspect you are using an on-line version in a browser. To get the proper Python error messages (called Tracebacks) you MUST run the program in a terminal on your own computer. These tracebacks are VERY informative (once you g

crosstab output

2017-01-06 Thread Val Krem via Python-list
A21 4 I want to create a variable by adding 2/(3+2) for the first row(A1) and 4/(1+4) for the second row (A2) Final data frame would be A1 3 2 0.4 A2 1 4 0.8 Thank you in advance -- https://mail.python.org/mailman/listinfo/python-list

Re: The hardest problem in computer science...

2017-01-06 Thread Larry Hudson via Python-list
oxed text""" if just not in '<^>': # Check for valid justification code just = '<' if isinstance(txt, str):# Check for string input txt = txt.split('\n') # Convert to list while txt[-1].rstrip() == '': # Delete trailing blank lines txt = txt[:-1] if just == '<': # Left just, only strip on right txt = [line.rstrip() for line in txt] else: # Otherwise strip both ends txt = [line.strip() for line in txt] txt = [line.expandtabs(tsize) for line in txt] # Cnvt tabs to spaces maxlen = max([len(line) for line in txt]) + 4 # Find longest line # Create the boxed text out = [] out.append(self.bxstr('BXtl ' + 'hz ' * maxlen + 'tr')) if tall: out.append(self.bxstr(['BXvt', ' ' * maxlen, 'BXvt'])) for line in txt: out.append(self.bxstr(['BXvt', ' {:{}{}} '. format(line, just, maxlen-4), 'BXvt'])) if tall: out.append(self.bxstr(['BXvt', ' ' * maxlen, 'BXvt'])) out.append(self.bxstr('BXbl ' + 'hz ' * maxlen + 'br')) return '\n'.join(out) #== if __name__ == '__main__': def grid(bc): """Print a box""" print(bc.bxstr(['BXtl hz hz hz TM hz Hz hZ tr'])) print(bc.bxstr(['BXvt', ' ', 'BXvt', ' ', 'BXvt'])) print(bc.bxstr('BX ml hz hz hz mm hz hz hz mr')) print(bc.bxstr(['BX vt', ' ', 'BXvt', ' ', 'BXvt'])) print(bc.bxstr('BXbl hz hz hz bm hz hz hz br')) bc = BoxChr() # Check all chars in all styles for style in bc._styles: bc.style = style grid(bc) # Verify error test try: bc.style = 'xx' except ValueError: print('Invaled style') # Test boxtext() method jab = """'Twas brillig, and the slithy toves \tDid gyre and gimbol in the wabe. All mimsy were the borogoves, \tAnd the momraths outgrabe. """ bc.style='ds' print(bc.boxtext(jab)) print(bc.boxtext(jab, tsize=8)) print(bc.boxtext(jab, just='^')) print(bc.boxtext(jab, just='>')) print(bc.boxtext(jab, tall=False)) -- -=- Larry -=- -- https://mail.python.org/mailman/listinfo/python-list

Python Events in 2017, Need your help.

2017-01-09 Thread Stephane Wirtel via Python-list
Dear Community, For the PythonFOSDEM [1] on 4th and 5th February in Belgium, I would like to present some slides with the Python events around the World. Based on https://python.org/events, I have noted that there are missing events, for example: * PyCon Otto: Italy * PyCon UK: United

Re: Can not run the Python software

2017-01-13 Thread [email protected] via Python-list
I have been added to the mailing list per your instructions. Please, have someone address the problem belowThanks Sent from my Sprint Phone. -- Original message--From: Date: Thu, Jan 5, 2017 10:13 PMTo: [email protected];Subject:Can not run the Python software Hi

Re: Python

2017-01-25 Thread Stephane Wirtel via Python-list
he help needed. > This email is confidential and may be subject to privilege. If you are not > the intended recipient, please do not copy or disclose its content but > contact the sender immediately upon receipt. > -- > https://mail.python.org/mailman/listinfo/python-list -- https://mail.python.org/mailman/listinfo/python-list

ANN: A new version (0.4.0) of python-gnupg has been released.

2017-01-29 Thread Vinay Sajip via Python-list
A new version of the Python module which wraps GnuPG has been released. What Changed? = This is an enhancement and bug-fix release, and all users are encouraged to upgrade. See the project website [1] for more information. Brief summary: * Added support for ``KEY_CONSIDERED`` in

Call for Volunteers at PythonFOSDEM 2017

2017-02-01 Thread Stephane Wirtel via Python-list
# Introduction The Python Community will be represented during FOSDEM 2017 with the Python Devrooms. This year, we will have two devrooms, the first one for 150 people on Saturday and the second one for 450 people on Sunday, it's really cool because we had accepted 24 talks instead

Re: Python gotcha of the day

2018-03-14 Thread Brian Oney via Python-list
second one as > >"" '"' "" "" > >which left me rather puzzled as to why the first wasn't being >interpreted as > >"" ' "' " " "" > >but of course that's not what's going on at all. The second one is > >'''"''' "" > >As to WHY - in both your examples, the literal can be interpreted as a >triple-quoted string, so it is (rather than some combination of >single-quoted strings). And, in both cases, the SHORTEST possible >reading as a triple-quoted string is used. > >There, now I can go back to work. > >- Thomas > >-- >https://mail.python.org/mailman/listinfo/python-list -- https://mail.python.org/mailman/listinfo/python-list

Writing a C extension - borrowed references

2018-03-20 Thread Tom Evans via Python-list
Hi all I'm writing my first C extension for Python here, and all is going well. However, I was reading [1], and the author there is advocating Py_INCREF 'ing *every* borrowed reference. Now, I get that if I do something to mutate and perhaps invalidate the PyObject that was borrowed

Re: Writing a C extension - borrowed references

2018-03-20 Thread Tom Evans via Python-list
On Tue, Mar 20, 2018 at 4:38 PM, Chris Angelico wrote: > BTW, have you looked into Cython? It's smart enough to take care of a > lot of this sort of thing for you. I did a bit; this work is to replace our old python 2 SAML client, which used python-lasso and python-libxml2, both pa

[OT] Re: Style Q: Instance variables defined outside of __init__

2018-03-20 Thread Tom Evans via Python-list
WD and automatic transmission are more expensive options than FWD and manual transmissions, and most cars are FWD and manual. At least most cars I can afford.. Cheers Tom -- https://mail.python.org/mailman/listinfo/python-list

Re: Writing a C extension - borrowed references

2018-03-20 Thread Tom Evans via Python-list
RMAT_PERSISTENT); into ctypes compatible syntax, when I can simply adapt the working C code to Python. :) Plus, there is the library static initialisation to manage, the issues of distributing the C libraries if I do a C wrapper to call from ctypes. This way, it can be distributed from our devpi very

condition.acquire vs lock.acquire

2018-03-27 Thread jayshankar nair via Python-list
   while count[ipID]> 1:   cond.wait()    if ipID == 0:   time.sleep(10)    count[ipID] = count[ipID] + 1    cond.release() // can i replace with lock.release Thanks,Jayshankar -- https://mail.python.org/mailman/listinfo/python-list

ANN: A new version (0.4.2) of python-gnupg has been released.

2018-03-28 Thread Vinay Sajip via Python-list
A new version of the Python module which wraps GnuPG has been released.  What Changed? = This is an enhancement and bug-fix release, and all users are encouraged to upgrade. See the project website [1] for more information.  Brief summary:  * Subkey information is now collected and

Re: julian 0.14 library

2018-04-04 Thread Dale Marvin via Python-list
gt;>> from julian.julian import to_jd, from_jd >>>>File "/usr/local/lib/python2.7/dist-packages/julian/julian.py", line >> 5 >>>> def __to_format(jd: float, fmt: str) -> float: >>>>^ >>>>

ANN: distlib 0.2.7 released on PyPI

2018-04-16 Thread Vinay Sajip via Python-list
ilman/listinfo/python-list

Generating list of rsquared_adj regression values for variating i with loop

2018-04-18 Thread Alexander Hempfing via Python-list
ew list, which contains the rsquared_adj values for i=1, i=2,... i=1000. y stays "static" the whole time. Can someone please help me here? -- https://mail.python.org/mailman/listinfo/python-list

Weird side effect of default parameter

2018-05-03 Thread Robert Latest via Python-list
def __init__(self, x, a=dict()): self.x = x self.a = a self.a[x] = x c = Foo(1) d = Foo(2) print(c.__dict__) print(d.__dict__) robert -- https://mail.python.org/mailman/listinfo/python-list

Re: Weird side effect of default parameter

2018-05-07 Thread Robert Latest via Python-list
Steven D'Aprano wrote: > Python function default values use *early binding*: the default parameter > is evaluated, ONCE, when the function is defined, and that value is used > each time it is needed. Thanks, "early binding" was the clue I was missing. robert -- https:/

Re: stock quotes off the web, py style

2018-05-16 Thread Chris Lindsay via Python-list
>It serves a naked set of data, which happens to conform to the python source code specification for dictionaries and consequently can be compiled into a dictionary with 'eval', like so: I would highly discourage any long-term usage (or any usage) of eval() in this sort of context.

Re: stock quotes off the web, py style

2018-05-16 Thread Brian Oney via Python-list
"https://api.iextrading.com/1.0/stock/IBM/quote"; >).read() >ibm = json.loads(ibm.decode("utf-8")) > >if you are using Python 3. > > >-- >https://mail.python.org/mailman/listinfo/python-list -- https://mail.python.org/mailman/listinfo/python-list

RE: Request for comments: use-cases for delayed evaluation

2018-05-17 Thread Dan Strohl via Python-list
None, return '', otherwise join""" for arg in args: tmp_arg = $(arg) If tmp_arg is None: return " return sep.join(args) -- https://mail.python.org/mailman/listinfo/python-list

RE: why does list's .remove() does not return an object?

2018-05-17 Thread Dan Strohl via Python-list
the objects as well for lookups, or a number of other techniques, but it would be easier to simply get it back during the remove(). Dan Strohl -- https://mail.python.org/mailman/listinfo/python-list

Re: "Data blocks" syntax specification draft

2018-05-21 Thread Chris Lindsay via Python-list
ince us that using mandatory TABs is a good idea? > > > -- > Steve > > -- > https://mail.python.org/mailman/listinfo/python-list > -- Chris Open Cosmos Any opinions given above are my own. -- https://mail.python.org/mailman/listinfo/python-list

RE: "Data blocks" syntax specification draft

2018-05-21 Thread Dan Strohl via Python-list
rther re-considerations, >> e.g. element separation should be now much simpler. >> A lot of examples with comparison included. >> >> >> Comments, suggestions are welcome. >> > >Mikhail, you have a completely different esthetic for syntax than the res

Re: best way to remove leading zeros from a tuple like string

2018-05-21 Thread Wolfram Hinderer via Python-list
to be even simpler. >>> str(tuple(map(int, s[1:-1].split("," '(128, 20, 8, 255, -1203, 1, 0, -123)' Wolfram -- https://mail.python.org/mailman/listinfo/python-list

RE: "Data blocks" syntax specification draft

2018-05-22 Thread Dan Strohl via Python-list
> > Explanation: > [here i'll use same symbol /// for the data entry point, but of course it can > be > changed if a better idea comes later. Also for now, just for simplicity - the > rule > is that the contents of a block starts always on the new line. > >

RE: "Data blocks" syntax specification draft

2018-05-23 Thread Dan Strohl via Python-list
alance between flexibility and complexity. Nothing else in python (that I can think of) forces people to use 4 spaces, that's merely a style thing. If I want to use 2 spaces, I can, I've seen modules that use 3 spaces for indenting and it works fine. So, the flexibility of adding the abilit

RE: Indented multi-line strings (was: "Data blocks" syntax specification draft)

2018-05-23 Thread Dan Strohl via Python-list
iters (and with consistent tabs/spaces). >This leading white space is ignored. > * All the leading white space beyond this 'left edge' is preserved. > * The newlines after the leading '''' and before the trailing '''' are >ignored, all the others preserved. (I thought about preserving the >trailing newline, but it is easier to add one than remove one.) > > hp > > These sound good to me. -- https://mail.python.org/mailman/listinfo/python-list

RE: Indented multi-line strings (was: "Data blocks" syntax specification draft)

2018-05-23 Thread Dan Strohl via Python-list
Or go with a different character (or set of characters) altogether... like $, \, ~, ^, < ? (good catch on it catching on ''''hello' I am not in this''', I forgot about that behavior) I'm not against a prefix character, just throwing out alternatives. (though, to me, the 'i' indicated int) -- https://mail.python.org/mailman/listinfo/python-list

Scripts not downloading Version 3.6.5

2018-05-24 Thread Chester Davies via Python-list
Hi! Yesterday I downloaded the latest version of Python, after some fiddling around with some command line, getting Python to open files etc, it wasn't able to find various pillows, so after a while, I decided to call it a night. I went to finish it off today, and discovered my compute

Scripts not downloading Version 3.6.5

2018-05-24 Thread Chester Davies via Python-list
Hi! Yesterday I downloaded the latest version of Python, after some fiddling around with some command line, getting Python to open files etc, it wasn't able to find various pillows, so after a while, I decided to call it a night. I went to finish it off today, and discovered my compute

RE: Indented multi-line strings (was: "Data blocks" syntax specification draft)

2018-05-31 Thread Dan Strohl via Python-list
> This is of course not a problem if the *trailing* quote determines the > indentation: > > a_multi_line_string = i''' >Py- > thon > ''' I get the point, but it feels like it would be a pain to use, and it

Override built in types... possible? or proposal.

2018-05-31 Thread Dan Strohl via Python-list
and would not be imported when that module was imported. Thoughts? Dan Strohl -- https://mail.python.org/mailman/listinfo/python-list

RE: Override built in types... possible? or proposal.

2018-05-31 Thread Dan Strohl via Python-list
module was imported. > > > > Thoughts? > > > > Dan Strohl > > > > My problem with this idea is that it breaks expectations. If I know one > thing as > a Python programmer, it's that 'Bob' is a str. Each time and every time. If >

RE: Indented multi-line strings

2018-06-01 Thread Dan Strohl via Python-list
ndent or outdent, so this would clean up those pieces. So... how does one go about suggesting changes to the built in types? I could take a whack at the code for it, but my C skills are no where near what should probably be needed for something this close to the core of the language. I'm not sure if adding a couple of methods is a PEP type of thing. Dan Strohl -- https://mail.python.org/mailman/listinfo/python-list

RE: Indented multi-line strings

2018-06-01 Thread Dan Strohl via Python-list
> > It would probably have to go via python-ideas, but if it gets the OK there I > doubt it would need a PEP. > Cool, thanks! > There are a few key questions I'd expect to see come up. > > Why does this need to be a string method? Why can't it be a standalo

RE: Indented multi-line strings

2018-06-04 Thread Dan Strohl via Python-list
ell be called a lot. Dan -- https://mail.python.org/mailman/listinfo/python-list

Help with 'site' package.

2018-06-04 Thread Erik Martinson via Python-list
al/lib/python3.6/site-packages ['/usr/local/lib/python3.6/dist-packages', '/usr/lib/python3/dist-packages', '/usr/lib/python3.6/dist-packages'] True Thanks, Erik "To error is human ... and to blame it on a computer is even more so." -- https://mail.python.org/mailman/listinfo/python-list

site package does not work

2018-06-05 Thread Erik Martinson via Python-list
al/lib/python3.6/site-packages ['/usr/local/lib/python3.6/dist-packages', '/usr/lib/python3/dist-packages', '/usr/lib/python3.6/dist-packages'] True Thanks, Erik -- https://mail.python.org/mailman/listinfo/python-list

Re: Valid encodings for a Python source file

2018-06-07 Thread Ben Finney via Python-list
Daniel Glus writes: > I'm trying to figure out the entire list of possible encodings for a Python > source file - that is, encodings that can go in a PEP 263 > <https://www.python.org/dev/peps/pep-0263/> encoding specification, like # > -*- encoding: foo -*-. What

ANN: A new version (0.4.3) of python-gnupg has been released. It contains a security-related change - please update to this version

2018-06-13 Thread Vinay Sajip via Python-list
A new version of the Python module which wraps GnuPG has been released. What Changed?=This is a security-fix release, and all users are strongly encouraged to upgrade.This fix mitigates against CVE-2018-12020. See the discoverer's blog post [6] formore information. Brief su

Re: text mining

2018-06-16 Thread Brian Oney via Python-list
stion, you were >successful. Answers like these make me also want ask "questions" like those. Thank you. I hope he's drunk. -- https://mail.python.org/mailman/listinfo/python-list

ANN: Version 0.1.5 of sarge (a subprocess wrapper library) has been released.

2018-06-18 Thread Vinay Sajip via Python-list
uot;Command not found" message. - Fixed #38: Replaced ``async`` keyword argument with ``async_``, as ``async``  has become a keyword in Python 3.7. - Fixed #39: Updated tutorial example on progress monitoring. What does Sarge do?--- Sarge tries to make interfacing with ex

RE: syntax difference (type hints)

2018-06-18 Thread Dan Strohl via Python-list
> -Original Message- > From: Python-list On > Behalf Of Schachner, Joseph > Sent: Monday, June 18, 2018 7:58 AM > To: Ed Kellett ; [email protected] > Subject: RE: syntax difference (type hints) > > EXTERNAL MAIL: python-list-bounces+d.strohl=f5@pytho

command line utility for cups

2018-06-20 Thread Brian Oney via Python-list
Dear all, I am having trouble with argparse. I am trying to translate the following line to a sleek python script: lpr -o media=legal -o sides=two-sided-long-edge filename Now where I am. import argparse parser = argparse.ArgumentParser(description='Print stuff with cups') parser.ad

Re: command line utility for cups

2018-06-20 Thread Brian Oney via Python-list
Thanks Peter! That's pretty slick. I will get it working for sure now. Regards, Brian -- https://mail.python.org/mailman/listinfo/python-list

<    36   37   38   39   40   41   42   43   44   45   >