Re: Clean Singleton Docstrings

2016-07-07 Thread Michael Selik
> On Jul 7, 2016, at 7:46 PM, Rob Gaddi > wrote: > > I've got a package that contains a global ensmartened dict that allows > all the various parts of my program to share state. The simplest solution would be to use a module as your singleton. For example, "registry.py" would work. Pydoc wil

Re: Quick poll: gmean or geometric_mean

2016-07-09 Thread Michael Selik
On Sat, Jul 9, 2016 at 10:17 AM Jason Friedman wrote: > > +1 for consistency > What do other languages use? Even though I generally prefer complete words instead of abbreviations, if an abbreviation is a strong standard across many statistics modules (like "stdev" instead of "standard_deviation

Re: Quick poll: gmean or geometric_mean

2016-07-09 Thread Michael Selik
On Sat, Jul 9, 2016, 12:57 PM Robert Kern wrote: > On 2016-07-09 17:13, Michael Selik wrote: > > On Sat, Jul 9, 2016 at 10:17 AM Jason Friedman > wrote: > > > >>> +1 for consistency > > > > What do other languages use? > > R, the m

Re: Quick poll: gmean or geometric_mean

2016-07-10 Thread Michael Selik
On Sun, Jul 10, 2016, 4:56 AM Steven D'Aprano wrote: > On Sun, 10 Jul 2016 05:28 pm, Rustom Mody wrote: > > > From fuzzy memory of sitting in statistics classes decades ago > > filled with μ-σ etc I'd suggest μ gμ hμ > > In all the stats books and references I've seen, μ is always the population

Re: Quick poll: gmean or geometric_mean

2016-07-10 Thread Michael Selik
On Sun, Jul 10, 2016, 5:08 AM Chris Angelico wrote: > On Sun, Jul 10, 2016 at 8:08 PM, Steven D'Aprano > wrote: > >> Now even the basic IPython shell has autocomplete :-) > > > > Not all shells or editors are IPython, and not all abbreviations are bad. > > Would you rather print, or > > write_va

Re: Curious Omission In New-Style Formats

2016-07-11 Thread Michael Torrie
On 07/11/2016 01:27 PM, Ian Kelly wrote: > On Mon, Jul 11, 2016 at 12:54 PM, Terry Reedy wrote: >> In any case, I think it an improvement to say that '0x00123' has a field >> width of 7 rather than a 'precision' of 5. >> > '{:#07x}'.format(0x123) # specifiy field width >> '0x00123' > "%#0

Re: Compression of random binary data

2016-07-11 Thread Michael Selik
On Mon, Jul 11, 2016, 10:56 AM wrote: > What kind of statistic law or mathematical conjecture or is it even a > physical law is violated by compression of random binary data? > If you get lucky, you might be able to achieve very good compression. > http://dilbert.com/strip/2001-10-25 Or are y

Re: Compression of random binary data

2016-07-12 Thread Michael Torrie
On 07/12/2016 11:46 AM, [email protected] wrote: > Well the algorithm start with looking up a suitable folding structure > "close enough to the number", then it works down the folding > structure finding the fold where the difference or sum between the > folds closest to zero. > > You do t

Re: [OT] Compression of random binary data

2016-07-13 Thread Michael Torrie
On 07/13/2016 03:46 AM, [email protected] wrote: > It is not that the data is not compressible i just need more chunks > or random data, it is the footprint of the algorithm that has a > certain it is a structure afterall albeit richer in interpretation > than the numerical field. Err, no,

Re: Touch screen development in Python

2016-07-13 Thread Michael Torrie
On 07/13/2016 01:33 PM, Jahn wrote: > I would like to learn more how to write python based touch application > for embedded system but I do not know what conditions a touch screen must > have so that it > will response to touch. > Does anyone know? These days GUI toolkits such as GTK+ or Qt pr

Re: Were is a great place to Share your finished projects?

2016-07-13 Thread Michael Torrie
On 07/13/2016 01:00 AM, Chris Angelico wrote: > On Wed, Jul 13, 2016 at 4:44 PM, Steven D'Aprano > wrote: >> Even if Github was 100% open source with no proprietary extensions, and the >> *technical* cost of leaving was low, the single-network effect would still >> lock >> you in, which leaves yo

Re: reversed(enumerate(x))

2016-07-20 Thread Michael Selik
> On Jul 20, 2016, at 12:42 PM, Ian Kelly wrote: > >for i, n in reversed(enumerate(x)): pass > > fails with "TypeError: argument to reversed() must be a sequence". So make it a sequence: for i, n in reversed(list(enumerate(x))): pass If ``x`` is very large, you can use your zip/range

Re: Stupid question, just need a quick and dirty fix

2016-07-21 Thread Michael Selik
> On Jul 22, 2016, at 12:39 AM, Jordan Bayless wrote: > > Posting the entire code snippet is tough because it's thousands of lines of > code. You could paste into a GitHub gist (https://gist.github.com/) and share the link. -- https://mail.python.org/mailman/listinfo/python-list

Re: Stupid question, just need a quick and dirty fix

2016-07-22 Thread Michael Selik
On Fri, Jul 22, 2016 at 2:11 AM Steven D'Aprano wrote: > On Fri, 22 Jul 2016 03:18 pm, Michael Selik wrote: > >> On Jul 22, 2016, at 12:39 AM, Jordan Bayless > wrote: > >> > >> Posting the entire code snippet is tough because it's thousands of lines &

Re: Dynamically call methods where method is known by address vs name

2016-07-22 Thread Michael Selik
On Fri, Jul 22, 2016 at 4:05 PM Malcolm Greene wrote: > I know I can do the following: > > >>> s = 'lower' > >>> getattr(s, 'upper')() > 'LOWER' > > But how could I do the same if I had the method 'address' (better > name???) vs. method name? > > >>> upper_method = s.upper > > How do I combine th

Re: Why not allow empty code blocks?

2016-07-24 Thread Michael Torrie
On 07/24/2016 07:14 PM, BartC wrote: > I've done little Python coding but still, having to use kid gloves for > indents does figure quite a bit in that. > > I can give some more examples but I'll probably be told that I'm using > the wrong tools! Which suggest there is a problem, but the effort

Is there a documented pylibpd (pure data wrapper/library) API?

2016-07-26 Thread Michael Sperone
Hi everyone, I'm starting using the libpd wrapper/library for python (pylibpd), to load and use my pure data patches within Python. I was wondering if there was any online documentation for this python version? At the least I'm looking for a list of classes and methods. Thank you! Mike -- http

Re: Why not allow empty code blocks?

2016-07-30 Thread Michael Torrie
On 07/30/2016 11:53 AM, Steven D'Aprano wrote: > On Sun, 31 Jul 2016 02:29 am, Rustom Mody wrote: > >> MIT on practical reasons for python over scheme: >> > https://www.wisdomandwonder.com/link/2110/why-mit-switched-from-scheme-to-python >> Berkeley on fundamental reasons for the opposite choice:

Re: Why not allow empty code blocks?

2016-07-31 Thread Michael Torrie
On 07/31/2016 10:04 AM, D'Arcy J.M. Cain wrote: > On Sun, 31 Jul 2016 11:53:47 -0400 > "D'Arcy J.M. Cain" wrote: >> On Mon, 01 Aug 2016 00:25:58 +1000 >> On the other hand I have no throwaway accounts. Every address I use >> is a primary one. I have all sorts of methods to block spam. None of >

Re: usage of functools.partial in in parallelism

2016-08-01 Thread Michael Selik
On Sun, Jul 31, 2016 at 5:47 AM Sivan Greenberg wrote: > That's exactly the answer I was looking for. Thanks. > > I got used too much I guess to solving problems the OOP way, e.g. my code > wraps the session.get invocation with a class to pack together the > arguments and data and also took care

Re: Using valid emails

2016-08-01 Thread Michael Torrie
On 08/01/2016 10:32 AM, D'Arcy J.M. Cain wrote: > On Sun, 31 Jul 2016 14:01:26 -0600 > Michael Torrie wrote: >>> So I have to examine every address I reply to or deal with the >>> bounce message later. Way to move your spam problem to someone >>> else. >

Re: usage of functools.partial in in parallelism

2016-08-01 Thread Michael Torrie
On 08/01/2016 01:13 AM, Michael Selik wrote: > You might benefit from watching the talk "Stop Writing Classes" > https://www.youtube.com/watch?v=o9pEzgHorH0 Great talk! Thanks for posting that. -- https://mail.python.org/mailman/listinfo/python-list

Re: Ide or code editor confusion

2016-08-04 Thread Michael Torrie
On 08/04/2016 01:23 AM, Lawrence D’Oliveiro wrote: > On Friday, July 22, 2016 at 2:38:10 AM UTC+12, Chris Angelico wrote: >> On Fri, Jul 22, 2016 at 12:22 AM, sigmaphine1914 wrote: >>> Beginning Python: using Python 2.6 and Python 3.1. By James Payne >>> >>> Part II. >> >> Ugh, that's extremely ol

Re: Capturing the bad codes that raise UnicodeError exceptions during decoding

2016-08-04 Thread Michael Selik
On Thu, Aug 4, 2016 at 3:24 PM Malcolm Greene wrote: > Hi Chris, > > Thanks for your suggestions. I would like to capture the specific bad > codes *before* they get replaced. So if a line of text has 10 bad codes > (each one raising UnicodeError), I would like to track each exception's > bad code

Re: Python slang

2016-08-05 Thread Michael Selik
On Fri, Aug 5, 2016 at 10:12 PM Chris Angelico wrote: > That answers the question about True and False, but not about None, > which started the question. Why are instances capitalized here? Is it > simply a matter of grandfathering in, with no specific decision? > When people ask me why the core

Re: Python slang

2016-08-06 Thread Michael Torrie
On 08/05/2016 07:14 PM, Steven D'Aprano wrote: > In English, we refer to ourselves in the first person as I, me, myself, and > sometimes "self", never as "this". One can say "this one has a hat", for > example, but it sounds weird, like something the Borg would say about a > specific Borg unit. Sa

Re: Python slang

2016-08-06 Thread Michael Torrie
On 08/06/2016 08:27 PM, Clayton Kirkwood wrote: > You can always tell the correctness by removing the other person. If it > doesn't sound right then, then it is wrong. You don't say 'I gave to I', or > 'I gave to me', it is 'I gave to myself'. Yup good point, and I failed at that obviously. Good

Re: How do I make a game in Python ?

2016-08-06 Thread Michael Torrie
On 08/06/2016 03:51 PM, Cai Gengyang wrote: > As in, any recommended websites that helps users create complex games in > Python ? I imagine you create a complex game in Python the same way you'd do it in just about any other language. Thus any website on game design would be broadly applicable.

Re: How do I make a game in Python ?

2016-08-07 Thread Michael Torrie
On 08/07/2016 08:47 AM, Cai Gengyang wrote: > Games are great. I guess I would like to invent animated games that > can teach students how to solve mathematical, physics, engineering , > Go and programming puzzles, basic financial literacy and investing > techniques through interesting and enrichin

Re: Make sure you removed all debugging print statements error

2016-08-08 Thread Michael Torrie
On 08/08/2016 06:20 AM, [email protected] wrote: > Hello guys! I was answering a question on a piece of homework of > mine. Sadly I can't answer it correctly due to the repetitive error > being "Make sure you removed all debugging print statements." > Hopefully one of you guys can help me sol

Re: Question regarding stdlib distutils strtobool behavior

2016-08-09 Thread Michael Selik
On Tue, Aug 9, 2016 at 9:26 AM Joseph Bane wrote: > Hello. > > It recently came to my attention that the strtobool function in the > standard library doesn't return Python native boolean values, but rather > returns integer 0 or 1: > > https://hg.python.org/cpython/file/3.5/Lib/distutils/util.py#

Re: Question regarding stdlib distutils strtobool behavior

2016-08-09 Thread Michael Selik
ot sure if those changes are worthwhile. As a side note, we discovered this with some code that was checking `if var > is True` instead of just `if var`. > The Pythonic style is to simply check ``if var`` rather than ``if var is True``. This realizes the flexibility of duck typing -- it

Re: Call for Assistance

2016-08-09 Thread Michael Selik
On Tue, Aug 9, 2016 at 3:23 AM Charles Ross wrote: > I’ve begun a new book called Meta Python that I’m looking for assistance > with. The book is one I wish was out there, and so am writing. The book is > targeted at experienced programmers who are novice Python users and want to > move from that

Re: [Tutor] Unable to get the gateway IP of wlan interface using python code

2018-11-12 Thread Michael Torrie
On 11/12/2018 05:55 PM, David Rock wrote: > Is there a requirement to use only what comes in the standard libraries, or > can you use things from pypi? > Getting interface details is exactly why netifaces was created > > https://pypi.org/project/netifaces/ Also if working with NetworkManager is

Re: Have I Been Banned?

2018-11-24 Thread Michael Torrie
On 11/20/2018 09:39 AM, Jon Ribbens wrote: > On 2018-11-20, Wildman wrote: >> In the past I have participated in the group without any >> problems. I access the forum through the usenet mirror >> and I am still using the same newsreader and account. >> Recently I made some followup posts to the g

Re: Begginers problem : tar: Error opening archive: Can't initialize filter; unable to run program "bzip2 -d

2018-12-29 Thread Michael Torrie
On 12/29/2018 01:15 AM, Rand .J wrote: > I'm trying to run this code from : https://github.com/pnnl/*safekit* ,using > cmd on windows 10, I already installed python. when I type the command: tar > -xjvf data_examples.tar.bz2 > > I keep getting the error: tar: Error opening archive: Can't initializ

Re: the python name

2019-01-04 Thread Michael Torrie
On 01/03/2019 06:35 PM, Gene Heskett wrote: > On Thursday 03 January 2019 15:28:49 Grant Edwards wrote: >> About 20 years ago, the RedHat Linux (way before RHEL) installer >> (which was written in Python) was called Anaconda. > Thanks for rescuing my old wet ram Grant, thats exactly what I was >

Re: Pythonic Y2K

2019-01-18 Thread Michael Torrie
On 01/16/2019 12:02 PM, Avi Gross wrote: > I recall the days before the year 2000 with the Y2K scare when people > worried that legacy software might stop working or do horrible things once > the clock turned. It may even have been scary enough for some companies to > rewrite key applications and e

Re: How do I get a python program to work on my phone?

2019-01-28 Thread Michael Torrie
On 2019-01-28 8:29 a.m., Steve wrote: > I now want to run it on my MotoG phone. The program accepts keyed in data > and will access two text files to keep data and I would like to have the > program chime my phone to remind me to take the next reading. > > First step is to get it running in my ph

Re: How do I get a python program to work on my phone?

2019-01-29 Thread Michael Torrie
On 2019-01-29 5:52 a.m., Bob Gailer wrote: > An interesting alternatives to create a simple web page to run in the > phone's browser. If you don't already have a server on the web you can rent > one from secure dragon for as low as $12 a year. Install websocketd and > python. Websocketd lets you do

Re: How do I get a python program to work on my phone?

2019-01-29 Thread Michael Torrie
On 2019-01-29 8:44 a.m., Michael Torrie wrote: > There have been some Python to javascript compilers, or implementations > of Python in Javascript. So maybe it's possible to make a hybrid app > using Python. Here's an interesting project that might work with some hyb

Re: How to replace space in a string with \n

2019-01-31 Thread Michael Poeltl
maybe this is an alternative way to get your wished result. >>> text = "The best day of my life!" >>> newtext = '\n'.join( text.split() ) >>> print(newtext) The best day of my life! >>> yours Michael * ^Bart [2019-01-31 10:22]: > Hello

Re: How to replace space in a string with \n

2019-01-31 Thread Michael Poeltl
hi, Maybe this is a proper way to do what you'd liked to achieve >>> text = "The best day of my life!" >>> newtext = '\n'.join( text.split() ) >>> print(newtext) The best day of my life! >>> yours Michael * ^Bart [2019-01-31 10:22]:

Re: How to replace space in a string with \n

2019-01-31 Thread Michael Poeltl
hi, ^Bart ended in a Mail-Delivery... so I send it ONLY to the python-list ^Bert, a proper way to do what you'd liked to achieve is the following: >>> text = "The best day of my life!" >>> newtext = '\n'.join( text.split() ) >>> print(ne

Re: How to replace space in a string with \n

2019-01-31 Thread Michael Poeltl
ed with the if-statement within the for(-loop) block happy learning the python-language! It's a great one, this I can promise you! regards Michael * Peter Otten <[email protected]> [2019-01-31 11:15]: > ^Bart wrote: > > >> Why? > > > > It's a school test,

Re: Python program to phone?

2019-02-07 Thread Michael Torrie
On 02/07/2019 09:00 PM, Steve wrote: > BeeWare looks as if it requires Java, does it? > Is it exclusively java? Kind of. You do your coding in Python, then that's compiled to python byte code, which is then translated to Java byte code. You'll need the Android SDK, even if you're not using Java

Re: Convert a list with wrong encoding to utf8

2019-02-14 Thread Michael Torrie
On 02/14/2019 12:02 PM, [email protected] wrote: > Τη Πέμπτη, 14 Φεβρουαρίου 2019 - 8:16:40 μ.μ. UTC+2, ο χρήστης Calvin > Spealman έγραψε: >> If you see something like this >> >> '\xce\x86\xce\xba\xce\xb7\xcf\x82 >> \xce\xa4\xcf\x83\xce\xb9\xce\xac\xce\xbc\xce\xb7\xcf\x82' >> >> then you d

Re: ANN: Creating GUI Applications with wxPython

2019-02-27 Thread Michael Torrie
On 02/27/2019 11:36 AM, Karsten Hilbert wrote: > On Wed, Feb 27, 2019 at 10:38:25AM -0500, Dave wrote: > >> * GUI relatively easy to understand and implement. easyGUI is truly easy in >> all areas, but fails some of my other requirements. The QT/PyQT/PySide2 >> situation is a mess - which one to

Re: ANN: Creating GUI Applications with wxPython

2019-02-27 Thread Michael Torrie
On 02/27/2019 10:59 AM, Igor Korot wrote: > Hopefully with the wxQt having more and more development we might have > a wxQt/Android port getting attention. I don't think Qt has any plans to support Android with the traditional Qt framework. They've instead focused on their next generation system,

Re: "use strict"

2019-03-12 Thread Michael Torrie
On 03/11/2019 01:00 PM, Abdur-Rahmaan Janhangeer wrote: > the problem was that i was reviewing the code, since everything worked (no > errors but wrong output for sure) it took sometimes to find that var. it > was like someone telling me there is fish in that lake and i was throwing > my line tryin

Re: subprocess svn checkout password issue

2019-03-16 Thread Michael Torrie
On 03/16/2019 10:08 AM, Grant Edwards wrote: > I don't know about svn specifically, but in the past it was typical > for programs requiring passwords and assuming interactive usage to > issue the password prompt to and read the password from /dev/tty, > rather than stdin/stdout. That allowed their

Re: Reasoning of calling a method on class object instead of class instance object

2019-03-18 Thread Michael Torrie
On 03/18/2019 05:55 PM, Ben Finney wrote: >> If I call `_c_to_f`, `_f_to_c` methods on `self` instead of >> `RefrigeratedShippingContainer` class object, still it works. > > That's right, and is indeed the point of making a static method on a > class. I'm confused. The methods that refer to Refi

Re: Reasoning of calling a method on class object instead of class instance object

2019-03-18 Thread Michael Torrie
On 03/18/2019 07:09 PM, Ben Finney wrote: > Arup Rakshit writes: > > Michael Torrie writes: > >> On 03/18/2019 05:55 PM, Ben Finney wrote: >>>> If I call `_c_to_f`, `_f_to_c` methods on `self` instead of >>>> `RefrigeratedShippingContainer` class ob

Re: Determining latest stable version for download

2019-03-20 Thread Michael Torrie
On 03/20/2019 07:10 PM, Tim Johnson wrote: > * Ian Kelly [190320 12:00]: >> 1) https://www.python.org/downloads/ has release information. Based on that >> you would currently want 3.7.2. Make sure you actually download 3.7.2 and >> not 3.7.2rc1. > Understood. Thanks. Your info is the solution.

Re: Determining latest stable version for download

2019-03-21 Thread Michael Torrie
On 03/21/2019 09:36 AM, Tim Johnson wrote: > Michael, I should have asked the following question: > Would I be able to install from the EPEL Repository or the Redhat > Software Collections to a local ~/bin? I am not sure, but have my doubts. Software Collections distributes softwa

Re: Function to determine list max without itertools

2019-04-19 Thread Michael Torrie
On 04/19/2019 04:01 AM, Sayth Renshaw wrote: > def max_try(listarg): > myMax = listarg[0] > try: > for item in listarg: > if item > myMax: > myMax = item > except TypeError: > print(f'Only numbers are supported, this entry "{item}" was not') >

Re: Error Opening Python for Windows Download

2019-05-13 Thread Michael Torrie
On 05/12/2019 04:42 PM, Alexandra Mistak wrote: > Hi Python, > > I have unsuccessfully downloaded Python Windows x86-64 executable installer > multiple > times. > > After installation, when I go to launch the program it tells me to

Re: Why Python has no equivalent of JDBC of Java?

2019-05-20 Thread Michael Torrie
On 05/20/2019 04:23 PM, Andrew Z wrote: > What does 249 specification mention about drivers? Nothing that I can see. But it stands to reason that at some point the Python code is going to have to interface with the SQL database server's API. And when the database in question is proprietary, the o

Re: PEP 594 cgi & cgitb removal

2019-05-24 Thread Michael Torrie
On 05/24/2019 01:24 PM, Marko Rauhamaa wrote: > There's a programming language arms race. Python wants to beat Java, C# > and go in the everything-for-everybody game. Python developers seem to > take the popularity of the language as proof of success. Pride goes > before the fall. I don't see this

Re: PEP 594 cgi & cgitb removal

2019-05-24 Thread Michael Torrie
On 05/24/2019 04:27 AM, Jon Ribbens via Python-list wrote: > On 2019-05-23, Gunnar Þór Magnússon wrote: >>> nginx is the current hotness. CGI has not been hotness since the >>> mid 90s. >> >> Serverless is the new hotness, and serverless is CGI. Technology is >> cyclical. > > Sorry, in what sense

Re: Checking refusal of a network connection

2019-06-01 Thread Michael Torrie
On 06/01/2019 11:15 AM, Markus Elfring wrote: >>> connect(3, {sa_family=AF_INET, sin_port=htons(37351), >>> sin_addr=inet_addr("127.0.0.1")}, 16) = -1 ECONNREFUSED (Connection refused) >> >> Without seeing the code, I'd be suspicious of that difference. > > I would expect that the IPv4 addre

Re: FDs will be closed after exception automatically in python2.7?

2019-06-10 Thread Michael Torrie
On 06/10/2019 04:18 AM, lampahome wrote: > as title, > > I confused will fd will be close after exception automatically? > Like: > try: > fd=open("file","w+") > fd.get() //any useless function of fd > except Exception: > print 'hi' No. What if you want to work with the fd object afte

Re: How control a GUI for an unrelated application from a Python script?

2019-06-13 Thread Michael Torrie
On 06/13/2019 05:49 PM, Christian Seberino wrote: > I have a third party GUI that manages some hardware. > > I want to control the hardware from a Python script. > > This seems to mean I need to somehow have Python code > that imitates a human doing the necessary > actions on the GUI (selec

Re: Use global, or not

2019-06-29 Thread Michael Torrie
On 06/29/2019 05:42 AM, Cecil Westerhof wrote: > That was the other possibility I was thinking about. And that would be > maybe better. Because I now do things like: > global_dict['messages']['created'].format(len(filepathArr)) > > much better would be: > instance.created(len(filepathArr))

Re: How do you insert an item into a dictionary (in python 3.7.2)?

2019-06-29 Thread Michael Torrie
On 06/28/2019 09:06 AM, CrazyVideoGamez wrote: > How do you insert an item into a dictionary? For example, I make a dictionary > called "dictionary". > > dictionary = {1: 'value1', 2: 'value3'} > > What if I wanted to add a value2 in the middle of value1 and value3? How about: dict[1.5] = 'valu

Re: Handle foreign character web input

2019-06-30 Thread Michael Torrie
On 06/30/2019 06:21 AM, Richard Damon wrote: > On 6/30/19 4:00 AM, moi wrote: >> Unfortunately not. >> >> The only thing Python succeeds to propose is a mechanism >> which does the opposite of UTF-8 when it comes to handle >> memory *and* - at the same time - which also does the opposite >> of UTF-

Re: Do I need a parser?

2019-07-02 Thread Michael Torrie
On 07/02/2019 12:47 PM, Thomas Jollans wrote: > Obviously, as Cameron points out, using Python instead of a custom > scripting language has security implications, that go with the increased > power that the user has. I've always found this kind of thing to be a bit strange. I do understand where

Re: What's wrong on using Popen's communicate method?

2019-07-05 Thread Michael Torrie
On 07/05/2019 09:03 PM, [email protected] wrote: > From Vista to Win10? That's a three generation gap! Buy a new PC might be > a better solution:-) Maybe. Windows 10 would probably run okay on that machine. It might be 10 years old, but if it's 64-bit, Win 10 should run on it. You could a

Re: Proper shebang for python3

2019-07-20 Thread Michael Speer
You may want to use `#!/usr/bin/env python3` instead. There is a concept in python called the virtual environment. This used to be done with a tool called virtualenv in python2, and is now done mainly through a venv module in python3. A virtual environment goes into a directory of your choosing a

Re: Proper shebang for python3

2019-07-24 Thread Michael Torrie
On 7/24/19 4:20 PM, Cameron Simpson wrote: > That is some progress, hooray. Then there's just sbin -> bin to go. I suppose in the olden days sbin was for static binaries, usable in single user mode for recovering the system without the main drive mounted. In more recent times, binaries that are

Re: Boolean comparison & PEP8

2019-07-28 Thread Michael Torrie
On 7/28/19 5:55 AM, Jonathan Moules wrote: > But this appears to be explicitly called out as being "Worse" in PEP8: > > """ > Don't compare boolean values to True or False using ==. > > Yes:   if greeting: > No:    if greeting == True: > Worse: if greeting is True: > """ Yet the recommended solu

Re: Boolean comparison & PEP8

2019-07-28 Thread Michael Torrie
On 7/28/19 6:04 PM, Chris Angelico wrote: > This is a fairly unusual case, though. More commonly, the default > would be None, not False, and "if bar is None:" is extremely well > known and idiomatic. Ahh yes, true. > This analysis is correct, but the situations where you *actually* want > to kno

Re: help with tkinter

2019-08-09 Thread Michael Torrie
On 8/9/19 4:52 AM, Peter J. Holzer wrote: > On 2019-08-09 10:34:34 +0300, Ahmad Adam Kabbara wrote: >> so when I write from >> tkinter import* >> t=Tk() >> tkinter.colorchooser.askcolor() >> I get this error message >> Traceback (most recent call last): >> File "C:\Users\kabba\Desktop\color and c

Re: Web framework for static pages

2019-08-12 Thread Michael Torrie
On 8/12/19 1:14 AM, morphex wrote: > What frameworks are there for generating static web pages in Python? What are > the features of each? A quick google search reveals a number of them. Pelican, Hyde, etc. -- https://mail.python.org/mailman/listinfo/python-list

Re: How should we use global variables correctly?

2019-08-22 Thread Michael Torrie
On 8/22/19 10:00 AM, Windson Yang wrote: > I can 'feel' that global variables are evil. I also read lots of articles > proves that (http://wiki.c2.com/?GlobalVariablesAreBad). However, I found > CPython Lib use quite a lot of `global` keyword. So how should we use > `global` keyword correctly? IIUC

Re: if STREAM.isatty():

2019-08-30 Thread Michael Torrie
On Fri, Aug 30, 2019, 05:02 Hongyi Zhao On Fri, 30 Aug 2019 17:53:02 +1000, Chris Angelico wrote: > > (Also, why the sleep? Seems unnecessary.) > > Because without using sleep, the stuff on screen will display very > shortly and then disappear. Is this not your testing result? No it is not. Wha

Re: "How to protect the python code"

2019-09-05 Thread Michael Torrie
On 9/5/19 2:48 AM, Saba Kauser wrote: > I am looking for ways available to protect the python source code > from being available to users for write/modify. Is it a good idea to > think that python source code can be protected? In general, no, not with an interpreted language. Intellectual property

Re: Renaming an import

2019-09-05 Thread Michael Speer
pkg/graph.py: from graphing_module_b import plot, axis pkg/foobar.py: from .graph import plot, axis Would it be sufficient to use a file for indirection? On Thu, Sep 5, 2019 at 7:11 PM Rob Gaddi wrote: > I'm trying to figure out how to rename an import globally for an entire > packa

Re: What about idea of making a "Pythonic Lisp"...i.e. a Lisp that more closely resembles the syntax of Python?

2019-09-15 Thread Michael Torrie
On 9/14/19 8:19 PM, Louis Valence wrote: > I had to read this twice. It confused the hell out of me. Anyhow, I > suppose you should take a look at > > https://github.com/hylang/hy Yup that's probably exactly the opposite of what the OP was asking about. Neat, though. -- https://mail.pytho

Re: What about idea of making a "Pythonic Lisp"...i.e. a Lisp that more closely resembles the syntax of Python?

2019-09-15 Thread Michael Torrie
On 9/15/19 9:10 AM, Christian Seberino wrote: > Say if I may ask a tangential question...I've always wondered whether it > would be not too hard to compile Python source code to a Lisp like source > code? How hard would it be to say compile Python source to Clojure source? I'm sure a compiler c

Re: Python shows error on line 15 that i cant fix

2019-09-21 Thread Michael Torrie
On 9/21/19 12:51 PM, Dave Martin wrote: > You seem to have the expectation that you know more about coding than > me and that you can insult me without me retaliating. If I were you, > I would leave this forum and never respond to another person question > again, if you think that you can rudely ra

Re: How can I set the value of the textedit box and slider of ui with the value from a config file when it has been created?

2019-10-01 Thread Michael Torrie
On 10/1/19 9:51 AM, Spencer Du wrote: > Hi > How can I set the value of the textedit box and slider of ui with the value > from a config file when it has been created meaning if a configuration file > exists then set the UI with value from the config file otherwise load ui with > nothing set to

Re: uses both shell and python codes in one script.

2019-10-03 Thread Michael Torrie
On 10/3/19 8:15 AM, James Lu wrote: > I would use IPython as a scripting language. It has a slow startup time > though. Lately I've been using Xonsh, which is a much more comfortable application of Python to shell scripting than anything else I've tried. Occasionally subprocess mode selection vs P

Re: how can i run python script in spamassassin

2019-10-03 Thread Michael Torrie
On 10/3/19 1:10 PM, Doris Marca Guaraca wrote: > > Hello, I'm sorry to bother you, I just reviewed this post, the Python > beginner, the Linux beginner, needs to run spamassassin, and now I'm trying > to do something very similar with a Python script is for a project, maybe you > can help me th

Re: Print to Paper

2019-10-04 Thread Michael Torrie
On 10/4/19 8:59 AM, Daniel wrote: > How to do a code to print to paper? please post here a "Hello World" > code to be printed on paper with an inkjet. What operating system? Are you using a graphical UI toolkit or is this a command-line program you're making? -- https://mail.python.org/mailman/

Re: question about making an App for Android

2019-10-10 Thread Michael Torrie
On 10/10/19 9:47 AM, pyotr filipivich wrote: > What I want is a "simple" program to calculate and display the > "natural time", and do so on my phone. > > "A simple program" to divide the amount of "today's" daylight into 12 > even '"hours", so that Dawn begins the First hour, the third hour is >

Re: python -m pip install and pip install

2019-10-10 Thread Michael Torrie
On 10/10/19 1:21 AM, Pankaj Jangid wrote: > So the scripts will just work fine if you simply use ~import pip~ > and work with it. > > Suppose you were writing bash scripts around python programs. Then > what will be the behaviour of, > > pip2 install mod > > under a python3 environment. If Pyth

Re: upgrading python on raspbian

2019-10-14 Thread Michael Torrie
On 10/14/19 8:52 AM, Gene Heskett wrote: > I think thats the obvious path forward. Once ported, we don't have to > worry about that legacy stuff for two or 3 generations of linux. A worthy goal and I'm sure the LinuxCNC folk would be grateful for contributions. Be aware that porting the python

Re: upgrading python on raspbian

2019-10-14 Thread Michael Torrie
On 10/14/19 10:00 AM, Michael Torrie wrote: > https://github.com/LinuxCNC/linuxcnc/issues/403 > > Whatever you do, you probably will want to discuss it on the github > issue tracker to make sure efforts aren't duplicated. Reading further, it appears that the binding and embed

Re: web scraper

2019-10-26 Thread Michael Torrie
On 10/25/19 9:19 AM, joseph pareti wrote: > but can it be generalized? > Not all tags are in the form ofto just replace those tags in the code, should > one process a different website? Not really, no. There is not an easy way to generalize this sort of web scraping. There are many different

Re: Is there some python libary for edit iso file drectly?

2019-11-04 Thread Michael Torrie
On 11/4/19 4:11 PM, Hongyi Zhao wrote: > Is there some python libary for edit iso file drectly? Isn't an ISO image a read-only sort of thing? If you want to modify files don't you have to create a whole new image? -- https://mail.python.org/mailman/listinfo/python-list

Re: How execute at least two python files at once when imported?

2019-11-06 Thread Michael Torrie
On 11/6/19 9:16 AM, Spencer Du wrote: > I just wanted a way to import at least two python files in parallel > and I wanted to know how this can be done or a reason why its bad as > stated in another post. It's not "bad," but it's also not possible. Nor does it make sense. That's why so many people

Re: Using Makefiles in Python projects

2019-11-10 Thread Michael Torrie
On 11/9/19 5:09 PM, Skip Montanaro wrote: > I thought recent versions of Win10 had a full Ubuntu subsystem. Before > that, doesn't something like Cygwin still exist/work? Sure you can install Ubuntu into the WSL2 system, but it's not like you can use that to script things back into Windows land. T

Re: Help!

2019-11-11 Thread Michael Torrie
On 11/11/19 12:07 PM, Jack Gilbert wrote: > Here's the deal, I have loaded both, one at a time, 3.7.2, and tried 3.8.0, > separately, when I go to open the program to run I get the same message, > Each time and for each version I get a Setup window. asking to modify, > repair, or uninstall, I usu

Re: Can we use Python for hacking?

2019-11-11 Thread Michael Torrie
On 11/11/19 9:49 PM, Abdur-Rahmaan Janhangeer wrote: > Someone requested my answer to the question: "Can we use Python for > hacking?" Sigh. I suppose it's a lost battle to reclaim that word. Most of what I do with Python is hacking but likely not as you are using the word. Most recently I hack

Re: Help!

2019-11-12 Thread Michael Torrie
As always, keep your messages on the mailing list so others can benefit. On 11/12/19 7:02 AM, Jack Gilbert wrote: > > . how do I get the PY program onto my desktop? Not quite sure what you mean. Python programs are saved into text files which you can store anywhere you want. Save them to the l

Re: nonlocal fails ?

2019-11-14 Thread Michael Torrie
On 11/14/19 7:15 AM, R.Wieser wrote: > Too bad though, it means that procedures that want to share/use its callers > variables using nonlocal can never be called from main. And that a caller > of a procedure using nonlocal cannot have the variable declared as global > (just tested it). nonloc

Re: nonlocal fails ?

2019-11-14 Thread Michael Torrie
On 11/14/19 10:57 AM, R.Wieser wrote: >> I know of no sane way that a function could work with the scope of >> any arbitrary caller. > > The trick seems to be to emulate a "by reference" call, by using a mutable > object as the argument and stuff the value inside of it (IIRC a tuple with a > sin

Re: nonlocal fails ?

2019-11-14 Thread Michael Torrie
On 11/14/19 10:57 AM, R.Wieser wrote: > The trick seems to be to emulate a "by reference" call, by using a mutable > object as the argument and stuff the value inside of it (IIRC a tuple with a > single element). I note that you didn't answer the question, what are you trying to accomplish? In o

Re: nonlocal fails ?

2019-11-14 Thread Michael Torrie
On 11/14/19 2:16 PM, R.Wieser wrote: > I think I did - though implicitily. What do normal people use "by > reference" arguments for ? Yep, that is what I wanted too. Well I've only seen this done in languages where other mechanisms for returning complex types are not present. For example in C

<    7   8   9   10   11   12   13   14   15   16   >