Questions tagged [python-trio]

Trio is a Python package for async concurrency and I/O that's obsessed with usability and correctness

Official web site

87 questions
0
votes
1 answer

Unable to validate my query for particular website

I'm trying to query the following website where Access Number will be a fixed value of 8778791867 And the PIN will be dynamic. From the normal browser am able to check if it's valid or invalid pin. But using my code below, I'm unable to get the…
0
votes
0 answers

Trio with Asyncio and starting/closing loops properly

So I am starting my program like this: try: b.loop.call_soon_threadsafe(b.loop.run_in_executor, None, lambda: trio.run(wallpaper)) except BaseException as e: sys.exit(e) try: b.loop.run_until_complete(background_task()) …
0
votes
1 answer

In Trio, how do you write data to a socket without waiting?

In Trio, if you want to write some data to a TCP socket then the obvious choice is send_all: my_stream = await trio.open_tcp_stream("localhost", 1234) await my_stream.send_all(b"some data") Note that this both sends that data over the socket and…
Arthur Tacca
  • 8,833
  • 2
  • 31
  • 49
0
votes
1 answer

How to synchronize two trio co-routines?

I'm going through Trio tutorial and I made an echo-client that sends message to an echo server for 10 seconds: async def sender(client_stream, flag): print("sender: started!") end_time = time.time() + 10 while time.time() < end_time: …
Jenia Ivanov
  • 2,485
  • 3
  • 41
  • 69
0
votes
1 answer

How to use Trio for fast web api calls?

I'm trying to speed up some code that calls an api_caller(), which is a generator that you can iterate over to get results. My synchronous code looks something like this: def process_comment_tree(p): # time consuming breadth first search that…
theQman
  • 1,690
  • 6
  • 29
  • 52
0
votes
1 answer

Asynchronous image search on screen with Trio

I'm trying to adapt this module to support asynchronous execution when searching for a lot of images in the same screenshot at a given time. I'm kind of new to async coding and after a lot of research I chose Trio to do it (because of it's…
Teodoro
  • 1,194
  • 8
  • 22
0
votes
1 answer

trio.open_process and trio.run_process give attribute errors

I'm trying to create an async subprocess and pass a variable to stdin but trio.run_process and trio.open_process both give an attribute error. It doesn't specify what is causing the error. Traceback (most recent call last): File "./update.py",…
Hussar
  • 53
  • 5
0
votes
1 answer

Python Trio set up a decimal number of workers

I'm working with trio to run asynchronous concurrent task that will do some web scraping on different websites. I'd like to be able to chose how many concurrent workers I'll divide the tasks with. To do so I've written this code async def…
Tom
  • 571
  • 2
  • 11
  • 29
0
votes
1 answer

Proper way to start a Trio server that manages multiple TCP Connections

I recently finished a project using a mix of Django and Twisted and realized it's overkill for what I need which is basically just a way for my servers to communicate via TCP sockets. I turned to Trio and so far I'm liking what I see as it's way…
Lorenzo Ang
  • 1,202
  • 3
  • 12
  • 35
0
votes
1 answer

Any advice on how to tune parameters to download urls faster with less errors? (trio + asks)

I'am writing simple program that downloads list of urls. prepare list of urls !curl -LO https://github.com/mozilla/cipherscan/raw/master/top1m/top-1m.csv !head -5 top-1m.csv …
tandav
  • 775
  • 2
  • 9
  • 14
0
votes
4 answers

Combining semaphore and time limiting in python-trio with asks http request

I'm trying to use Python in an async manner in order to speed up my requests to a server. The server has a slow response time (often several seconds, but also sometimes faster than a second), but works well in parallel. I have no access to this…
Manu CJ
  • 2,629
  • 1
  • 18
  • 29
0
votes
1 answer

python-trio: AttributeError: sendall

I'm just trying to run the echo-client-low-level.py from the python-trio docs: # echo-client-low-level.py import sys import trio # arbitrary, but: # - must be in between 1024 and 65535 # - can't be in use by some other program on your computer # -…
NarūnasK
  • 4,564
  • 8
  • 50
  • 76
1 2 3 4 5
6