Search Results
|
Post |
Author |
Forum |
Replies |
Views |
Posted
[asc]
|
|
|
Thread: c:\... Syntax
Post: RE: c:\... Syntax
import requests
import base64
from requests.auth import HTTPBasicAuth
myobj=""
# Set user and password
UserName = "User"
Password = "Password"
# Encode the username and password here
#message = UserNa... |
|
Aussie |
General Coding Help |
18 |
5,504 |
Jan-13-2021, 10:00 PM |
|
|
Thread: c:\... Syntax
Post: RE: c:\... Syntax
Hi, I have tried a number of syntax combinations.
I am hoping there is one still remaining that I have not.
Surely it shouldn't be this difficult.
I have searched the web and not found anything that w... |
|
Aussie |
General Coding Help |
18 |
5,504 |
Jan-12-2021, 09:38 PM |
|
|
Thread: c:\... Syntax
Post: RE: c:\... Syntax
import requests
import base64
# Set user and password
UserName = "Xxxxxx"
Password = "Xxxxxx"
# Encode the username and password here
#message = UserName+":"+Password
message = f'{UserName}:{Password}... |
|
Aussie |
General Coding Help |
18 |
5,504 |
Jan-12-2021, 04:42 PM |
|
|
Thread: c:\... Syntax
Post: RE: c:\... Syntax
Is it possible to turn the ssl verification off?
Thanks, |
|
Aussie |
General Coding Help |
18 |
5,504 |
Jan-12-2021, 10:01 AM |
|
|
Thread: c:\... Syntax
Post: RE: c:\... Syntax
Hi Guy's,
Is there an URL that requires SSL and I can get the associated certificate, so I can test.
As I cant really give details out, which makes it difficult for others to try and give advice.
I ha... |
|
Aussie |
General Coding Help |
18 |
5,504 |
Jan-11-2021, 06:00 AM |
|
|
Thread: c:\... Syntax
Post: RE: c:\... Syntax
New error below.
Arrow below y of verify.
verify="C:\Desktop\NFUJDEV236.cer")
... |
|
Aussie |
General Coding Help |
18 |
5,504 |
Jan-10-2021, 09:59 PM |
|
|
Thread: c:\... Syntax
Post: RE: c:\... Syntax
>>> %Run 'HTTP Test.py'
Traceback (most recent call last):
File "C:\Users\Administrator\Documents\HTTP Test.py", line 19
x = requests.get('https://xxxx.xxxx.xxxx.xxxx:8443/xxxx/xxxx/ret... |
|
Aussie |
General Coding Help |
18 |
5,504 |
Jan-08-2021, 11:08 PM |
|
|
Thread: c:\... Syntax
Post: RE: c:\... Syntax
import requests
import base64
# Set user and password
UserName = "User"
Password = "Password"
# Encode the username and password here
message = UserName+":"+Password
print(message)
message_bytes = mes... |
|
Aussie |
General Coding Help |
18 |
5,504 |
Jan-08-2021, 11:00 PM |
|
|
Thread: c:\... Syntax
Post: RE: c:\... Syntax
I can put up the full code tomorrow, its on my work pc.
It is to do with a HTTP request and an SSL certificate.
I am not totally sure this is the correct way to do it or if a Python reference needs to... |
|
Aussie |
General Coding Help |
18 |
5,504 |
Jan-08-2021, 09:24 AM |
|
|
Thread: c:\... Syntax
Post: c:\... Syntax
Hi Guy's,
I am trying to send a request.
When I try to run the code I get an error arrow below the C: in the below line;
verify=r"C:\\Users\Administrator\DEV236.cer"
SyntaxError: can't as... |
|
Aussie |
General Coding Help |
18 |
5,504 |
Jan-08-2021, 08:48 AM |
|
|
Thread: Python Requests SSL
Post: Python Requests SSL
Hi,
I have managed to get Auth working. However, using the SSL certificate is proving difficult.
Any ideas? verify ='C:/Users/Administrator/Desktop/xxxxxxx.cer'. Thanks,
------------------------------... |
|
Aussie |
General Coding Help |
0 |
1,960 |
Jan-07-2021, 02:09 AM |
|
|
Thread: Python Requests
Post: RE: Python Requests
Hi,
I have managed to get Auth working. However, using the SSL certificate is proving difficult.
Any ideas?
--------------------------------------------------------------------------
import requests
... |
|
Aussie |
General Coding Help |
2 |
2,692 |
Dec-23-2020, 03:24 AM |
|
|
Thread: Python Requests
Post: Python Requests
Hi,
I have started looking at requests in Python.
It must be possible to add both an ssl and authentication right?
If correct, how.
Also, you can write payloads to class's right.
Thanks, **smile** |
|
Aussie |
General Coding Help |
2 |
2,692 |
Sep-07-2020, 10:46 AM |
|
|
Thread: Array
Post: RE: Array
Hi, sorry about the long length of code.
However, I feel I need to show in full to describe what I am about.
The code below works. However, surely there is a more elegant way.
I tried to use a for loo... |
|
Aussie |
General Coding Help |
2 |
1,917 |
Sep-03-2020, 09:56 PM |
|
|
Thread: Array
Post: Array
Hi, I want to print the sample values to a csv file.
The code below does create a file and prints to it.
Though I want the "value" part of the writerow to an actual sample value.
Blank1, DateTime, B... |
|
Aussie |
General Coding Help |
2 |
1,917 |
Sep-03-2020, 04:06 AM |
|
|
Thread: Binary File Read
Post: RE: Binary File Read
Hi, further to this I want to print to a csv file.
The code below does create a file and prints to it.
Though I want the "value" part of the writerow to an actual sample value.
And each sample value ... |
|
Aussie |
General Coding Help |
6 |
8,226 |
Sep-03-2020, 01:27 AM |
|
|
Thread: DNP3 file transfer with python
Post: DNP3 file transfer with python
Hi,
has anyone had anything to to with DNP3 file transfer using python?
Or something similar that may help get an understanding.
Thanks, |
|
Aussie |
General Coding Help |
0 |
1,417 |
Sep-01-2020, 10:45 PM |
|
|
Thread: Binary File Read
Post: RE: Binary File Read
Hi, I changed it a little bit
def readdata(filename):
'''Read data from a file. Data count is in the header'''
with open(filename, "rb") as file:
buffer = file.read(20)
size, ... |
|
Aussie |
General Coding Help |
6 |
8,226 |
Sep-01-2020, 04:50 AM |
|
|
Thread: Binary File Read
Post: RE: Binary File Read
Hi, I have put the code in Python tags, edited previous post.
The output is below.
The file has a header of 20 bytes. Broke down in various byte sizes.
One byte
Two bytes
and four bytes
The header pro... |
|
Aussie |
General Coding Help |
6 |
8,226 |
Sep-01-2020, 02:22 AM |
|
|
Thread: Binary File Read
Post: Binary File Read
Hi, I have tried a number of examples to try and get the code below to step through correctly.
The header needs to be stepped through once and the sample code at the end to run through until there are... |
|
Aussie |
General Coding Help |
6 |
8,226 |
Sep-01-2020, 12:42 AM |