N
n00m
1.
Python 2.3.4
2.
Win98 and Win2k Professional
Python 2.3.4
2.
Win98 and Win2k Professional
No, my guess is that you're running an old version of Python.
The constant was added in the source on 27 Nov 2003; I'm not
Dennis said:Bryan Olson declaimed the following in comp.lang.python:
Are you sure of that 2003?
n00m said:> Bryan;
> Look at how I corrected your the very first version
> (see added arguments in both functions). And now it
> really can handle multiple connections!
1.Bryan said:Ah, yes, I see. (In my defense, I had already fixed that bug in
my second version.)
[code snipped]Phill said:Newbie question:
I have a dictionary called "rec". And a list called "db". db is my
database. rec are to be records in the database. In a loop I'm trying to
create a record and add it to my database. The key stmt is
db.append( rec )
This works initially but it seems that instead of copying the values in
rec and adding it to db, only a reference of rec is added to db. Thus
when I reassign rec with new data and then do another append I end up
with two records in my database but now the both contain the same data,
namely the latest version or rec.
So how do I add a dictionary into a list by value rather than by reference?
The complete code is here:
Phill Atwood said:def csv_it():
db = [] # the entire database of records
rec = {} # a single rec: a dictionary of field names and data pairs
fields = [] # list of field names collected so far for current record
for line in open(inputfile):
kword = getkeyword(line) # get keyword (or field name) ....
# Now clear current record
fields = []
rec.clear()
dummylist = []
> So how do I add a dictionary into a list by value rather than
> by reference?
[...]> The complete code is here:
n00m said:> Btw, why we need send() if there is sendall()?
> Btw, the newest oops in the topic's subject is:
> the code does not work in the case of:
>
> sqls_host, sqls_port = '192.168.0.8', 1433
> proxy_host, proxy_port = '192.168.0.3', 1434
> ## proxy_host, proxy_port = '127.0.0.1', 1434
> ## proxy_host, proxy_port = '', 1434
>
> I.e. when both Python and vbs script run on one machine
> (with ip = 192.168.0.3) and SQL Server runs on another
> (with ip = 192.168.0.8)
>
> How namely it does not work:
> in the idle window only one line is printed:
>
> VB_SCRIPT:.........
>
> that's all. No errors from Python. After timeout expires
> I get an error message from VBS (smth like preHandShake()
> failed; I've never seen it before).
>
> I just wonder MUST (or not) it work at all (IN THEORY)?
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.