linux4noobs linux4noobs Why can't I create posts/comments on Lemmy with copy/paste from terminal to show what I did wrong?
Jump
technology Technology Not everyone needs to have an opinion on AI
Jump
  • "Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearHA
    Hammerheart
    7 days ago 92%

    it believes that to “categorically condemn the use of AI writing tools” is both “ableist and classist”. (The implication that working-class people and people with disabilities can only write fiction with the help of generative AI, however, is apparently A-OK.)

    nothing about their initial statement implies that the poor and disabled need to or can only use AI. This sort of bad faith discourse irritates me. It's a deliberate attempt to discredit those espousing an opposing opinion. It's manipulative and intellectually dishonest.

    12
  • opensource Opensource there's a new "zen" Firefox fork on the block focused on theming and has some features from Edge, all licensed under MPL
    Jump
  • "Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearHA
    Hammerheart
    3 weeks ago 100%

    I have the tab bar set to expand when I hover over it. But when I split tabs to see two pages at once, I don't seem able to make them take up different proportions of the screen. The split tabs feature was what made me want to give it a spin, so I hope it is possible.

    2
  • opensource Opensource there's a new "zen" Firefox fork on the block focused on theming and has some features from Edge, all licensed under MPL
    Jump
    opensource Opensource Beyond-All-Reason: Open source RTS game built on top of the Recoil RTS Engine
    Jump
    linux4noobs linux4noobs Beginner Distro recommendations
    Jump
  • "Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearHA
    Hammerheart
    1 month ago 100%

    Ive been daily driving debian since dec 25, 2023. I dont regret it at all. I had some experience using ubuntu in like 2007, but other than that had been using windows exclusively.

    2
  • learn_programming Learn Programming How to go from writing code that works to writing efficient, clean code and following good practices?
    Jump
    linux_memes Linux Memes Thou shalt not roast thy master
    Jump
  • "Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearHA
    Hammerheart
    2 months ago 100%

    It is fucking brutal

    Your "Typing-Speed-Test" repo? Zero stars—sounds about right. And those "bots" you’ve created? They scream “desperation” louder than a midnight Tinder swipe. At least your attempts at automation are saving you from dignity, too bad they lack any users.
    
    Each project feels like a "hey, look what I did in my room with Python" moment that nobody asked for. Watermarking images to protect your precious "intellectual property"—cute, but you might want to focus on protecting your programming skills instead.
    
    3
  • linux
    Linux Hammerheart 2 months ago 90%
    Uber simple FOSS video editing software

    All I want to do is put a still image over a MP3 so I can upload a song to Youtube. (Sidenote: It feels really good to find a song I want to show someone that isn't already on Youtube. It used to be a somewhat regular thing i'd do, I have about a dozen Youtube videos that are just songs I uploaded because I wanted to show them to someone, but I guess Youtube got more stuff and my taste got more pedestrian, so I haven't felt the need to do it until now. Feels good!) I used VEED, a web editor, and it produced a >300mb file. That seems a bit excessive. For the curious, this is the song: https://youtu.be/iLz7VXhCrnk

    8
    4
    programming Programming Advanced Terminal Tips and Tricks
    Jump
  • "Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearHA
    Hammerheart
    2 months ago 100%

    I find it easier using my pinky to hit ctrl than taking my fingers off the home row to use the arrow keys.

    1
  • programming Programming Advanced Terminal Tips and Tricks
    Jump
  • "Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearHA
    Hammerheart
    2 months ago 100%

    ctrl-b: move cursor back one character

    ctrl-f: move cursor foward one character

    ctrl-d: delete character under cursor

    2
  • ask_experienced_devs Ask Experienced Devs Users of Vim and similars, what exactly makes it useful compared to other text editors? How much time do you suppose you save when working with it?
    Jump
    linux Linux [Weekly thread] GNU+Linux help: ask anything!
    Jump
    programming Programming Internet is amazing, but why should it be ruled by Web? Read Alan Kay's insights on WWW in Answer to My Question on Qura
    Jump
  • "Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearHA
    Hammerheart
    3 months ago 100%

    Its pretty cool he mentioned the work of doug engelbert. I recently finished a book called 'what the dormouse said: how the 60s counterculture shaped the personal computer.' Kay's comment makes me feel that was not just a bit of trivia, but a glimpse into the potential of computing that is tsill yet to be realized.

    1
  • python Python Can I get some feedback / review on my code?
    Jump
  • "Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearHA
    Hammerheart
    3 months ago 100%

    I just want you to know you weren't screaming into the void. Look at my new main.py:

    
    from pathlib import PurePath
    
    
    from Layout import Layout
    
    
    DEFAULT_FOLDER = PurePath("/home", "mike", "bg")
    WATERMARK_DIR = Path(Path(os.getcwd()).parent, "assets", "img")
    
    
    def main() -> Layout:
        return Layout()
    
    if __name__ == "__main__":
        main()
    

    (I know I still need to change those folder defaults, but I am still riding the high of getting all that layout stuff into Layout.py and it working. I spent a couple hours today struggling, wondering why I was just getting a blank screen, when i realized i forgot to call .grid() on the frame that held all the widgets! So it was just rendering a blank window. )

    2
  • windows10
    Windows 10 Hammerheart 3 months ago 88%
    how do i turn on this history search in windows terminal?

    Every so often, I accidentally activate .... what ever this is... I can't seem to find any info on what it's called, or exactly what hotkey makes it happen. It kinda bugs me because tonight I wanted to turn it on, because I wanted to access something from my history that it would have been tedious to up arrow to. I thought windowsKey + , did it, but when I tried it in a new tab, it didn't work. Someone must know what this is and how to toggle it.

    7
    1
    technology Technology EU attempt to sneak through new encryption-eroding law slammed by Signal, politicians
    Jump
    linux Linux what are the pros and cons of apt vs flatpak?
    Jump
  • "Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearHA
    Hammerheart
    3 months ago 100%

    I thought id give flatpak firefox a shot and the profiles are broken. I might be able to fix it by making some symlinks but it left a bad taste in my mouth. I was unable to get it to recognize my userChrome.css

    1
  • python Python Can I get some feedback / review on my code?
    Jump
  • "Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearHA
    Hammerheart
    3 months ago 100%

    Thank you SO MUCH. This is exactly the kind of response i wanted, and also thought it would be naive to hope for. Seriously, you'rr awesome.

    And i really appreciate how you even looked for something nice to say too. :)

    7
  • python
    Python Hammerheart 3 months ago 100%
    Can I get some feedback / review on my code?

    I started working through the 100 Days of Code course of Udemy last February, and I'm in the home stretch. I'm on the final lessons, which are really just prompts for projects. No hand holding, just a brief description of the goal. I recently finished a tkinter GUI program, the goal of which was to enable adding text watermarks. I took a few liberties--mainly, I made it possible to layer a png on top of the background. It was a really fun project and quickly grew more complicated than I expected it to. I got some hands on experience with the Single Responsibility Principle, as I started off doing everything in my Layout class. Eventually, I moved all the stuff that actually involved manipulating the Image objects to an ImageManager class. I feel like I could have gotten even more granular. That's one thing I would love to get some feedback on. How would a more experienced programmer have architected this program? Anyway, I guess this preamble is long enough. I'm going to leave a link to the repository here. I would have so much appreciation for anyone who took the time to look at the code, or even clone the repo and see if my instructions for getting it to run on your machine work. [**Watermark GUI Repo**](https://github.com/Taky0nDon/Watermark-Adding-App)

    30
    12
    linux Linux How are you parsing JSON on the command line?
    Jump
  • "Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearHA
    Hammerheart
    3 months ago 75%

    I have perused it, but its both so dense and so broad that its not that helpful unless i know exactly what I'm looking for. I have also tried info and tldr. I actually like tldr the most,. although the exhaustiveness of the man pages must be admired. I dont find it to be the best teacher.

    2
  • linux Linux How are you parsing JSON on the command line?
    Jump
  • "Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearHA
    Hammerheart
    3 months ago 100%

    What are some goos resources for learning jq? I really struggle when it comes to nested keys/values which obviously limits my ability to use it.

    6
  • programmer_humor Programmer Humor Roses are red, violets are blue, everyone is using IPv6, why aren't you?
    Jump
    programming Programming What programming language ruby, python og javascript?
    Jump
  • "Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearHA
    Hammerheart
    3 months ago 100%

    Im biased here, ive been learning python for almost 16 months and only dabbled in Javascript and never did any Ruby, but for a first language, i think python is fantastic. Its "easy" enough to keep you feeling like your skill is actually improving, while still being able to do pretty much anything (where performance is not a high priority). I also just think javascript is ugly to look at.

    3
  • piracy
    Installing and using Jellyfin without root

    cross-posted from: https://programming.dev/post/14680192 > I have a VPS, but no root access so I can't use apt, or even read a lot of the system files. I would like to get jellyfin (or any media server, really) running on it. Jellyfin has a portable installation option, so I followed the instructions in the docs to install it from the .tar.gz. > > But it says I have to install ffmpeg-jellyfin, and I can't find a portable installation of that. My VPS already has ffmpeg installed on it. Will jellyfin work if I just point it to that instead? Or, how can I go about installing ffmpeg-jellyfin without root access?

    12
    4
    linux
    Linux Hammerheart 4 months ago 86%
    Installing and using Jellyfin without root

    I have a VPS, but no root access so I can't use apt, or even read a lot of the system files. I would like to get jellyfin (or any media server, really) running on it. Jellyfin has a portable installation option, so I followed the instructions in the docs to install it from the .tar.gz. But it says I have to install ffmpeg-jellyfin, and I can't find a portable installation of that. My VPS already has ffmpeg installed on it. Will jellyfin work if I just point it to that instead? Or, how can I go about installing ffmpeg-jellyfin without root access?

    21
    13
    linux Linux Can anyone recommend a lightweight, stable distro for a thinkpad?
    Jump
  • "Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearHA
    Hammerheart
    4 months ago 100%

    I have a T560 and i run debian with sway. It serves the dual purpose of getting me more comfortable in the terminal (i even use power shell on my windowa desk top a lot more now), and it runs much better than KDE or gnome did. Im missing some obvious quality of life settings like easily adjusting the power settings (it never sleeps, just turns off the screen and locks). But again, im trying to get more comfortable using the terminal so for me its more of a "take the training wheels off" thing.

    2
  • firefox Firefox How to combat creeping firefox enshitification?
    Jump
  • "Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearHA
    Hammerheart
    4 months ago 100%

    Is this just referring to the firefox sync feature? I love being able to access tabs from my laptop on my phone and vice versa.

    18
  • programmer_humor Programmer Humor What it's like to be a developer in 2024
    Jump
    windows10 Windows 10 How to start a GUI remotely
    Jump
  • "Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearHA
    Hammerheart
    4 months ago 100%

    Yea, i have tried it. It spawns a new process, but doesnt display a window. Unfortunately i dont think theres a simple equivalent to putting in a display parameter like you could on linux (this is the sort of thing that made me switch my laptop to Linux btw. Windows makes it so hard to be a "poweruser." but i digress).

    2
  • windows10
    Windows 10 Hammerheart 4 months ago 100%
    How to start a GUI remotely

    I recently got ssh set up so I can do stuff in powershell on my desktop from my laptop. I want to be able to start a movie on my desktop from my laptop, instead of having to reach for my wireless keyboard. I was researching how to do this with SSH, and it looks like OpenSSH no longer allows you to run the server as a user, it can only be ran as a service which doesn't have access to the desktop. What's the best way to achieve this functionality?

    10
    3
    linux4noobs linux4noobs [debian] What's the best way to get certain programs to run on startup (with sway)
    Jump
  • "Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearHA
    Hammerheart
    4 months ago 100%

    In case this thread turns up a google search, or anyone is keeping score, I think I more or less managed to achieve what I wanted by putting this is in my config:

    assign [class="Firefox-esr"]  "2"
    exec wezterm -e cmus
     exec swaymsg [app_id="org.wezfurlong.wezterm"] focus
     exec swaymsg move container to workspace "10"
     exec firefox
    

    the only thing i don't love is that if quit cmus, it closes the window instead of bringing me back to the shell. maybe i have so chain commands or something, i don't know. i'm happy to have made it this far. Another thing is I don't know if it's possible to distinguish between the specific instance of wezterm that's running cmus, and the other one i want running on workspace 1.

    1
  • linux4noobs
    linux4noobs Hammerheart 4 months ago 85%
    [debian] What's the best way to get certain programs to run on startup (with sway)

    I have been using sway (basically i3 for Wayland) instead of a traditional desktop environment because it really makes a difference in my laptops performance. But apparently sway ignores .desktop files which was how i was autostarting things on KDE. Is the best way to handle this by going through the sway config? If not, how would you do it. Bonus points if you can tell me how to get the autostart programs to also open in specific workspaces.

    5
    4
    learn_programming
    Learn Programming Hammerheart 4 months ago 100%
    Weird behavior in python (tkinter) [SOLVED]

    I'm working on a little gui app that will eventually (hopefully) add a watermark to a photo. But right now I'm focused on just messing around with tkinter and trying to get some basic functionality down. I've managed to display an image. Now I want to change the image to whatever is in the Entry widget (ideally, the user would put an absolute path to an image and nothing else). When I click the button, it makes the image disappear. I made it also create a plain text label to see if that would show up. It did. Okay, time to break out the big guns. Add a breakpoint. `py -m pdb main.py`. it works. wtf? ```python def change_image(): new_image = Image.open(image_path.get()).resize((480, 270)) new_tk_image = ImageTk.PhotoImage(new_image) test_image_label.configure(image=new_tk_image) breakpoint() ``` with the breakpoint, the button that calls change_image works as expected. But without the breakpoint, it just makes the original image disappear. Please help me understand what is happening! edit: all the code ```python import io import tkinter as tk from pathlib import Path from tkinter import ttk from PIL import ImageTk from PIL import Image from LocalImage import Localimage from Layout import Layout class State: def __init__(self) -> None: self.chosen_image_path = "" def update_image_path(self): self.chosen_image_path = image_path.get() def change_image(): new_image = Image.open(image_path.get()).resize((480, 270)) new_tk_image = ImageTk.PhotoImage(new_image) test_image_label.configure(image=new_tk_image) breakpoint() TEST_PHOTO_PATH = "/home/me/bg/space.png" PIL_TEST_PHOTO_PATH = "/home/me/bg/cyberpunkcity.jpg" pil_test_img = Image.open(PIL_TEST_PHOTO_PATH).resize((480,270)) # why does the resize method call behave differently when i inline it # instead of doing pil_test_img.resize() on a separate line? root = tk.Tk() root.title("Watermark Me") mainframe = ttk.Frame(root, padding="3 3 12 12") mainframe.grid(column=0, row=0, sticky="NWES") layout = Layout(mainframe) image_path = tk.StringVar() tk_image = ImageTk.PhotoImage(pil_test_img) test_image_label = ttk.Label(image=tk_image) entry_label = ttk.Label(mainframe, text="Choose an image to watermark:") image_path_entry = ttk.Entry(mainframe, textvariable=image_path) select_button = ttk.Button(mainframe, text="Select", command=change_image) hide_button = ttk.Button(mainframe, text="Hide", command= lambda x=test_image_label: layout.hide_image(x)) test_text_label = ttk.Label(mainframe, text="here i am") empty_label = ttk.Label(mainframe, text="") for child in mainframe.winfo_children(): child.grid_configure(padx=5, pady=5) entry_label.grid(column=0, row=0) image_path_entry.grid(column=1, row=0) hide_button.grid(column=0, row=3) select_button.grid(column=0, row=4) test_image_label.grid(column=0, row=5) empty_label.grid(column=0, row=6) image_path_entry.insert(0,TEST_PHOTO_PATH) image_path_entry.focus() breakpoint() root.mainloop() ```

    15
    9
    linux
    Linux Hammerheart 8 months ago 93%
    How to see CMUS logs / get info for bug reports

    Sometimes my CMUS will randomly stop playing a track or it won't play the next track until I manually go in and hit `c` (for resume) or otherwise initiate playback. I would like to be able to see what happened before these instances so i could either fix my config or, if its a problem beyond the scope of my local environment, get info to write up a proper bug report with. Where can I find such logs? Would they be in the systemd journal or somewhere in /var ?

    14
    2
    neovim
    Neovim Hammerheart 9 months ago 92%
    :s/ failed to find the `^M` s

    So I just had an issue where my shebang lines weren't parsing properly for a python script I was attempting to execute. A quick google revealed that it was probably because I wrote the scripts on windows and now I was trying to run them on Linux (so happy i finally made the switch btw. using the computer is fun again!). So i took the advice I found and tried to run `:%s/^M/` (using C-v, C-m to insert the escape character), and it failed to find any matches. I tried the same command in vanilla vi and it worked. Is there some setting I don't have configured properly? I would prefer to be able to do this sort of thing within neovim.

    11
    3
    linux
    Linux Hammerheart 9 months ago 91%
    Xclip is not talking to the system clipboard (Klipper)

    If anyone could help me out with this, I'd greatly appreciate it. Basically, I can't ctrl + v to paste anything I pipe into the clipboard selection in xclip, and i can't `xclip -o` anything I copied with ctrl-c or ctrl-shift-c. Maybe I want to paste a path into a neovim file. `echo $(pwd) | xclip -i -sel c` Now the path is in my clipboard, right? It sure shows up if i `xclip -o -sel c`! But when I go into neovim and paste from the unnamedplus register, instead it pastes the last thing I copied in my browser. if I want to copy the output of something from my terminal and google it, ctrl+v in the browser completely ignores my xclip selection. i am forced to use the mouse and ctrl+shift+c in order to paste it into a search engine, like a caveman. I hope I've done a decent enough job explaining the problem. It was most apparent earlier, as I was making a cronjob and I had to be explicit about file paths because i couldn't assume the working directory would be the directory of the script I was calling. I really wish I could have just `echo $(pwd) | xclip -sel c`; open neovim; hit p; see the path appear in my file. I have a little clipboard icon in my system tray with my copy history, except none of the things I put in the clipboard selection with `xclip -sel c` or `xsel -b` appear there. I think that program is klipper, but I'm not sure. I know there's a number of work arounds but still this kind of frustrates me. I think it has something to do with wayland and xclipboard not talking to each other. I am running wayland, KDE Plasma 5.27.5, and Debian 12. Is there a simple configuration setting I can tweak, or do I need to find something to replace klipper or xclip? I have tried toggling the `keep selection and clipboard the same` and `always save text selection in history` settings in the plasma clipboard, no change. I tried two terminal emulators to no avail. I will happily provide any more information if it would be helpful.

    19
    2
    linux
    Linux Hammerheart 9 months ago 87%
    I feel like breaking my windows install was a rite of passage

    Lately ive noticed that i was wanting to do certain things on Windows that just seemed much easier and more intuitive on Linux, based in the OS specific solutions i would see to problems i encountered. And i was more frequently using software where Windows support seemed like an after thought. A couple days ago i finally sat down and tried to install Mint. The installer didnt recognize my windows partition so it didnt offer any assistance. And a stroke of fate saw my internet connection dieing at the exact same time. Yes, i cant believe it either. So i decided to live dangerously and just try to wing the installation with no outside help. It seems like creating a second EFI partition was not the right call. The install failed, and I couldn't get back onto windows. I wound up just using a live ubuntu image for a few days while i wrestled with repairing the boot loader. I didnt succeed. Eventually i just made a windows recovery disk from my Desktop with an intact copy of windows, and had to reinstall windows. Then i did manage to successfully install Debian, and ive been having such a great time with it so far. I feel like i probably didnt even need to keep a windows partition, especially since i could have just used my desktop if i REALLY needed windows. I havent had this much fun just using the computer since i was a kid.

    111
    22
    neovim
    Neovim Hammerheart 9 months ago 100%
    UndoTree Plugin Not Working

    I'm new to vim and getting the hang of the configuration. I've gone through a couple of youtube videos giving a tutorial of setting it up with lazy.nvim. Now I am following ThePrimeagen's config, and UndoTree doesn't work. The plugin is loaded and my config is properly sourced, but when I run run :UndoTreeToggle, I get this lovely error: `(E5108: Error executing lua: function undotree#UndotreeToggle[11]..<SNR>37_new[2]..41, line 6: Vim(echoerr):"diff" is not executable. stack traceback: [C]: at 0x7ff77ae89570)` I am running windows (currenty in the process of backing up my personal data so I can try out Linux without feeling too disconnected from my daily computer user). I did a little bit of google searching and checked the issues on github, unfortunately I couldn't find anything related to my problem. Any help would be much appreciated.

    8
    1
    learn_programming
    Learn Programming Hammerheart 1 year ago 100%
    Why am I getting this unexpected arguments warning in python?

    I am working on user authentication in Flask. I have my User class, which inherits from db.Model (SQLAlchemy) and UserMixins (flask-login): ```python class User(db.Model, UserMixin): id = db.Column(db.Integer, primary_key=True) email = db.Column(db.String(100), unique=True) password = db.Column(db.String(100)) name = db.Column(db.String(1000)) ``` and I create a new User object during registration: ```python new_user = User( name=request.form["name"], password=generate_password_hash(password=request.form.get("password"), salt_length=8, method="pbkdf2:sha256"), email=request.form["email"]) ``` Since I inherited from UserMixins, I started to get an "unexpected arguments" warning from pycharm when I create new_user. can someone explain to me why that is? If I don't inherit from UserMixins, the warning goes away.

    10
    2
    meta
    Programming.dev Meta Hammerheart 1 year ago 100%
    I can't log into pd in jerboa?

    So, it used to work just fine. Then jerboa became basically unusable due to some bug. That was a few weeks ago. I saw an update was available, so I thought to give it another try. It's much more stable after the update, and my lemmy.one account works just fine. But when I try to log in with this account on jerboa, I get an incorrect login error. I set the instance to "programming.dev" and I know I used the right credentials because my password manager filled them in, just like it does in the browser. Any ideas on a cause or fix? It might be a jerboa issue but I don't get why it seems to only impact this instance.

    3
    4
    python
    Python Hammerheart 1 year ago 100%
    [Solved] Help with spotipy

    I am trying to create a playlist with spotify and the spotipy library in python. However, I keep getting a "No token provided" error when making my API request. However, if I use the same token with a curl request, it works! Can someone please help. This is my code: ``` auth_manager = SpotifyOAuth(client_id=CLIENT, client_secret=SECRET, redirect_uri="http://example.com/", scope=SCOPE, username=spotify_display_name ) token = auth_manager.get_access_token( as_dict=False, check_cache=True ) sp = spotipy.Spotify(auth_manager=auth_manager, auth=token ) user_dict = sp.current_user() user_id = user_dict["id"] print(f"Welcome, {user_dict['display_name']}") # SEARCH # QUERY FORMAT: "track: track-name year: YYYY" spotify_search_endpoint = "https://api.spotify.com/v1/search/" test_query = "track:Hangin'+Tough year:1989" search_parameters = { "q": format_query(test_query), "type": "track" } results = sp.search(q=search_parameters["q"]) print(results) ``` output: ``` {'tracks': {'href': 'https://api.spotify.com/v1/search?query=track%3AHangin%27%2BTough%2520year%3A1989&type=track&offset=0&limit=10', 'items': [], 'limit': 10, 'next': None, 'offset': 0, 'previous': None, 'total': 0}} ``` ``` { "error": { "status": 401, "message": "No token provided" } } ``` This is really frustrating! The authentication is working, otherwise the token wouldn't have been valid for the curl request. I must be doing something wrong with spotipy.

    6
    9
    c_lang
    C Programming Language Hammerheart 1 year ago 100%
    I made my first C program!

    I was looking over the first kata i did on codewars, and I thought it would be fun to try and solve it in C. The object was to return a string based on a boolean input. it took a lot of trial and error, googling, chat gippity, but I eventually got it to work. I am still focused on learning python, but I've had it in my mind that I should branch out once I've reached a competence plateau in python. I'm nowhere near that plateau yet, but this seemed simple enough to warrant the necessary investment in time to accomplish it. ``` // C: #include <stdbool.h> // FIRST EVER C PROGRAM const char *bool_to_word (bool value){ // you can return a static/global string or a string literal if (value == 1){ return "Yes"; } else{ return "No"; } } ``` I realize this is pretty trivial, but still, it's a milestone for me and I wanted to do my part to get the ball rolling on this community.

    6
    5