Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
graph
Nov 22, 2006

aaag peanuts
what a terrible night to program a curse

Adbot
ADBOT LOVES YOU

mediaphage
Mar 22, 2007

Excuse me, pardon me, sheer perfection coming through

graph posted:

what a terrible night to program a curse

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

Silver Alicorn posted:

thanks anyway

yw

root of all eval
Dec 28, 2002

From MY perspective python is a nightmare without virtual environments, and even then you have to worry about pip package dependencies. And then that sucks so we use poetry to create our local venvs and pip reqs. And then docker to actually run anything.

OSs seem to have a habit of needing a specific python version and it's never the one you want.

This is the same for any non compiled scripting language, and I guess same for compiled too to an extent though it's more hardware architecture based?

Don't know if that helps but good luck OP.

root of all eval
Dec 28, 2002

Also on windows you can and should be using Linux subsystem. It's actually good

Silver Alicorn
Mar 30, 2008

𝓪 𝓻𝓮𝓭 𝓹𝓪𝓷𝓭𝓪 𝓲𝓼 𝓪 𝓬𝓾𝓻𝓲𝓸𝓾𝓼 𝓼𝓸𝓻𝓽 𝓸𝓯 𝓬𝓻𝓮𝓪𝓽𝓾𝓻𝓮
yeah I just wanted to see if it would work really.

root of all eval
Dec 28, 2002

At that rate you may be able to do something like this
https://pyinstaller.org/en/stable/

As far as I can tell it bundles up a python version, your code and all the dependencies as a little standalone executable for a target platform.

It should just be 'runnable' with the overhead of a bigger executable size. Never tried it though outside of Deno which is a JS runtime as a standalone

Best Bi Geek Squid
Mar 25, 2016
I vaguely remember having to janitor some things so that the same python curses script would work on both linux and windows. I forget what it was but there is something about most windows curses implementations that is very slightly off. I don’t remember what that is now, so you’re welcome for this very useful tip! :cheers:

Silver Alicorn
Mar 30, 2008

𝓪 𝓻𝓮𝓭 𝓹𝓪𝓷𝓭𝓪 𝓲𝓼 𝓪 𝓬𝓾𝓻𝓲𝓸𝓾𝓼 𝓼𝓸𝓻𝓽 𝓸𝓯 𝓬𝓻𝓮𝓪𝓽𝓾𝓻𝓮
thanks I had it working in an older project so I’ll see if there’s any special incantations I needed back then.

tk
Dec 10, 2003

Nap Ghost
Sophisticated interfaces, I type my curses in Comic Sans.

root of all eval
Dec 28, 2002

I'm a goober and didn't realize curses was a module level c wrapper

"The Windows version of Python doesn’t include the curses module. A ported version called UniCurses is available."

https://pypi.org/project/UniCurses/

Jonny 290
May 5, 2005



[ASK] me about OS/2 Warp
one of the bbs software packages i used to gently caress with actually used curses to give the ability to draw windows etc. it kinda ruled. i built a yospos browser inside of it

Best Bi Geek Squid
Mar 25, 2016

Best Bi Geek Squid posted:

op make a yospos roguelike

Jonny 290 posted:

a yospos browser inside of it

the people have spoken, op. they want the pos

root of all eval
Dec 28, 2002

The game in question is spacepos so

Beeftweeter
Jun 28, 2005

a medium-format picture of beeftweeter staring silently at the camera, a quizzical expression on his face

Hed posted:

notcurses looks pretty cool



whoa this owns

Beeftweeter
Jun 28, 2005

a medium-format picture of beeftweeter staring silently at the camera, a quizzical expression on his face

Cybernetic Vermin posted:

i like rich for just easily prettying up a program: https://github.com/Textualize/rich

the sister project textual is something to have seen once, but rather a step too far for any need i've ever had: https://github.com/Textualize/textual

this seems cool too and i think i'm gonna use it

Silver Alicorn
Mar 30, 2008

𝓪 𝓻𝓮𝓭 𝓹𝓪𝓷𝓭𝓪 𝓲𝓼 𝓪 𝓬𝓾𝓻𝓲𝓸𝓾𝓼 𝓼𝓸𝓻𝓽 𝓸𝓯 𝓬𝓻𝓮𝓪𝓽𝓾𝓻𝓮
i'm still programming curses. also I've learned how to make a tree style data structure, serialize it as json and load it back in. another tool in my belt

Beeftweeter
Jun 28, 2005

a medium-format picture of beeftweeter staring silently at the camera, a quizzical expression on his face
i think rich displays that (formatted, obviously) for you? one of the examples shows something like that

Silver Alicorn
Mar 30, 2008

𝓪 𝓻𝓮𝓭 𝓹𝓪𝓷𝓭𝓪 𝓲𝓼 𝓪 𝓬𝓾𝓻𝓲𝓸𝓾𝓼 𝓼𝓸𝓻𝓽 𝓸𝓯 𝓬𝓻𝓮𝓪𝓽𝓾𝓻𝓮
cool

Beeftweeter
Jun 28, 2005

a medium-format picture of beeftweeter staring silently at the camera, a quizzical expression on his face

huh, what is this using libav/ffmpeg for? afaik there's a ncurses output device for ffmpeg/ffplay, but other than that i've never seen support for notcurses

Best Bi Geek Squid
Mar 25, 2016
json derulo

Hed
Mar 31, 2004

Fun Shoe

Beeftweeter posted:

huh, what is this using libav/ffmpeg for? afaik there's a ncurses output device for ffmpeg/ffplay, but other than that i've never seen support for notcurses

It's so it can embed images/moving images but I haven't played around with this functionality much.
But you can see it here:
https://www.youtube.com/watch?v=dcjkezf1ARY
(skip to 20s, I forget how to make the SA-formatted tagged YT link do it)

Silver Alicorn
Mar 30, 2008

𝓪 𝓻𝓮𝓭 𝓹𝓪𝓷𝓭𝓪 𝓲𝓼 𝓪 𝓬𝓾𝓻𝓲𝓸𝓾𝓼 𝓼𝓸𝓻𝓽 𝓸𝓯 𝓬𝓻𝓮𝓪𝓽𝓾𝓻𝓮
huh, turns out I can't just use the escape key cause of something called "escape sequences"? weird

git apologist
Jun 4, 2003

Silver Alicorn posted:

i'm working on a project and I'm doing it in python with curses. seems cool so far. it tells me when the terminal size changes and I can write text to the screen and handle input. I'm not having too much trouble finding documentation/examples.

should I be using some other bullshit? curses is available on the host I'm working with (sdf dot org) and I assume its available on a wide variety of platforms so it seems natural to me.

also is it normal to wrap the write function so it doesn't crash the program every time you accidentally write outside the screen buffer

i used some python cli library i think it was this https://github.com/tiangolo/typer

writing a curses app seems cool maybe i’ll try it

Silver Alicorn
Mar 30, 2008

𝓪 𝓻𝓮𝓭 𝓹𝓪𝓷𝓭𝓪 𝓲𝓼 𝓪 𝓬𝓾𝓻𝓲𝓸𝓾𝓼 𝓼𝓸𝓻𝓽 𝓸𝓯 𝓬𝓻𝓮𝓪𝓽𝓾𝓻𝓮
curses is pretty simple and it's available on many systems

polyester concept
Mar 29, 2017

i use curses every time i have to write code

polyester concept
Mar 29, 2017

well-read undead posted:

i curse a lot when i'm programming, does that help op?

:doh:

outhole surfer
Mar 18, 2003

https://esolangs.org/wiki/Fuckfuck

programming in curses

Best Bi Geek Squid
Mar 25, 2016

quote:

This is a very sanitised version of hello world.
code:
barb!!!!!!!!! able folk barb!!!!!! folk barb!!!!!!!!! folk
barb!! folk barb sing!!! teas bait folk barb! cask folk barb cask
barb!!!!!! cask! barb!! cask folk barb! cask sing! barb!!!!!!!!!!!!!!
cask folk cask barb!! cask teas!!!!! cask teas!!!!!!! cask folk barb
cask folk cask

rotor
Jun 11, 2001

classic case of pineapple derangement syndrome

these things are never clever or funny and they just strike me as tragic wastes of the human spirit

outhole surfer
Mar 18, 2003

rotor posted:

these things are never clever or funny and they just strike me as tragic wastes of the human spirit

i dunno -- brainfuck is a fun/clever toy, and f*ckf*ck is just a play on brainfuck, subbing in curse words for operators.

rotor
Jun 11, 2001

classic case of pineapple derangement syndrome
yes exactly

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

Silver Alicorn posted:

curses is pretty simple and it's available on many systems

are you sure? can you double check?

matti
Mar 31, 2019

Silver Alicorn posted:

curses is pretty simple and it's available on many systems

it does not work though

matti
Mar 31, 2019

it's a library from 1978 before unix even had asynchronous interfaces

slightly papered over by system v and later by the open group

just absolutely abysmal

matti
Mar 31, 2019

term.h feels relatively modern in comparison

matti fucked around with this message at 04:53 on Feb 25, 2024

Broken Machine
Oct 22, 2010

have you considered ncurses?

https://en.wikipedia.org/wiki/Ncurses

it's a lot like curses. except it is new and improved with better interfaces. it's what the freebsd installer uses even

Neslepaks
Sep 3, 2003

lol

Cybernetic Vermin
Apr 18, 2005

good that someone said, because my memory of (n)curses is that it is one of those ancient lovely libraries that was really bad even when it was new. both in that it is incredibly convoluted for what it is, and kind of notably i believe it had way less functionality than most terminal libraries at the time.

so i opt to read the "curses" in the thread title as the more general "anyone doing cool and thought through ui on the terminal", which i do love.

Adbot
ADBOT LOVES YOU

Broken Machine
Oct 22, 2010

ncurses is fine, actually. last updated 2022. if you've used screen, you've enjoyed it yourself. it's still under mit license even

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply