Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: How to run together python3.10 and python3.7
Post: How to run together python3.10 and python3.7

Hi everyone. I have a code which is written with python3.7 Because of python3.7 doesnt have switch-case I wrote another code script with python3.10 I need to run these two code snippets together. I d...
ilknurg General Coding Help 2 772 Nov-14-2022, 08:58 AM
    Thread: How to combine two output in one variable?
Post: How to combine two output in one variable?

I have a while loop. In my loop the result can be one or more than one. Like: 2 antivirüs name's like: Kaspersky. Trend Micro I want to combine them in one variable like Kaspersky#Trend Micro . And ...
ilknurg General Coding Help 2 1,198 Aug-01-2022, 08:25 AM
    Thread: How to write a part of powershell command as a variable?
Post: RE: How to write a part of powershell command as a...

(Jul-26-2022, 11:27 AM)rob101 Wrote: This is untested, but in theory in should work: query = '"Select * from AntiVirusProduct"' result = session.run_ps(f'get-wmiobject -namespace root\SecurityCente...
ilknurg General Coding Help 2 1,127 Jul-26-2022, 11:31 AM
    Thread: How to write a part of powershell command as a variable?
Post: How to write a part of powershell command as a var...

I have a powershell command to run it with winrm. result = session.run_ps('get-wmiobject -namespace root\SecurityCenter2 -computername localhost -Query "Select * from AntiVirusProduct"')I want ...
ilknurg General Coding Help 2 1,127 Jul-26-2022, 11:09 AM
    Thread: How to parse std out?
Post: How to parse std out?

I want to parse the output below. I want to get IP Address line. __GENUS : 2 __CLASS : Win32_NetworkAdapterConfiguration __SUPERCLASS : __DYNASTY : __RELPATH : ...
ilknurg General Coding Help 1 1,014 Jul-22-2022, 11:23 AM
    Thread: How to parse the result of winrm.Response?
Post: How to parse the result of winrm.Response?

I have a code script with pywinrm. I connect a remote machine and run powershell. The result type is class 'winrm.Response', how can i parse it? My result is something like that: <Response code ...
ilknurg General Coding Help 0 749 Jul-21-2022, 12:34 PM
    Thread: Mysql Syntax error in pymysql
Post: RE: Mysql Syntax error in pymysql

(May-17-2022, 08:05 AM)ibreeden Wrote: (May-17-2022, 07:43 AM)ilknurg Wrote: How can i fix this error?Difficult to say. First isolate the offending line in your code. Then add print statements bef...
ilknurg General Coding Help 4 2,377 May-17-2022, 09:35 AM
    Thread: ValueError: Length mismatch: Expected axis has 8 elements, new values have 1 elements
Post: ValueError: Length mismatch: Expected axis has 8 e...

import mysql.connector import pandas as pd def to_camel_case(col_name: str) -> str: #""function to convert column names to camel case""" if '_' in col_name: components = col_name...
ilknurg General Coding Help 1 5,157 May-17-2022, 08:50 AM
    Thread: Mysql Syntax error in pymysql
Post: Mysql Syntax error in pymysql

I have the code below for migration from mysql to postgresql. def get_mysql_connection(database_name: Optional[str] = None) -> MysqlConnection: if database_name is None: database_name ...
ilknurg General Coding Help 4 2,377 May-17-2022, 07:43 AM
    Thread: How can i parse my output?
Post: RE: How can i parse my output?

(Mar-16-2022, 09:03 AM)Gribouillis Wrote: You could start by splitting >>> x = b'CN=User1,OU=DEVELOPER,OU=DEFAULT,OU=TURKIYE,OU=GLOBAL,DC=TRADONS,DC=local' >>> L = [t.split(b'=', 1...
ilknurg General Coding Help 4 1,575 Mar-16-2022, 02:39 PM
    Thread: How can i parse my output?
Post: How can i parse my output?

I have this code script for ldap search. I want to find user's group. import ldap username = "user1" l = ldap.initialize("ldap://192.168.1.24") try: l.protocol_version = ldap.VERSION3 l.se...
ilknurg General Coding Help 4 1,575 Mar-16-2022, 08:39 AM
    Thread: Ldap3 Python print(conn.entries) doesnt work
Post: RE: Ldap3 Python print(conn.entries) doesnt work

Yes I have such a library.
ilknurg General Coding Help 15 5,784 Mar-16-2022, 08:31 AM
    Thread: Ldap3 Python print(conn.entries) doesnt work
Post: RE: Ldap3 Python print(conn.entries) doesnt work

result = (True, {'result': 0, 'description': 'success', 'dn': '', 'message': '', 'referrals': None, 'type': 'searchResDone'}, [{'raw_dn': b'CN=user G\xc3\xbc\xc3\xa7l\xc3\xbc,OU=DEVELOPERS,OU=ANKARA,O...
ilknurg General Coding Help 15 5,784 Mar-15-2022, 12:59 PM
    Thread: Ldap3 Python print(conn.entries) doesnt work
Post: RE: Ldap3 Python print(conn.entries) doesnt work

(Mar-15-2022, 12:42 PM)Gribouillis Wrote: What is the type of CaseInsensitiveDict ? it is a library
ilknurg General Coding Help 15 5,784 Mar-15-2022, 12:43 PM
    Thread: Ldap3 Python print(conn.entries) doesnt work
Post: RE: Ldap3 Python print(conn.entries) doesnt work

(Mar-15-2022, 09:45 AM)Gribouillis Wrote: Try to convert it to dict for example from ldap3.utils.ciDict import CaseInsensitiveDict class MyEncoder(json.JSONEncoder): def default(self, obj): ...
ilknurg General Coding Help 15 5,784 Mar-15-2022, 12:39 PM
    Thread: Ldap3 Python print(conn.entries) doesnt work
Post: RE: Ldap3 Python print(conn.entries) doesnt work

(Mar-15-2022, 08:35 AM)Gribouillis Wrote: It fails because the dictionary in the result contains a byte string b'CN=user G\xc3\xbc\xc3\xa7l\xc3\xbc,OU=DEVELOPERS,OU=ANKARA,OU=TURKIYE,OU=TRD-GLOBAL,D...
ilknurg General Coding Help 15 5,784 Mar-15-2022, 09:25 AM
    Thread: Ldap3 Python print(conn.entries) doesnt work
Post: RE: Ldap3 Python print(conn.entries) doesnt work

(Mar-15-2022, 07:25 AM)Gribouillis Wrote: So you want to convert a search result which is a bytes string to json. What does the bytes string look like? Can you post it here? Also how have you tried ...
ilknurg General Coding Help 15 5,784 Mar-15-2022, 08:00 AM
    Thread: Ldap3 Python print(conn.entries) doesnt work
Post: RE: Ldap3 Python print(conn.entries) doesnt work

(Mar-14-2022, 05:54 PM)Gribouillis Wrote: What's in the 'result' object? Have you tried printing result, or dir(result)? When i run print(result) ı get the search result that i want. But i cannot pa...
ilknurg General Coding Help 15 5,784 Mar-15-2022, 07:06 AM
    Thread: Ldap3 Python print(conn.entries) doesnt work
Post: Ldap3 Python print(conn.entries) doesnt work

I have the code below for ldap search. I want to save my search result as json. why print(conn.entries) doesnt work? from ldap3 import Server, Connection, ALL from ldap3 import Server, Connection...
ilknurg General Coding Help 15 5,784 Mar-14-2022, 02:14 PM
    Thread: How to use a variable in linux command in python code?
Post: How to use a variable in linux command in python c...

I have a python code. In my code I run this commands via os.system. How can i give sAMAccountName as a parameter? I have a variable which is name. It can change in every search. I want to write name ...
ilknurg General Coding Help 2 1,606 Mar-14-2022, 06:46 AM

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020