473,466 Members | 1,456 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Newbie needs help

Greetings all,

I'm wanting to maintain what values in one file and call them in
another. The purpose being to keep a single location where url's,
login's and passwords can be maintained, then called as needed from
another file.

In file #1 I have...

import time
import os
import sys

url = 'http://zoo/'

adminlogin = 'Zebra'
adminpassword = 'Zebra12$'
---------------------------------------------

In file #2 I have the following...

from cPAMIE import PAMIE

#Imports - used to setup / control finding files
import time
import os
import sys
import loginout #name of the file retaining all url/login info
from log import log

#Create New Pamie Object
ie=PAMIE()
ie=Visible =1
t=time

adminlogin (ie,url)
if ie.findText ('Site Status: Active'):
log ('PASSED -- ADMIN Module - ADMIN Login & Admin Tab Navigation
Successful')
else:
log ('WARNING -- ADMIN Module Login & Admin Tab Navigation
FAILED')
time.sleep(2)

What am I doing incorrectly to not have file two log in when
executed. All files are in the same directory. Keep it simple...
I'm new at this.

THNX
Aug 26 '08 #1
4 1019
Is the loginout file named loginout.py ? It needs to be for the
import to work. If the import works, you have to refer to those
variables within the right namespace, ie : loginout.url,
loginout.adminlogin, etc.

On Tue, Aug 26, 2008 at 12:46 PM, frankrentef <fr*********@yahoo.comwrote:
Greetings all,

I'm wanting to maintain what values in one file and call them in
another. The purpose being to keep a single location where url's,
login's and passwords can be maintained, then called as needed from
another file.

In file #1 I have...

import time
import os
import sys

url = 'http://zoo/'

adminlogin = 'Zebra'
adminpassword = 'Zebra12$'
---------------------------------------------

In file #2 I have the following...

from cPAMIE import PAMIE

#Imports - used to setup / control finding files
import time
import os
import sys
import loginout #name of the file retaining all url/login info
from log import log

#Create New Pamie Object
ie=PAMIE()
ie=Visible =1
t=time

adminlogin (ie,url)
if ie.findText ('Site Status: Active'):
log ('PASSED -- ADMIN Module - ADMIN Login & Admin Tab Navigation
Successful')
else:
log ('WARNING -- ADMIN Module Login & Admin Tab Navigation
FAILED')
time.sleep(2)

What am I doing incorrectly to not have file two log in when
executed. All files are in the same directory. Keep it simple...
I'm new at this.

THNX
--
http://mail.python.org/mailman/listinfo/python-list
Aug 26 '08 #2
On Aug 26, 11:46*am, frankrentef <frankren...@yahoo.comwrote:
Greetings all,

I'm wanting to maintain what values in one file and call them in
another. *The purpose being to keep a single location where url's,
login's and passwords can be maintained, then called as needed from
another file.

In file #1 I have...

import time
import os
import sys

url = 'http://zoo/'

adminlogin = 'Zebra'
adminpassword = 'Zebra12$'

---------------------------------------------

In file #2 I have the following...

from cPAMIE import PAMIE

#Imports - used to setup / control finding files
import time
import os
import sys
import loginout * *#name of the file retaining all url/login info
from log import log

#Create New Pamie Object
ie=PAMIE()
ie=Visible =1
t=time

adminlogin (ie,url)
if ie.findText ('Site Status: Active'):
* * log ('PASSED -- ADMIN Module - ADMIN Login & Admin Tab Navigation
Successful')
else:
* * log ('WARNING -- ADMIN Module Login & Admin Tab Navigation
FAILED')
time.sleep(2)

What am I doing incorrectly to not have file two log in when
executed. *All files are in the same directory. * Keep it simple...
I'm new at this.

THNX
Yes, the first file is named loginout.py

Would the second file need something akin to...

loginout.admin (ie,url,adminlogin)

Aug 26 '08 #3
On Tue, Aug 26, 2008 at 8:33 PM, frankrentef <fr*********@yahoo.comwrote:
>
Would the second file need something akin to...

loginout.admin (ie,url,adminlogin)
Yes. Since you're importing the whole module.

--
Marco Bizzarri
http://iliveinpisa.blogspot.com/
Aug 27 '08 #4
Help, I'm missing / still not grasping something....

My "loginout" file contains the following...

from cPAMIE import PAMIE

#Imports - used to setup / control finding files
import time
import os
import sys

url = 'http://test2/'
adminlogin = 'Gorillia'
adminpassword = 'Gorillia1$'
#Admin Login Def Function

def adminlogin(ie,url):
ie.navigate (url + 'isweb/admin/default.aspx')
time.sleep(2)
ie.textBoxSet ('AdminLogin1:txtUsername','adminlogin')
time.sleep(2)
ie.textBoxSet ('AdminLogin1:inputPassword','adminpassword')
time.sleep(2)
ie.buttonClick ('AdminLogin1:btnLogin')
time.sleep(2)
My "main" Python file contains...

from cPAMIE import PAMIE

import time
import os
import sys
import loginout
from log import log

ie=PAMIE()
ie=Visible =1
t=time

ie=PAMIE ()

#+++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++
+++++++++

adminlogin (ie, url, adminlogin)
if ie.findText ('Site Status: Active'):
log ('PASSED -- ADMIN Module - ADMIN Login & Admin Tab Navigation
Successful')
else:
log ('WARNING -- ADMIN Module Login & Admin Tab Navigation
FAILED')
time.sleep(2)
All that happens is an I.E. session comes up with the url
"about:blank" in the address.

What am I doing incorrectly.
THNX
Aug 27 '08 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: igmox | last post by:
hi, i am a complete newbie and got stuck. my question is about costumers and prices Customer_ID CustomerName CustomerType 1 John 2 2 Joe ...
0
by: Statsstudent2006 | last post by:
Hello! I am a newbie, and have received my first VBA assignment. I have to write a subroutine that generates the Fibonacci sequence of numbers (the first n numbers, where n is an integer number...
23
by: Gunnerman6875 | last post by:
Hi everyone, Well I'm a newbie to Access and your site so forgive me if my terminology is a little out. I'm currently trying to create what i thought would be a simple database for work. I'm in...
8
by: karokat | last post by:
Hi, I want to learn how to program and python seems to be the most intuitive language according to various internet sources - but I'm not sure if it's best for newbies... please advise.. Anyway,...
11
by: itgetsharder | last post by:
can anyone help me? code errors! -------------------------------------------------------------------------------- im creating a code for a printer. the question i am trying to answer is : ...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.