How to read the response from an university website in python? [duplicate] - python

This question already has answers here:
What is the quickest way to HTTP GET in Python?
(14 answers)
How to scrape a website which requires login using python and beautifulsoup?
(5 answers)
Closed 21 days ago.
The community is reviewing whether to reopen this question as of 21 days ago.
I am trying to make a monitor thing to detect the course vacancy so that I can take the lecture at college. When I checked for the vacancy, I clicked the button, and it popped up a window showing all classes' current vacancy. I had also taken a look into f12, I saw a json file in networking(it is a file about the vacancy).
I want to read this file in python so I can detect any changes of it. But the question is I need to log in first, then I can read the file. How should I do this in python?
Hope you guys understand my question ( I already tried my best to explain this q. as I am fairly new to python.)
I want to make a monitor to keep checking the vacancy of a course. Can anyone help?

Related

Discord.py How would I retrieve the NICKNAME of someone in the server when having their ID? [duplicate]

This question already has answers here:
Obtaining username from user id | discord.py
(2 answers)
Closed 2 years ago.
How would I retrieve the NICKNAME of someone in the server when having their ID?
Pretty straight forward question.
Thanks in advance!
There is fairly robust documentation on discord.py, here's the link to the specific section I think you want.
https://discordpy.readthedocs.io/en/latest/api.html#discord.Client.user
https://discordpy.readthedocs.io/en/latest/api.html#discord.User.display_name
I would read through it before you actually start coding much more, and always reference it when you are stuck. I'm not actually going to provide you with the code because I feel it is necessary to study the docs anyway.

How to make a .py file not human readable? [duplicate]

This question already has answers here:
How to obfuscate Python code effectively? [duplicate]
(22 answers)
Closed 3 years ago.
I have a script in .py format and random forest in pickle format and i should deliver it to a customer . He should not be able to read both.
If you really have to hide the code **, I recommend you to use an obfuscator
An example: https://wiki.python.org/moin/Pyarmor
PS: you have a similar question here: How to obfuscate Python code effectively?
Also, this is something I never did or explored, but through PYC-only distribution could be an alternative, but you must explore this by yourself.
Find out more at https://www.curiousefficiency.org/posts/2011/04/benefits-and-limitations-of-pyc-only.html
*** I know obfuscating code is not nice, but sometimes companies require it :/

How do I store data that it is inputted forever? [duplicate]

This question already has answers here:
How to save a dictionary to a file?
(12 answers)
Closed 5 years ago.
I want to take an input from someone and save it in a dictionary even after I end the program so that I can run it again and retrieve the information. How do I do this?
You need to save the information to a file or database when the program ends and reload it when it starts. Pickle is one way you can do that.

Get the current location using python [duplicate]

This question already has answers here:
Is there any GPS library for use in Python?
(2 answers)
Closed 8 years ago.
Hi I am trying to get the location of my computer using python.
I looked at the web and nothing.
Is it even possible in python?
Perhaps this question could be reworded? Are you asking "Is there a GPS library in python?" If so...Is there any GPS library for use in Python?

Go to line python [duplicate]

This question already has answers here:
Is there a label/goto in Python?
(22 answers)
Closed 9 years ago.
I want my program to go to a certain line in the program which is running when it I needed to and run from there. Is this possible and if so How can this be done?
Put whatever lines you want to be done in a function, then put the function call where you want. Goto is bad form in any language, and it doesn't exist in Python.
If you think your code is too short to warrant a full function, you can use a lambda function (but those can be tricky).

Categories

Resources