Obfuscator for Python Code

2005-08-17 Thread codecraig
Is there any obfuscator out there that obfuscates the python code (byte code i guess)??? -- http://mail.python.org/mailman/listinfo/python-list

libdnet and python (scapy)

2005-08-16 Thread codecraig
I am interested in using libdnet with Python, how can I go about installing it on windows? http://libdnet.sourceforge.net/ Ultimately, I would like to get Scapy (http://www.secdev.org/projects/scapy/) running on windows...currently it is a *nix app written in Python, so I think I should be able

Re: Read / Write image file

2005-05-04 Thread codecraig
so something like, x = sock.recv(1024) while (len(x) 0): # do stuff x = sock.recv(1024) ?? So what if the client sends 4 bytes, and then sends 8000 bytes? WIll I get the first 4 bytes as a separate msg so to speak? Basically i want to catch each message from the client as a whole.

Read / Write image file

2005-05-03 Thread codecraig
I have a image file on my pc, say a .jpg. Basically I want to setup a client/server socket, and I want the client to read in the jpg and send it to the server, where the server can write that data into a new file on the server. I tried just doing something like.. x = open(abc.jpg) y = x.read()

Re: Read / Write image file

2005-05-03 Thread codecraig
thanks Phil, the problem was that I was not using rb and wb. thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: Read / Write image file

2005-05-03 Thread codecraig
By the way, what is 'rb' and 'wb' ? Also, when I create a client/server sockets I do something like... SERVER --- server.bind(('', 4321)) (sock, addr) = server.accept() x = server.recv(1024) CLIENT client.connect(('localhost', 4321)) x = open(abc.txt, rb) client.send(x)

Re: figuring out # of bytes

2005-04-25 Thread codecraig
so each character in the string is 1 byte? if so, can u point me to somewhere that states that perhaps? thanks -- http://mail.python.org/mailman/listinfo/python-list

__init__.py question

2005-04-22 Thread codecraig
Ok, I have the following directory structure C:\pycode -- blah.py -- mynewdir -- __init__.py -- abc.py [[ C:\pycode\mynewdir\abc.py ]] def doFoo(): print hi def doBar(): print bye [[ C:\pycode\mynewdir\__init__.py ]] from mynewdir import * [[ C:\pycode\blah.py ]]

Re: Define Constants

2005-04-21 Thread codecraig
Thanks for the input. i am renaming my module to be customthing. I noticed that is how many python modules are, so I will stick to the convention. Thanks for the help. -- http://mail.python.org/mailman/listinfo/python-list

Private class?

2005-04-21 Thread codecraig
Hi, First, I come from a Java background. Ok, so I have this idea that I want to create an EventBus...basically a central class where objects can register themselves as listeners for different events. This central class also has methods so that objects can fire events. Something like

python classes/file structure

2005-04-21 Thread codecraig
What is the best/common way to structure ur python code for an application? For example...if I create some custom GUI widgets I have this C:\stuff -- gui --: MyCustomWidget.py --: TestWidgets.py so MyCustomWidget.py has one class, class MyCustomWidget: ... so from

Regular Expressions - Python vs Perl

2005-04-21 Thread codecraig
Hi, I am interested in regular expressions and how Perl and Python compare. Particulary, I am interested in performance (i.e. speed), memory usage, flexibility, completeness (i.e. supports simple and complex regex operations...basically is RegEx a strong module/library in Python?) Anyone

Re: Regular Expressions - Python vs Perl

2005-04-21 Thread codecraig
Well so far from what I have found, Perl is faster than Python for RegEx, although perl is harder to read. -- http://mail.python.org/mailman/listinfo/python-list

Re: Regular Expressions - Python vs Perl

2005-04-21 Thread codecraig
I found some benchmarking (perhaps simple) but search for The Great Computer language shootout look at the original shootout and the win32 one. Thomas: I doubt the total execution time for all the RegEx queries you ever ran took as much time as you just wasted on your little experiment.

Re: python classes/file structure

2005-04-21 Thread codecraig
Thanks, but I am not familiar with the __all__ variable, could u give me an example? Without using, __all__would i do this in my __init__.py? import MyCustomWidget1 import MyCustomWidget2 import MyCustomWidget3 etc? -- http://mail.python.org/mailman/listinfo/python-list

Re: python classes/file structure

2005-04-21 Thread codecraig
also is it common to have one class per file? seems weird to have, MyCustomWidget.MyCustomWidget thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: Regular Expressions - Python vs Perl

2005-04-21 Thread codecraig
Thanks for the input. I was just looking for some feedback about which was better and faster, if an answer exists. However, I am not choosing Perl or Python b/c of it's RegEx engine as someone mentioned. The question was just because I was curious, sorry if I misled you to think I was choosing

Define Constants

2005-04-20 Thread codecraig
Hi, I have a question about how to define constants. My directory structure looks like... C:\ -- abc.py -- utils -- __init__.py -- CustomThing.py Ok, CustomThing looks like... TOP = 0 LEFT = 1 class CustomThing: def __init__(self): self.foo = foo

Update Label when Scale value changes

2005-04-19 Thread codecraig
Hi, I am using Tkinter and I have a Label and a Scale. I want to update my label everytime the Scale value changes. What is the best way of doing this? Do i have to bind for every event type? Or is there some better way? If I do have to bind each type of event to the scale, what types occur

Re: Update Label when Scale value changes

2005-04-19 Thread codecraig
Yea that is what i needed. Can you recommend a good Tkinter site (or book, but preferably site) about learning Tkinter. I've tried: http://www.python.org/moin/TkInter http://www.pythonware.com/library/tkinter/introduction/ But I am looking for more about events, etc. Thanks --

XML-RPC -- send file

2005-04-19 Thread codecraig
Hi, I want to use XML-RPC to send a file from client-to-server or from server-to-client. I know XML-RPC supports, int, string etc...not objects. I thought i read somewhere that by using pickle or something, that u could get a string representation of your object (or a file in my case) and

Tkinter and Scrollbar

2005-04-19 Thread codecraig
Hi, I am trying to use a Scrollbar for a Listbox. I want a scrollbar which which has the vertical and horizontal scroll bars. Here is how i am doing it now, is the only way or best way to do it? # vertical scroll bar for list self._scrollbarY = Scrollbar(self.myContainer)

Re: XML-RPC -- send file

2005-04-19 Thread codecraig
how would I decode it? -- http://mail.python.org/mailman/listinfo/python-list

Re: XML-RPC -- send file

2005-04-19 Thread codecraig
Experient I have been :) Here is what I am getting now CLIENT --- d = xmlrpclib.Binary(open(C:\\somefile.exe).read()) server.sendFile(d) SERVER -- def sendFile(tmp): print FILE:, tmp The server receives the file, because it prints it out, but on the client I get

Re: XML-RPC -- send file

2005-04-19 Thread codecraig
stefan: i added, return 1 to my sendFile method on the server...took care of the error, thanks. f. petitjean: i cleaned up my code by closing the file, however, when i tried your exact code above...i got stuck an infinite loop and my PC speaker beeped over and over :) thanks. --

Tkinter Tkconstants

2005-04-18 Thread codecraig
Hi, I was reading through the Tkinter tutorial at http://www.pythonware.com/library/tkinter/introduction/index.htm ...and it mentions that by doing, from Tkinter import * you have access to the constants in Tkconstants, since Tkinter imports it automatically. However, in the shell if I do..

Tkinter Event Types

2005-04-18 Thread codecraig
Hi, When I do something like. s = Scale(master) s.bind(ENTER, callback) def callback(self, event): print event.type I see 7 printed out. Where are these constants defined for various event types? Basically i want to do something like... def callback(self, event): if event.type ==

Re: Tkinter Tkconstants

2005-04-18 Thread codecraig
nevermind, i should access it by HORIZONTAL not Tkinter.HORIZONTAL since I imported everything from Tkinter already. Thanks anyway -- http://mail.python.org/mailman/listinfo/python-list

Python - interpreted vs compiled

2005-04-15 Thread codecraig
Hi, I have a question about Python. I know that it is an interpreted language, meaning a python program is converted to binary on the fly each time it is run, or compiled. What would be the purpose of compiling? I guess the compiled python code (question, is compiled python code called byte

Re: Python - interpreted vs compiled

2005-04-15 Thread codecraig
thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: Is Python appropriate for web applications?

2005-04-15 Thread codecraig
for more information on web application frameworks check out http://pyre.third-bit.com/pyweb/ It is a project aimed at helping web app developers to figure out which frameworks to use, etc. good luck! -- http://mail.python.org/mailman/listinfo/python-list

Re: Get OS name

2005-04-15 Thread codecraig
i guess i wanted the result in a nice string like Windows XP instead of 5.1 i guess i'll have to convert it myself, thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: Get OS name

2005-04-15 Thread codecraig
where can I get wmi module, it doesnt come with Python right? thanks. -- http://mail.python.org/mailman/listinfo/python-list

py2exe - create one EXE

2005-04-15 Thread codecraig
Hi, Is there a way to create one .exe using py2exe (or some other extension/utility that can do it)? Basically i want to generate one .exe that contains everything my python app needs to run instead of having a .exe, some .zips, etc. thanks --

Re: Get OS name

2005-04-15 Thread codecraig
my requirements for getting the OS info havent changed. My first message says How can I get the OS Name, such as Windows XP Pro. that's what I wanted all along. thanks for the information anyway, i believe platform is better than my previous approach. thanks --

Re: py2exe - create one EXE

2005-04-15 Thread codecraig
must have missed it on py2exe front pageand for google i didnt try that search exactly. Thanks though. I was trying like one executable py2exe, etc. -- http://mail.python.org/mailman/listinfo/python-list

Re: py2exe - create one EXE

2005-04-15 Thread codecraig
I tried the installer v6...and i generated a spec, and i built the exe...when i run the exe i get a error popup window from Windows asking me to send an Error report. The warnings that were generated during the build all appear to be ignorable as the documentation mentions. any ideas? --

Re: py2exe - create one EXE

2005-04-15 Thread codecraig
oh and Fredrik, i tried the SingleInstaller linkwhich points to a script using NSIS. I followed those instructions which generated an .exe. HOwever, when i run the .exe nothing happens (meaning no process starts, no output, no errors, nothing). any ideas on that? have ever used it? --

Re: py2exe - create one EXE

2005-04-15 Thread codecraig
fredrik... any ideas on my last post? (copied below for u) oh and Fredrik, i tried the SingleInstaller linkwhich points to a script using NSIS. I followed those instructions which generated an .exe. HOwever, when i run the .exe nothing happens (meaning no process starts, no output,

py2exe + XML-RPC problem

2005-04-14 Thread codecraig
Hi, I tried to take the Monkey Shell script (http://www.sharp-ideas.net/archives/2005/03/monkey_shell_us.html) and make it into an executable. I am making an executable for the server piece (monkey_shelld.py). So my setup.py looks like this # setup.py from distutils.core import setup import

distribute python script

2005-04-14 Thread codecraig
i want to distribute my python script as an executable. I have tried py2exe but it caused a problem in my script when I ran it. I know about Gordon McMillans Installer (which is no longer hosted)..but i tried that and when i run the .exe it generated, it just crashes (i.e. Windows wants to send

Re: distribute python script

2005-04-14 Thread codecraig
surei posted another thread eariler, which explains much more related to py2exe..check that out and let me know if that helps. http://groups-beta.google.com/group/comp.lang.python/browse_thread/thread/4071921987be308d -- http://mail.python.org/mailman/listinfo/python-list

Re: py2exe + XML-RPC problem

2005-04-14 Thread codecraig
update to this. I generated an exe for the client and server. They both run fine, except, when i send a command from the client to server, the cleint spits out this.. xmlrpclib.ProtocolError: ProtocolError for 10.50.20.5:80/RPC2: -1 When I run the .py's by themselves I do not get this. This

Re: distribute python script

2005-04-14 Thread codecraig
Thanks so much Thomas!!! I added encodings to my setup's...here it is setup(console=[{script: 'monkey_shell.py'}], options={py2exe: {packages: [encodings]}}) and i did the same for the other python script. Thanks!! -- http://mail.python.org/mailman/listinfo/python-list

SimpleXMLRPCServer - turn of output

2005-04-14 Thread codecraig
Hi, I have a simple script which starts a SimpleXMLRPCServer. A client connects to the server and executes one of the servers methods. When the server processes the request and returns it, the server prints some info out to the console, something like this.. localhost - - [14/Apr/2005

SimpleXMLRPCServer - disable output

2005-04-14 Thread codecraig
Hi, I thought I posted this, but its been about 10min and hasnt shown up on the group. Basically I created a SimpleXMLRPCServer and when one of its methods gets called and it returns a response to the client, the server prints some info out to the console, such as, localhost - - [14/Apr/2005

Re: SimpleXMLRPCServer - disable output

2005-04-14 Thread codecraig
Jeremy Jones wrote: codecraig wrote: Hi, I thought I posted this, but its been about 10min and hasnt shown up on the group. Basically I created a SimpleXMLRPCServer and when one of its methods gets called and it returns a response to the client, the server prints some info out

Re: SimpleXMLRPCServer - disable output

2005-04-14 Thread codecraig
Jeremy, Thanks for clearing that up. I am so used to java (i.e. foo.setLogRequests(0))...that I forgot I could just do, foo.logRequests = 0. Learning one day at a time :) Thanks. -- http://mail.python.org/mailman/listinfo/python-list