#๐Ÿ”’ quick question

89 messages ยท Page 1 of 1 (latest)

golden zenithBOT
#

@wheat pelican

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

wheat pelican
#

br?

#

what

#

Oh

#

That makes sense

cosmic spindle
#

It looks like a discord link

wheat pelican
#

Fair

#

It's just the custom Discord URL protocols

cosmic spindle
#

Yah, that's funny, you're cool just maybe space it or something

wheat pelican
#

discord :// -/message-requests

#

ok

#

ty

#

basically I'm trying to execute a url protocol in python

#

i tried with os.system but it doesnt work

#

the stackoverflow post suggested that i use start <x> but it doesnt look like i can provide the extra url params

cosmic spindle
#

A url isn't a command

#

That os.system is to run commands (executables), just like you would at your command prompt/shell

wheat pelican
#

Fair

cosmic spindle
#

I don't work with discord's APIs so I'm not really familiar with this stuff.

wheat pelican
#

nah but like

cosmic spindle
#

What are you trying to accomplish?

wheat pelican
#

this is for any URL protocol

#

discord is just an example

#

at the moment im trying to run a roblox protocol

#

roblox-player://placeId=1

#

and it automatically launches roblox to that place ID

sharp fox
#

Well then you need to determine which application can interpret those URLs

wheat pelican
#

Wait

cosmic spindle
#

'Run a Roblox protocol': what do you mean by this? You want to open a webpage to a url?

sharp fox
#

And then figure out how to launch that program passing it that URL

wheat pelican
#

are just like

#

params to the executable?

sharp fox
#

Well, I'm not sure on the implementation details to be frank

cosmic spindle
sharp fox
#

I think explorer.exe should be able to handle the URL iirc

wheat pelican
#

just open the roblox applicataion with those parameters

#

bc it works with Run

sharp fox
#

It will read the registry and find the correct handler based on the protocol

wheat pelican
#

and it works with web browsers

sharp fox
#

But it's not platform agnostic

cosmic spindle
#

Yes, you could open chrome <url>, for instance

wheat pelican
#

i only need it to work on windows

sharp fox
#

If you run 'explorer.exe [URL]'

wheat pelican
#

like this?

#

explorer.exe roblox://placeId=1

sharp fox
#

Yeah I think that should work

wheat pelican
#

unfortunately not

#

its so odd

cosmic spindle
#

Or show code, better yet

wheat pelican
#

just opens regular explorer

#

without any url execution

cosmic spindle
#

I said chrome

wheat pelican
#

oh shoot

#

i was answering the other dude

#

ok hold

cosmic spindle
#

Tbh, I'm not sure you're going to accomplish what you want to accomplish, but: once you figure out how to do it manually, then you can use os.system. Both Roblox and discord have api's.

wheat pelican
#

they both have APIs

#

but its not what i want to accomplish

sharp fox
#

And not the run box

wheat pelican
#

i tried later in the video

#

tried run box, tried start explorer.exe roblox://placeId=1, tried os.system("explorer.exe roblox://placeId=1")

sharp fox
#

Ah mb

cosmic spindle
#

Yah, why do you expect that url to work?

#

If it doesn't work in browser?

wheat pelican
#

because the Run window is explorer under the hood

cosmic spindle
#

Try 'start' not 'explorer'

wheat pelican
#

start roblox://placeId=1?

cosmic spindle
#

Sure, try it from command prompt

wheat pelican
#

Works

#

Wait what

#

How does that work but not when I do os.system

#

Wait what

cosmic spindle
#

But you never tried start with os.system

wheat pelican
#

Holy

#

Thanks

cosmic spindle
#

Start is equivalent to run, explorer is the file explorer (not same as run)

wheat pelican
#

I was about to learn the internal ways Run works and ShellRunDialog and shit and then I didnt do the simplest option ๐Ÿ˜ญ

#

Ty

#

!close

golden zenithBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.