magic-wormhole 0.18.0

2025-03-12 Thread meejah via Python-list
Hello, I am happy to announce that magic-wormhole 0.18.0 has been released. A visible change is the default display of QR Codes, following the specification for file-transfer magic-wormhole codes. This can be turned off with --no-qr All changes in this release: * Improve the example to act more

Re: Book recommendation? For getting up to date

2025-02-16 Thread rbowman via Python-list
On Sun, 16 Feb 2025 22:00:11 +0100, Jan Erik Moström wrote: > I have done so ... to be really honest, it was when I couldn't remember > how to create an iterator for a class I was writing, that I realized > that I needed a refresher. Most of my Python was related to Esri's ArcGIS version. Up unti

Re: Book recommendation? For getting up to date

2025-02-16 Thread rbowman via Python-list
On Mon, 17 Feb 2025 08:59:11 +1300, dn wrote: > - on Coursera am sad to advise avoiding U.Mich courses - they tend to be > re-worded Java (I think) content, don't follow PEP-008 and 'miss' Python > idioms The edx CS50 Python from Harvard is decent. It does start with the basics but overall I enj

Re: Book recommendation? For getting up to date

2025-02-16 Thread dn via Python-list
On 17/02/25 01:50, Jan Erik Moström via Python-list wrote: I'm looking for a book that would teach me the lastest and greatest parts of Python, does anyone have any recommendations? I've looked at python.org and pythonbooks.org but I couldn't decide which one to get. I used to

Re: Book recommendation? For getting up to date

2025-02-16 Thread rbowman via Python-list
On Sun, 16 Feb 2025 13:50:33 +0100, Jan Erik Moström wrote: > I used to be fairly good at Python, but I haven't done any serious > programming in the last 10 years or so. So I would like something that > got me up-to-date with the latest features. David Beasley's 'Python Distilled'. The author do

Re: Book recommendation? For getting up to date

2025-02-19 Thread Mike via Python-list
On 16-02-2025 13:50, Jan Erik Moström via Python-list wrote: I'm looking for a book that would teach me the lastest and greatest parts of Python, does anyone have any recommendations? I've looked at python.org and pythonbooks.org but I couldn't decide which one to get. I us

Re: Book recommendation? For getting up to date (Posting On Python-List Prohibited)

2025-02-21 Thread rbowman via Python-list
On Thu, 20 Feb 2025 21:51:51 - (UTC), Lawrence D'Oliveiro wrote: > On Thu, 20 Feb 2025 10:05:32 -0300, Salvador Mirzo wrote: > >> It's much more pleasurable (to me) to read books off-screen. > > You can’t do searches, though. For non-fiction a decent index does wonders. A good layout and ta

Re: Book recommendation? For getting up to date

2025-02-20 Thread songbird via Python-list
Mike wrote: ... > My current best collection for online quality open access Python Books > is on: > https://nocomplexity.com/documents/pythonbook/generatedfiles/overview.html#books > thanks! no need for me to print any programming books. some old textbooks are still useful, but many pr

Re: Matplotlib "collections" module in recent Python, Matplotlib

2025-06-18 Thread jmhannon.ucdavis--- via Python-list
Thanks. That appears to be exactly the thing I was looking for (vis-a-vis collections). -- https://mail.python.org/mailman3//lists/python-list.python.org

Re: Matplotlib "collections" module in recent Python, Matplotlib

2025-06-18 Thread jmhannon.ucdavis--- via Python-list
Thanks, D'Arcy. I've done a fair amount of 2-to-3 migration in the past, but there was a lot of stuff in that article ("six", for instance) that I hadn't run across. -- https://mail.python.org/mailman3//lists/python-list.python.org

Matplotlib "collections" module in recent Python, Matplotlib

2025-06-16 Thread jmhannon.ucdavis--- via Python-list
Greetings. We (the group that I work with) have "inherited" some Python scripts that were written years ago, using Python 2. We're trying to upgrade the scripts so that they work in our current environment: OS: Ubuntu 24.04.2 LTS $ python --version Python 3.11.13 >>> ma

Re: Python tutor mailing list?

2025-05-27 Thread dn via Python-list
Message received! Hope you enjoyed your holiday... On 28/05/25 12:00, Alan Gauld via Python-list wrote: On 28/05/2025 00:32, Alan Gauld via Python-list wrote: The archives are still there and the sign-up page seems to work, but it doesn't recognise me. I tried signing up as a new m

concurrent.interpreters: why syntax errors in exec() cause a SyntaxError instead of an InterpreterError?

2025-09-25 Thread a.mux--- via Python-list
Hi, I am testing the [concurrent.interpreters](https://docs.python.org/3.14/library/concurrent.interpreters.html) feature from Python **3.14rc3** (the latest current rc). The subinterpreter seems to behave in a surprising way when encountering syntax errors. For example, in the following code:

Re: Slices by length

2025-09-06 Thread dn via Python-list
On 7/09/25 00:47, Rob Cliffe via Python-list wrote: I quite often find myself writing expressions of the form     someString[x : x+n] where n is often an int and x may be an int, a variable, or a (possibly complicated) expression. 0 A PEP 1 A helper-function eg slice_by_length

Environments and Version Control (if not packaging and PyPI)

2025-09-04 Thread dn via Python-list
How do you start (and thus run) a Python project? tldr; question in last paragraph Two articles appeared in my InTray: - Reuven Lerner (Python Trainer) saying "You’re probably using uv wrong" (https://lerner.co.il/2025/08/28/youre-probably-using-uv-wrong/), NB adapted from [his] “Better develo

Re: Test message. Posted a question several days ago and don't see it.

2025-09-10 Thread dn via Python-list
Hi Steve, ask away... On 11/09/25 16:15, Steve Jorgensen via Python-list wrote: I posted a question here several days ago and received a "Welcome to the "Python-list" mailing list!" email, but I still don't see my question in the list. I'm posting this mainly to

Re: Access to return / exception context in finally block

2025-09-01 Thread marius.spix--- via Python-list
>In your example when would isinstance(__exit_context__, ReturnContext) >be True and when would it be False? What would __exit_context__.value >be? I can't think of a sensible meaning for it. If no exception occurs, >is the value returned by f supposed to be 10/x or __exit_context__.value >+ 1

Image enhance

2025-09-02 Thread amrodi9999--- via Python-list
I'm new to Python. Operating System - Windows XP SP3 Python 2.7 installed. I got a script that tries to improve the image? I created a bat file using the command line. C:\python27\python.exe d:\temp\teste.py But even though it runs, it displays an error: "... no encoding declare..." Can anyone

Re: Image enhance

2025-09-02 Thread amrodi9999--- via Python-list
My code from PIL import Image, ImageEnhance import matplotlib.pyplot as plt import numpy as np import cv2 # Original image path image_path = "D:\temp\STC.jpg" # Altere se estiver em outro local original_image = Image.open(image_path) # Convert to OpenCV to apply enhancements cv_image = cv2.cvtC

Re: Access to return / exception context in finally block

2025-09-02 Thread marius.spix--- via Python-list
>def f(x): > try: > quot = 10 / x > except ZeroDivisionError as exc: > log_error(exc) > return 0 > else: > log_return(quot) > return quot + 1 > finally: > "Any cleanup processing needed before returning" This involves defining the new

Access to return / exception context in finally block

2025-08-30 Thread marius.spix--- via Python-list
Dear mailing list, there is currently no direct way to observe the current interpreter state in a finally block without tracing. My idea is introducing an immutable __exit_context__ magic variable, which would have one of three possible values: * ReturnContext(value), if a return statement is

PyPi mirrors

2025-08-24 Thread dn via Python-list
Hi, Do you use a mirror in front of the PyPi "Cheese Shop"? - perhaps a server like DevPi or Bandersnatch? - perhaps a personal interest or your enterprise? - is there public instance such as unis and others mirroring Linux distros? -- Regards, =dn -- https://mail.python.org/mailman3//lists/pyt

Re: can you improve this text-only beginner copy program?

2025-08-28 Thread dn via Python-list
PS Ethan: way-down the docs you'll find two very handy methods worth applying as a second-attempt at this challenge! On 28/08/25 03:41, Chris Angelico via Python-list wrote: On Thu, 28 Aug 2025 at 01:28, Ethan Carter wrote: def copy(s, d): """Copies text fil

Re: can you improve this text-only beginner copy program?

2025-08-28 Thread dn via Python-list
On 29/08/25 10:52, Grant Edwards via Python-list wrote: On 2025-08-28, Mark Bourne wrote: Ethan Carter wrote: PS. Is it just me or there's just us in this used-to-be-very-active group? Thanks for being my teacher here. Have a good day! Until a few months ago, there was a gateway

Re: Python documentary

2025-08-29 Thread dn via Python-list
To you (if apparently in-reply to the OP), On 30/08/25 07:19, Larry Martell via Python-list wrote: https://www.youtube.com/watch?v=GfH4QL4VqJ0 Watched this last night. Overall I enjoyed it (but my wife, who is not a programmer, fell asleep). My only quibble is that they spent too much time

Re: Slices by length

2025-10-08 Thread meowxiik via Python-list
> Which brings to mind a possible alternate syntax: s[x::n] This would AFAIK collide with the the x[a:b:c] syntax, which already means something, the c is the size of a step M On 8 October 2025 16:22:46 CEST, [email protected]

Re: Proposal: private keyword for import statements to hide module dependencies

2025-11-25 Thread bjotta via Python-list
It seem like you are talking about classes and sub-classes. I was talking about dependencies in projects. e..g I create a library that has some dependencies (numpy here) Inside the library there is a file importing numpy for example. ''' import numpy as np def stock_earnings(winnings, losses):

Re: Proposal: private keyword for import statements to hide module dependencies

2025-11-25 Thread bjotta via Python-list
I tried explaining it further down in the thread -- https://mail.python.org/mailman3//lists/python-list.python.org

Re: Failing to install Python

2025-12-01 Thread dn via Python-list
On 01/12/2025 22:40, [email protected] wrote: I have installed Python on two Win10 computers over the last 20 years. Only after several spits and starts each time did it finally work. The new Win11 desktop is now running. I can't help but think there is an easier way to get it installed than

Re: A switch somewhere, or bug?

2025-12-04 Thread ';dn' via Python-list
incidents as the message says.. Footnote: Fifteen plus Fifteen is thirty. Sixteen and Sixteen is thirty too. -Original Message- From: dn via Python-list Sent: Thursday, December 4, 2025 1:30 PM To: [email protected] Subject: Re: A switch somewhere, or bug? On 05/12/2025 05:06, Em wrote

Re: A switch somewhere, or bug?

2025-12-04 Thread dn via Python-list
On 05/12/2025 05:06, Em wrote: Two computers, both alike in dignity, in fair windows land... in Win10/Python 3.13 my program runs as well as can be expected. However, on my new computer Win11/Python 3.14.1 there is a peculiarity. On the new machine, when I click on the file name, it immediately

Have do_nothing as default action for dictionary?

2017-09-03 Thread Christopher Reimer via Python-list
Greetings, I was playing around this piece of example code (written from memory). def filter_text(key, value):     def do_nothing(text): return text     return {'this': call_this,   'that': call_that,   'what': do_nothing }[key](value) Is

Looking for Python examples for querying, selecting items in N-Triples

2017-09-04 Thread David Shi via Python-list
I found this is very confusing. I will appreciate if simple examples are given. Regards, David -- https://mail.python.org/mailman/listinfo/python-list

How best to search and get values of label in N-Triples

2017-09-04 Thread David Shi via Python-list
I have a parsed N-Triples file, having many items like the following. "Baddesley Clinton E04009816"@en .

Re: Have do_nothing as default action for dictionary?

2017-09-04 Thread Christopher Reimer via Python-list
Greetings, After reading everyone's comments and doing a little more research, I re-implemented my function as a callable class.     def __call__(self, key, value):     if key not in self._methods:     return value     return self._methods[key](value) This behaves like my prev

Can some one give examples of how to use graph.label to get data values while dealing with N-Triples files?

2017-09-04 Thread David Shi via Python-list
How to used graph.label to get data values like 'Baddesley Clinton E04009816'? "Baddesley Clinton E04009816"@en .

How to get values for skos/note, skos/notation and label in N-Triples

2017-09-05 Thread David Shi via Python-list
"Baginton E04009817"@en . "Live" .

Setting property for current class from property in an different class...

2017-09-06 Thread Christopher Reimer via Python-list
Greetings, My web scraper program has a top-level class for managing the other classes. I went to set up a property for the top-level class that changes the corresponding property in a different class. class Scraper(object):     def __init__(self, user_id, user_name):     self.requestor

Re: Setting property for current class from property in an different class...

2017-09-06 Thread Christopher Reimer via Python-list
On 9/6/2017 7:41 PM, Stefan Ram wrote: The following code runs here: Your code runs but that's not how I have mine code set up. Here's the revised code: class Requestor(object):     def __init__(self, user_id, user_name ):     self._page_start = -1     @property     def page_start(sel

Re: Setting property for current class from property in an different class...

2017-09-07 Thread Christopher Reimer via Python-list
On 9/6/2017 9:26 PM, Christopher Reimer wrote: On Sep 6, 2017, at 9:14 PM, Stefan Ram wrote: I can run this (your code) without an error here (Python 3.6.0), from a file named "Scraper1.py": I'll check tomorrow. I recently switched from 3.5.x to 3.6.1 in the PyCharm IDE. It's probably FU

My Issues

2017-09-08 Thread Carson McDaniel via Python-list
Hello, I am an extreme beginner at this so forgive me if I've done something simple wrong, but every time I try to open Python (3.6.2), I get an error message that says the program can't start because api-ms-win-crt-runtime-l1-1-0.dll is missing from my computer. It says to try reinstalling the

Re: [Tutor] beginning to code

2017-09-13 Thread Larry Hudson via Python-list
On 09/13/2017 09:18 AM, ROGER GRAYDON CHRISTMAN wrote: I have not yet mastered how to respond to a particular note in a threadwith the mailer that I use, so this is not in response to anyone in particular,but just to some of the sentiments as a whole. if x:> # do something Completely out

Re: "tkinter"

2017-09-13 Thread Larry Hudson via Python-list
On 09/13/2017 05:33 AM, leam hall wrote: On Wed, Sep 13, 2017 at 8:28 AM, Stefan Ram wrote: I presume that "tkinter" is intended to be pronounced "logically": T K inter (tee kay inter /ti keI In t%/) . But it would be faster to pronounce it T kinter (tee kinter /ti kIn t%/) . S

Re: The Incredible Growth of Python (stackoverflow.blog)

2017-09-14 Thread Mark Lawrence via Python-list
On 14/09/2017 05:37, Terry Reedy wrote: On 9/13/2017 2:44 AM, Paul Rubin wrote: Are there actually Py3 codebases? Let's think a bit.  There is the Python half of the Python3 codebase, perhaps 400K.  But we can discount that. Then there are all the Py compatible modules on PyPI, which is to

Re: Easy way to get a list of tuples.

2017-09-21 Thread Mark Lawrence via Python-list
On 21/09/2017 11:18, Sayth Renshaw wrote: Hi I have been toying with json and I particular area where I cannot get the desired result a list of tuples as my return. The json from the API is way to long but I don't think it will matter. .. hitting url data = r.json() for item in data["RaceDay

Re: [Tutor] beginning to code

2017-09-22 Thread Mark Lawrence via Python-list
On 22/09/2017 08:01, Bill wrote: Steve D'Aprano wrote: On Fri, 22 Sep 2017 02:57 pm, Bill wrote: I find Python to be more more like Java, with regard to "passing objects by reference". Which is not a surprise, since both Python and Java use the same value passing style: pass by object refere

Re: [Tutor] beginning to code

2017-09-22 Thread Mark Lawrence via Python-list
On 22/09/2017 10:53, Bill wrote: I just wanted to mention that my comment was made in the context that Python is implemented by an interpreter written in C.   I realize that this may not always be the case.  However, I haven't heard anyone mention a Python interpreter written in Python yet. T

Re: [Tutor] beginning to code

2017-09-23 Thread Mark Lawrence via Python-list
On 23/09/2017 04:06, Bill wrote: Mark Lawrence wrote: On 22/09/2017 08:01, Bill wrote: Steve D'Aprano wrote: On Fri, 22 Sep 2017 02:57 pm, Bill wrote: I find Python to be more more like Java, with regard to "passing objects by reference". Which is not a surprise, since both Python and Java u

Re: Beginners and experts (Batchelder blog post)

2017-09-27 Thread Larry Hudson via Python-list
On 09/27/2017 09:41 AM, leam hall wrote: On Sat, Sep 23, 2017 at 5:26 PM, Ned Batchelder wrote: [snip] The question is, what should a person "know" when hiring out as a programmer? What is 'know" and what should be "known"? Specifically with Python. Hopefully NOT like this person... (Sourc

Re: Printing a Chunk Of Words

2017-09-28 Thread Mark Lawrence via Python-list
On 26/09/2017 01:15, Cai Gengyang wrote: """ Boolean Operators True and True is True True and False is False False and True is False False and False is False True or True is True True or False is True False or True is True False or False is False Not True is False

Re: newb question about @property

2017-10-02 Thread Larry Hudson via Python-list
On 10/01/2017 03:52 PM, Bill wrote: Steve D'Aprano wrote: The definitive explanation of descriptors is here: https://docs.python.org/3/howto/descriptor.html Thank you!  It is next on my list.   Then I'll try that Circle problem you mentioned as an exercise last night!  I don't expect run into

Re: The "loop and a half"

2017-10-03 Thread Larry Hudson via Python-list
On 10/03/2017 10:29 AM, Stefan Ram wrote: Is this the best way to write a "loop and a half" in Python? x = 1 while x: x = int( input( "Number (enter 0 to terminate)? " )) if x: print( f'Square = { x**2 }' ) In a C-like language, one could write: while x = int( input( "

Re: Python 2 -> 3, urllib.urlOpen

2017-10-14 Thread Mark Lawrence via Python-list
On 13/10/17 23:27, Irv Kalb wrote: One of the colleges where I teach has just moved from Python 2 to Python 3. I am in the process of converting my beginning Python class from Python 2 to Python 3. Everything has gone smoothly, until I just tried to convert some code that imports and uses ur

why del is not a function or method?

2017-10-16 Thread Xue Feng via Python-list
Hi, I wonder why 'del' is not a function or method. Most operations can be used as follows len(team) or team.append("tom") But, I think del team[2] is somewhat uncommon. Why does not it take a syntax we are famillar with? -- https://mail.python.

Re: why del is not a function or method?

2017-10-16 Thread Ben Finney via Python-list
Steve D'Aprano writes: > On Tue, 17 Oct 2017 03:16 am, Oren Ben-Kiki wrote: > > > That doesn't explain why `del` isn't a method though. > > `del` cannot be a method or a function, because the argument to `del` > is the name of the variable, not the contents of the variable. Since a Python “varia

ANN: distlib 0.2.6 released on PyPI

2017-10-28 Thread Vinay Sajip via Python-list
I've just released version 0.2.6 of distlib on PyPI [1]. For newcomers,distlib is a library of packaging functionality which is intended to beusable as the basis for third-party packaging tools. The main changes in this release are as follows: * Fixed #99: Updated to handle a case where sys.getfi

pythonw.exe error

2017-10-30 Thread George Kalamaras via Python-list
When I am running IDLE return to me Missing python36.dll error Στάλθηκε από την Αλληλογραφία για Windows 10 -- https://mail.python.org/mailman/listinfo/python-list

Any good explanations on pd.merge(df,df2, on=['Code', 'Region'])

2017-11-08 Thread David Shi via Python-list
I am trying to gain a clear understanding on pd.merge(df,df2, on=['Code', 'Region']). Can anyone assist? Regards, David -- https://mail.python.org/mailman/listinfo/python-list

Re: can't get python to run

2017-11-12 Thread Mary Ann via Python-list
trying to install and run Python 3.5.2 (64 bit) and keep getting error message: the program can't start because api-ms-win-crt-runtime-l1-1-0.dll is missing from your computer. Try reintalling the program to fix this problem. I am on Windows 7 Home Premium I have uninstalled and reinstall

Round to 2 decimal places

2017-12-06 Thread nick martinez via Python-list
I'm stuck. I need my program to round the end solution to 2 decimal places but cant figure it out. Can someone help? I've been trying between printf and round() but cant seem to get either to work. Python 3.5 is what I'm using. import math print("This program will calculate the surface area and

Re: Round to 2 decimal places

2017-12-06 Thread nick martinez via Python-list
On Wednesday, December 6, 2017 at 8:13:36 PM UTC-5, [email protected] wrote: > The following works: > > import math > > print("This program will calculate the surface area and volume of a > 3-dimensional cone: ") > print() > print() > r = input("What is the radius in feet? (no negatives): ") >

Re: Round to 2 decimal places

2017-12-06 Thread nick martinez via Python-list
On Wednesday, December 6, 2017 at 9:03:27 PM UTC-5, [email protected] wrote: > On Thursday, December 7, 2017 at 12:39:38 PM UTC+11, nick martinez wrote: > > On Wednesday, December 6, 2017 at 8:13:36 PM UTC-5, [email protected] > > wrote: > > > The following works: > > > > > > import math > >

Re: Round to 2 decimal places

2017-12-06 Thread nick martinez via Python-list
On Wednesday, December 6, 2017 at 9:32:27 PM UTC-5, nick martinez wrote: > On Wednesday, December 6, 2017 at 9:03:27 PM UTC-5, [email protected] wrote: > > On Thursday, December 7, 2017 at 12:39:38 PM UTC+11, nick martinez wrote: > > > On Wednesday, December 6, 2017 at 8:13:36 PM UTC-5, ssghot...

Python homework

2017-12-08 Thread nick martinez2 via Python-list
I have a question on my homework. My homework is to write a program in which the computer simulates the rolling of a die 50 times and then prints (i). the most frequent side of the die (ii). the average die value of all rolls. I wrote the program so it says the most frequent number out of all the r

Re: Python Templating Language

2017-12-18 Thread Brian Oney via Python-list
you may consider checking out a more general approach. Noweb was the first to my knowledge and lead the way for Sweave (R or S), and pyweave, as mentioned. https://en.wikipedia.org/wiki/Noweb Cheers -- https://mail.python.org/mailman/listinfo/python-list

Re: Native object exposing buffer protocol

2018-01-05 Thread Ben Finney via Python-list
Rob Gaddi writes: > I'd like to create a native Python object that exposes the buffer > protocol. Basically, something with a ._data member which is a > bytearray that I can still readinto, make directly into a numpy array, > etc. The “etc.” seems pretty important, there. You want the behaviour

Re: Why does __ne__ exist?

2018-01-07 Thread Ben Finney via Python-list
Chris Angelico writes: > On Mon, Jan 8, 2018 at 10:55 AM, Ben Finney > wrote: > > We've established that it is useful to allow data types to define > > their own meaning of “equal” and “not equal”, like many other > > operations. Is that not good enough reason to allow it still? > > The fact th

Re: Very strange issues with collections.Mapping

2018-01-19 Thread John Krukoff via Python-list
Have you ruled out the possibility that collections.Mapping has been (perhaps temporarily) assigned to something else? On Thu, Jan 18, 2018 at 2:37 PM, Jason Swails wrote: > Hello! > > I am running into a very perplexing issue that is very rare, but creeps up > and is crashing my app. > > The ro

error message by installation

2018-01-19 Thread ‪Ibrahim Nasr‬ ‪ via Python-list
kindly inform me what to do. -- https://mail.python.org/mailman/listinfo/python-list

Help: 64bit python call c and got OSError: exception: access violation writing 0xFFFFFFFF99222A60

2018-01-22 Thread Jason Qian via Python-list
Hello! I am using ctypes on Windows to interface with a dll and it works fine on Linux and windows 32-bit python. But, when using 64-bit python, we got error "exception: access violation writing 0x99222A60". Checking our server, it seems work without any problem. but the python gi

Re: Help: 64bit python call c and got OSError: exception: access violation writing 0xFFFFFFFF99222A60

2018-01-22 Thread Jason Qian via Python-list
Thanks you very much, fixed the problem :) On Mon, Jan 22, 2018 at 4:28 PM, Random832 wrote: > On Mon, Jan 22, 2018, at 16:00, Jason Qian via Python-list wrote: > > Hello! > > > > I am using ctypes on Windows to interface with a dll and it works fine > > on Linu

Re: Help: 64bit python call c and got OSError: exception: access violation writing 0xFFFFFFFF99222A60

2018-01-22 Thread Jason Qian via Python-list
Thanks for the help, Jason On Mon, Jan 22, 2018 at 5:41 PM, eryk sun wrote: > On Mon, Jan 22, 2018 at 9:00 PM, Jason Qian via Python-list > wrote: > > > > I am using ctypes on Windows to interface with a dll and it works fine > > on Linux and windows 32-bit python.

Re: Help: 64bit python call c and got OSError: exception: access violation writing 0xFFFFFFFF99222A60

2018-01-24 Thread Jason Qian via Python-list
s you very much, fixed the problem :) > > On Mon, Jan 22, 2018 at 4:28 PM, Random832 wrote: > >> On Mon, Jan 22, 2018, at 16:00, Jason Qian via Python-list wrote: >> > Hello! >> > >> > I am using ctypes on Windows to interface with a dll and it works &

Python call c pass a callback function on Linux

2018-01-24 Thread Jason Qian via Python-list
Hi, I have following code that works fine on windows. InvocationCB=WINFUNCTYPE(None, c_char_p, c_int) submit = lib.submit submit.argtypes = [ctypes.c_void_p, c_void_p,InvocationCB] submit.restype = ctypes.c_int def handleResponse(message, code): print('--- handleResponse ---') prin

Re: Python call c pass a callback function on Linux

2018-01-24 Thread Jason Qian via Python-list
HI Dennis, Thanks for the help, After changing WINFUNCTYPE to CFUNCTYPE, the call back function works on the Linux :) Thanks again, Jason On Wed, Jan 24, 2018 at 6:15 PM, Dennis Lee Bieber wrote: > On Wed, 24 Jan 2018 17:16:22 -0500, Jason Qian via Python-list > declaim

Re: Help: 64bit python call c and got OSError: exception: access violation writing 0xFFFFFFFF99222A60

2018-01-24 Thread Jason Qian via Python-list
58 PM, Jason Qian wrote: > >> Thanks you very much, fixed the problem :) >> >> On Mon, Jan 22, 2018 at 4:28 PM, Random832 >> wrote: >> >>> On Mon, Jan 22, 2018, at 16:00, Jason Qian via Python-list wrote: >>> > Hello! >>> > >&g

Please help on print string that contains 'tab' and 'newline'

2018-01-27 Thread Jason Qian via Python-list
HI I am a string that contains \r\n\t [Ljava.lang.Object; does not exist*\r\n\t*at com.livecluster.core.tasklet I would like it print as : [Ljava.lang.Object; does not exist tat com.livecluster.core.tasklet -- https://mail.python.org/mailman/listinfo/python-list

Re: Please help on print string that contains 'tab' and 'newline'

2018-01-27 Thread Jason Qian via Python-list
HI I have a string that contains \r\n\t [Ljava.lang.Object; does not exist*\r\n\t*at com.livecluster.core.tasklet I would like to print it as : [Ljava.lang.Object; does not exist tat com.livecluster.core.tasklet How can I do this in python print ? Thanks On Sat, Jan 27, 20

Re: Please help on print string that contains 'tab' and 'newline'

2018-01-27 Thread Jason Qian via Python-list
st*\r\n\t*at com Thanks On Sat, Jan 27, 2018 at 4:20 PM, Ned Batchelder wrote: > On 1/27/18 3:15 PM, Jason Qian via Python-list wrote: > >> HI >> >> I am a string that contains \r\n\t >> >> [Ljava.lang.Object; does not exist*\r\n\t*at >>

Re: Please help on print string that contains 'tab' and 'newline'

2018-01-27 Thread Jason Qian via Python-list
Reedy wrote: > On 1/27/2018 3:15 PM, Jason Qian via Python-list wrote: > >> HI >> >> I am a string that contains \r\n\t >> >> [Ljava.lang.Object; does not exist*\r\n\t*at >> com.livecluster.core.tasklet >> >> >> I would like it p

Re: Please help on print string that contains 'tab' and 'newline'

2018-01-27 Thread Jason Qian via Python-list
there are 0D 0A 09 %c %d 116 *%c %d 13%c %d 10%c %d 9* %c %d 97 On Sat, Jan 27, 2018 at 9:05 PM, Dennis Lee Bieber wrote: > On Sat, 27 Jan 2018 20:33:58 -0500, Jason Qian via Python-list > declaimed the following: > > > Ljava.lang.Object; does not exis

Re: How to embed a native JIT compiler to a django app?

2018-01-28 Thread Stephane Wirtel via Python-list
On 01/27, Etienne Robillard wrote: Hi, I want to compile a Django application into a C source file and embed a JIT compiler into the binary. Is there any way of doing this with llvm/clang? Hi Etienne, I think no, Django will use Python and this one is interpreted. Answer, no... Now, you

Re: Please help on print string that contains 'tab' and 'newline'

2018-01-28 Thread Jason Qian via Python-list
99 c %d %c 111 o %d %c 109 m On Sun, Jan 28, 2018 at 9:50 AM, Steven D'Aprano < [email protected]> wrote: > On Sat, 27 Jan 2018 21:23:02 -0500, Jason Qian via Python-list wrote: > > > there are 0D 0A 09 > > If your string actually contains CARRIAGE

Re: Please help on print string that contains 'tab' and 'newline'

2018-01-28 Thread Jason Qian via Python-list
Thanks a lot :) os.write(1, message) works ! On Sun, Jan 28, 2018 at 8:04 PM, Dan Stromberg wrote: > How about: > >>> os.write(1, message) > > On Sun, Jan 28, 2018 at 4:51 PM, Jason Qian via Python-list > wrote: > > print(repr(message)) out : >

Re: Please help on print string that contains 'tab' and 'newline'

2018-01-28 Thread Jason Qian via Python-list
Thanks Peter, replace print with os.write fixed the problem. On Sun, Jan 28, 2018 at 3:57 AM, Peter Otten <[email protected]> wrote: > Jason Qian via Python-list wrote: > > > HI > > > >I have a string that contains \r\n\t > > > >[L

Re: Please help on print string that contains 'tab' and 'newline'

2018-01-28 Thread Jason Qian via Python-list
The message type is bytes, this may make different ? print(type(message)) On Sun, Jan 28, 2018 at 8:41 PM, Steven D'Aprano < [email protected]> wrote: > On Sun, 28 Jan 2018 20:31:39 -0500, Jason Qian via Python-list wrote: > > > Thanks a lot :) >

Re: IoT automation

2018-01-28 Thread Dale Marvin via Python-list
On 1/28/18 7:39 AM, Prahallad Achar wrote: Hello team, Could you please help me out in automation of IoT product end to end Regards Prahallad ? --Dale -- https://mail.python.org/mailman/listinfo/python-list

Re: IoT automation

2018-01-29 Thread Prahallad Achar via Python-list
Thank you Mr. Marvin On 29 Jan 2018 12:02 pm, "Dale Marvin via Python-list" < [email protected]> wrote: > On 1/28/18 7:39 AM, Prahallad Achar wrote: > >> Hello team, >> Could you please help me out in automation of IoT product end to end >>

Help on convert PyObject to string (c) Python 3.6

2018-02-04 Thread Jason Qian via Python-list
Hi, This is the case of calling python from c and the python function will return a string. It seems python been called correctly, but got error when convert the python string to c string. -- c -- PyObject* pValue = PyObject_CallObject(pFunc, pArgs); -- python -- import string, ran

Re: Help on convert PyObject to string (c) Python 3.6

2018-02-04 Thread Jason Qian via Python-list
Hi Chris, Thanks a lot ! Using PyUnicode_DecodeUTF8 fix the problem. On Sun, Feb 4, 2018 at 12:02 PM, Chris Angelico wrote: > On Mon, Feb 5, 2018 at 3:52 AM, Jason Qian via Python-list > wrote: > > Hi, > > > >This is the case of calling python from c and th

Help on PyImport_Import(pNAme)

2018-02-04 Thread Jason Qian via Python-list
Hi, This only works when loading modules from the current directory. Is there a way I can load from somewhere else ? Thanks for help, -- https://mail.python.org/mailman/listinfo/python-list

Re: $srcdir and $datadir

2018-02-10 Thread Ben Finney via Python-list
Victor Porton writes: > I want my program to work both when it is installed (using $datadir) > and when it is not yet installed (using $srcdir). Given your descriptions of both those, I don't see how it can reliably work; the program will expect directories that may not exist. Why hard-code them

"Programs" folder not found.

2018-02-15 Thread Enerel Amgalan via Python-list
Hello! So I downloaded “Python” program in C:>Users>(my name)>AppData>Local>Programs>Python.And then in “Local” folder I can’t find “Programs” folder,but it says it downloaded in “Programs”.So can you help me. -- https://mail.python.org/mailman/listinfo/python-list

Re: Help on convert PyObject to string (c) Python 3.6

2018-02-19 Thread Jason Qian via Python-list
Thanks a lot and I will take a look Cython, On Mon, Feb 19, 2018 at 3:23 PM, Stefan Behnel wrote: > Jason Qian via Python-list schrieb am 04.02.2018 um 17:52: > >This is the case of calling python from c and the python function > will > > return a string. > > Hi J

How to link to python 3.6.4 library on linux ?

2018-02-19 Thread Jason Qian via Python-list
Hi, I am calling python from a c application. It compiles and works fine on the windows. How do I compile and link it on the linux for Python 3.6.4 ? Under python dir, it only have a static library, /opt/Python-3.6.4*/lib*/*libpython3.6m.a* * If I link to it, I g

Re: How to link to python 3.6.4 library on linux ?

2018-02-19 Thread Jason Qian via Python-list
Thanks Chris, I think I figured it out that when build python on Linux, we need to enable-shared. Thanks again, On Mon, Feb 19, 2018 at 5:04 PM, Chris Angelico wrote: > On Tue, Feb 20, 2018 at 8:07 AM, Jason Qian via Python-list > wrote: > > Hi, > > > > I am

APPLICATION NOT RUNNING.

2018-03-02 Thread Faruq Bashir via Python-list
I try to run an application with the latest version of python that is python 3.6.4 (32-bit) ., instead of running the application it only shows feel free to mail [email protected] if you continue to encounter issues,Please help me out thanks. -- https://mail.python.org/mailman/listinfo/pyt

Bypassing firewall

2018-03-05 Thread Faruq Bashir via Python-list
    How will i bypass web application firewall -- https://mail.python.org/mailman/listinfo/python-list

Re: Why does datetime.timedelta only have the attributes 'days' and 'seconds'?

2022-04-16 Thread Jon Ribbens via Python-list
On 2022-04-16, Dennis Lee Bieber wrote: > On Sat, 16 Apr 2022 20:35:22 - (UTC), Jon Ribbens > declaimed the following: >>I can categorically guarantee you it is not. But let's put it a >>different way, if you like, if I want to add 24 hours, i.e. 86,400 >>seconds (or indeed any other fixed tim

Re: Why does datetime.timedelta only have the attributes 'days' and 'seconds'?

2022-04-19 Thread Jon Ribbens via Python-list
On 2022-04-19, Loris Bennett wrote: > I now realise that timedelta is not really what I need. I am interested > solely in pure periods, i.e. numbers of seconds, That's exactly what timedelta is. > that I can convert back and forth from a format such as > > 11-22::44:55 I don't recognise that

<    11   12   13   14   15   16   17   18   19   20   >