Sponsored Content
Top Forums Programming Python (seleniumrequests)Class, Constructor, Method Not Working Post 302953289 by Aia on Wednesday 26th of August 2015 07:35:58 PM
Old 08-26-2015
Quote:
Originally Posted by metallica1973
So I simple cant understand why I dont have access to:

goodies.wpscaper.wpjfetch
goodies.wpscaper.wpsoup

or

goodies.wppscaper.wppjfetch
goodies.wppscaper.wppsoup

why cant I see them?? I am truly confused.
Python does not work as such.

In relatation to it:
Code:
wpjfetch=seleniumrequests.PhantomJS('../ms-tuesday/phantomjs/bin/phantomjs')

wpjfetch is a local binding to whatever object is returned from calling the method seleniumrequests.PhantomJS() and it is out of scope as soon as the goodies.wpscaper() method is finished.
You can return it inside the method, or you can make it an instance class attribute and then you can access to it as goodies.wppjfetch, but that breaks OOP encapsulation.

Last edited by Aia; 08-26-2015 at 09:12 PM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

call constructor of java class in script

Hi, Is it possible to call the constructur of a java class in a shell script? I know you can call static methods, but can you also call the constructor? tnx. (1 Reply)
Discussion started by: thebladerunner
1 Replies

2. Shell Programming and Scripting

Method isSuccess not working right perl

Good morning all.... I have been learning Perl for about 2 months now and I guess I am getting there as much as I can however I am really stuck. I have a Perl script called postEvent.pl which uses a package called event.pm. PostEvent.pl depends on a meithod inside event.pm called isSuccess to... (0 Replies)
Discussion started by: LRoberts
0 Replies

3. Programming

Pointer for class not working that well. Syntax I think.

I'll be gratefull for any help. Thanks. :) This is the non class type error: # g++ -I/usr/include/mysql -I/usr/include/mysql++ -lmysqlpp -L/usr/lib/mysql -L/usr/local/lib/mysql++ loaddsgsports.cpp -o loaddsgsports loaddsgsports.cpp: In function âint outputToImport(const char*, const char*,... (1 Reply)
Discussion started by: sepoto
1 Replies

4. Shell Programming and Scripting

[Python]StringVar() Class String processing

I have a requirement where I collect inputs from entry widget in gui(via variables a,b,c) and then output a string like this: -a a -b b -c c. Hence if I have given a=1 b=2 c=3, The output string is --> -a 1 -b 2 -c 3 or if I have given a=1 b=2 (c left blank) then the output is --> -a 1... (1 Reply)
Discussion started by: animesharma
1 Replies

5. Solaris

Python script not working in batch process

Good morning, I have a python 2.3 script that runs stand alone as intended when tested, then it was put into a ksh script. when running the ksh script it runs as intended. The problem is that my script does not run when the ksh script is called by another user who runs a batch process (as of right... (1 Reply)
Discussion started by: mhahe
1 Replies

6. UNIX for Advanced & Expert Users

Get pointer for existing device class (struct class) in Linux kernel module

Hi all! I am trying to register a device in an existing device class, but I am having trouble getting the pointer to an existing class. I can create a class in a module, get the pointer to it and then use it to register the device with: *cl = class_create(THIS_MODULE, className);... (0 Replies)
Discussion started by: hdaniel@ualg.pt
0 Replies

7. Shell Programming and Scripting

Date Format not working in python script

Good Morning, I am working on a pyhton script, where it has to fetch a file from our vendor's server over an ftp. The file is having a date format of "MMDDYYYY" (i have included in my python script), but when the script is executed it is unable to fetch the file. At the same time, if i... (1 Reply)
Discussion started by: AReddy
1 Replies

8. Shell Programming and Scripting

Python: Comparison is not working for me

Guys it is very simple script , but for some reason my IF condition is not matching. from sys import argv import os filename='testdata.txt' txt=open(filename) while 1: line= txt.readline() if not line: break line=line.strip('\n') sp=line.split(" ") command =sp+ " " +sp+ " "... (4 Replies)
Discussion started by: baker
4 Replies

9. Programming

C++ : Base class member function not accessible from derived class

Hello All, I am a learner in C++. I was testing my inheritance knowledge with following piece of code. #include <iostream> using namespace std; class base { public : void display() { cout << "In base display()" << endl; } void display(int k) {... (2 Replies)
Discussion started by: anand.shah
2 Replies

10. Shell Programming and Scripting

Challenge in finding listing class method and its number of code lines

there are about 300 objectivec .m files and I need to print each file name and its method and number of lines inside the method there is a sample perl files that do perl brace matching... (0 Replies)
Discussion started by: steve32001
0 Replies
XFCE4-POWER-MANAGER(1)					      General Commands Manual					    XFCE4-POWER-MANAGER(1)

NAME
xfce4-power-manager - The Xfce 4 Power manager SYNOPSIS
xfce4-power-manager [options] DESCRIPTION
xfce4-power-manager manages the power sources on the computer and the devices that can be controlled to reduce their power consumption (such as LCD brightness level, monitor sleep, CPU frequency scaling). In addition, xfce4-power-manager provides a set of freedesktop-com- pliant DBus interfaces to inform other applications about current power level so that they can adjust their power consumption, and it pro- vides the inhibit interface which allows applications to prevent automatic sleep actions via the power manager; as an example, the operat- ing system's package manager should make use of this interface while it is performing update operations. You can run xfce4-power-manager from the command line without specifying any extra arguments. OPTIONS
--no-daemon Starts the power manager in non-daemon mode: useful for debugging. --restart Causes the running power manager to restart. --customize Shows the configuration dialog. --quit Causes any running instance of xfce4-power-manager to exit. BUGS
Please report any bugs to http://bugzilla.xfce.org/. Development discussion should be conducted on the goodies-dev@xfce.org mailing list. Usage related questions should be directed to the xfce@xfce.org mailing list. HOMEPAGE
http://goodies.xfce.org/ AUTHOR
Ali Abdallah <aliov@xfce.org> MANPAGE AUTHORS
Ali Abdallah <aliov@xfce.org>, Robby Workman <rworkman@slackware.com>. 31 March 2009 Version 0.8.0 XFCE4-POWER-MANAGER(1)
All times are GMT -4. The time now is 08:07 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy