Sponsored Content
Top Forums Programming Python Changing Default Mutable Value After Import Post 302996324 by metallica1973 on Monday 24th of April 2017 10:46:19 AM
Old 04-24-2017
Python Changing Default Mutable Value After Import

Is it possible to change a (just a snippet of all the code):

Code:
Class Setup(object):
def __init__(self, localm = 'http://127.0.0.1:1414', remotem = 'https://10.0.0.160:1414',
		license = "blah\n"
		"blah blah\n"
		"blah blah blah\n"
		):
		
		logging.basicConfig(level=logging.ERROR)
		
		self.lm = localm
		self.rm = remotem	
		self.lic = license



default mutable value after it is imported or after initialization of a class using ipython? For example:

Code:
cpaste

Class Setup(object):
def __init__(self, localm = 'http://127.0.0.1:1414', remotem = 'https://10.0.0.160:1414',
		license = "blah\n"
		"blah blah\n"
		"blah blah blah\n"
		):
		
		logging.basicConfig(level=logging.ERROR)
		
		self.lm = localm
		self.rm = remotem	
		self.lic = license
whos

Setup          type      <class '__main__.Setup'>
logging        module    <module 'logging' from '/<...>.7/logging/__init__.pyc'>
pasted_block   str       __init__stuff

Setup.__init__.__defaults__("remotem = 'https://10.0.0.162:1414'")
TypeError                                 Traceback (most recent call last)
<ipython-input-11-e07587c9ad62> in <module>()
----> 1 Setup.__init__.__defaults__("remotem = 'https://10.0.0.160:1414'")

TypeError: 'tuple' object is not callable

or after the class initialization? What I want to achieve in the above example is to change the ip address without having to modify my code that is in Eclipse.
 

7 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Changing userID and Changing group and GID

Hello, I want to write a ksh script about changing UID and changing group with GID. There are multiple servers i want to perform that job. linux1 linux2 linux3 linux4 linux5 ...... . . . . . 1.) How can i enter "password" in script rather asking me? I was trying this... ssh... (2 Replies)
Discussion started by: deal732
2 Replies

2. Shell Programming and Scripting

Python- Changing background color on Button click

Hi, I am trying to write a python program which changes background color on click of button. However i am stuck up. Instead of changing the color currently it is creating a new frame every time. please look at the code and let me know how to correct it #!/usr/bin/env python from Tkinter... (0 Replies)
Discussion started by: vickylife
0 Replies

3. Shell Programming and Scripting

Python 2.5 / 2.2 import "errno" fails on AIX Server

I am trying to import the "xmlrpclib" Module from Activepython 2.5 in einer older Python 2.2. Already achived this on a SUSE Linux server, but I am now required to do it on a AIX server. Resolved the first few error messages by copying files from Activepython to Python but I can't get the... (0 Replies)
Discussion started by: frieling
0 Replies

4. UNIX for Dummies Questions & Answers

How to Import dump file with default value for single column?

Hi, I need to import more than 250K of records to another Database(Oracle).But I want particular column value to be changed in the destination table. Is it possible to do this during export or import process with out modifying data from original table.I do not want to run Update manually. ... (6 Replies)
Discussion started by: GOVINDARAJ.M
6 Replies

5. Shell Programming and Scripting

**python** unable to read the background color in python

I am working on requirement on spreadsheet in python scripting. I have a spreadsheet containing cell values and with background color. I am able to read the value value but unable to get the background color of that particular cell. Actually my requirement is to read the cell value along... (1 Reply)
Discussion started by: giridhar276
1 Replies

6. Windows & DOS: Issues & Discussions

How to execute python script on remote with python way..?

Hi all, I am trying to run below python code for connecting remote windows machine from unix to run an python file exist on that remote windows machine.. Below is the code I am trying: #!/usr/bin/env python import wmi c = wmi.WMI("xxxxx", user="xxxx", password="xxxxxxx")... (1 Reply)
Discussion started by: onenessboy
1 Replies

7. Programming

Create a C source and compile inside Python 1.4.0 to 3.7.0 in Python for ALL? platforms...

Hi all... As you know I like making code backwards compatible for as many platforms as possible. This Python script was in fact dedicated for the AMIGA A1200 using Pythons 1.4.0, 1.5.2, 1.6.0, 2.0.1, and 2.4.6 as that is all we have for varying levels of upgrades from a HDD and 4MB FastRam... (1 Reply)
Discussion started by: wisecracker
1 Replies
PAPS(1) 						      General Commands Manual							   PAPS(1)

NAME
paps - UTF-8 to PostScript converter using Pango SYNOPSIS
paps [options] files... DESCRIPTION
paps reads a UTF-8 encoded file and generates a PostScript language rendering of the file. The rendering is done by creating outline curves through the pango ft2 backend. OPTIONS
These programs follow the usual GNU command line syntax, with long options starting with two dashes (`-'). A summary of options is included below. --landscape Landscape output. Default is portrait. --columns=cl Number of columns output. Default is 1. --font=desc Set the font description. Default is Monospace 12. --rtl Do rtl layout. --paper ps Choose paper size. Known paper sizes are legal, letter, a4. Default is A4. --bottom-margin=bm Set bottom margin in postscript points (1/72 inch). Default is 36. --top-margin=tm Set top margin. Default is 36. --left-margin=lm Set left margin. Default is 36. --right-margin=rm Set right margin. Default is 36. --help Show summary of options. --header Draw page header for each page. --markup Interpret the text as pango markup. --encoding=ENCODING Assume the documentation encoding is ENCODING. --lpi Set the lines per inch. This determines the line spacing. --cpi Set the characters per inch. This is an alternative method of specifying the font size. --stretch-chars Indicates that characters should be stretched in the y-direction to fill up their vertical space. This is similar to the texttops behaviour. AUTHOR
paps was written by Dov Grobgeld <dov.grobgeld@gmail.com>. This manual page was written by Lior Kaplan <kaplan@debian.org>, for the Debian project (but may be used by others). April 17, 2006 PAPS(1)
All times are GMT -4. The time now is 10:12 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy