What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » make putty session, without putty

make putty session, without putty
Author: Message:
Jarrod
Veteran Member
*****

Avatar
woot simpson

Posts: 1304
Reputation: 20
– / Male / Flag
Joined: Sep 2006
O.P. make putty session, without putty
i'm trying to write a program to write a program to tailor putty session then launch in plink
i was using python and had
code:
for line in open(os.path.dirname(sys.argv[0])+'/sessions/base', 'rU'):
    if "ProxyPassword" in line:
        line = line.replace("ProxyPassword\\", "ProxyPassword\\" + listy[3] + chr(92)
       
                           
    if "ProxyUsername" in line:
        line = line.replace("ProxyUsername\\",  "ProxyUsername\\" + listy[2] + chr(92)

and the end of the second if statement is some invalid syntax. how do i avoid it?
( i tried using double slashes but the result was the same)

This post was edited on 12-01-2008 at 09:45 AM by Jarrod.

[Image: 5344.png]
[Image: sig.png]

A.k.a. The Glad Falconer














12-01-2008 09:02 AM
Profile E-Mail PM Find Quote Report
Mnjul
forum super mod
******

Avatar
plz wub me

Posts: 5396
Reputation: 58
– / Other / Flag
Joined: Nov 2002
Status: Away
RE: make putty session, without putty
Don't you think you're missing right parentheses in line.replace()? :p

This post was edited on 12-01-2008 at 11:29 AM by Mnjul.
12-01-2008 11:29 AM
Profile PM Web Find Quote Report
Jarrod
Veteran Member
*****

Avatar
woot simpson

Posts: 1304
Reputation: 20
– / Male / Flag
Joined: Sep 2006
O.P. RE: make putty session, without putty
yep i just noticed that:P
but the main problem seems to be that python uses different line breaks to note pad and i want my file to look like this attached

but instead it looks like this:
code:
HyperlinkRegularExpression\(((https%3F|ftp):%5C/%5C/)|www%5C.)(([0-9]+%5C.[0-9]+%5C.[0-9]+%5C.[0-9]+)|localhost|([a-zA-Z0-9%5C-]+%5C.)%2A[a-zA-Z0-9%5C-]+%5C.(com|net|org|info|biz|gov|name|edu|[a-zA-Z][a-zA-Z]))(:[0-9]+)%3F((%5C/|%5C%3F)[^%20"]%2A[^%20,;%5C.:">)])%3F\
HyperlinkRegularExpressionUseDefault\1\
HyperlinkBrowser\\
HyperlinkBrowserUseDefault\1\
HyperlinkUseCtrlClick\0\
HyperlinkUnderline\1\
SerialFlowControl\1\
SerialParity\0\
SerialStopHalfbits\2\
SerialDataBits\8\
SerialSpeed\9600\
SerialLine\COM1\
ShadowBoldOffset\1\
ShadowBold\0\
WideBoldFontHeight\0\
WideBoldFontCharSet\4749836\
WideBoldFontIsBold\4627356\
WideBoldFont\\
WideFontHeight\0\
WideFontCharSet\4627372\
WideFontIsBold\4749836\
WideFont\\
BoldFontHeight\1\
BoldFontCharSet\4749832\
BoldFontIsBold\4627372\
BoldFont\\
ScrollbarOnLeft\0\
LoginShell\1\
StampUtmp\1\
BugRekey2\0\
BugPKSessID2\0\
BugRSAPad2\0\
BugDeriveKey2\0\
BugHMAC2\0\
BugRSA1\0\
BugPlainPW1\0\
BugIgnore1\0\
PortForwardings\D7070,\
RemotePortAcceptAll\0\
LocalPortAcceptAll\0\
X11AuthType\1\
X11Display\\
X11Forward\0\
BlinkText\0\
BCE\1\
LockSize\0\
EraseToScrollback\1\
ScrollOnDisp\1\
ScrollOnKey\0\
ScrollBarFullScreen\0\
ScrollBar\1\
CapsLockCyr\0\
Printer\\
UTF8Override\1\
CJKAmbigWide\0\
LineCodePage\\
Wordness224\2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,2,2,2,2,2,2,2,2\
Wordness192\2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,2,2,2,2,2,2,2,2\
Wordness160\1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1\
Wordness128\1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1\
Wordness96\1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,1,1,1,1\
Wordness64\1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,1,1,1,2\
Wordness32\0,1,2,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,1,1,1,1,1,1\
Wordness0\0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\
MouseOverride\1\
RectSelect\0\
MouseIsXterm\0\
PasteRTF\0\
RawCNP\0\
Colour21\255,255,255\
Colour20\187,187,187\
Colour19\85,255,255\
Colour18\0,187,187\
Colour17\255,85,255\
Colour16\187,0,187\
Colour15\85,85,255\
Colour14\0,0,187\
Colour13\255,255,85\
Colour12\187,187,0\
Colour11\85,255,85\
Colour10\0,187,0\
Colour9\255,85,85\
Colour8\187,0,0\
Colour7\85,85,85\
Colour6\0,0,0\
Colour5\0,255,0\
Colour4\0,0,0\
Colour3\85,85,85\
Colour2\0,0,0\
Colour1\255,255,255\
Colour0\187,187,187\
BoldAsColour\1\
Xterm256Colour\1\
ANSIColour\1\
TryPalette\0\
UseSystemColours\0\
FontVTMode\4\
FontQuality\0\
FontHeight\10\
FontCharSet\0\
FontIsBold\0\
Font\Courier%20New\
TermHeight\24\
TermWidth\80\
WinTitle\\
WinNameAlways\1\
DisableBidi\0\
DisableArabicShaping\0\
LFImpliesCR\0\
AutoWrapMode\1\
DECOriginMode\0\
ScrollbackLines\1000\
BellOverloadS\5000\
BellOverloadT\2000\
BellOverloadN\5\
BellOverload\1\
BellWaveFile\\
BeepInd\0\
Beep\1\
BlinkCur\0\
CurType\0\
WindowBorder\1\
SunkenEdge\0\
HideMousePtr\0\
FullScreenOnAltEnter\0\
AlwaysOnTop\0\
Answerback\PuTTY\
LocalEdit\2\
LocalEcho\2\
TelnetRet\1\
TelnetKey\0\
CtrlAltKeys\1\
ComposeKey\0\
AltOnly\0\
AltSpace\0\
AltF4\1\
WindowIcon\\
Transparency\255\
FailureReconnect\0\
WakeupReconnect\0\
TrayRestore\0\
StartTray\0\
Tray\1\
StorageType\1\
NetHackKeypad\0\
ApplicationKeypad\0\
ApplicationCursorKeys\0\
NoRemoteCharset\0\
NoDBackspace\0\
RemoteQTitleAction\1\
NoRemoteWinTitle\0\
NoAltScreen\0\
NoRemoteResize\0\
NoMouseReporting\0\
NoApplicationCursors\0\
NoApplicationKeys\0\
LinuxFunctionKeys\0\
RXVTHomeEnd\0\
BackspaceIsDelete\1\
PassiveTelnet\0\
RFCEnviron\0\
RemoteCommand\\
PublicKeyFile\\
SSH2DES\0\
SshProt\2\
SshNoShell\0\
AuthKI\1\
AuthTIS\0\
SshNoAuth\0\
RekeyBytes\1G\
RekeyTime\60\
KEX\dh-gex-sha1,dh-group14-sha1,dh-group1-sha1,WARN\
Cipher\aes,blowfish,3des,WARN,arcfour,des\
ChangeUsername\0\
AgentFwd\0\
TryAgent\1\
Compression\0\
NoPTY\0\
LocalUserName\\
UserName\\
Environment\\
ProxyTelnetCommand\connect%20%25host%20%25port%5Cn\
ProxyPassword\\
ProxyUsername\\
ProxyPort\8080\
ProxyHost\10.0.0.3\
ProxyMethod\3\
ProxyLocalhost\0\
ProxyDNS\1\
ProxyExcludeList\\
AddressFamily\0\
TerminalModes\INTR=A,QUIT=A,ERASE=A,KILL=A,EOF=A,EOL=A,EOL2=A,START=A,STOP=A,SUSP=A,DSUSP=A,REPRINT=A,WERASE=A,LNEXT=A,FLUSH=A,SWTCH=A,STATUS=A,DISCARD=A,IGNPAR=A,PARMRK=A,INPCK=A,ISTRIP=A,INLCR=A,IGNCR=A,ICRNL=A,IUCLC=A,IXON=A,IXANY=A,IXOFF=A,IMAXBEL=A,ISIG=A,ICANON=A,XCASE=A,ECHO=A,ECHOE=A,ECHOK=A,ECHONL=A,NOFLSH=A,TOSTOP=A,IEXTEN=A,ECHOCTL=A,ECHOKE=A,PENDIN=A,OPOST=A,OLCUC=A,ONLCR=A,OCRNL=A,ONOCR=A,ONLRET=A,CS7=A,CS8=A,PARENB=A,PARODD=A,\
TerminalSpeed\38400,38400\
TerminalType\xterm\
TCPKeepalives\0\
TCPNoDelay\1\
PingIntervalSecs\0\
PingInterval\0\
WarnOnClose\1\
CloseOnExit\1\
PortNumber\8080\
Protocol\ssh\
SSHLogOmitData\0\
SSHLogOmitPasswords\1\
LogFlush\1\
LogFileClash\-1\
LogType\0\
LogFileName\putty.log\
HostName\host-palace.net\
Present\1\

so any ideas on how to get python to use the putty style line breaks instead of windows ones?
thanx  also Mnjul

.txt File Attachment: Cbase.txt (4.68 KB)
This file has been downloaded 226 time(s).

This post was edited on 12-01-2008 at 11:49 AM by Jarrod.

[Image: 5344.png]
[Image: sig.png]

A.k.a. The Glad Falconer














12-01-2008 11:48 AM
Profile E-Mail PM Find Quote Report
wj
Former Admin
*****

Avatar
I aim to misbehave.

Posts: 2224
Reputation: 52
39 / – / Flag
Joined: Mar 2002
RE: make putty session, without putty

You probably need \n\l rather then just \n
"A towel is about the most massively useful
thing an interstellar hitchhiker can have."
12-01-2008 10:07 PM
Profile PM Find Quote Report
Jarrod
Veteran Member
*****

Avatar
woot simpson

Posts: 1304
Reputation: 20
– / Male / Flag
Joined: Sep 2006
O.P. RE: make putty session, without putty
so if i go for example
code:
x = x.replace("\\n", "\\n\\l")

will that do it?

This post was edited on 12-02-2008 at 03:10 AM by Jarrod.

[Image: 5344.png]
[Image: sig.png]

A.k.a. The Glad Falconer














12-02-2008 02:48 AM
Profile E-Mail PM Find Quote Report
ShawnZ
Veteran Member
*****

Avatar

Posts: 3146
Reputation: 43
32 / Male / Flag
Joined: Jan 2003
RE: make putty session, without putty
don't use \\n, use \n :p
Spoiler:
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
12-02-2008 05:56 AM
Profile PM Web Find Quote Report
Jarrod
Veteran Member
*****

Avatar
woot simpson

Posts: 1304
Reputation: 20
– / Male / Flag
Joined: Sep 2006
O.P. RE: make putty session, without putty
ok well for example
x = "hello\neveryone"
print x

produces:
hello
eveyone

however
x = x.replace("\n", "\n\l")
print x produces:
hello
\leveryone



[Image: 5344.png]
[Image: sig.png]

A.k.a. The Glad Falconer














12-02-2008 06:21 AM
Profile E-Mail PM Find Quote Report
ShawnZ
Veteran Member
*****

Avatar

Posts: 3146
Reputation: 43
32 / Male / Flag
Joined: Jan 2003
RE: make putty session, without putty
also, it's \l\n :p

also, i'm pretty sure putty just needs \n

This post was edited on 12-02-2008 at 11:45 AM by ShawnZ.
Spoiler:
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
12-02-2008 11:43 AM
Profile PM Web Find Quote Report
Jarrod
Veteran Member
*****

Avatar
woot simpson

Posts: 1304
Reputation: 20
– / Male / Flag
Joined: Sep 2006
O.P. RE: make putty session, without putty
quote:
Originally posted by ShawnZ
also, i'm pretty sure putty just needs \n
well why then when i open the session file in putty it just crashes, preforming an illegal operation?

and
print "hello\l\nhello"

produces:
hello\l
hello

This post was edited on 12-03-2008 at 10:34 AM by Jarrod.

[Image: 5344.png]
[Image: sig.png]

A.k.a. The Glad Falconer














12-03-2008 10:32 AM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On