Re: Numpy and Terabyte data

2018-01-03 Thread Albert-Jan Roskam
On Jan 2, 2018 18:27, Rustom Mody wrote: > > Someone who works in hadoop asked me: > > If our data is in terabytes can we do statistical (ie numpy pandas etc) > analysis on it? > > I said: No (I dont think so at least!) ie I expect numpy (pandas etc) > to not work if

Simple graphic library for beginners

2018-01-10 Thread Jan Erik Moström
I'm looking for a really easy to use graphic library. The target users are teachers who have never programmed before and is taking a first (and possible last) programming course. I would like to have the ability to draw lines, circles, etc. Nothing fancy, as little window management as possibl

Re: Simple graphic library for beginners

2018-01-11 Thread Jan Erik Moström
On 10 Jan 2018, at 13:40, Jan Erik Moström wrote: I'm looking for a really easy to use graphic library. The target users are teachers who have never programmed before and is taking a first (and possible last) programming course. Thanks for all the suggestions, I'm going to take

Re: Tuple unpacking inside lambda expressions

2022-04-20 Thread Albert-Jan Roskam
On Apr 20, 2022 13:01, Sam Ezeh wrote: I went back to the code recently and I remembered what the problem was. I was using multiprocessing.Pool.pmap which takes a callable (the lambda here) so I wasn't able to use comprehensions or starmap Is there anything for situations

Register multiple excepthooks?

2022-07-31 Thread Albert-Jan Roskam
log_uncaught_errors() so it does both things? Thanks! Albert-Jan -- https://mail.python.org/mailman/listinfo/python-list

Re: Register multiple excepthooks?

2022-08-04 Thread Albert-Jan Roskam
On Aug 1, 2022 19:34, Dieter Maurer wrote: Albert-Jan Roskam wrote at 2022-7-31 11:39 +0200: >   I have a function init_logging.log_uncaught_errors() that I use for >   sys.excepthook. Now I also want to call another function (ffi.dlclose()) >   upon

Book/resource recommendation about Celery?

2022-09-15 Thread Albert-Jan Roskam
Hi, I'm using Flask + Celery + RabbitMQ. Can anyone recommend a good book or other resource about Celery?  Thanks! Albert-Jan -- https://mail.python.org/mailman/listinfo/python-list

Re: Find the path of a shell command

2022-10-14 Thread Albert-Jan Roskam
On Oct 14, 2022 18:19, "Peter J. Holzer" wrote: On 2022-10-14 07:40:14 -0700, Dan Stromberg wrote: > Alternatively, you can "ps axfwwe" (on Linux) to see environment > variables, and check what the environment of cron (or similar) is.  It > is this environment (mostly) that

Yaml.unsafe_load error

2022-10-19 Thread Albert-Jan Roskam
code below. Thanks! Albert-Jan Python 3.6.8 (default, Nov 16 2020, 16:55:22) [GCC 4.8.5 20150623 (Red Hat 4.8.5-44)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import yaml >>> f

Re: Yaml.unsafe_load error

2022-10-19 Thread Albert-Jan Roskam
On Oct 19, 2022 13:02, Albert-Jan Roskam wrote:    Hi,    I am trying to create a celery.schedules.crontab object from an external    yaml file. I can successfully create an instance from a dummy class "Bar",    but the crontab class seems call __setsta

Re: Keeping a list of records with named fields that can be updated

2022-12-17 Thread Albert-Jan Roskam
On Dec 15, 2022 10:21, Peter Otten <[email protected]> wrote: >>> from collections import namedtuple >>> Row = namedtuple("Row", "foo bar baz") >>> row = Row(1, 2, 3) >>> row._replace(bar=42) Row(foo=1, bar=42, baz=3) Ahh, I always thought these are undocumen

Re: How to enter escape character in a positional string argument from the command line?

2022-12-21 Thread Albert-Jan Roskam
On Dec 21, 2022 06:01, Chris Angelico wrote: On Wed, 21 Dec 2022 at 15:28, Jach Feng wrote: > That's what I am taking this path under Windows now, the ultimate solution before Windows has shell similar to bash:-) Technically, Windows DOES have a shell similar to bash. It'

Re: Fast lookup of bulky "table"

2023-01-16 Thread Albert-Jan Roskam
On Jan 15, 2023 05:26, Dino wrote: Hello, I have built a PoC service in Python Flask for my work, and - now that the point is made - I need to make it a little more performant (to be honest, chances are that someone else will pick up from where I left off, and implement

Re: LRU cache

2023-02-18 Thread Albert-Jan Roskam
:         _cache.pop()     try:         return _cache[arg]     except KeyError:         result = expensivefunc(arg)         _cache[arg] = result         return result Albert-Jan -- https://mail.python.org/mailman/listinfo/python-list

Re: LRU cache

2023-02-18 Thread Albert-Jan Roskam
On Feb 18, 2023 17:28, Rob Cliffe via Python-list wrote: On 18/02/2023 15:29, Thomas Passin wrote: > On 2/18/2023 5:38 AM, Albert-Jan Roskam wrote: >>     I sometimes use this trick, which I learnt from a book by Martelli. >>     Instead of try/exc

Re: Packaging/MANIFEST.in: Incude All, Exclude .gitignore

2021-03-13 Thread Albert-Jan Roskam
you could call a simple bash script in a git hook that syncs your MANIFEST.in with your .gitignore. Something like: echo -n "exclude " > MANIFEST.in cat .gitignore | tr '\n' ' ' >> MANIFEST.in echo "graft $(readlink -f ./keep/this)" >> MANIFEST.in https://docs.python.org/2/distuti

Re: .title() - annoying mistake

2021-03-21 Thread Albert-Jan Roskam
On 20 Mar 2021 23:47, Cameron Simpson wrote: On 20Mar2021 12:53, Sibylle Koczian wrote: >Am 20.03.2021 um 09:34 schrieb Alan Bawden: >>The real reason Python strings support a .title() method is surely >>because Unicode supports upper, lower, _and_ title case letters, and

Async requests library with NTLM auth support?

2021-06-01 Thread Albert-Jan Roskam
Hi, I need to make thousands of requests that require ntlm authentication so I was hoping to do them asynchronously. With synchronous requests I use requests/requests_ntlm. Asyncio and httpx [1] look promising but don't seem to support ntlm. Any tips? Cheers! Albert-Jan

Re: Async requests library with NTLM auth support?

2021-06-03 Thread Albert-Jan Roskam
> Asyncio and httpx [1] look promising but don't seem to support ntlm. Any tips? ==> https://pypi.org/project/httpx-ntlm/ Not sure how I missed this in the first place. :-) -- https://mail.python.org/mailman/listinfo/python-list

Async code across Python versions

2021-06-03 Thread Albert-Jan Roskam
is it better to use 3rd party libraries? It seems that things get a little easier with newer Python versions, so it might also a reason to simplify the code. Cheers! Albert-Jan -- https://mail.python.org/mailman/listinfo/python-list

Recommendation for drawing graphs and creating tables, saving as PDF

2021-06-11 Thread Jan Erik Moström
I'm doing something that I've never done before and need some advise for suitable libraries. I want to a) create diagrams similar to this one https://www.dropbox.com/s/kyh7rxbcogvecs1/graph.png?dl=0 (but with more nodes) and save them as PDFs or some format that can easily be converted to PD

Re: argparse support of/by argparse

2021-07-23 Thread Albert-Jan Roskam
>>> [1] https://pypi.org/project/clize/ I use and like docopt (https://github.com/docopt/docopt). Is clize a better choice? -- https://mail.python.org/mailman/listinfo/python-list

Re: Tracing in a Flask application

2021-08-09 Thread Albert-Jan Roskam
Hi, logging.basicConfig(level="DEBUG") ..in e.g __init__.py AJ On 4 Aug 2021 23:26, Javi D R wrote: Hi I would like to do some tracing in a flask. I have been able to trace request in plain python requests using sys.settrace(), but this doesnt work with F

Ansible, pip and virtualenv

2021-10-31 Thread Albert-Jan Roskam
in advance! Albert-Jan -- https://mail.python.org/mailman/listinfo/python-list

Re: How to apply a self defined function in Pandas

2021-10-31 Thread Albert-Jan Roskam
> df['URL'] = df.apply(lambda x: connect(df['URL']), axis=1) I think you need axis=0. Or use the Series, df['URL'] = df.URL.apply(connect) -- https://mail.python.org/mailman/listinfo/python-list

Call julia from Python: which package?

2021-12-17 Thread Albert-Jan Roskam
.html# * https://pypi.org/project/juliacall/ * https://github.com/JuliaPy/PyCall.jl Thanks in advance! Albert-Jan -- https://mail.python.org/mailman/listinfo/python-list

Re: Call julia from Python: which package?

2021-12-21 Thread Albert-Jan Roskam
e how this Julia/Python interaction might work. The little bit of experience with Julia more or less coincides with what Oscar mentioned: a lot of "warm up" time. This is actually a py2.7 project that I inherited. I was asked to convert it to py3.8. Thanks and merry xmas

Re: Gunicorn - HTTP and HTTPS in the same instance?

2022-01-08 Thread Albert-Jan Roskam
to easily set the transfer encoding to gzip Albert-Jan -- https://mail.python.org/mailman/listinfo/python-list

Re: Waht do you think about my repeated_timer class

2022-02-03 Thread Albert-Jan Roskam
On Feb 2, 2022 23:31, Barry wrote: > On 2 Feb 2022, at 21:12, Marco Sulla wrote: > > You could add a __del__ that calls stop :) Didn't python3 make this non deterministic when del is called? I thought the recommendation is to not rely on __del__ in python3 code

Pypy with Cython

2022-02-03 Thread Albert-Jan Roskam
f the program (e.g a modulo 11 digit check) are implemented in Cython. Should I use pure Python instead when using Pypy? I compiled the Cython modules for pypy and they work, but I'm afraid they might just slow things down. Thanks! Albert-Jan -- https://mail.python.org/mailman/listi

Re: Pypy with Cython

2022-02-03 Thread Albert-Jan Roskam
On Feb 3, 2022 17:01, Dan Stromberg wrote: > The best answer to "is this slower on > Pypy" is probably to measure. > Sometimes it makes sense to rewrite C > extension modules in pure python for pypy. Hi Dan, thanks. What profiler do you recommend I normally us

Re: Error installing requirements

2022-02-19 Thread Albert-Jan Roskam
On Feb 18, 2022 08:23, Saruni David wrote: >> Christian Gohlke's site has a Pillow .whl for python 2.7: https://www.lfd.uci.edu/~gohlke/pythonlibs/#pillow -- https://mail.python.org/mailman/listinfo/python-list

Re: Long running process - how to speed up?

2022-02-19 Thread Albert-Jan Roskam
On Feb 19, 2022 12:28, Shaozhong SHI wrote: I have a cvs file of 932956 row and have to have time.sleep in a Python script.  It takes a long time to process. How can I speed up the processing?  Can I do multi-processing? Perhaps a dask df:  https://docs.dask.org/

Re: One-liner to merge lists?

2022-02-25 Thread Albert-Jan Roskam
If you don't like the idea of 'adding' strings you can 'concat'enate: >>> items = [[1,2,3], [4,5], [6]] >>> functools.reduce(operator.concat, items) [1, 2, 3, 4, 5, 6] >>> functools.reduce(operator.iconcat, items, []) [1, 2, 3, 4, 5, 6] The latter is the functio

Re: SQLAlchemy: JSON vs. PickleType vs. raw string for serialised data

2022-02-28 Thread Albert-Jan Roskam
On Feb 28, 2022 10:11, Loris Bennett wrote: Hi, I have an SQLAlchemy class for an event:   class UserEvent(Base):   __tablename__ = "user_events"   id = Column('id', Integer, primary_key=True)   date = Column('date', Date, nullable=False)  

Marshmallow: json-to-schema helper?

2022-04-04 Thread Albert-Jan Roskam
a())  # OSError https://marshmallow.readthedocs.io/en/stable/api_reference.html#marshmallow.Schema.from_dict https://docs.python.org/3/library/inspect.html#inspect.getsource Thanks! Albert-Jan -- https://mail.python.org/mailman/listinfo/python-list

Fwd: dict.get_deep()

2022-04-04 Thread Albert-Jan Roskam
-- Forwarded message -- From: Marco Sulla Date: Apr 2, 2022 22:44 Subject: dict.get_deep() To: Python List <> Cc: A proposal. Very often dict are used as a deeply nested carrier of data, usually decoded from JSON.  data["users"][0]["address"]["str

Re: flask app convert sql query to python plotly.

2022-04-04 Thread Albert-Jan Roskam
On Apr 2, 2022 20:50, Abdellah ALAOUI ISMAILI wrote: i would like to convert in my flask app an SQL query to an plotly pie chart using pandas. this is my code : def query_tickets_status() :     query_result = pd.read_sql ("""     SELECT COUNT(*)count_status

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

2016-08-15 Thread Jan Erik Moström
On 15 Aug 2016, at 16:00, Sickfit92 wrote: 1. How long did it take you guys to master the language or, let me put it this way to completely get the hang and start writing code? I'm probably not representative since I had used about 10-15 different language before looking at Python. To learn t

Re: Is that forwards first or backwards first? (Re: unintuitive for-loop behavior)

2016-10-04 Thread Albert-Jan Roskam
(Sorry for top-posting) Yep, part of the baby's hardware. Also, the interface is not limited to visual and auditory information: http://www.scientificamerican.com/article/pheromones-sex-lives/ From: Python-list on behalf of Steven D'Aprano Sent: Tuesday, Octob

Re: New to python

2016-10-17 Thread Jan Erik Moström
On 17 Oct 2016, at 21:51, Bill Cunningham wrote: I just installed python I might start with 3. But there is version 2 out too. So far I can '3+4' and get the answer. Nice. I typed the linux man page and got a little info. So to learn this language is there an online tutorial? I am interest

Re: Adding colormaps?

2017-01-23 Thread Albert-Jan Roskam
)https://github.com/BIDS/colormap/blob/master/colormaps.py From: Python-list on behalf of Martin Schöön Sent: Saturday, January 21, 2017 8:42:29 PM To: [email protected] Subject: Re: Adding colormaps? Den 2017-01-21 skrev Gilmeh Serda : > On Wed, 18 Jan 2017

Re: How coding in Python is bad for you

2017-01-23 Thread Albert-Jan Roskam
sola dosis facit venenum ~ Paracelsus (1493-1541) From: Python-list on behalf of alister Sent: Monday, January 23, 2017 8:32:49 PM To: [email protected] Subject: Re: How coding in Python is bad for you On Tue, 24 Jan 2017 07:19:42 +1100, Chris Angelico

macOS specific - reading calendar information

2018-03-14 Thread Jan Erik Moström
I've been trying to find some example of how to read calendar info on macOS but I haven't found anything ... I'm probably just bad at searching !! What I want to do is to read calendar info for a date range. Does anyone know of an example of how to do this? = jem -- https://mail.python.org/m

Re: macOS specific - reading calendar information

2018-03-15 Thread Jan Erik Moström
On 14 Mar 2018, at 21:40, Larry Martell wrote: I've been trying to find some example of how to read calendar info on macOS but I haven't found anything ... I'm probably just bad at searching !! What I want to do is to read calendar info for a date range. Does anyone know of an example of ho

Re: Asynchronous processing is more efficient -- surely not?

2018-04-04 Thread Jan Erik Moström
On 4 Apr 2018, at 9:27, Steven D'Aprano wrote: Its as hard to wrap your brain around as parallel processing in general, but with even worse performance than sequential processing. Am I totally wrong? I would say that it all depends on what kind of stuff you're doing. I'm no scheduling exper

Re: Pandas, create new column if previous column(s) are not in [None, '', np.nan]

2018-04-11 Thread Albert-Jan Roskam
On Apr 11, 2018 20:52, [email protected] wrote: > > I have a dataframe: > > import pandas as pd > import numpy as np > > df = pd.DataFrame( { 'A' : ['a', 'b', '', None, np.nan], > 'B' : [None, np.nan, 'a', 'b', '']}) > > A B > 0 a None > 1 b NaN > 2

Re: How to write partial of a buffer which was returned from a C function to a file?

2018-04-12 Thread Albert-Jan Roskam
On Apr 12, 2018 09:39, [email protected] wrote: > > Chris Angelico於 2018年4月12日星期四 UTC+8下午1時31分35秒寫道: > > On Thu, Apr 12, 2018 at 2:16 PM, wrote: > > > This C function returns a buffer which I declared it as a > > > ctypes.c_char_p. The buffer has size 0x1 bytes long and the valid > > > d

Flask test generator code review?

2018-04-18 Thread Albert-Jan Roskam
the docstring of test_generator? This would make the nosetests output a bit more understandable. Thanks! Albert-Jan import os import sys from os.path import splitext from http import HTTPStatus as status import nose from MyFabulousApp import app app.testing = True template_folder

Re: RE newbie question

2018-04-18 Thread Albert-Jan Roskam
On Apr 18, 2018 21:42, TUA wrote: > > import re > > compval = 'A123456_8' > regex = '[a-zA-Z]\w{0,7}' > > if re.match(regex, compval): >print('Yes') > else: >print('No') > > > My intention is to implement a max. length of 8 for an input string. The > above works well in all other respect

Re: The basics of the logging module mystify me

2018-04-20 Thread Albert-Jan Roskam
On Apr 19, 2018 03:03, Skip Montanaro wrote: > > > I really don't like the logging module, but it looks like I'm stuck > with it. Why aren't simple/obvious things either simple or obvious? Agreed. One thing that, in my opinion, ought to be added to the docs is sample code to log uncaught except

Re: Extract data

2018-05-15 Thread Albert-Jan Roskam
On May 15, 2018 08:54, Steven D'Aprano wrote: On Tue, 15 May 2018 11:53:47 +0530, mahesh d wrote: > Hii. > > I have folder.in that folder some files .txt and some files .msg files. > . > My requirement is reading those file contents . Extract data in that > files . Reading .msg can be done

Re: Extract data from multiple text files

2018-05-15 Thread Albert-Jan Roskam
On May 15, 2018 14:12, mahesh d wrote: import glob,os import errno path = 'C:/Users/A-7993\Desktop/task11/sample emails/' files = glob.glob(path) '''for name in files: print(str(name)) if name.endswith(".txt"): print(name)''' for file in os.listdir(path): print(f

Re: user defined modules

2018-06-09 Thread Albert-Jan Roskam
On 5 Jun 2018 09:32, Steven D'Aprano wrote: On Mon, 04 Jun 2018 20:13:32 -0700, Sharan Basappa wrote: > Is there a specific location where user defined modules need to be kept? > If not, do we need to specify search location so that Python interpreter > can find it? Python modules used as s

Re: python 3.7 - I try to close the thread without closing the GUI is it possible?

2018-09-15 Thread Albert-Jan Roskam
> I try to close the thread without closing the GUI is it possible? Qthread seems to be worth investigating: https://medium.com/@webmamoffice/getting-started-gui-s-with-python-pyqt-qthread-class-1b796203c18c -- https://mail.python.org/mailman/listinfo/python-list

[OT] master/slave debate in Python

2018-09-23 Thread Albert-Jan Roskam
*sigh*. I'm with Hettinger on this. https://www.theregister.co.uk/2018/09/11/python_purges_master_and_slave_in_political_pogrom/ -- https://mail.python.org/mailman/listinfo/python-list

RE: A tool to add diagrams to sphinx docs

2016-04-01 Thread Albert-Jan Roskam
> Subject: Re: A tool to add diagrams to sphinx docs > From: [email protected] > Date: Fri, 1 Apr 2016 18:26:48 +0200 > To: [email protected] > > On 1-4-2016 17:59, George Trojan - NOAA Federal wrote: > > What graphics editor would you recommend to create diagrams that can be > > inclu

RE: extract rar

2016-04-01 Thread Albert-Jan Roskam
> Date: Fri, 1 Apr 2016 13:22:12 -0600 > Subject: extract rar > From: [email protected] > To: [email protected] > > Hello everyone, > > I am wondering is there any way to extract rar files by python without > WinRAR software? > > I tried Archive() and patool, but seems they required t

RE: read datas from sensors and plotting

2016-04-17 Thread Albert-Jan Roskam
> From: [email protected] > Subject: read datas from sensors and plotting > Date: Sun, 17 Apr 2016 18:46:25 +0200 > To: [email protected] > > I'm reading in python some values from some sensors and I write them in > a csv file. > My problem now is to use this datas to plot a realtime graph

RE: Remove directory tree without following symlinks

2016-04-22 Thread Albert-Jan Roskam
> From: [email protected] > Subject: Re: Remove directory tree without following symlinks > Date: Sat, 23 Apr 2016 03:14:12 +1000 > To: [email protected] > > On Sat, 23 Apr 2016 01:09 am, Random832 wrote: > > > On Fri, Apr 22, 2016, at 10:56, Steven D'Aprano wrote: > >> What should I use

RE: Remove directory tree without following symlinks

2016-04-23 Thread Albert-Jan Roskam
> From: [email protected] > Date: Fri, 22 Apr 2016 13:28:01 -0500 > Subject: Re: Remove directory tree without following symlinks > To: [email protected] > > On Fri, Apr 22, 2016 at 12:39 PM, Albert-Jan Roskam > wrote: > > FYI, Just today I found out

RE: Remove directory tree without following symlinks

2016-04-24 Thread Albert-Jan Roskam
> From: [email protected] > Date: Sat, 23 Apr 2016 15:22:35 -0500 > Subject: Re: Remove directory tree without following symlinks > To: [email protected] > > On Sat, Apr 23, 2016 at 4:34 AM, Albert-Jan Roskam > wrote: >> >>> From: [email protected] >&

RE: re.search - Pattern matching review ( Apologies re sending)

2016-05-28 Thread Albert-Jan Roskam
> Date: Sat, 28 May 2016 23:48:16 +0530 > Subject: re.search - Pattern matching review ( Apologies re sending) > From: [email protected] > To: [email protected] > > Dear Python friends, > > I am on Python 2.7 and Linux . I am trying to extract the address > "1,5,147456:8192" from the bel

Recommendation for GUI lib?

2016-06-02 Thread Jan Erik Moström
I want to write a few programs with a GUI but I don't want to use Tk. Instead I'm looking for some other library, I've tried to look around and also asked a few but I don't really know what to use. Do you have any recommendations? Primary platforms are OS X and Linux. I, of course, want to hav

Re: Recommendation for GUI lib?

2016-06-11 Thread Jan Erik Moström
Thanks everybody for your answers. I really appreciate your answers and I do have a few things to investigate later this summer (after finishing my current "excursion" into Java, and trying to learn KDB/Q). = jem -- https://mail.python.org/mailman/listinfo/python-list

Re: Why not allow empty code blocks?

2016-07-31 Thread Jan Erik Moström
On 31 Jul 2016, at 19:22, Steven D'Aprano wrote: On Mon, 1 Aug 2016 12:25 am, Gordon Levi wrote: I admire those who use a valid email address on Usenet but it is an open invitation for spammers. I doubt if there is anybody who uses their primary email address. Spammers have moved on from U

Re: What Python related git pre-commit hooks are you using?

2018-11-18 Thread Albert-Jan Roskam
On 18 Nov 2018 20:33, Malcolm Greene wrote: >Curious to learn what Python related git >pre-commit hooks people are using? >What >hooks have you found useful and which >hooks have you tried I use Python to reject large commits (pre-commit hook): http://code.activestate.com/recipes/578883-git

Re: Most "pythonic" syntax to use for an API client library

2019-04-28 Thread Albert-Jan Roskam
On 29 Apr 2019 07:18, DL Neil wrote: On 29/04/19 4:52 PM, Chris Angelico wrote: > On Mon, Apr 29, 2019 at 2:43 PM DL Neil > wrote: >> >> On 29/04/19 3:55 PM, Chris Angelico wrote: >>> On Mon, Apr 29, 2019 at 1:43 PM DL Neil >>> wrote: Well, seeing you ask: a more HTTP-ish approach *mi

Re: Creating time stamps

2019-07-22 Thread Albert-Jan Roskam
On 22 Jul 2019 23:12, Skip Montanaro wrote: Assuming you're using Python 3, why not use an f-string? >>> dt = datetime.datetime.now() >>> dt.strftime("%Y-%m-%d %H:%M") '2019-07-22 16:10' >>> f"{dt:%Y-%m-%d %H:%M}" '2019-07-22 16:10' ===》》 Or if you're running < Python 3.6 (no f strings): form

Re: Document Entire Apps

2019-09-21 Thread Albert-Jan Roskam
On 15 Sep 2019 07:00, Sinardy Gmail wrote: I understand that we can use pydoc to document procedures how about the relationship between packages and dependencies ? ==》 Check out snakefood to generate dependency graphs: http://furius.ca/snakefood/. Also, did you discover sphinx already? --

Re: [Tutor] Most efficient way to replace ", " with "." in a array and/or dataframe

2019-09-22 Thread Albert-Jan Roskam
k it's a deliberate design choice that decimal and thousands where used here as params, and not a 'locale' param? It seems nice to be able to specify e.g. locale='dutch' and then all the right lc_numeric, lc_monetary, lc_time where used. Or even locale='nl_NL.1252' and you also wouldn't need 'encoding' as a separate param. Or might that be bad on windows where there's no locale-gen? Just wondering... Albert-Jan -- https://mail.python.org/mailman/listinfo/python-list

Re: Funny code

2019-09-26 Thread Albert-Jan Roskam
On 26 Sep 2019 10:28, Christian Gollwitzer wrote: Am 26.09.19 um 08:34 schrieb ast: > Hello > > A line of code which produce itself when executed > > >>> s='s=%r;print(s%%s)';print(s%s) > s='s=%r;print(s%%s)';print(s%s) > > Thats funny ! ==> Also impressive, a 128-language quine: https://git

sqlalchemy & #temp tables

2019-10-07 Thread Albert-Jan Roskam
pe of the context manager. Oh, I don't have rights to create a 'real' table. :-( Thanks! Albert-Jan -- https://mail.python.org/mailman/listinfo/python-list

Re: sqlalchemy & #temp tables

2019-10-11 Thread Albert-Jan Roskam
On 8 Oct 2019 07:49, Frank Millman wrote: On 2019-10-07 5:30 PM, Albert-Jan Roskam wrote: > Hi, > > I am using sqlalchemy (SA) to access a MS SQL Server database (python 3.5, > Win 10). I would like to use a temporary table (preferably #local, but > ##global would also b

Re: python2 vs python3

2019-10-21 Thread Albert-Jan Roskam
On 18 Oct 2019 20:36, Chris Angelico wrote: On Sat, Oct 19, 2019 at 5:29 AM Jagga Soorma wrote: > > Hello, > > I am writing my second python script and got it to work using > python2.x. However, realized that I should be using python3 and it > seems to fail with the following message: > > --

Re: Win32api problems

2019-10-22 Thread Albert-Jan Roskam
On 22 Oct 2019 11:23, GerritM wrote: > ImportError: DLL load failed: The specified > procedure could not be found. I've had the same error before and I solved it by adding the location where the win32 dlls live to PATH. Maybe PATH gets messed up during the installation of something. -- htt

Re: nonlocal fails ?

2019-11-14 Thread Jan Erik Moström
On 14 Nov 2019, at 14:06, R.Wieser wrote: I've also tried moving "MyVar = 7" to the first line, but that doesn't change anything. Using "global MyVar" works.. Try def outer(): MyVar = 10 def Proc1(): nonlocal MyVar MyVar = 5 Proc1()

Re: nonlocal fails ?

2019-11-14 Thread Jan Erik Moström
On 14 Nov 2019, at 15:15, 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). So wha

Library for text substitutions with calculations?

2020-12-15 Thread Jan Erik Moström
I want to do some text substitutions but a bit more advanced than what string.Template class can do. I addition to plain text substitution I would like to be able to do some calculations: $value+1 - If value is 16 this would insert 17 in the text. I would also like to subtract. $value+1w - I

Re: Accessing class variable at class creation time

2005-09-23 Thread Jan-Ole Esleben
You could use self.__class__.X HTH, Ole 23 Sep 2005 14:01:21 -0700, Carlos <[EMAIL PROTECTED]>: > Hi! > > class A: > X = 2 > def F(): > print A.X > F() > > The above fails because the name A is not > yet at global scope when the reference A.X > is reached. Is there any way to refer to

Re: Accessing class variable at class creation time

2005-09-24 Thread Jan-Ole Esleben
That doesn't really give him a way of using the class variable inside a method. Ole 2005/9/24, Benji York <[EMAIL PROTECTED]>: > Carlos wrote: > > Hi! > > > > class A: > > X = 2 > > def F(): > > print A.X > > F() > > > > The above fails because the name A is not > > yet at global scope

Graph and Table implementation

2005-01-21 Thread Jan Rienyer Gadil
could anyone please help me! what and how is the best implementation of creating a table based on data coming from the serial port ? and also how would i be able to create graphs (2D) based on these data? opinions and suggestion are most highly welcome. thanks. jr -- http://mail.python.org/mail

How to assign

2005-01-25 Thread Jan Rienyer Gadil
Sort of a newbie question: How am i going to assign to a variable anything the user inputs on a wxTxtCtrl? -- http://mail.python.org/mailman/listinfo/python-list

Metaclasses and class variables

2005-08-04 Thread Jan-Ole Esleben
Hi! I am new to this list, and maybe this is a stupid question, but I can't seem to find _any_ kind of answer anywhere. What I want to do is the following: I want to insert a class variable into a class upon definition and actually use it during definition. Manually, that is possible, e.g.: cla

Re: Metaclasses and class variables

2005-08-04 Thread Jan-Ole Esleben
I thought __new__ was called upon construction of the _class_ object that "Meta" is the type of. Then it would be available at the time of the definition of my class. Or am I mistaken? Ole 2005/8/4, Christopher Subich <[EMAIL PROTECTED]>: > Jan-Ole Esleben wrote: > > cl

Re: Metaclasses and class variables

2005-08-04 Thread Jan-Ole Esleben
Yes, that works, but it is unfortunately not an option (at least not a good one). Is there no way to create a class variable that exists during definition of the class? (I cannot imagine there isn't, since technically it's possible and manually it can be done...) Ole > classvar is defined AFTER

Re: Metaclasses and class variables

2005-08-04 Thread Jan-Ole Esleben
. Ole 2005/8/4, Mike C. Fletcher <[EMAIL PROTECTED]>: > Jan-Ole Esleben wrote: > > >Yes, that works, but it is unfortunately not an option (at least not a > >good one). > > > >Is there no way to create a class variable that exists during > >definition of

Metaclasses and new-style classes

2005-08-07 Thread Jan-Ole Esleben
Hi! I've just posted a question about metaclasses in ZOPE on the ZOPE list, and one of the replies said that metaclasses (at least "painless" metaclasses) cannot be used without new-style classes (or rather, that they don't work where you cannot explicitly use new-style classes). I haven't so far

Re: Why is this?

2005-08-10 Thread Jan-Ole Esleben
For the sake of completeness (I didn't copy this message to the list): > I have a problem with initialization. > >>> a, b = [[]]*2 > >>> a.append(1) > >>> b > [1] > > Why is this? Why does not this behave like the below: You create a single list (inside your brachets) and duplicate a reference to

graphing

2005-02-13 Thread Jan Rienyer Gadil
i'm currently using python 2.3(enthought edition) on win 2000/xp. i'm using boa constructor on the GUI part and matplotlib 0.71 on plotting the graph. i am using an MDIParentFrame. one of the child frame (MDIChildFrame1) will be used for the table part. then another child frame (MDIChildFrame2) wi

saving a text file

2005-02-14 Thread Jan Rienyer Gadil
any idea how to automatically save to a text file? here's what the program do: first, data is read from the serial port every fixed lenght of time the data will then be put to a table, now, every serial read, a table will be created for the data that will be gathered (one window for each table) to

Re: is there a problem on this simple code

2005-03-13 Thread Jan Rienyer Gadil
@ sir Peter so you mean that it is correct (at least on the unpack() part) when i run this program on IDLE , Python 2.3 (enthought edition), nothing is outputted on the shell, until i decide to close the shell, wherein it tells me if i would like to kill a process... import serial import string

Re: Parallel Python x.y.A and x.y.B installations on a single Windows machine

2013-11-25 Thread Albert-Jan Roskam
erent python versions. Also, you can make it run nosetests for each python version and/or implementation (pypy and jython are supported) Albert-Jan -- https://mail.python.org/mailman/listinfo/python-list

Re: cx_Oracle throws: ImportError: DLL load failed: This application has failed to start ...

2013-11-25 Thread Albert-Jan Roskam
On Sun, 11/24/13, MRAB wrote: Subject: Re: cx_Oracle throws: ImportError: DLL load failed: This application has failed to start ... To: [email protected] Date: Sunday, November 24, 2013, 7:17 PM On 24/11/2013 17:12, Ruben van den Berg wrot

Re: Parallel Python x.y.A and x.y.B installations on a single Windows machine

2013-11-25 Thread Albert-Jan Roskam
On Mon, 11/25/13, Jurko Gospodnetić wrote: Subject: Re: Parallel Python x.y.A and x.y.B installations on a single Windows machine To: [email protected] Date: Monday, November 25, 2013, 2:57 PM   Hi. On 25.11.2013. 14:20, Albert-Jan

L[:]

2014-01-10 Thread Albert-Jan Roskam
n as far as I can remember. I do not get that. Why is the "L[:]" idiom more memory-efficient here? How could the increased efficiency be demonstrated? #Python 2.7.3 (default, Sep 26 2013, 16:38:10) [GCC 4.7.2] on linux2 >>> L = [x ** 2 for x in range(10)] >>>

Re: Problem writing some strings (UnicodeEncodeError)

2014-01-12 Thread Albert-Jan Roskam
On Sun, 1/12/14, Paulo da Silva wrote: Subject: Problem writing some strings (UnicodeEncodeError) To: [email protected] Date: Sunday, January 12, 2014, 4:36 PM Hi! I am using a python3 script to produce a bash script from lots of filena

Re: L[:]

2014-01-14 Thread Albert-Jan Roskam
On 1/13/2014 4:00 AM, Laszlo Nagy wrote: > >> Unless L is aliased, this is silly code. > There is another use case. If you intend to modify a list within a for > loop that goes over the same list, then you need to iterate over a copy. > And this cannot be called an "alias" because it has

Re: Is it possible to get string from function?

2014-01-16 Thread Albert-Jan Roskam
On Thu, 1/16/14, Peter Otten <[email protected]> wrote: Subject: Re: Is it possible to get string from function? To: [email protected] Date: Thursday, January 16, 2014, 9:52 AM Roy Smith wrote: > I realize the subject line is kind of mean

Re: Guessing the encoding from a BOM

2014-01-16 Thread Albert-Jan Roskam
On Thu, 1/16/14, Chris Angelico wrote: Subject: Re: Guessing the encoding from a BOM To: Cc: "[email protected]" Date: Thursday, January 16, 2014, 7:06 PM On Fri, Jan 17, 2014 at 5:01 AM, Björn Lindqvist wrote: > 201

<    1   2   3   4   5   6   7   8   >