I am importing a file which contains a persons name (firstName, middleName, etc). If I define a
function to do this, how can I use the variables outside of that function?
Here is the code:
import string
def getName():
data = open("enterName .txt")
allNames = data.readlines( )
data.close()
fName = string.lower(al lNames[0])
mName = string.lower(al lNames[1])
lName = string.lower(al lNames[2])
nName = string.lower(al lNames[3])
pName = string.lower(al lNames[4])
I need to use these variables in another function (routine) to calculate the associated numbers.
Since these are local to the function, how is this done? Can I make them global or something?
Thanks, Jeff 11 2224
"Jeff Wagner" <JW*****@hotmai l.com> wrote in message
news:ks******** *************** *********@4ax.c om... I am importing a file which contains a persons name (firstName, middleName, etc). If I define a function to do this, how can I use the variables outside of that function?
You can simply return data from a function. Examples:
def returnString():
return "ABCDE"
def returnInteger() :
return 5 + 5
def returnList():
return ['a', 'B', 1, 3, 5] Here is the code:
import string
def getName():
data = open("enterName .txt") allNames = data.readlines( ) data.close()
fName = string.lower(al lNames[0]) mName = string.lower(al lNames[1]) lName = string.lower(al lNames[2]) nName = string.lower(al lNames[3]) pName = string.lower(al lNames[4])
I need to use these variables in another function (routine) to calculate the associated numbers.
Since these are local to the function, how is this done? Can I make them global or something?
Global data is, probably, best avoided [this is a general program design
principle, not something specific to Python]. As shown in the earlier code,
you can return any data type, so, why not return data in the most convenient
form, the one that best suits your purposes ?
You now have enough enough information to design a solution. May I simply
suggest, however, that you distinguish between a single entity, and a group
of entities. By this I mean you would write function(s) to manipulate the
data belonging to a single entity [the names of a person], and function(s)
to manipulate groups of persons [you will probably want to, later on, store
multiple persons in a file].
I hope this helps.
Anthony Borla
On Sat, 29 Nov 2003 05:39:32 GMT, "Anthony Borla" <aj*****@bigpon d.com> wrotf: "Jeff Wagner" <JW*****@hotmai l.com> wrote in message news:ks******* *************** **********@4ax. com... I am importing a file which contains a persons name (firstName, middleName, etc). If I define a function to do this, how can I use the variables outside of that function?
You can simply return data from a function. Examples:
def returnString(): return "ABCDE"
def returnInteger() : return 5 + 5
def returnList(): return ['a', 'B', 1, 3, 5]
Here is the code:
import string
def getName():
data = open("enterName .txt") allNames = data.readlines( ) data.close()
fName = string.lower(al lNames[0]) mName = string.lower(al lNames[1]) lName = string.lower(al lNames[2]) nName = string.lower(al lNames[3]) pName = string.lower(al lNames[4])
I need to use these variables in another function (routine) to calculate the associated numbers.
Since these are local to the function, how is this done? Can I make them global or something?
Global data is, probably, best avoided [this is a general program design principle, not something specific to Python]. As shown in the earlier code, you can return any data type, so, why not return data in the most convenient form, the one that best suits your purposes ?
You now have enough enough information to design a solution. May I simply suggest, however, that you distinguish between a single entity, and a group of entities. By this I mean you would write function(s) to manipulate the data belonging to a single entity [the names of a person], and function(s) to manipulate groups of persons [you will probably want to, later on, store multiple persons in a file].
I hope this helps.
Anthony Borla
Here's the solution I came up with (maybe not the best?):
def getName():
data = open("enterName .txt")
allNames = data.readlines( )
data.close()
fName = string.lower(al lNames[0])
mName = string.lower(al lNames[1])
lName = string.lower(al lNames[2])
nName = string.lower(al lNames[3])
pName = string.lower(al lNames[4])
fullName = fName, mName, lName, nName, pName
return fullName
nameList = getName()
Then when I need nameList in another module, I used:
from GetName import nameList
and went from there. Whew, there sure is a lot to learn. I thought I was understanding it pretty
well when I was reading some books and tutorials but when I started to write code, I seemed to
forget everything.
Now I'm trying to figure out how to process this list (which I think is really a string) and get the
numerical value for each name.
This is my string:
('Jeffery', 'Thomas', 'Wagner', 'Jeff', 'Wagner')
and I have to take each name and add up what each letter represents.
Here's what I have so far:
for eachName in nameList:
print eachName #just to let me see that each name is correct .. I will remove it later
for eachName[len(eachName)-1]
call my masterNumber routine to add them all together
and I'm totally stuck. I have to add up J+E+F+F+E+R+Y and send it to the masterNumber routine to get
a total.
For some reason, when I got the length of eachName, it was giving me one value over the correct
answer and hence, I subtracted one.
This is challenging to say the least but fun, too.
Jeff
I think I just figured out part of my problem.
I have to change the line:
fullName = fName, mName, lName, nName, pName
to
fullName = fName[:-1], mName[:-1], lName[:-1], nName[:-1], pName
to remove the trailing "\n"
This gives me part of my solution ;)
Jeff Here's the solution I came up with (maybe not the best?):
def getName():
data = open("enterName .txt") allNames = data.readlines( ) data.close() fName = string.lower(al lNames[0]) mName = string.lower(al lNames[1]) lName = string.lower(al lNames[2]) nName = string.lower(al lNames[3]) pName = string.lower(al lNames[4]) fullName = fName, mName, lName, nName, pName return fullName
nameList = getName()
Then when I need nameList in another module, I used:
from GetName import nameList
and went from there. Whew, there sure is a lot to learn. I thought I was understanding it pretty well when I was reading some books and tutorials but when I started to write code, I seemed to forget everything.
Now I'm trying to figure out how to process this list (which I think is really a string) and get the numerical value for each name.
This is my string:
('Jeffery', 'Thomas', 'Wagner', 'Jeff', 'Wagner')
and I have to take each name and add up what each letter represents.
Here's what I have so far:
for eachName in nameList: print eachName #just to let me see that each name is correct .. I will remove it later for eachName[len(eachName)-1] call my masterNumber routine to add them all together
and I'm totally stuck. I have to add up J+E+F+F+E+R+Y and send it to the masterNumber routine to get a total.
For some reason, when I got the length of eachName, it was giving me one value over the correct answer and hence, I subtracted one.
This is challenging to say the least but fun, too.
Jeff
Jeff Wagner <JW*****@hotmai l.com> wrote: I am importing a file which contains a persons name (firstName, middleName, etc). If I define a function to do this, how can I use the variables outside of that function?
Here is the code:
import string
def getName():
data = open("enterName .txt") allNames = data.readlines( ) data.close()
fName = string.lower(al lNames[0]) mName = string.lower(al lNames[1]) lName = string.lower(al lNames[2]) nName = string.lower(al lNames[3]) pName = string.lower(al lNames[4])
I need to use these variables in another function (routine) to calculate the associated numbers. Since these are local to the function, how is this done? Can I make them global or something?
class getName:
def __init__(self, filename):
(
self.fName, self.mName, self.lName, self.nName, self.pName
) = [k.lower() for k in file(filename). readlines()]
names = getName("enterN ame.txt")
print names.fName
print names.mName
print names.lName
--
- Tim Roberts, ti**@probo.com
Providenza & Boekelheide, Inc.
On Fri, 28 Nov 2003 22:49:07 -0800, Tim Roberts <ti**@probo.com > wrotf: Jeff Wagner <JW*****@hotmai l.com> wrote: I am importing a file which contains a persons name (firstName, middleName, etc). If I define a function to do this, how can I use the variables outside of that function?
Here is the code:
import string
def getName():
data = open("enterName .txt") allNames = data.readlines( ) data.close()
fName = string.lower(al lNames[0]) mName = string.lower(al lNames[1]) lName = string.lower(al lNames[2]) nName = string.lower(al lNames[3]) pName = string.lower(al lNames[4])
I need to use these variables in another function (routine) to calculate the associated numbers. Since these are local to the function, how is this done? Can I make them global or something?
class getName: def __init__(self, filename): ( self.fName, self.mName, self.lName, self.nName, self.pName ) = [k.lower() for k in file(filename). readlines()]
names = getName("enterN ame.txt")
print names.fName print names.mName print names.lName
Sweeeeeeet! I haven't gotten to classes yet ... I guess I just did ;)
Thanks a lot,
Jeff
Jeff Wagner fed this fish to the penguins on Friday 28 November 2003
22:05 pm: Here's the solution I came up with (maybe not the best?):
def getName():
data = open("enterName .txt") allNames = data.readlines( ) data.close() fName = string.lower(al lNames[0]) mName = string.lower(al lNames[1]) lName = string.lower(al lNames[2]) nName = string.lower(al lNames[3]) pName = string.lower(al lNames[4]) fullName = fName, mName, lName, nName, pName return fullName
nameList = getName()
Then when I need nameList in another module, I used:
from GetName import nameList
This will only let you handle ONE set of data, since you are
referencing just the results of one call to getName()...
and went from there. Whew, there sure is a lot to learn. I thought I was understanding it pretty well when I was reading some books and tutorials but when I started to write code, I seemed to forget everything.
Looks a bit like you are trying to modularize the task before even
getting the logic of how to pass data into and out of functions.
Now I'm trying to figure out how to process this list (which I think is really a string) and get the numerical value for each name.
Ah... numeralogy <G> Ignoring your "master numbers" special cases, I
presume that A=1, B=2... Z=26?, and that the output range is 0..9
Try hacking the following three files (watch out for line wraps):
-=-=-=-=-=- main.py
#
# main application file for numeralogy exercise
#
import Person
import Number
import sys
if len(sys.argv) > 1:
data = file(sys.argv[1], "r")
else:
data = None
while 1:
p = Person.Person(d ata)
if not p.Valid: break
print p.fName, Number.reductio n(Number.encode (p.fName))
print p.mName, Number.reductio n(Number.encode (p.mName))
print p.lName, Number.reductio n(Number.encode (p.lName))
print p.nName, Number.reductio n(Number.encode (p.nName))
print p.pName, Number.reductio n(Number.encode (p.pName))
if data: data.close()
-=-=-=-=-=- Person.py
#
# Person class file
#
class Person:
def __init__(self, fid = None):
if fid:
self.fName = fid.readline(). strip()
self.mName = fid.readline(). strip()
self.lName = fid.readline(). strip()
self.nName = fid.readline(). strip()
self.pName = fid.readline(). strip()
self.Valid = ( self.fName
and self.mName
and self.lName
and self.nName
and self.pName )
else:
try:
self.fName = raw_input("Ente r first name: ").strip()
self.mName = raw_input("Ente r middle name: ").strip()
self.lName = raw_input("Ente r last name: ").strip()
self.nName = raw_input("Ente r nick name: ").strip()
self.pName = raw_input("Ente r preferred name: ").strip()
self.Valid = ( self.fName
and self.mName
and self.lName
and self.nName
and self.pName )
except:
self.Valid = 0
-=-=-=-=- Number.py
#
# number cruncher file
#
def encode(aName):
aName = aName.lower()
sum = 0
for ch in aName:
sum += (ord(ch) - ord("a") + 1)
return sum
def reduction(aNumb er):
# ignores special values, just reduces to range 0..9
# recursive definition
if aNumber > 9:
sum = 0
for ch in str(aNumber):
sum += int(ch)
return reduction(sum)
else:
return aNumber
The main routine will, if supplied on the command line, open the data
file. Person.Person() will, if given an open file reference, read the
next five lines from the file, otherwise it will prompt the console for
the names. An empty name causes the "valid" flag to go false, which
breaks the loop in the main file.
Number.encode() takes a name, converts each character into a number
from 1..26, and sums them. Number.reductio n() (reduce is already a
Python operation) takes an integer, if it is in the 0..9 range returns
it, otherwise takes the string representation of it (easier to get to
each digit as a character), then adds the individual digits, before
calling itself recursively on the new value.
Shouldn't be too difficult to insert an if block for your special case
values.
-- =============== =============== =============== =============== == < wl*****@ix.netc om.com | Wulfraed Dennis Lee Bieber KD6MOG < wu******@dm.net | Bestiaria Support Staff < =============== =============== =============== =============== == < Bestiaria Home Page: http://www.beastie.dm.net/ < Home Page: http://www.dm.net/~wulfraed/ <
On Sat, 29 Nov 2003 03:39:34 GMT, Jeff Wagner <JW*****@hotmai l.com> wrote: I am importing a file which contains a persons name (firstName, middleName, etc). If I define a function to do this, how can I use the variables outside of that function?
Does the file only contain ONE person's info, or does the pattern of 5 lines repeat for more?
If it's only one person, as you have it here, you can just split on line endings, like
def getName(): return map(str.lower, file('enterName .txt').read().s plitlines())
to return a list of the lower case strings you want, which you can then do
an unpacking assignment with, e.g.,
fName, mName, lName, nName, pName = getName()
But that's sure a special-purpose routine, being locked into just using the first five lines
of a particular file with a fixed file name.
If you have other possible files of the same format, and possibly with more than one
person's info (i.e., repeating groups of 5 lines), I'd suggest a generator that you
can pass a file name to, and which will return the info in successive lists of 5.
E.g., the following looks like a function, but the 'yield' makes it a generator-maker
====< JeffWagner.py >============== =============== =======
def mkgen_GetName(f ileOrPath):
if isinstance(file OrPath, str):
fileOrPath = file(fileOrPath ) # use open file or open by name
lineCount = 0
for line in fileOrPath:
if lineCount%5==0: nameList = []
nameList.append (line.strip().l ower()) # strips white space incl newline if any
lineCount += 1
if lineCount%5==0: yield nameList
def test():
from StringIO import StringIO
siofile = StringIO("""\
John
Q
Public
JQ
Johnny
Alice
B
Choklas
Allie
Chok
""")
for fName, mName, lName, nName, pName in mkgen_GetName(s iofile):
# do whatever with each successive person-info set ...
print ('%10s'*5)%(fNa me, mName, lName, nName, pName)
if __name__ == '__main__':
test()
=============== =============== =============== ============
if you run this, you get:
[13:00] C:\pywk\clp>jef fwagner.py
john q public jq johnny
alice b choklas allie chok
It also has the advantage that it doesn't put the whole file in memory, just what it needs
as it goes. Here is the code:
import string
Are you still using 1.5.2? You really ought to upgrade to 2.3.2 ;-) def getName():
data = open("enterName .txt")
^^^^ ^^^^^^^^^^^^^-- do you really want this as a fixed name in your function?
|
+-- deprecated in favor of 'file'
allNames = data.readlines( )
^^^^^^^^^^^-- reads the whole file into memory. Not so good for big files. data.close()
^^^^^^^^^^^^ good practice, but not necessary if you are using cPython. fName = string.lower(al lNames[0])
fName = allNames[0].lower() # current way to spell previous line
# (hence importing string is not necessary)
mName = string.lower(al lNames[1]) lName = string.lower(al lNames[2]) nName = string.lower(al lNames[3]) pName = string.lower(al lNames[4])
I need to use these variables in another function (routine) to calculate the associated numbers. Since these are local to the function, how is this done? Can I make them global or something?
'or something' is preferred ;-)
BTW, if you don't want to use a loop to sequence through the data, you can get it one set
at a time from the generator's .next method, e.g., from JeffWagner import mkgen_GetName if 1: # so I can copy/paste from the source file
... from StringIO import StringIO
... siofile = StringIO("""\
... John
... Q
... Public
... JQ
... Johnny
... Alice
... B
... Choklas
... Allie
... Chok
... """)
... gen = mkgen_GetName(s iofile) gen.next()
['john', 'q', 'public', 'jq', 'johnny'] a,b,c,d,e = gen.next() a,b,c
('alice', 'b', 'choklas') d,e
('allie', 'chok') gen.next() # expecting the StopIteration exception here
Traceback (most recent call last):
File "<stdin>", line 1, in ?
StopIteration # so you will have to catch that to use .next() cleanly
BTW, what does pName stand for?
Regards,
Bengt Richter
On 29 Nov 2003 21:04:25 GMT, bo**@oz.net (Bengt Richter) wrotf: On Sat, 29 Nov 2003 03:39:34 GMT, Jeff Wagner <JW*****@hotmai l.com> wrote:
I am importing a file which contains a persons name (firstName, middleName, etc). If I define a function to do this, how can I use the variables outside of that function?Does the file only contain ONE person's info, or does the pattern of 5 lines repeat for more?
It contains only one person's info at a time.
If it's only one person, as you have it here, you can just split on line endings, like
def getName(): return map(str.lower, file('enterName .txt').read().s plitlines())
to return a list of the lower case strings you want, which you can then do an unpacking assignment with, e.g.,
fName, mName, lName, nName, pName = getName()
Excellent, I'll play around with this.
But that's sure a special-purpose routine, being locked into just using the first five lines of a particular file with a fixed file name.
If you have other possible files of the same format, and possibly with more than one person's info (i.e., repeating groups of 5 lines), I'd suggest a generator that you can pass a file name to, and which will return the info in successive lists of 5.
E.g., the following looks like a function, but the 'yield' makes it a generator-maker
What is a generator maker?
====< JeffWagner.py >============== =============== ======= def mkgen_GetName(f ileOrPath): if isinstance(file OrPath, str): fileOrPath = file(fileOrPath ) # use open file or open by name lineCount = 0 for line in fileOrPath: if lineCount%5==0: nameList = [] nameList.append (line.strip().l ower()) # strips white space incl newline if any lineCount += 1 if lineCount%5==0: yield nameList
def test(): from StringIO import StringIO siofile = StringIO("""\ John Q Public JQ Johnny Alice B Choklas Allie Chok """) for fName, mName, lName, nName, pName in mkgen_GetName(s iofile): # do whatever with each successive person-info set ... print ('%10s'*5)%(fNa me, mName, lName, nName, pName)
if __name__ == '__main__': test() ============== =============== =============== =============
if you run this, you get:
[13:00] C:\pywk\clp>jef fwagner.py john q public jq johnny alice b choklas allie chok
It also has the advantage that it doesn't put the whole file in memory, just what it needs as it goes.
Here is the code:
import string
Are you still using 1.5.2? You really ought to upgrade to 2.3.2 ;-)
def getName():
data = open("enterName .txt")
^^^^ ^^^^^^^^^^^^^-- do you really want this as a fixed name in your function? | +-- deprecated in favor of 'file'
allNames = data.readlines( ) ^^^^^^^^^^^-- reads the whole file into memory. Not so good for big files. data.close() ^^^^^^^^^^^^ good practice, but not necessary if you are using cPython. fName = string.lower(al lNames[0])
fName = allNames[0].lower() # current way to spell previous line # (hence importing string is not necessary)
mName = string.lower(al lNames[1]) lName = string.lower(al lNames[2]) nName = string.lower(al lNames[3]) pName = string.lower(al lNames[4])
I need to use these variables in another function (routine) to calculate the associated numbers. Since these are local to the function, how is this done? Can I make them global or something? 'or something' is preferred ;-)
BTW, if you don't want to use a loop to sequence through the data, you can get it one set at a time from the generator's .next method, e.g.,
from JeffWagner import mkgen_GetName if 1: # so I can copy/paste from the source file ... from StringIO import StringIO ... siofile = StringIO("""\ ... John ... Q ... Public ... JQ ... Johnny ... Alice ... B ... Choklas ... Allie ... Chok ... """) ... gen = mkgen_GetName(s iofile) gen.next() ['john', 'q', 'public', 'jq', 'johnny'] a,b,c,d,e = gen.next() a,b,c ('alice', 'b', 'choklas') d,e ('allie', 'chok') gen.next() # expecting the StopIteration exception here Traceback (most recent call last): File "<stdin>", line 1, in ? StopIteration # so you will have to catch that to use .next() cleanly
BTW, what does pName stand for?
Regards, Bengt Richter
>====< JeffWagner.py >============== =============== ======= def mkgen_GetName(f ileOrPath): if isinstance(file OrPath, str): fileOrPath = file(fileOrPath ) # use open file or open by name lineCount = 0 for line in fileOrPath: if lineCount%5==0: nameList = [] nameList.append (line.strip().l ower()) # strips white space incl newline if any lineCount += 1 if lineCount%5==0: yield nameList
def test(): from StringIO import StringIO siofile = StringIO("""\ John Q Public JQ Johnny Alice B Choklas Allie Chok """) for fName, mName, lName, nName, pName in mkgen_GetName(s iofile): # do whatever with each successive person-info set ... print ('%10s'*5)%(fNa me, mName, lName, nName, pName)
if __name__ == '__main__': test() ============== =============== =============== =============
if you run this, you get:
[13:00] C:\pywk\clp>jef fwagner.py john q public jq johnny alice b choklas allie chok
It also has the advantage that it doesn't put the whole file in memory, just what it needs as it goes.
Here is the code:
import stringAre you still using 1.5.2? You really ought to upgrade to 2.3.2 ;-)
I am using 2.3.2. def getName():
data = open("enterName .txt") ^^^^ ^^^^^^^^^^^^^-- do you really want this as a fixed name in your function? | +-- deprecated in favor of 'file'
allNames = data.readlines( ) ^^^^^^^^^^^-- reads the whole file into memory. Not so good for big files. data.close() ^^^^^^^^^^^^ good practice, but not necessary if you are using cPython.
You mean that it closes itself by default?
BTW, if you don't want to use a loop to sequence through the data, you can get it one set at a time from the generator's .next method, e.g.,
from JeffWagner import mkgen_GetName if 1: # so I can copy/paste from the source file ... from StringIO import StringIO ... siofile = StringIO("""\ ... John ... Q ... Public ... JQ ... Johnny ... Alice ... B ... Choklas ... Allie ... Chok ... """) ... gen = mkgen_GetName(s iofile) gen.next() ['john', 'q', 'public', 'jq', 'johnny'] a,b,c,d,e = gen.next() a,b,c ('alice', 'b', 'choklas') d,e ('allie', 'chok') gen.next() # expecting the StopIteration exception here Traceback (most recent call last): File "<stdin>", line 1, in ? StopIteration # so you will have to catch that to use .next() cleanly
Thanks, I'll have to play around with these ideas. I'm still very much a beginner.
BTW, what does pName stand for?
pName stands for Present Name ... mostly used for women who have taken on their husbands last name.
In numerology, the name one was born with is most important but nickNames and any other change of
name (married name) is taken into account, also.
Thanks, Jeff
Regards, Bengt Richter This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Vsevolod (Simon) Ilyushchenko |
last post by:
Hi,
Last year I have written a Perl module to serve as a backend to
Macromedia Flash applications: http://www.simonf.com/amfperl
I have just rewritten it in Python, which I have not used before. Thus,
a couple of questions which I was not able to solve with online research:
1. To send an arbitrary object to Flash, I would like to use
introspection to find out the values of all its instance variables. How
|
by: Mark English |
last post by:
Basic problem:
If there is a C-extension module in a package and it tries to import
another python module in the same package without using the fully
qualified path, the import fails.
Config:
Python 2.4 on Windows 2000
For example:
mypackage contains:
|
by: Steve George |
last post by:
Hi, I have a scenario where I have a master schema that defines a
number of complex and simple types. I then have a number of other
schemas (with different namespaces) where I would like to reuse some
of these master complex and simple types. This I believe will assist
me in transforming between the master schema and the other smaller
schemas that contain a subset of the elements in the master schema.
I understand that I can import an...
|
by: D Mat |
last post by:
Hi,
I'm trying to get MS Access 2000 to automatically import a series of
(~200) flat text, tab delimited, data files into a single Access table,
with consistent fields and rows.
The files have different, but somewhat logical naming structures
(ex.Jun01.txt, Jun02.txt, Jul01.txt, etc...).
Is there a relatively simple way to accomplish this, considering i'm new
to Access. I was especially hoping to do this without having to
manually...
|
by: Sam Lazarus |
last post by:
I need to import data from a website, but the text is arranged badly:
Name:John Doe
Title:Grunt
ID:314159
Name:Jane Doe
Title:Queen-Bee
ID:271828
etc...
| |
by: Ali |
last post by:
I am having problem compiling schema contained in WSDL file when analyzing
schema types contained in it (for example
http://www.ebout.net/net/GoogleSearch.wsdl).
Following code demonstrates my problem:
using System.Diagnostics;
using System.IO;
using System.Xml;
using System.Xml.Schema;
|
by: Snozz |
last post by:
The short of it:
If you needed to import a CSV file of a certain structure on a regular
basis(say 32 csv files, each to one a table in 32 databases), what
would be your first instinct on how to set this up so as to do it
reliably and minimize overhead? There are currently no constraints on
the destination table. Assume the user or some configuration specifies
the database name, server name, and filename+fullpath. The server is
SQL...
|
by: kkadakia |
last post by:
I get a daily excel file for a entire month which I want to transfer into Access at the end of the month. So, there are around 20-25 excel files I get by the end of the month, and I would like to import them into Access using a button. The data contained in the excel files is similar, so there should no formatting issues while importing.
I searched through the forums and found the code by mmccarthy for importing excel files. I tried using...
|
by: rshepard |
last post by:
I'm stymied by what should be a simple Python task: accessing the value of
a variable assigned in one module from within a second module. I wonder if
someone here can help clarify my thinking. I've re-read Chapter 16 (Module
Basics) in Lutz and Ascher's "Learning Python" but it's not working for me.
In one module (the "source"), variablePage.py, three wxPython widgets
display values that are assigned to variables: curVar, UoDlow, and...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
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 we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |