HI All! I need to have some help. I have a python function name is abc.py and variable is declared in abc.py, variable name is 'uname'. How can i call variable name 'uname' of abc.py in my batch file name testing.bat and get uname value in my batch testing.bat file? Best Regards Sarfraz

Member Avatar
Member Avatar
+0 forum 8

HI All! I am creating a Python function that should set environment variable. My simple code is [I]#!/usr/bin/python import os os.environ['FK_DBO_PASS']="12345" print "After setting Environment Variable is ",os.environ['FK_DBO_PASS'][/I] When i execute this code file in command prompt it is giving me this result [I]After setting Environment Variable is 12345[/I] But when i run this command in command prompt SET FK_DBO_PASS The result is [I]Environment variable FK_DBO_PASS not defined[/I] My code is not setting environment variable .Can some one help me how i can fix this code? and how i can set temporary environment variable through python code just for my …

Member Avatar
Member Avatar
+0 forum 5

Hi there I have following XML document that i want to read in python code. i know how to read, thing is i want to make hash/list from this XML document. <?xml version="1.0" ?> ‐<TradeExt> ‐ <fxall category="buyer" version="2.0"> ‐<tradeHeader> <sourceId>test_sourceId1</sourceId> <pmsId>4521363.0.0</pmsId> <fundId>ACCT1@TESTCUST</fundId> </tradeHeader> ‐ <tradeStatus> <dealImmediately>F</dealImmediately> <blockImmediately>F</blockImmediately> </tradeStatus> ‐ <tradeFinancials> <userDefinedFields Name="UDF_6">six</userDefinedFields> <userDefinedFields Name="UDF_7">seven</userDefinedFields> <remarks>test remark</remarks> </tradeFinancials> </fxall> ‐ <fxall category="buyer" version="2.0"> ‐ <tradeHeader> <sourceId>test-sourceId2</sourceId> <pmsId>4521363.0.1</pmsId> <fundId>ACCT2@TESTCUST</fundId> <pomsId>4521363_0_1_0</pomsId> <blockTicketId>4521363</blockTicketId> <lastNegotiator>trader@TESTCUST</lastNegotiator> <traderId>null Maker Name</traderId> </tradeHeader> ‐ <tradeStatus> <state>Completed</state> <nonNegotiated>F</nonNegotiated> <blockImmediately>F</blockImmediately> </tradeStatus> ‐ <tradeFinancials> <spotRate>1.4144</spotRate> <forwardPoints>0</forwardPoints> <allinRate>1.4144</allinRate> <indicativeRate>1.1695</indicativeRate> <counterParty>ABN</counterParty> <userDefinedFields Name="UDF_9">nine</userDefinedFields> <userDefinedFields Name="UDF_10">ten</userDefinedFields> <userDefinedFields Name="UDF_11">eleven</userDefinedFields> <remarks>test remark2</remarks> </tradeFinancials> </fxall> </TradeExt> -----------------------------END …

Member Avatar
Member Avatar
+0 forum 2

Hi there I am translating PERL code into PYTHON Code My PERL code is if ( my $client = $dealing_clients->{ $data->{fundId} } ) And i translated it into python as if (client = dealing_clients[data["fundId"]]): But it is giving my following Error "Syntax Error While detecting Tuple" Any one know how to fix this error and why i am getting this error? Waiting for guidance. Thanks in advance. Regards Sarfraz

Member Avatar
Member Avatar
+0 forum 2

Hi there I have following hash related code in Perl that i need to translate in Python if ( exists $legs->{$reference} ) { logg(" 2nd leg of swapes: $ref - merging"); my $swap = merge_swap_legs( $legs->{$ref}, $fields ); $ref = new_fk_ref( $fxall, $ref, $swap ); } else { $legs->{$ref} = $fields; logg("1st leg of swap: $ref"); Can anyone help me how i can translate above code into PYTHON? Waiting for help from some one. Thanks Regards

Member Avatar
Member Avatar
+0 forum 2

Hi there I am translating PERL code into python and i am new on both language.I have one question if we have hash key reference in PERL like this way $a->{b} how we can traslate it into PYTHON? and if we have this code $a->{$b} , how we translate it into PYTHON also? Waiting for help. Thanks Regards Sarfraz

Member Avatar
Member Avatar
+0 forum 2

The End.