On Dec 28 2007, 7:07 pm, [EMAIL PROTECTED] wrote:
snip
form = cgi.FieldStorage()
if not form.has_key(pass):
print Enter password
filename = test.gpg
pass = form.getvalue(pass).strip()
os.system(gpg --version gpg.out)
os.system(echo %s | gpg --batch --password-fd 0 --decrypt %s d.out
On Aug 16, 5:03 am, [EMAIL PROTECTED] [EMAIL PROTECTED]
wrote:
snip
I use impacket for stuff like that,
seehttp://oss.coresecurity.com/projects/impacket.html
Cheers
Rich.
Thanks, Rich - I'll have a look
--
http://mail.python.org/mailman/listinfo/python-list
Hello all -
I'm looking at trying to write a python script to connect to a layer 2
bridge (no IP available).
Looking at the sockets function, it's not clear if I can connect using
only the mac address - it appears to want either a broadcast address
or a specific IP address.
Can anyone give me a
On Aug 15, 12:05 pm, Martin v. Löwis
snip
If your operating system supports the PF_PACKET protocol family, you
can try to use that. Python only wraps the socket interface of the
operating system, so if the system's socket implementation has no
facility for that, Python cannot expose it to you,
On Apr 27, 2:08 pm, gtb [EMAIL PROTECTED] wrote:
The lines
if __name__ == 'main':
someClass().fn()
appear at the end of many examples I see. Is this to cause a .class
file to be generated?
These are samples to give the programmer an idea of how the code is
supposed to work. If you
On Apr 27, 2:33 pm, Steven W. Orr [EMAIL PROTECTED] wrote:
On Friday, Apr 27th 2007 at 14:07 -0700, quoth James Stroud:
snip
I'm trying to see if by being clever, I can factor out the common code of
the four different functions and still end up with what they create ending
up in the
On Mar 22, 11:48 am, John Salerno [EMAIL PROTECTED] wrote:
snip
http://www.pythonchallenge.com
Ugh, I gave up on that site a long time ago! :)
I got stuck on 34 a couple of months ago and haven't had time to go
back to it.
Fun challenge.
--
On Mar 11, 2:34 am, Mike Schinkel [EMAIL PROTECTED] wrote:
Hi,
I'm relatively new to Python but have lots of prior programming experience
as a developer, instructor, and author (ASP/VBScript/SQL Server and
Clipper.)
snip
--
-Mike
[EMAIL PROTECTED] wrote:
Greetings:
snip
elif q.lower() == some# s in some is highlighted
snip
Any ideas? Thanks in advance.
Keith
Would the missing colon have something to do with it?
elif q.lower() == some:
--
http://mail.python.org/mailman/listinfo/python-list
OriginalBrownster wrote:
snip
Example
If i had a list:bread, butter, milk
def get_word(s, which=1, sep=','):
return s.split(sep)[which-1].strip()
get_word('bread, butter, milk')
'milk'
--
http://mail.python.org/mailman/listinfo/python-list
alisonken1 wrote:
OriginalBrownster wrote:
snip
Example
sorry, forgot the '... everything after the last comma ...' part.
--
http://mail.python.org/mailman/listinfo/python-list
Sorry, missed an option in there:
def get_word(s, which=1, sep=','):
return s.split(sep)[which-1].strip()
get_word('bread, butter, milk')
'milk'
get_word('bread, butter, milk')
'bread'
get_word('bread, butter, milk', 3)
'milk'
get_word('bread is brown, butter is yellow, milk
bob wrote:
snip
bus = dbus.Bus (dbus.Bus.TYPE_SYSTEM)
hal_service = bus.get_service ('org.freedesktop.Hal')
hal_manager = hal_service.get_object ('/org/freedesktop/Hal/Manager',
'org.freedesktop.Hal.Manager')
snip
It appears that bus.get_service() has
Wesley Henwood wrote:
I've checked and double checked my code and I am closing all files
explicitly after opening them. The only possibliy I can think of is
Python opening files each time I run a script, or each time imput to
stderr or stdout is redirected.
snip
The problem I think is that
snip
readlines () will try to read until the stream/socket is closed. Try to
read only one line. This of course means that you cannot sent \n as part
of the data, you have to escape them somehow.
snip
If I remember correctly, if you want to pass '\n' so readline won't
stop, you should be
[EMAIL PROTECTED] wrote:
snip
56 records were different
Type, FileType,
Item,
Hash,
Path, Size, CullCd, Ext, DtCr,
DtLMd, DtLAc
Traceback (most recent call last):
[EMAIL PROTECTED] wrote:
hi
say i have string like this
astring = 'abcd efgd 1234 fsdf gfds abcde 1234'
if i want to find which postion is 1234, how can i achieve this...? i
want to use index() but it only give me the first occurence. I want to
know the positions of both 1234
thanks
Scott David Daniels wrote:
[EMAIL PROTECTED] wrote:
SNIP
print list(positions('1234', 'abcd efgd 1234 fsdf gfds abcde 1234'))
prints:
[10, 31]
Nicer than mine ;)
Shows I need to get a job where I use python more!
--
http://mail.python.org/mailman/listinfo/python-list
Leo Breebaart wrote:
SNIP
Also, assume that I have set it up as above. Now I want certain
other print statements to go to sys.stderr alone. If I understand
the docs correctly (possibly I don't), the way to do this is to
start attaching explicit StreamHandlers and whatnot. Whereas with
Leo Breebaart wrote:
I have another question where I am not so much looking for a
solution but rather hoping to get some feedback on *which*
solutions people here consider good Pythonic ways to approach a
issue.
The situation is this: I am writing fairly large console scripts
in Python.
Hello Bruce -
bruce wrote:
Hi...
Never used python, but I have a question regarding Drop Down Menus. Does
Python allow me to create a website, that will permit the user to create
Drop Down menus that can be initiated with the right mouse click? If it can,
is it fairly easy to implement?
Benji York wrote:
SNIP
I generally do this:
dirs =
/home/florian
/home/john
/home/whoever
...and then use str.split() in my program.
--
Benji York
The only problem with this would be if you plan on updating the config
file later in the program - I don't think
[EMAIL PROTECTED] wrote:
snip
But what other uses does the '__init__.py' script have? What do you
use it for?
snip
__init__.py is used for initialization of the package - similar to
__init__() in a function or class declaration.
One example would be if you create a package with generic
Your question was answered on PyGTK mailing list. Please, don't crosspost.
Where is the pygtk mailing list?
--
http://mail.python.org/mailman/listinfo/python-list
Will I get the same error running main if
the total number of lines in the smaller modules is 10k?
Not sure if this would solve your problem, but I noticed the 10K
filesize.
I don't know about other programmers, but I find it much easier to
keep track of stuff if I keep the individual file
It can be fun when talking several subjects in the same post g.
In this case, it was just a matter of thinking about what the main
question was about unit testing code that also required other
production packages, but with the caveats that he didn't want to
duplicate packages just to test code or
To raise a specific error, just find the error that you want to raise,
then give the error a text string to print: ex.
raise IOError(This raises an IO error)
On the stderr output, when the routine hits this line, you will get:
raise IOError(This raises an IOError)
Traceback (most recent call
OP = Original Poster
--
http://mail.python.org/mailman/listinfo/python-list
I believe that Paddy was referencing his second point about keeping
production code and test code clearly delimited, so was
recommending that a version control system be used rather than the
local disk structure required by python for building module packages.
Although, I have found that symlinks
Not sure about vcs - but cvs can be more fun if the hard disk dies
{g}.
--
http://mail.python.org/mailman/listinfo/python-list
As to the question fail to see how version control relates to
code/test separation, the original poster asked several questions, one
of which was production/testing code separation.
Along with the separation (so while you're testing new functionality,
you don't break production files), a
Unless you override some of os.* functions in foo, you want to import
os into foo and bar separately.
Python does not reimport the module a second time (create a second
instance of os), it only creates a pointer to the first instance that's
loaded.
--
Actually, it does not execute the code only the first time, more
accurately, it initializes the code only the first time.
But you are correct, it exposes the os.* module into the current
namespace so you don't have to go to convoluted lengths to get to it.
--
Although 'namespace' may be a misnomer, module interfaces are 'exposed'
to the module that imports it - it's not imported a second time into
the new 'namespace'. The confusion comes about thinking that modules
and classes are related.
When a module is first imported, an instance is created for
34 matches
Mail list logo