Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: Error TypeError: output_type_handler() takes 2 positional arguments but 6 were given
Post: RE: Error TypeError: output_type_handler() takes 2...

(Oct-17-2022, 06:23 PM)paulo79 Wrote: Hi all, I'm running a python code that was working before with older version. Now using 3.10 I'm gettin error below: TypeError: output_type_handler() takes 2 ...
paulo79 General Coding Help 1 1,857 Oct-17-2022, 06:29 PM
    Thread: Error TypeError: output_type_handler() takes 2 positional arguments but 6 were given
Post: Error TypeError: output_type_handler() takes 2 pos...

Hi all, I'm running a python code that was working before with older version. Now using 3.10 I'm gettin error below: TypeError: output_type_handler() takes 2 positional arguments but 6 were givenThe...
paulo79 General Coding Help 1 1,857 Oct-17-2022, 06:23 PM
    Thread: Reordering output messages
Post: RE: Reordering output messages

(May-25-2022, 04:03 PM)menator01 Wrote: Might could use this approach odd = [] even = [] for i in range(20): if i % 2 == 0: even.append(str(i)) else: odd.append(str(i)) pri...
paulo79 General Coding Help 4 1,534 May-25-2022, 04:24 PM
    Thread: Reordering output messages
Post: Reordering output messages

Hi all, I have a script where I do a loop condition and show ERROR or OK messages depending of each line return. Example: for v_count_gds in cursor_count: v_count_gd=str(v_count_...
paulo79 General Coding Help 4 1,534 May-25-2022, 02:02 PM
    Thread: Compare variable with values in a file
Post: Compare variable with values in a file

I have a file: cat file1.txt cel01 cel02 cel03 cel03I have a Oracle DB cursor that brings some values from to variable VAL_CEL1. cursor_fgnmaes.execute("select distinct failgroup from v$asm_disk")I w...
paulo79 General Coding Help 1 1,078 Apr-21-2022, 04:36 PM
    Thread: Create array of values from 2 variables
Post: Create array of values from 2 variables

I have 2 variables that have values like : var1=cel01 var2=disktypeHD var1=cel02 var2=disktypeEF var1=cel03 var2=disktypeEF var1=cel04 var2=disktypeHDThese variables come from 2 FOR loops. like : f...
paulo79 General Coding Help 1 1,055 Apr-19-2022, 06:43 PM
    Thread: Concat Strings
Post: Concat Strings

Hi all, Trying to concat this variable with strings but it is addind a line in output: >>> del v_first_cell_name >>> v_first_cell_name=subprocess.check_output("cat /tmp/p_f | sort...
paulo79 General Coding Help 5 1,418 Apr-15-2022, 08:12 PM
    Thread: Crate Loop into os file
Post: Crate Loop into os file

Hi all, I have this shell script that goes to a loop on file lines: for dDames in `cat /tmp/Dnames` do #echo $dgname for FNames in `cat /tmp/FNames` do echo $DNames echo $FName...
paulo79 General Coding Help 0 695 Apr-12-2022, 12:20 PM
    Thread: Pass variable to subprocess
Post: RE: Pass variable to subprocess

(Apr-12-2022, 11:32 AM)paulo79 Wrote: (Apr-11-2022, 11:53 PM)snippsat Wrote: String formatting and now use f-string new in Python 3.6 ➡ >>> VARIABLE = 12 >>> s = f"cat /tmp/logal...
paulo79 General Coding Help 4 9,953 Apr-12-2022, 11:40 AM
    Thread: Pass variable to subprocess
Post: RE: Pass variable to subprocess

(Apr-11-2022, 11:53 PM)snippsat Wrote: String formatting and now use f-string new in Python 3.6 ➡ >>> VARIABLE = 12 >>> s = f"cat /tmp/logall | sort -u | grep -v {VARIABLE}" >&g...
paulo79 General Coding Help 4 9,953 Apr-12-2022, 11:32 AM
    Thread: Pass variable to subprocess
Post: Pass variable to subprocess

Hi all, I want to pass a variable to this command : VARIABLE=12 v_num_final_distinct_grid_disks_per_cell_and_dg = subprocess.check_output("cat /tmp/logall | sort -u | grep -v VARIABLE", shell=True);...
paulo79 General Coding Help 4 9,953 Apr-11-2022, 11:36 PM
    Thread: Os command output in variable shows wrong value
Post: RE: Os command output in variable shows wrong valu...

I found a solution! v_num_distinct_phy_disks_in_cells = subprocess.check_output("cat /tmp/p_count_num_phy_disks_all_cell | sort -u | wc -l", shell=True); print (v_num_distinct_phy_disks_in_cells)
paulo79 General Coding Help 2 1,467 Apr-09-2022, 03:45 PM
    Thread: Os command output in variable shows wrong value
Post: Os command output in variable shows wrong value

I have this : v_num_distinct_phy_disks_in_cells=os.system('cat /tmp/p_count_num_phy_disks_all_cell | sort -u | wc -l')The content of file is : cat /tmp/p_count_num_phy_disks_all_cell 12 12 12If I r...
paulo79 General Coding Help 2 1,467 Apr-09-2022, 03:38 PM
    Thread: Cursor Variable inside Another Cursor . CX_ORacle
Post: Cursor Variable inside Another Cursor . CX_ORacle

Hi all, I have 3 cursors, want to pass values from first and second on third cursor query as below. import cx_Oracle as oracledb conn = oracledb.connect("/", mode=oracledb.SYSASM) cursor_dgnames...
paulo79 General Coding Help 1 1,477 Apr-08-2022, 02:41 PM
    Thread: Query output in Tuple
Post: RE: Query output in Tuple

(Apr-07-2022, 12:31 PM)buran Wrote: the query result is consists of one-element tuples. You can always access the first element in each tuple by dgname[0], or create a list with all first elements ...
paulo79 General Coding Help 2 1,898 Apr-07-2022, 12:54 PM
    Thread: Query output in Tuple
Post: Query output in Tuple

Hi all, I have this wuery output that I want to write to a text file. But it is writeen with "(" and "'" and I want it clear. From database I have this output: NAME ------------------------------ ...
paulo79 General Coding Help 2 1,898 Apr-07-2022, 12:13 PM
    Thread: ElementTree get attribute value part of string
Post: ElementTree get attribute value part of string

Hi all, I have this : >>> import xml.etree.ElementTree as ET >>> tree = ET.parse('disks.xml') >>> root = tree.getroot() >>> root.tag 'cli-output' >>> ro...
paulo79 General Coding Help 1 2,040 Apr-05-2022, 08:09 PM
    Thread: Print variable between "
Post: RE: Print variable between "

I found a way that works: print('"""{var}"""'.format(var=val))
paulo79 General Coding Help 5 1,663 Mar-11-2022, 02:12 PM
    Thread: Print variable between "
Post: RE: Print variable between "

Error is : Error:Traceback (most recent call last): File "<stdin>", line 2, in <module> TypeError: not all arguments converted during string formatting >>>I could run using : ...
paulo79 General Coding Help 5 1,663 Mar-11-2022, 01:37 PM
    Thread: Print variable between "
Post: Print variable between "

Hi all, I'm trying to print variable between " (double quotes) . Code is below: import cx_Oracle as oracledb import xml.etree.ElementTree as ET def output_type_handler(cursor, name, default_type, s...
paulo79 General Coding Help 5 1,663 Mar-11-2022, 01:18 PM

User Panel Messages

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