Re: multiprocess passing arguments double asterisks

2016-10-24 Thread Thomas Nyberg
hat you can apply map too, but not with the original function. So then the wrapper function converts the tuple back to what you want originally. Hopefully I'm understanding correctly and hopefully this helps. Cheers, Thomas -- https://mail.python.org/mailman/listinfo/python-list

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

2016-11-10 Thread Thomas Nyberg
tried using the full path to the other binary? Cheers, Thomas -- https://mail.python.org/mailman/listinfo/python-list

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

2016-11-10 Thread Thomas Nyberg
()? https://docs.python.org/2/library/os.html#os.unsetenv Cheers, Thomas -- https://mail.python.org/mailman/listinfo/python-list

Re: Python String Handling

2016-11-11 Thread Thomas Nyberg
"Richard/P") I mean maybe you can't use that, but if you can't use that, then I'm probably not understanding your question. Cheers, Thomas -- https://mail.python.org/mailman/listinfo/python-list

Re: Quick help for a python newby, please

2016-11-23 Thread Thomas Nyberg
d = date(byear, bmonth, bday) Then you could write something like: diff = date.today() - d Of course you'll need to a do a bit more work to deal with years (e.g. has your birthday happened this year yet or not?), but does this not fix your problem? Cheers, Thomas -- https

Re: How to concatenate strings in different lists

2016-11-23 Thread Thomas Nyberg
irs = zip(val_1, val_2) >>> catted_strings = [] >>> for pair in pairs: catted_string = ''.join(pair) catted_strings.append(catted_string) >>> print(catted_strings) ['aA', 'bB', 'cC'] Hope this this helps. Cheers, Thomas -- https://mail.python.org/mailman/listinfo/python-list

Re: Random number help

2016-11-23 Thread Thomas Nyberg
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? random.randint(1,100) works as it will randomly pick numbers between 1 and 100 but say i don't

Re: NameError

2016-11-23 Thread Thomas Nyberg
711/how-to-install-apt-get-or-yum-on-mac-os-x Hopefully this helps. Cheers, Thomas -- https://mail.python.org/mailman/listinfo/python-list

Re: NameError

2016-11-24 Thread Thomas Nyberg
without quotes and press enter) which starts the python interpreter. You should see this: ">>>". After this, then type "import pygame". See if that works. Cheers, Thomas -- https://mail.python.org/mailman/listinfo/python-list

Re: Splitting text into lines

2016-12-13 Thread Thomas Nyberg
ated instances of '\r' or '\n' with '\n'? I.e. something like >>> # the_string is your file all read in >>> import re >>> re.sub("[\r\n]+", "\n", the_string) and then continuing as before (i.e. splitting by newlines, etc.) Does that work? Cheers, Thomas -- https://mail.python.org/mailman/listinfo/python-list

Re: Mapping with continguous ranges of keys

2016-12-15 Thread Thomas Nyberg
property that the next value is greater than your value. After that you spit out the final second value. There might be better ways to find the keys, but I think this approach is probably your best bet. Cheers, Thomas -- https://mail.python.org/mailman/listinfo/python-list

Re: Mapping with continguous ranges of keys

2016-12-15 Thread Thomas Nyberg
On 12/15/2016 12:48 PM, Terry Reedy wrote: On 12/15/2016 12:27 PM, Thomas Nyberg wrote: I haven't dealt with a data structure exactly like this, but it's basically a sparse array. A sparse array has at least half missing values. This one has none on the defined domain, but

Re: Mapping with continguous ranges of keys

2016-12-16 Thread Thomas Nyberg
On 12/15/2016 11:57 PM, Terry Reedy wrote: On 12/15/2016 4:30 PM, Thomas Nyberg wrote: On 12/15/2016 12:48 PM, Terry Reedy wrote: A sparse array has at least half missing values. This one has none on the defined domain, but contiguous dupicates. I'm sorry for devolving into semantics

Re: Problem while building Python 3.6 from source.

2017-01-13 Thread Thomas Nyberg
On 01/13/2017 10:00 AM, Michael S wrote: '*** Error in ./python'" free(): invalid next size (normal): 0x015bdf90 ***'. Are you possibly running out of memory due to the extra concurrent compilations? Cheers, Thomas -- https://mail.python.org/mailman/listinfo/python-list

Re: PEP 393 vs UTF-8 Everywhere

2017-01-20 Thread Thomas Nyberg
ps://wiki.python.org/moin/TimeComplexity Cheers, Thomas -- https://mail.python.org/mailman/listinfo/python-list

Is requests[security] required for python 3.5+ ?

2017-02-02 Thread Thomas Nyberg
nd I am testing out which requirements continue to be required in the version. Thanks for any info. Cheers, Thomas -- https://mail.python.org/mailman/listinfo/python-list

Re: Python gotcha of the day

2018-03-14 Thread Thomas Jollans
s "" ' "' " " "" 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

Re: Python gotcha of the day

2018-03-15 Thread Thomas Jollans
On 2018-03-15 07:11, Ben Finney wrote: > Steven D'Aprano writes: > >> py> """\"" >> '"' > > That's an empty string delimited by ‘"’; followed by a double-quote > character, escaped, delimited by ‘"’; followed by two more empty > strings. They concatenate to a single one-character string. >

Re: lire du son en format natif avec python

2018-03-21 Thread Thomas Jollans
;association francophone Python (afpy) [2]. Ici, écrivez en anglais la prochaine fois s.v.p. [1] https://wiki.python.org/moin/FrenchLanguage [2] https://www.afpy.org/forums Au sujet de votre question: vous pouvez aussi lire et passer ce que vous avez enregistré avec PyAudio. Je pense qu'il faut le pa

Re: I keep getting this error message when i try to run a program in Python

2018-03-22 Thread Thomas Jollans
On 2018-03-22 19:37, Damjan Stojanovski wrote: > i am sorry but i can not find a way to attach an image here so you can see > what i mean. Please someone tell me how to add an image here. > This is a text only list. -- https://mail.python.org/mailman/listinfo/python-list

Re: Putting Unicode characters in JSON

2018-03-22 Thread Thomas Jollans
riting to is opened as UTF-8 text, or the ensure_ascii parameter of dumps() or dump() is set to True (the default) – and then write the data in ASCII or any ASCII-compatible encoding (e.g. UTF-8). Basically, the default behaviour of the json module means you don't really have to worry about encodings at all once your original data is in unicode strings. -- Thomas -- https://mail.python.org/mailman/listinfo/python-list

Re: Entering a very large number

2018-03-23 Thread Thomas Jollans
On 2018-03-23 14:01, ast wrote: > Le 23/03/2018 à 13:43, Rustom Mody a écrit : >> On Friday, March 23, 2018 at 5:46:56 PM UTC+5:30, ast wrote: >>> Hi >>> >>> I found this way to put a large number in >>> a variable. >> >> What stops you from entering the number on one single (v long) line? > > >

Re: Best practice for managing secrets (passwords, private keys) used by Python scripts running as daemons

2018-03-24 Thread Thomas Jollans
On 24/03/18 20:41, Chris Angelico wrote: > On Sun, Mar 25, 2018 at 4:24 AM, Peter J. Holzer wrote: >> On 2018-03-23 11:50:52 -0700, Dan Stromberg wrote: >>> I'd put them in a file with access to the daemon.. >>> >>> Putting credentials in an environment variable is insecure on Linux, >>> because p

Re: julian 0.14 library

2018-04-04 Thread Thomas Jollans
On 2018-04-04 05:44, Chris Angelico wrote: > On Wed, Apr 4, 2018 at 12:24 PM, sum abiut wrote: >> Hi, >> Has anyone try this https://pypi.python.org/pypi/julian/0.14 >> >> i got this error trying to import julian >> > import julian >> Traceback (most recent call last): >> File "", line 1, in

Re: pip problems

2018-04-09 Thread Thomas Jollans
d have an option to remove old Pythons from the PATH. Maybe it does. I wouldn't know. -- Thomas -- https://mail.python.org/mailman/listinfo/python-list

Re: Filtering computer.lang.python

2018-04-10 Thread Thomas Jollans
d some moderation. None (or barely any) of the regulars use Google Groups. Some people use USENET directly and maintain their own extensive filtering regime to make it readable. Probably most of us use the mailing list, because it's just so much nicer! -- Thomas -- https://mail.python.org/mailman/listinfo/python-list

Re: python notifying calling script that multiprocessing tasks have finished at lower level scripts

2018-04-13 Thread Thomas Jollans
On 13/04/18 18:08, Daiyue Weng wrote: > (the structure > is attached as a png file). No it's not. This is a text-only list. (you know what, I'm sick of saying that) > > The execution is sequential, e.g. running script_1, then 2 then 3. > > After executing the 1st sequence (script_1 to 3), mast

Re: Python Import Impossibility

2018-04-13 Thread Thomas Jollans
On 13/04/18 14:48, ?? ?? wrote: > Hello, > > Could you tell me how to import the installed modules ? > > I have successfully installed openpyxl, but > When I executed ‘import openpyxl’, > The following message is displayed: > Traceback (most recent call last): > File "", line 1, in > impor

Re: Instance variables question

2018-04-16 Thread Thomas Jollans
t; "self.x = y", whatever self and y are, sets the attribute "x" of the object "self". Whether "self.x" previously existed does not matter (ignoring descriptors and the like). If you access self.x, whether x exists obviously does matter, and there's

Re: Python Import Impossibility

2018-04-17 Thread Thomas Jollans
2.7, you might as well just uninstall it to save you the headaches. -- Thomas -- https://mail.python.org/mailman/listinfo/python-list

Re: The basics of the logging module mystify me

2018-04-19 Thread Thomas Jollans
ndler (WARNING)> >>> logging.lastResort.setLevel(logging.INFO) # DON'T DO THIS THOUGH >>> log.info('info 2') info 2 >>> Of course you should rather be creating your own handler >>> handler = logging.StreamHandler() >>> handler.setLev

Re: detect laptop open/close from within Python?

2018-04-26 Thread Thomas Jollans
On 26/04/18 17:37, Skip Montanaro wrote: > I'm going through a bout of RSI problems with my wrists, so klst night > I refreshed an old typing watcher program I wrote a couple decades ago > (there's a comment about Python 1.4 in the code!): > > https://github.com/smontanaro/python-bits/blob/master/

Re: setuptools setup.py commands are unintuitive and undiscoverable (--help-commands should replace --help)

2018-04-27 Thread Thomas Jollans
pip anyway. Most packages are on the PyPI, and even where they're not, pip can install directly from source tarballs and git repositories. -- Thomas -- https://mail.python.org/mailman/listinfo/python-list

Re: Question about Decimal and rounding

2018-04-27 Thread Thomas Jollans
t the "obvious" way to check whether a Decimal number is an integer is simply: >>> d1 = Decimal('1.1') >>> d2 = Decimal('3') >>> int(d1) == d1 False >>> int(d2) == d2 True Final thoughts: * Beware of spending too much time on premature

Re: Passing all pandas DataFrame columns to function as separate parameters

2018-04-27 Thread Thomas Jollans
m: if your columns have different types, this will cast some or all of your columns to a different type. It's probably clearer if you start with the column labels: func(*(df.loc[:,col] for col in df.columns)) or use df.items(): func(*(values for col, values in df.items())) -- Thom

Re: In numpy, why is it ok to do matrix.mean(), but not ok to do matrix.median()?

2018-05-01 Thread Thomas Jollans
On 01/05/18 19:57, C W wrote: > matrix.median()# throws error message READ error messages. At the very least, quote error messages when asking questions somewhere like here. There I was, wondering why the numpy docs didn't mention ndarray.median when you were clearly using it... Anyway,

Re: itemgetter with default arguments

2018-05-04 Thread Thomas Jollans
On 2018-05-04 15:01, Steven D'Aprano wrote: > A re-occurring feature request is to add a default to itemgetter and > attrgetter. For example, we might say: > > from operator import itemgetter > f = itemgetter(1, 6, default="spam") # proposed feature > f("Hello World!") # returns ('e', 'W') > f(

Re: itemgetter with default arguments

2018-05-04 Thread Thomas Jollans
On 04/05/18 22:38, Ian Kelly wrote: > On Fri, May 4, 2018 at 11:04 AM, Steven D'Aprano > wrote: >> On Fri, 04 May 2018 09:17:14 -0600, Ian Kelly wrote: >> >>> On Fri, May 4, 2018 at 7:01 AM, Steven D'Aprano >>> wrote: Here are the specifications: * you must use lambda, not def; >>>

Re: f-string anomaly

2018-05-14 Thread Thomas Jollans
On 2018-05-14 04:08, Terry Reedy wrote: > On 5/13/2018 3:22 PM, Ken Kundert wrote: > > Please do not double post. > >> I am seeing an unexpected difference between the behavior of the string >> format method and f-strings. > > Read > https://docs.python.org/3/reference/lexical_analysis.html#form

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

2018-05-22 Thread Thomas Jollans
On 2018-05-20 23:54, Paul wrote: > you will find several useful sites where you can test regexes. Regex > errors are very common, even after you have experience with them. What's the benefit of those compared to simply trying out the regex in a Python console? -- https://mail.python.org/mailman/

Re: '_' and '__'

2018-05-26 Thread Thomas Jollans
x27;d actually want to name a variable, of course. As such, _ has become an idiomatic name for dummy variables, i.e. something you use when syntax requires you to give a variable name, but you don't actually want one (probably because you're throwing the variable away). This mostly happe

Re: String encoding in Py2.7

2018-05-29 Thread Thomas Jollans
hes the default encoding required by your console. This is usually the case as long as you stay on the same PC, but this assumption can fall apart quite easily when you move code and data between systems, especially if they use different operating systems or (human) languages. Just use Python 3. There, the print function is not magic, which makes life so much more logical. -- Thomas -- https://mail.python.org/mailman/listinfo/python-list

Re: Attachments

2018-06-06 Thread Thomas Jollans
On 06/06/18 02:48, Ben Finney wrote: > "Peter J. Holzer" writes: >> (I remember that I have seen some messages in the past where an >> attachment was obviously missing. Maybe specific content types are >> stripped, but not attachments in general) > > Yes. There may be exceptions, but “don't expec

Re: Stefan's headers [was:Names and identifiers]

2018-06-07 Thread Thomas Jollans
On 07/06/18 22:36, Peter Pearson wrote: > X-Copyright: (C) Copyright 2018 Stefan Ram. All rights reserved. Distribution > through any means > other than regular usenet channels is forbidden. It is forbidden to publish > this article in the > Web, to change URIs of this article into links,

Re: Valid encodings for a Python source file

2018-06-08 Thread Thomas Jollans
16 that are not sufficiently ASCII-compatible. Of course, as Terry Reedy writes, > For new code for python 3, don't use an encoding cookie. Use an editor that > can save in utf-8 and tell it to do so if it does not do so by default. -- Thomas -- https://mail.python.org/mailman/listinfo/python-list

Re: Stefan's headers [was:Names and identifiers]

2018-06-08 Thread Thomas Jollans
On 08/06/18 14:13, Ned Batchelder wrote: > On 6/8/18 2:34 AM, Thomas Jollans wrote: >> On 07/06/18 22:36, Peter Pearson wrote: >> >>> X-Copyright: (C) Copyright 2018 Stefan Ram. All rights reserved. >>> Distribution through any means >>>    other than r

Re: File names with slashes [was Re: error in os.chdir]

2018-07-03 Thread Thomas Jollans
On 2018-07-03 14:06, Mikhail V wrote: > Greg wrote: > >> Mikhail V wrote: >>> s= "\"s\"" -> >>> s= {"s"} >> >> But now you need to find another way to represent set literals. > > > I need to find? That comment was not about (current) Python but > rather how I think string should have been

Re: installing sklearn

2018-07-04 Thread Thomas Jollans
cikit-learn doesn't provide Python 3.7 binaries yet. They do provide binaries for Python 3.6. So the simplest solution to your immediate problem might be to stick with Python 3.6 for the time being until all the packages you rely on have been updated. -- Thomas -- https://mail.python.org/mailman/listinfo/python-list

Re: 转发: No pip for my Python 3.6.5!

2018-07-09 Thread Thomas Jollans
Welcome to the list! On 2018-07-09 10:14, 卢 嘉幸 wrote: > But there comes the error message !!! > > What is going wrong? Without you telling us what "the error message" is, I'm afraid there's no way anybody can possibly know. -- Thomas -- https://mail.python.org/mailman/listinfo/python-list

Re: Guido van Rossum resigns as Python leader

2018-07-14 Thread Thomas Jollans
On 13/07/18 00:20, Roel Schroeven wrote: > Yes, you read that right: Guido van Rossum resigns as Python leader. > > See his mail: > (https://mail.python.org/pipermail/python-committers/2018-July/005664.html) Thanks for posting this here, Roel. Much appreciated. Guido has been fantastic, and he w

Re: Can anyone tell me where the old MacPython "16 ton" logo came from?

2018-07-15 Thread Thomas Jollans
On 15/07/18 14:49, Christian Heimes wrote: > On 2018-07-15 14:05, Mark wrote: >> I'm curious to understand how come the original MacPython logo is of a 16 >> ton weight (rather than, say the word 'python' or a picture of a snake)? >> You can see the logo here: https://homepages.cwi.nl/~jack/macpyt

Re: logging from time critical tasks -- QueueListener().stop() takes the whole CPU

2018-07-15 Thread Thomas Jollans
On 16/07/18 07:39, Gerlando Falauto wrote: > On Monday, July 16, 2018 at 6:56:19 AM UTC+2, dieter wrote: >>> ... >>> Why is the main thread taking up so much CPU? >>> I believe at this point listener.stop() should only be waiting for the >>> helper thread to terminate, which I reckon would be impl

Re: logging from time critical tasks -- QueueListener().stop() takes the whole CPU

2018-07-15 Thread Thomas Jollans
On 16/07/18 08:24, Gerlando Falauto wrote: > On Monday, July 16, 2018 at 8:13:46 AM UTC+2, Thomas Jollans wrote: >> On 16/07/18 07:39, Gerlando Falauto wrote: >>> On Monday, July 16, 2018 at 6:56:19 AM UTC+2, dieter wrote: >>>>> ... >>>>> Why i

Re: Users banned

2018-07-17 Thread Thomas Jollans
On 2018-07-16 01:29, Jon Ribbens wrote: > On 2018-07-15, Chris Angelico wrote: >> On Mon, Jul 16, 2018 at 7:35 AM, Marko Rauhamaa wrote: >>> Christian Gollwitzer : Am 15.07.18 um 19:25 schrieb Ethan Furman: > The following users are now banned from Python List: > ... > BartC

Re: Users banned

2018-07-17 Thread Thomas Jollans
On 18/07/18 00:10, Jon Ribbens wrote: > On 2018-07-17, Thomas Jollans wrote: >> On 2018-07-16 01:29, Jon Ribbens wrote: >>> Do you have any reason to believe the message at the top of the >>> thread purporting to ban users was genuinely from the moderators? >>&g

Re: can't install/run pip (Latest version of Python)

2018-07-18 Thread Thomas Jollans
On 2018-07-18 02:47, S Lea wrote: > What do you use, Gene? > It seems most business program run on Windows. Many of us here use Linux. Some just rather like it and could use any OS, while for others, software they rely on for work might only work properly, or work better, on Linux. (This might be

Re: What is the pattern for this number set?

2018-07-18 Thread Thomas Jollans
to be able to create the > table. How do you calculate the values? > > ChrisA > Or, at least, what do the numbers mean? What game do they apply to? - Thomas -- https://mail.python.org/mailman/listinfo/python-list

Re: What is the pattern for this number set?

2018-07-18 Thread Thomas Jollans
opy it by hand. > On Wed, Jul 18, 2018 at 4:01 PM Thomas Jollans wrote: >> >> On 18/07/18 23:43, Chris Angelico wrote: >>> On Thu, Jul 19, 2018 at 7:16 AM, wrote: >>>> This is a chart I made using BASIC back in the 90s when I could still >>>> do ma

Re: Make, Sphinx and Windows

2018-07-22 Thread Thomas Jollans
On 22/07/18 05:24, Abdur-Rahmaan Janhangeer wrote: > normally when you use make with sphinx, it should build and tell you errors > (so that reviewers don't have to correct it manually) i have been doing > some contribs to french docs translation but my make is a bit crazy : > > https://www.pythonm

Re: print & string formatting

2018-07-22 Thread Thomas Jollans
On 22/07/18 06:54, Cameron Simpson wrote: > On 21Jul2018 21:33, Sharan Basappa wrote: >> I get a lot confused while using print functions in Python. >> >> For example, I get the same results for the following code: >> >> str = "one two three" > > Pleasetry not to name variables after builtin clas

Re: Better way / regex to extract values form a dictionary

2018-07-22 Thread Thomas Jollans
On 21/07/18 14:39, Ganesh Pal wrote: >> The dictionary is irrelevant to your question. It doesn't matter whether >> the path came from a dict, a list, read directly from stdin, an >> environment variable, extracted from a CSV file, or plucked directly from >> outer space by the programmer. The proc

Re: list of lists

2018-07-22 Thread Thomas Jollans
On 22/07/18 14:53, Sharan Basappa wrote: > Thanks. I initially thought about this but did not know if this is legal > syntax. In this kind of situation – you think you know how to do something but you're not quite sure if it'll work as intended – just try it! Start up an interactive interpreter,

Re: ongoing browser projects

2018-07-22 Thread Thomas Jollans
o half as well as they already do it. You can use webkit (of safari/chrome/etc. fame), or you can use gecko (mozilla). Webkit is easy to embed with PyQt or PyGObject/gtk+3. I don't know about gecko. -- Thomas > > thanks, > > Abdur-Rahmaan Janhangeer > https://

Re: ongoing browser projects

2018-07-23 Thread Thomas Jollans
On 23/07/18 03:43, Akkana Peck wrote: > There used to be a Python-WebKit-GTK2 library that was fairly easy > to use and even had documentation, but it's been orphaned for years, > and in any case a lot of the modern web no longer works with the old > WebKit engine. You'd think there would be someth

Re: ongoing browser projects

2018-07-23 Thread Thomas Jollans
On 23/07/18 09:00, Thomas Jollans wrote: > On 23/07/18 03:43, Akkana Peck wrote: >> There used to be a Python-WebKit-GTK2 library that was fairly easy >> to use and even had documentation, but it's been orphaned for years, >> and in any case a lot of the modern web no

Re: Tracking a memory leak in C extension - interpreting the output of PYTHONMALLOCSTATS

2018-07-23 Thread Thomas Jollans
tes) https://github.com/python/cpython/blob/b18f8bc1a77193c372d79afa79b284028a2842d7/Objects/obmalloc.c#L1327 Have fun debugging! -- Thomas > > How do I use the info produced by PYTHONMALLOCSTATS do get to the > culprit of the leak? Is there anything wrong in my reasoning here? >

Re: curses, ncurses or something else

2018-07-23 Thread Thomas Jollans
On 24/07/18 00:24, John Pote wrote: > Ideas invited. This doesn't answer your question at all, but when I want a small script to produce largish streams of numbers, I write them to a (csv) file and plot them using matplotlib then and there. -- https://mail.python.org/mailman/listinfo/python-list

Re: Python 2.7.14 and Python 3.6.0 netcdf4

2018-07-23 Thread Thomas Jollans
On 24/07/18 00:39, [email protected] wrote: > from netCDF4 import Dataset > > I had: > > Traceback (most recent call last): > File "", line 1, in > ModuleNotFoundError: No module named 'netCDF4' > > > What can I do to solve this error for Python 3.6.0 I

Re: Format list of list sub elements keeping structure.

2018-07-24 Thread Thomas Jollans
On 24/07/18 08:25, Mark Lawrence wrote: > On 24/07/18 06:41, Sayth Renshaw wrote: >> On Tuesday, 24 July 2018 14:25:48 UTC+10, Rick Johnson  wrote: >>> Sayth Renshaw wrote: >>> elements = [['[{0}]'.format(element) for element in elements]for elements in data] >>> >>> I would suggest you a

Re: Confused on git commit tree about Lib/datetime.py

2018-08-01 Thread Thomas Jollans
on and the different ways hg and git have of doing things. -- Thomas -- https://mail.python.org/mailman/listinfo/python-list

Re: Confused on git commit tree about Lib/datetime.py

2018-08-01 Thread Thomas Jollans
On 01/08/18 12:49, Chris Angelico wrote: On Wed, Aug 1, 2018 at 8:40 PM, Thomas Jollans wrote: On 01/08/18 05:16, Jeffrey Zhang wrote: I found a interesting issue when checking the Lib/datetime.py implementation in python3 This patch is introduced by cf86e368ebd17e10f68306ebad314eea31daaa1e

Re: Problems with wxPython _core_.pyd on windows98

2018-08-03 Thread Thomas Jollans
On 02/08/18 18:02, Wanderer wrote: I have a laptop with windows 98 I use to connect to the OBD2 port on my car. I'm trying to install pyobd. I have a build for Python 2.7 for Windows98 that works but I'm having trouble with running wxPython. I get the following error. I'm sure you have your rea

Non-unicode file names

2018-08-08 Thread Thomas Jollans
ng happened in true UNIX style) Demo script to try at home below. -- Thomas # -*- coding: UTF-8 -*- from __future__ import unicode_literals, print_function import sys import os.path import subprocess import tempfile import shutil script = 'print(__file__)\n' file_names = ['

Re: Non-unicode file names

2018-08-08 Thread Thomas Jollans
On 09/08/18 01:48, MRAB wrote: > On 2018-08-08 23:16, Thomas Jollans wrote: >> On *nix, file names are bytes. In real life, we prefer to think of file >> names as strings. How non-ASCII file names are created is determined by >> the locale, and on most systems these days, ev

Re: Non-unicode file names

2018-08-09 Thread Thomas Jollans
On 09/08/18 05:13, INADA Naoki wrote: > Please use Python 3.7. > > Python 3.7 has several improvements on this area. Thanks! Darkly remembering something about UTF-8 mode, I suspected it might... > > * When PEP 538 or 540 is used, default error handler for stdio is > surrogateescape > * You can

Re: using python's logo in your own logo

2018-08-09 Thread Thomas Jollans
On 09/08/18 10:13, Abdur-Rahmaan Janhangeer wrote: > in short, > > can you use python's logo in your own logo without credit? > > yours, > > Abdur-Rahmaan Janhangeer > https://github.com/Abdur-rahmaanJ > Mauritius > See https://www.python.org/community/logos/ and https://www.python.org/psf/tra

Re: Pylint false positives

2018-08-14 Thread Thomas Jollans
f.method_b(42)**3 @abstractmethod def method_b(self, answer): """ This is a great place to put a docstring """ You *can* raise NotImplementedError in your abstractmethods, but I don't think it's really necessary. You

Re: How to pass Python command line options (vs arguments) when running script directly vs via Python interpreter?

2018-08-15 Thread Thomas Jollans
On 14/08/18 23:45, Malcolm Greene wrote: > When you run a script via "python3 script.py" you can include command > line options like -b, -B, -O, -OO, etc between the "python3" interpreter > reference and the script.py file, eg. "python3 -b -B -O -OO script.py". > When you create a script that is ex

Re: How to pass Python command line options (vs arguments) when running script directly vs via Python interpreter?

2018-08-16 Thread Thomas Jollans
On 2018-08-16 01:05, Chris Angelico wrote: > On Thu, Aug 16, 2018 at 8:51 AM, Cameron Simpson wrote: >> And as an additional alternative, when I want something weird (extra python >> args or the like) I usually make my script.py into a module and invoke it >> via a shell script, eg: >> >> #!/bin/

Re: How to pass Python command line options (vs arguments) when running script directly vs via Python interpreter?

2018-08-16 Thread Thomas Jollans
On 2018-08-16 14:33, Chris Angelico wrote: > On Thu, Aug 16, 2018 at 8:32 PM, Thomas Jollans wrote: >> On 2018-08-16 01:05, Chris Angelico wrote: >>> On Thu, Aug 16, 2018 at 8:51 AM, Cameron Simpson wrote: >>>> And as an additional alternative, when I want something

Re: Writing bytes to stdout reverses the bytes

2018-08-20 Thread Thomas Jollans
On 2018-08-20 04:22, Chris Angelico wrote: > On Mon, Aug 20, 2018 at 12:01 PM, Grant Edwards > wrote: >> On 2018-08-20, Ben Bacarisse wrote: >>> It is if you run it as hd. >> >> What do you mean "run it as hd"? >> >> I don't have an "hd" in my path. > > Your system is different from mine, then.

Re: Writing bytes to stdout reverses the bytes

2018-08-20 Thread Thomas Jollans
On 2018-08-20 17:07, Akkana Peck wrote: >> Thomas Jollans : >>> Wonderful. Now why don't we all forget about hexdump and use xxd? ;-) > > Marko Rauhamaa writes: >> Fedora: >> >>$ xxd >>bash: xxd: command not found >>$ hd &

Re: zpifile.py error - no crc 32 attribute

2018-08-22 Thread Thomas Jollans
. Then I'm sure we can help you figure out what went wrong. If you installed from source and you didn't have zlib headers installed at the time, I could imagine this happening... but I have no idea if Python would even build without zlib. -- Thomas "# ./testx.py None &quo

Re: Broken pip

2018-08-29 Thread Thomas Jollans
y over /usr/bin/pip (e.g. by putting ~/.local/bin/ near the front of your $PATH) If things break, you now know how to undo the damage thanks to Larry ;-) Also, PLEASE use Python 3. Still using Python 2 today is like still using Windows XP in early 2013. https://pythonclock.org/ -- Thomas > u

Re: Broken pip

2018-08-29 Thread Thomas Jollans
be/ a Python 4. Maybe Python 4.0 will be the version after 3.9 (doubtful IMHO). Maybe it'll come later. Maybe it never will. It certainly won't include any major breaking changes, and considering PEP 394, I could imagine that when the time comes we will see /usr/bin/python3 pointing to /usr/bin/python4.0 (as silly as that sounds). -- Thomas -- https://mail.python.org/mailman/listinfo/python-list

Re: Shall I worry about python2/3 compatibility when using library?

2018-08-31 Thread Thomas Jollans
On 31/08/18 04:27, Stone Zhong wrote: Hi there, I think the fact is: - There are still considerable amount of people still using python2 - Python2 user will eventually upgrade to python3 So any library not written in a compatible way will either break now for python2 user, or will break in the

Re: Verifying the integrity/lineage of a file

2018-08-31 Thread Thomas Jollans
On 2018-08-31 16:36, Malcolm Greene wrote: > I have use case where I need to distribute binary files to customers and > want to provide a way for our customers to verify the > "integrity/lineage" (I know there's a better description, but can't > think of it) of these files, eg. to give them the con

Re: Anaconda with Python 3.7

2018-09-03 Thread Thomas Jollans
On 2018-09-03 11:38, gvim wrote: > Anyone have any idea when Anaconda might ship a version compatible with > Python 3.7. I sent them 2 emails but no reply. > > gvim You can install Python 3.7 in a conda environment right now. Most packages (certainly all the ones I use) appear to be available for

Re: Error installing libraries

2018-09-03 Thread Thomas Jollans
On 2018-09-03 09:10, ojas gupta wrote: > error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft > Visual C++ Build Tools": > http://landinghub.visualstudio.com/visual-cpp-build-tools > > > Command ""c:\users\ojas > gupta\appdata\loc

Re: Anaconda with Python 3.7

2018-09-03 Thread Thomas Jollans
a different Python version, and all the conda-installed (Python) packages will be installed in the new Python version. https://conda.io/docs/user-guide/tasks/manage-environments.html -- Thomas PS: Please always make sure you reply on-list. > > AK > > On Mon, Sep 3, 2018 at

Re: Cross platform mutex to prevent script running more than instance?

2018-09-04 Thread Thomas Jollans
roach for *nix daemons, but as you say, it does have its own drawbacks. -- Thomas -- https://mail.python.org/mailman/listinfo/python-list

Re: Hi I'm trying to get live data from stock using python , is it possible?

2018-09-04 Thread Thomas Jollans
On 2018-09-04 18:22, [email protected] wrote: > On Tuesday, September 4, 2018 at 7:21:31 PM UTC+3, [email protected] wrote: >> Hi , >> for example: >> I want to know if AAPL is more than value 300 and if it does I want it to >> send to me mail with gmail :) . thanks for the help.. Of course

Re: Any SML coders able to translate this to Python?

2018-09-04 Thread Thomas Jollans
ation, (lambda X=Y: A)() So, isqrt = (lambda n: 0 if n == 0 else (lambda r=isqrt(n//4): 2*r if n < (2*r+1)**2 else 2*r+1)()) This is obviously the same as your multi-expression function, with the addition of the integer division as suggested by Marko. Cheers, Tho

Re: Verifying the integrity/lineage of a file

2018-09-04 Thread Thomas Jollans
On 2018-09-04 16:13, Grant Edwards wrote: > On 2018-09-01, Peter Pearson wrote: > >> Writing your own crypto software is fraught with peril, and that >> includes using existing libraries. > > Writing your own crypto software isn't a problem, and it can be very > educational. > > Just don't _use

Re: Anaconda with Python 3.7

2018-09-05 Thread Thomas Jollans
On 2018-09-03 11:38, gvim wrote: > Anyone have any idea when Anaconda might ship a version compatible with > Python 3.7. I sent them 2 emails but no reply. > > gvim You can install Python 3.7 in a conda environment right now. Most packages (certainly all the ones I use) appear to be available for

Re: Anaconda with Python 3.7

2018-09-05 Thread Thomas Jollans
a different Python version, and all the conda-installed (Python) packages will be installed in the new Python version. https://conda.io/docs/user-guide/tasks/manage-environments.html -- Thomas PS: Please always make sure you reply on-list. > > AK > > On Mon, Sep 3, 2018 at 6:13 AM Th

Re: Error installing libraries

2018-09-05 Thread Thomas Jollans
On 2018-09-03 09:10, ojas gupta wrote: > error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-to ols > > > Command ""c:\users\ojas gupta\appdata\local\progr

Re: Cross platform mutex to prevent script running more than instance?

2018-09-05 Thread Thomas Jollans
't work cross machine, if that is an issue. I think a PID file is the traditional approach for *nix daemons, but as you say, it does have its own drawbacks. -- Thomas -- https://mail.python.org/mailman/listinfo/python-list

Re: Hi I'm trying to get live data from stock using python , is it

2018-09-05 Thread Thomas Jollans
On 2018-09-04 18:22, [email protected] wrote: > On Tuesday, September 4, 2018 at 7:21:31 PM UTC+3, [email protected] wrote: >> Hi , >> for example: >> I want to know if AAPL is more than value 300 and if it does I want it to send to me mail with gmail :) . thanks for the help.. Of course it's

Re: fsxNet Usenet gateway problem again

2018-09-06 Thread Thomas Jollans
On 2018-09-06 15:50, Michael Torrie wrote: > On 09/05/2018 02:30 PM, Chris Angelico wrote: >> I don't think this was spamming the list with the same question; a >> glitch somewhere in a netnews server appears to be re-posting some old >> posts. > > I wonder why this bbs gateway in New Zealand keep

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