Search Results
|
Post |
Author |
Forum |
Replies |
Views |
Posted
[asc]
|
|
|
Thread: add space on variable
Post: RE: add space on variable
Thanks for your answers it's OK for me now with your help!
Alex |
|
enigma619 |
General Coding Help |
3 |
1,875 |
Jun-24-2021, 02:30 PM |
|
|
Thread: add space on variable
Post: add space on variable
Hi
i've a variable x which must contain 150 characters (every time)
On this variable sometimes I set just "bla" and sometimes "blablabla"
But on my result I want that my var x contains 150 characters... |
|
enigma619 |
General Coding Help |
3 |
1,875 |
Jun-24-2021, 08:48 AM |
|
|
Thread: Problem to parse a json
Post: RE: Problem to parse a json
Thanks for your detailed answer!
My dictionary is a result of a curl https://....
With your answer I will succeed to retrieve all my values. |
|
enigma619 |
General Coding Help |
3 |
2,375 |
Dec-04-2020, 08:16 AM |
|
|
Thread: Problem to parse a json
Post: RE: Problem to parse a json
I think I' ve found the solution:
for i in data['Results']:
for a,b in data['Results'].items():
if (a == i):
print (i, b["StatusH"]) |
|
enigma619 |
General Coding Help |
3 |
2,375 |
Dec-03-2020, 04:26 PM |
|
|
Thread: Problem to parse a json
Post: Problem to parse a json
Hi
I've some problem to parse my json
which is like:
{
"Results": {
"check1": {
"LastResultTime": 1607002708,
"LastResultTimeH": "2020-12-03 14:38:28 +0100 CET",
... |
|
enigma619 |
General Coding Help |
3 |
2,375 |
Dec-03-2020, 04:12 PM |
|
|
Thread: factorise split
Post: RE: factorise split
|
enigma619 |
General Coding Help |
4 |
2,079 |
Nov-03-2020, 08:28 AM |
|
|
Thread: factorise split
Post: RE: factorise split
Thanks !
In fact I want to find value 64 (from 64%) with my split
(Nov-02-2020, 01:41 PM)perfringo Wrote: With information provided I don't see how it can be 'working'.
>>> reason = 'te... |
|
enigma619 |
General Coding Help |
4 |
2,079 |
Nov-02-2020, 01:48 PM |
|
|
Thread: factorise split
Post: factorise split
Hi
I've general question, not just linked with python (sorry if off topic)
i've a split expression which works:
reason.split(" ")[3].split("(")[2].split(")")[0].split("%")[0]
The expression I want... |
|
enigma619 |
General Coding Help |
4 |
2,079 |
Nov-02-2020, 12:44 PM |
|
|
Thread: split string
Post: split string
Hi
I've a question about proper method to split a string.
my strings are like this:
object Host "serviceXXX-YYYY" {I'm doing my plit like this:
hostname = line.split(" ")[2].split('"')[1]Do you ha... |
|
enigma619 |
General Coding Help |
1 |
2,064 |
May-20-2020, 02:27 PM |
|
|
Thread: re.match value
Post: RE: re.match value
Thanks for your answer, it works !
I'm trying to understand.
On docs I see:
search ⇒ find something anywhere in the string and return a match object.
match ⇒ find something at the beginning of the st... |
|
enigma619 |
General Coding Help |
4 |
2,033 |
Apr-24-2020, 02:45 PM |
|
|
Thread: re.match value
Post: re.match value
Hi
I've a question about match value in python.
On a server I've installed a tool edac-utils. When I launch this command, result is:
[server]edac-util
mc1: 1257 Corrected Errors with no DIMM info
... |
|
enigma619 |
General Coding Help |
4 |
2,033 |
Apr-24-2020, 02:00 PM |
|
|
Thread: iterate and print json datas
Post: iterate and print json datas
Hi
i've a problem to iterate a json file
My Json
{
"name": "value1",
"surname": "value2",
"size": "value3",
"age": "value4",
"update": false
}I want to iterate with python this json and p... |
|
enigma619 |
General Coding Help |
1 |
1,921 |
Apr-01-2020, 11:35 AM |
|
|
Thread: grep value files
Post: grep value files
Hi
Quick question: for you what is the best way in a python script to grep a word / value in all directory files (reccursively)?
I have seen many means to do but not sure what is the best proper mea... |
|
enigma619 |
General Coding Help |
0 |
1,499 |
Mar-04-2020, 02:21 PM |
|
|
Thread: iterate json and count
Post: RE: iterate json and count
I feel stupid...
Thanks, it works! |
|
enigma619 |
General Coding Help |
2 |
2,022 |
Mar-02-2020, 01:41 PM |
|
|
Thread: iterate json and count
Post: iterate json and count
Hi
I've a problem with a json to print all my results.. Seems a stupid problem but..
r = requests.post(
request_url,
headers=headers,
veri... |
|
enigma619 |
General Coding Help |
2 |
2,022 |
Mar-02-2020, 09:42 AM |
|
|
Thread: curl and jq on python
Post: RE: curl and jq on python
Thanks with .json() it sounds better with first result.
(and thanks for your clear explanation)
Now i need to apply "| jq '.' | grep -c '__name'" on this r result.
But i don't succeed to retrieve re... |
|
enigma619 |
General Coding Help |
3 |
3,784 |
Feb-28-2020, 02:09 PM |
|
|
Thread: curl and jq on python
Post: curl and jq on python
Hi
I've a question about a request I need to do on a python script.
In fact I use icinga and my request on bash is:
curl -k -s -u admin:XXXXXXXX H 'Accept: application/json' 'https://localhost:566... |
|
enigma619 |
General Coding Help |
3 |
3,784 |
Feb-28-2020, 12:56 PM |
|
|
Thread: checking value on json
Post: RE: checking value on json
Top it works fine.
Thanks for answer, I understand now.
Alex |
|
enigma619 |
General Coding Help |
2 |
1,945 |
Jan-16-2020, 03:51 PM |
|
|
Thread: checking value on json
Post: checking value on json
Hi
i've a little question about checking a value in a json file.
I've my json file like that:
{
"server_model": {
"server_type1": {
"service":["service1","service2"],
... |
|
enigma619 |
General Coding Help |
2 |
1,945 |
Jan-16-2020, 02:50 PM |
|
|
Thread: Difference Between 2 files
Post: Difference Between 2 files
Hi
I've a question to compare 2 files.
My first file 'file_new' contain:
Output:1
2
3
5
6
7My second file 'file_old' contains:
Output:1
2
3
4
5
6I want to compare these two files.
My file_new contai... |
|
enigma619 |
General Coding Help |
3 |
2,759 |
Dec-20-2019, 04:16 PM |