On Dec 28 2007, 7:07 pm, [EMAIL PROTECTED] wrote:
> 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 --decr
On Aug 16, 5:03 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> 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
On Aug 15, 12:05 pm, "Martin v. Löwis"
> 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
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 Apr 27, 2:33 pm, "Steven W. Orr" <[EMAIL PROTECTED]> wrote:
> On Friday, Apr 27th 2007 at 14:07 -0700, quoth James Stroud:
>
> 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 name
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
On Mar 22, 11:48 am, John Salerno <[EMAIL PROTECTED]> wrote:
> >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.
--
http://mail.python.org/mailman/listinfo/python
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.)
>
> --
> -Mike
> Schinkelhttp://www.mikeschinkel.com/blogs/http:/
[EMAIL PROTECTED] wrote:
> Greetings:
> elif q.lower() == "some"# s in some is highlighted
> 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
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
alisonken1 wrote:
> OriginalBrownster wrote:
>
> > Example
sorry, forgot the '... everything after the last comma ...' part.
--
http://mail.python.org/mailman/listinfo/python-list
OriginalBrownster wrote:
> 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
bob wrote:
> 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')
>
It appears that bus.get_service() has bee
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.
>
The problem >I think< is th
> 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.
>
If I remember correctly, if you want to pass '\n' so readline won't
stop, you should be able to
[EMAIL PROTECTED] wrote:
> 56 records were different
> Type, FileType,
>Item,
> Hash,
>
> Path, Size, CullCd, Ext, DtCr,
> DtLMd, DtLAc
> Traceback (most recent call last
Scott David Daniels wrote:
> [EMAIL PROTECTED] wrote:
> 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
[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"
> thank
Leo Breebaart wrote:
> 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
> print
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 Pytho
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 implemen
Benji York wrote:
>
> 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 Con
Florian Lindner wrote:
> Hello,
> since ConfigParser does not seem to support multiple times the same option
> name, like:
>
> dir="/home/florian"
> dir="/home/john"
> dir="/home/whoever"
Another option would be to switch to the XMLParser library and use an
XML file for the configuration.
That w
> 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
[EMAIL PROTECTED] wrote:
> But what other uses does the '__init__.py' script have? What do you
> use it for?
__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 database
met
> 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
OP = Original Poster
--
http://mail.python.org/mailman/listinfo/python-list
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
It can be fun when talking several subjects in the same post .
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 h
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 proper
Not sure about "vcs" - but "cvs" can be more fun if the hard disk dies
{g}.
--
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 symli
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 th
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.
--
http://mail.python.org/mailman/l
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.
--
http://mail.python.org/mailman/listinfo/pyth
35 matches
Mail list logo