Hello
I want to create a dictionary (from SQL usernames) of
the format:
accounts = {
('psmit', '123456'): 'psmit',
('rmatt', 'mypass'): 'rmatt',
}
So I have:
accounts = {}
UserCursor.execute(sqlstr)
rows = UserCursor.fetchall()
UserConn.commit()
The nice-looking, revamped Python web site states that
you can do this, but does not go on to say how.
Does anyone know?
On an OT note, I've recently seen how it can be done
in a shell script:
http://www.debian-administration.org/articles/371
Ben
_
On 3/8/06, Alan Gauld <[EMAIL PROTECTED]> wrote:
Ethereal is one well knownand powerful one, but there are others which may be simpler touse.
Yes, with Ethereal comes a command-line version called tethereal, which I've used within Python on both Windows and Linux. It worked nicely for trafic a
Thanks to all who responded. I ended up using a sender parameter as suggested by Andre and Alan, as this was very simple to do.
Ben
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
Hello
I want myfunction in the pseudocode below return something different if it was called from indexfunction.
def indexfunction(): blah
def myfunction(): x = 'whatever' if : return x else: return + x +
Thanks
Ben
___
Tuto
Why are these homework programming challenges so
recognisable? It boils down to:
Write a function that that uses X and Y techniques.
The function may be hard and challenging to write but
doesn't ever do anything interesting or anything that
is useful and complete on its own.
I realise teachers ha
Hello
I have a script based on:
http://aspn.activestate.com/ASPN/docs/ActivePython/2.4/pywin32/Windows_NT_Eventlog.html
It collects eventlogs data from many Windows servers.
I know how to handle normal Python Tracebacks, but my
script bombs out with a Dr Watson error when
connecting to one particu
--- Intercodes <[EMAIL PROTECTED]> wrote:
> List: I am still open to suggestions.
Being also keen to write better web apps in Python,
I've spent a considerable amount of time reading about
this (and it is indeed confusing), I've opted to try
out something like Pylons or Turbogears.
One thing I w
Compiling is certainly helpful in my case, and I did
not realise how simple it was until you explained it.
I estimate that most of our MCSEs will not know about
the strings command or attempt to look inside
something like test.pyc for a password.
As for users, I'll be amazed if they tried it. An
--- Alan Gauld <[EMAIL PROTECTED]> wrote:
> command line arguments?
>
> $ startapp -d mydb -l user/password &
>
> That way they are
> 1) kept secret(especially if you turn shell history
> off ;-) and
> 2) can be changed every time you restart the server
> app and
> 3) you can have production a
Hi Danny
The Unix servers are ancient HP-UX ones. I doubt if
an SSH implementation for them exists, but it is not
worth my while trying to find out, because I will not
be allowed to install anything on them (or even
suggest it). So I access them using telnetlib:
host = 'hpserver'
user = 'backup
; wrote:
> 2006/1/21, Ben Vinger <[EMAIL PROTECTED]>:
> > Hello
> >
> > I've written a couple of scripts that check log
> files
> > on our WIndows and Unix servers. These scripts
> have
> > plain text passwords in them, so anyone who can
> acce
Hello
I've written a couple of scripts that check log files
on our WIndows and Unix servers. These scripts have
plain text passwords in them, so anyone who can access
the filesystem of the Windows server that runs the
scripts can discover the passwords of the servers.
Is there a way to hide/encry
Yes, you are right, - Shuying Wang's suggestion fixed
the immediate problem, but there is still someting
wrong with my code - maybe I'll ask about it again
later.
--- Ewald Ertl <[EMAIL PROTECTED]> wrote:
> >
> Have a more precisely look at your code.
> s.getName() does just return, what you h
Hello
I've been reading about how a class has access to its
own 'self', so I tried the following, but it is not
working as I would expect:
class Skill:
def __init__(self):
self.history = []
def setName(self, skill):
self.name = skill
def getName(self):
return se
Thanks - it was exactly as you said
--- Kent Johnson <[EMAIL PROTECTED]> wrote:
> Most likely your XML file is 16-bit unicode, not
> utf-8. When ascii text
> is represented as unicode, every other byte will be
> a null byte. That is
> the extra character that shows up as a space or box
> depen
e large Unicode string.
text = infile.read()
# Close the file.
infile.close()
The same function is used to open a file for writing;
just use "w" (write) or "a" (append) as the second
argument.
--- Ben Vinger <[EMAIL PROTECTED]> wrote:
> Hello all
>
> I want
Hello all
I want to do the following in an XML file:
XFile = open(XmlFile,'r')
for line in XFile.readlines():
if line.find('') > 0:
print line
However, it does not work due to extra characters that
appear in the XML file. For example if I use the
previous code without the if condition
Below is a program I found at
http://starship.python.net/crew/neale/ (though it does
not seem to be there anymore.) It uses a seperate
file for the URLs
--- Adisegna <[EMAIL PROTECTED]> wrote:
> My question is how to use a loop to go through a
> tuple of URLs. Please feel
> free to suggest an ea
It is almost certain that you are using MS Windows,
and that Python is not in you "system path".
If so, here's what to do:
Add the top-level Python directory to your Windows
"PATH". On Windows NT this is done with Control
Panel/System/Environment. On Windows 2000 and Windows
XP it is done with C
The Python interpreter already contain the code for
multiplication, so you don't need to write it. You
can just use it:
x = raw_input('give the first number')
y = raw_input('give the second number')
print x, ' times ', y, ' is', int(x) * int( y)
Or in the interactive interpreter you can just:
--- Alex Nedelcu <[EMAIL PROTECTED]> wrote:
> 4. What's the hottest web framework right now that
> does not require an
> application server (meaning that it runs on fastcgi)
Take a look at Myghty - it seems pretty good - it is
a Python rewrite of Perl::Mason (which Amazon.com is
based on). Yo
Mailman can be set up to reply to the forum, but
people on this list prefer to live with pain!
--- geon <[EMAIL PROTECTED]> wrote:
> Hi,
>
> Seems to me as very unuseful thing in this phorum,
> when I choose Replay
> to any message, the field "to whom or Receiver" is
> all the time not
> tutor@
--- John Carmona <[EMAIL PROTECTED]> wrote:
> Ben I could not get your script working
indentation?
___
Can't remember an address in your address book? Enter the first few letters and
Address AutoComplete will automatic
Or like this:
for x in range (0,256):
print ord(chr(x)), ': ', chr(x)
(you could just print x, instead of ord(chr(x)), but
then you would not be using ord)
Ben
--- Pujo Aji <[EMAIL PROTECTED]> wrote:
> Actually you can do the same way:
>
> # Convert intAscii to charAscii
> S = [chr
It sounds like you've been using the Python
interactive prompt such as IDLE. You can type the
same Python statements you've used there into a text
editor or Python IDE and save it.
Let's say you have created a Python program/script
called hello.py in a text editor and saved it. You can
now open a
--- Ben Vinger <[EMAIL PROTECTED]> wrote:
> --- Bob Gailer <[EMAIL PROTECTED]> wrote:
> > Solutions:
> > 2 - l = os.popen(r'snmpget -Os -c ' +
> SNMPcommunity
> > + ' -v2c -r 3 ' + IP +
> > ' ' + counter, '
27 matches
Mail list logo