Re: Stupid question, just need a quick and dirty fix

2016-07-21 Thread Jordan Bayless
No, I tried using a bunch of elif statements earlier and when I added more than around 3 of them it threw errors. I just assumed that was some kind of limit. We both agree that's piss-poor, lazy coding. I'm just trying to find something that works though. To this point, everything I try fails.

Re: Stupid question, just need a quick and dirty fix

2016-07-21 Thread Jordan Bayless
On Thursday, July 21, 2016 at 11:28:55 PM UTC-5, Chris Angelico wrote: > On Fri, Jul 22, 2016 at 2:19 PM, Jordan Bayless wrote: > > I get various errors no matter what I do to this to try and make it work. > > Variable not defined. Referenced before assignment. etc etc. I'm

Stupid question, just need a quick and dirty fix

2016-07-21 Thread Jordan Bayless
I'm trying to modify some code to suit my purposes and I'm just trying to filter results as necessary. Basically, the code is returning one of a number from a subset of 150 numbers. I want to only do anything with it if the number is a 'good' one. I'm by no means a Python programmer (C# for me b

Re: Python Script for Colorizing Traceroute Output (apologies for top-post)

2012-11-17 Thread Jordan Bylsma
For this case the firewalls DO respond to TTL(in most cases) and will show in a traceroute. The objective here is to colorize particular devices to easily see what type of devices traffic would traverse across the network. I would be using a database of device hostnames that when they match in t

Python Script for Colorizing Traceroute Output

2012-11-17 Thread Jordan Bylsma
I'm looking into writing a python script that colorizes particular hops when using traceroute. Anyone run across something like this? I don't think it would be extremely difficult to write but some example code would help. Basically particular hops in traceroute output would match a table as eit

A case for "real" multiline comments

2012-04-18 Thread Jordan Perr
Object4]. I can't really see a good way to get around this without true multiline comments. - Jordan -- http://mail.python.org/mailman/listinfo/python-list

Dynamically Cause A Function To Return

2011-09-19 Thread Jordan Evans
I want dynamically place the 'return' statement in a function via user input or achieve the same through some other means. If some other means, the user must be able initiate this at runtime during a raw_input(). This is what I have so far, this would be an awesome command line debugging tool if

Directly Executable Files in Python

2011-03-28 Thread Jordan Meyer
Is it possible to make a directly executable (such as .exe on Windows) file from scripts written in Python? So as to prevent the end-user from having to download an interpreter to run the program. -- http://mail.python.org/mailman/listinfo/python-list

Re: Instant File I/O

2011-03-24 Thread Jordan Meyer
That did the trick! Thanks! -- http://mail.python.org/mailman/listinfo/python-list

programming

2010-09-19 Thread Jordan Blanton
I am in a computer science class in which I am supposed to be creating a program involving a sine wave and some other functions. I understand the concept of the problem, but I don't understand any of the "lingo" being used. The directions might as well be written in a different language. Is there a

array matching

2010-04-29 Thread Bill Jordan
Hey guys, I am sorry if this is not the right list to post some questions. I have a simple question please and would appreciate some answers as I am new to Python. I have 2 D array: test = [[A,1],[B,2],[A,3][B,4]] I want to arrang this array in different arrays so each one will have what is att

Re: datetime string conversion error

2010-03-16 Thread Jordan Apgar
On Mar 16, 3:07 pm, Christian Heimes wrote: > Jordan Apgar wrote: > > Hey all, > > I'm trying to convert a string to a date time object and all my fields > > convert except for month which seems to default to january. > > > here's what I'm

datetime string conversion error

2010-03-16 Thread Jordan Apgar
int date print olddate I get: 2010-03-16 14:46:38.409137 2010-01-16 14:46:38.409137 notice the 01 in the second date from what I could tell everything is formatted correctly. thanks for the help. ~Jordan -- http://mail.python.org/mailman/listinfo/python-list

Binary data transfer issue

2010-03-15 Thread Jordan Apgar
Hi all, I'm trying to transfer a binary file over xmlrpclib. My test file is a .jpeg file. I can transfer all the data over but when I go to open the .jpeg I get "Error interpreting JPEG image file (Invalid JPEG file structure: SOS before SOF)" here's the code: ===Various Shared Funct

fork vs threading.Thread

2010-02-12 Thread Jordan Apgar
I'm trying to run two servers in the same program at once. Here are the two: class TftpServJ(Thread): def __init__(self, ip, root, port=69, debug = False ): Thread.__init__(self) setup stuff here def run(self): try: self.server.listen(self.ip, self.port

Pycrypto RSA ciphertext to string back to ciphertext issue

2010-02-11 Thread Jordan Apgar
Hey all, I'm trying to convert the encrypted data from RSA to a string for sending over xmlrpc and then back to usable data. Whenever I decrypt I just get junk data. Has anyone else tried doing this? Here's some example code: from Crypto.PublicKey import RSA from Crypto import Random key = RSA

SimpleXMLRPCServer and client address

2010-02-10 Thread Jordan Apgar
I'm trying to right a server that needs specific information for each client accessing it. The easiest way I could think of doing this is keeping this information based on ip address (the information is only valid for a short time). I know there is no was to get the client's address directly and

SocketServer error: AttributeError: instance has no __call__ method

2010-02-10 Thread Jordan Apgar
Hey guys, I'm having some issues connecting to my Socket Server, I get this traceback on the sever side: Exception happened during processing of request from ('127.0.0.1', 56404) Traceback (most recent call last): File "/usr/lib/python2.6/SocketServer.py"

Re: Pycrypto RSA Issue

2010-02-09 Thread Jordan Apgar
On Feb 9, 1:27 pm, Legrandin wrote: > > gkey = RSA.generate(384, Random.new().read) > > string = str((gkey.publickey().__getstate__(),(333,444))) > > You are encrypting with RSA a piece of data which is way > larger than the key size (48 bytes). ah thanks Legrandin -- http://mail.python.org/mail

Re: errno 107 socket.recv issue

2010-02-09 Thread Jordan Apgar
On Feb 9, 1:51 pm, Jean-Michel Pichavant wrote: > Jordan Apgar wrote: > > thanks JM, > > > at this point i switched over to this scheme and now I'm getting an > > error durring instantiation of the server: > > Server.py: > > from Crypto.PublicKey im

Pycrypto RSA Issue

2010-02-09 Thread Jordan Apgar
I am trying to encrypt public data along with another tuple and then decrypt it after sending. RSA is needed for negotiation of keys for AES. But I just get garbage after I decrypt it. This is what I'm attempting to do: from Crypto.PublicKey import RSA from Crypto import Random gkey = RSA.generat

Re: errno 107 socket.recv issue

2010-02-09 Thread Jordan Apgar
thanks JM, at this point i switched over to this scheme and now I'm getting an error durring instantiation of the server: Server.py: from Crypto.PublicKey import RSA from ServerNegotiator import ServerNegotiator from sharedComs import * f = open("hostid") tup = stringToTuple(f.readline()[0:-1]) H

Re: errno 107 socket.recv issue

2010-02-09 Thread Jordan Apgar
> http://docs.python.org/library/socketserver.html > > JM each time a handler is spawned is it client specific? in other words when two clients send something to the server do handlers spawn for each of them or does everything just go into a single handler? -- http://mail.python.org/mailman/list

Re: errno 107 socket.recv issue

2010-02-09 Thread Jordan Apgar
I found my car ;) here's the server: class commServer: """Class to hold a tcp server and interact with with it allows for a wrapper around socket class to keep code clean""" def __init__ (self, host, hostid, port, buff =1024): self.host = host self.hostid = hostid #id

errno 107 socket.recv issue

2010-02-09 Thread Jordan Apgar
I have a simple tcp server and client where the server sits and waits for a message and then processes it, my client sends its first message to the server. On the server I receive: socket.error: [Errno 107] Transport endpoint is not connected when calling msg = self.socket.recv(self.buffer) My c

still having problems with "Nim". using python 2.6.4

2010-02-07 Thread Jordan Uchima
my problem is that i can't get it to make the players have more than 1 turn each, it accepts any value for playerChoice, (it is only supposed to accept values from 1 to 4), and "

"Nim" game being created, no GUI used... Need tips...

2010-02-05 Thread Jordan Uchima
I am creating a game called Nim, but cannot get a loop going no matter what I do. What i am trying to do is get it to only accept input from 1 to 4, and keep asking for input from the same player if he/she enters in an invalid number. I also want it to stop when there is 1 or no piece(s) left, and

Re: Unicode File Names

2008-10-16 Thread Jordan
On Oct 16, 10:18 pm, John Machin <[EMAIL PROTECTED]> wrote: > On Oct 17, 12:52 pm, Jordan <[EMAIL PROTECTED]> wrote: > > > > > On Oct 16, 9:20 pm, John Machin <[EMAIL PROTECTED]> wrote: > > > > On Oct 17, 11:43 am, Jordan <[EMAIL PROTECTED]> wr

Re: Unicode File Names

2008-10-16 Thread Jordan
On Oct 16, 10:18 pm, John Machin <[EMAIL PROTECTED]> wrote: > On Oct 17, 12:52 pm, Jordan <[EMAIL PROTECTED]> wrote: > > > > > On Oct 16, 9:20 pm, John Machin <[EMAIL PROTECTED]> wrote: > > > > On Oct 17, 11:43 am, Jordan <[EMAIL PROTECTED]> wr

Re: Unicode File Names

2008-10-16 Thread Jordan
On Oct 16, 9:20 pm, John Machin <[EMAIL PROTECTED]> wrote: > On Oct 17, 11:43 am, Jordan <[EMAIL PROTECTED]> wrote: > > > I've got a bunch of files with Japanese characters in their names and > > os.listdir() replaces those characters with ?'s. I'm try

Unicode File Names

2008-10-16 Thread Jordan
I've got a bunch of files with Japanese characters in their names and os.listdir() replaces those characters with ?'s. I'm trying to open the files several steps later, and obviously Python isn't going to find '01-.jpg' (formally '01-ひらがな.jpg') because it doesn't exist. I'm not sure where in th

Re: Attack a sacred Python Cow

2008-07-25 Thread Jordan
Well this discussion is chugging along merrily now under its own steam, but as the OP I should probably clarify a few things about my own views since people continue to respond to them (and are in some cases misunderstanding me.) I *like* explicit self for instance variable access. There are argum

Re: Attack a sacred Python Cow

2008-07-24 Thread Jordan
> > You're not a lunatic. > > We, and Python itself, change quite readily. > > Neither of those mean your ideas in this instance have merit. You're right, these premises don't lead to this conclusion. Neither do they lead to its negation, of course. As it happens, you're wrong on both counts. I d

Re: Attack a sacred Python Cow

2008-07-24 Thread Jordan
> Then why do you write, let me quote: > > """ > (snip) coding __eq__ (snip) buys you > nothing from the != operator. != isn't (by default) a synonym for the > negation of == (unlike in, say, every other language ever); not only > will Python let you make them mean different things, without > docum

Re: Attack a sacred Python Cow

2008-07-24 Thread Jordan
> I don't really mind, what you think about my response.  Python will suffer > from it as little as it will suffer from your complaints:  These things > will not change, whatever any of us says about them.  So this discussion > unlikely to produce any new insight, especially because this as been >

Re: Attack a sacred Python Cow

2008-07-24 Thread Jordan
> Personally, I think it has more to do with statements like "there are > plenty of smart Python programmers who will > justify all kinds of idiocy in the name of their holy crusade" than > with your position. You don't begin a discussion by discrediting > anyone who might disagree with you as some

Re: Attack a sacred Python Cow

2008-07-24 Thread Jordan
On Jul 24, 8:01 pm, Lawrence D'Oliveiro <[EMAIL PROTECTED] central.gen.new_zealand> wrote: > In message > <[EMAIL PROTECTED]>, Jordan > wrote: > > > Except when it comes to Classes. I added some classes to code that had > > previously just been funct

Re: Attack a sacred Python Cow

2008-07-24 Thread Jordan
> This is just plain wrong for at least C# and C++.  C# wants you to > explicitly overload "!=", if you have overloaded "==", While this is as inconvenient as Python at least it doesn't catch you unawares. C# 1 (or maybe 0.5), Python 0. > C++ complains > about "!=" not being defined for class A.

Re: Attack a sacred Python Cow

2008-07-24 Thread Jordan
OK, it seems my original reply to Bruno got lost in the Aether (apologies therefore if a paraphrased "quantum duplicate" of this message is eventually forthcoming.) Torsten has adequately responded to his second point, so I need only replicated what I said for the first. > Please get your facts,

Re: Attack a sacred Python Cow

2008-07-24 Thread Jordan
On Jul 24, 7:40 pm, Torsten Bronger <[EMAIL PROTECTED]> wrote: > Hallöchen! > > Bruno Desthuilliers writes: > > [...] > > > How would you handle this case with an implicit 'self' : > > > class Foo(object): > >    pass > > > def bar(self): > >    print self > > > Foo.bar = bar > > Just like this.  H

Re: Attack a sacred Python Cow

2008-07-24 Thread Jordan
Of course not. I just think Explicit is better than Implicit is taken seriously by a large segment the Python community as a guiding principle, and overall its influence does more harm than good. Clearly self being in every argument list was a decision arrived at long before the Zen was ever coin

Re: Attack a sacred Python Cow

2008-07-23 Thread Jordan
On Jul 24, 3:41 pm, Jordan <[EMAIL PROTECTED]> wrote: > Hi everyone, > > I'm a big Python fan who used to be involved semi regularly in > comp.lang.python (lots of lurking, occasional posting) but kind of > trailed off a bit. I just wrote a frustration inspired rant on m

Attack a sacred Python Cow

2008-07-23 Thread Jordan
Hi everyone, I'm a big Python fan who used to be involved semi regularly in comp.lang.python (lots of lurking, occasional posting) but kind of trailed off a bit. I just wrote a frustration inspired rant on my blog, and I thought it was relevant enough as a wider issue to the Python community to po

Re: Question about inheritence

2008-07-22 Thread Jordan
On Jul 22, 12:26 pm, Catherine Heathcote <[EMAIL PROTECTED]> wrote: > If I create a new class inherited from another with a constructor, what > happens with the new class's constructer? > Thanks for your time. Well, the __init__ method of the subclass is called, and from within it you can call the

Re: % sign in python?

2008-07-17 Thread Jordan
n syntax uses of > non-alpha-or-digit ascii symbols.  When I finish and upload it > somewhere, I will post an announcement with the link. > > tjr That sounds great Terry! I look forward to seeing this. ~Jordan -- http://mail.python.org/mailman/listinfo/python-list

Re: Testing for connection to a website

2008-07-15 Thread Jordan
On Jul 15, 3:43 pm, Alexnb <[EMAIL PROTECTED]> wrote: > Okay, I already made this post, but it kinda got lost. So anyway I need to > figure out how to test if the user is able to connect to a specific website. > Last time I got pointed to the urllib2 page, but if I do urlopen() and and > am not con

Re: How can I save command prompt screen

2008-07-15 Thread Jordan
Let me take a stab: I figure you either want to save something that is showing up in the standard output in which case you can: instead of using the print command to print to standard output, open a file and append to that instead of printing, and then you can open that up when you are done and s

Re: graphing lifelines

2008-07-15 Thread Jordan
There are several different modules for graphing in Python which you can find easily by searching, but to my knowledge none of them will simply take in a set of tuples and turn them into what you want, although I am sure that it is certainly possible to program a app that could do that for you...

Python ver of System.arraycopy() in Java

2008-07-14 Thread Jordan
I could seem to find a built in function that would serve the purpose of System.arraycopy() in java. I was able to accomplish it with something like this: def arraycopy(source, sourcepos, dest, destpos, numelem): dest[destpos:destpos+numelem] = source[sourcepos:sourcepos +numelem] is there

Re: error when porting C code to Python (bitwise manipulation)

2008-07-10 Thread Jordan
Well, that about wraps this up...MRAB was 100% correct, that solution worked...not sure how I managed to mess it up when I tried it early. Based on the incoming values of u here is the code with the minimal number of maskings: def findit(u): mask = 0x u += 0xe91aaa35 u ^= u >>

Re: error when porting C code to Python (bitwise manipulation)

2008-07-10 Thread Jordan
On Jul 10, 4:04 pm, Harald Luessen <[EMAIL PROTECTED]> wrote: > On Thu, 10 Jul 2008 Jordan wrote: > > > > >On Jul 10, 1:35 pm, MRAB <[EMAIL PROTECTED]> wrote: > >> On Jul 10, 4:56 am, Jordan <[EMAIL PROTECTED]> wrote: > > >> > I am try

Re: error when porting C code to Python (bitwise manipulation)

2008-07-10 Thread Jordan
On Jul 10, 1:35 pm, MRAB <[EMAIL PROTECTED]> wrote: > On Jul 10, 4:56 am, Jordan <[EMAIL PROTECTED]> wrote: > > > > > I am trying to rewrite some C source code for a poker hand evaluator > > in Python.  Putting aside all of the comments such as just using th

Re: error when porting C code to Python (bitwise manipulation)

2008-07-10 Thread Jordan
Well, I have figured out something that works: def findit(u): u += 0xe91aaa35 u1 = ~(0x - u) ^ u >> 16 u1 += ((u1 << 8) & 0x) u1 ^= (u1 & 0x) >> 4 b = (u1 >> 8) & 0x1ff a = (u1 + (u1 << 2) & 0x) >> 19 r = int(a) ^ hash_adjust[int(b)]

Re: error when porting C code to Python (bitwise manipulation)

2008-07-09 Thread Jordan
if after the first step (u += 0xe91aaa35) you apply this function: invert = lambda x: ~int(hex(0x - x)[0:-1],16) it returns the correct value (corrected the overflow) but there is still something wrong, still looking into it, if someone knows how to do this, feel free to comment :) -- ht

Re: error when porting C code to Python (bitwise manipulation)

2008-07-09 Thread Jordan
I realize I did a pretty bad job of explaining the problem. The problem is the python version is returning an r that is WY to big. Here is an example run through that function in each language: C: u starts at 1050 u += 0xe91aaa35; u is now -384127409 u ^= u >> 16; u

Re: error when porting C code to Python (bitwise manipulation)

2008-07-09 Thread Jordan
I was actually just going through an example to show what was happening each step of the way and noticed the overflow!!! bah, stupid tricks tricks tricks!!! The problem is def the overflow, I notice that I start to get negative numbers in the C version, which makes me think that the & 0x t

error when porting C code to Python (bitwise manipulation)

2008-07-09 Thread Jordan
I am trying to rewrite some C source code for a poker hand evaluator in Python. Putting aside all of the comments such as just using the C code, or using SWIG, etc. I have been having problems with my Python code not responding the same way as the C version. C verison: unsigned find_fast(unsign

Re: Proof that \ is a better line joiner than parenthetical sets

2008-06-06 Thread Jordan Greenberg
Joshua Kugler wrote: "Beautiful is better than ugly." And I think putting parenthesis around a multi-line statement is much prettier. So there! :) j And PEP 8 agrees with you. Another vote for parens. -Jordan -- http://mail.python.org/mailman/listinfo/python-list

TypeError: unsupported operand type(s) for /: 'NoneType' and 'NoneType'

2008-05-01 Thread Jordan Harry
I'm trying to write a simple program to calculate permutations. I created a file called "mod.py" and put the following in it: def factorial(n): a = n b = n while a>0 and b>1: n = (n)*(b-1) b = b-1 def perm(n, r): a = factorial(n) b = factorial(n-r) q =

Re: implement random selection in Python

2007-11-16 Thread Jordan
weightings is 100.) Not sure if it satisfies the conditions in my last post either do some empirical testing, or some mathematics, or maybe a bit of both. On Nov 17, 12:02 pm, Jordan <[EMAIL PROTECTED]> wrote: > Maybe it would help to make your problem statement a litte rigorous so

Re: implement random selection in Python

2007-11-16 Thread Jordan
;t think of any other obvious way of generalising the behaviour of the N = 1 case. - Jordan On Nov 17, 10:50 am, Bruza <[EMAIL PROTECTED]> wrote: > On Nov 16, 4:47 pm, Bruza <[EMAIL PROTECTED]> wrote: > > > > > > > On Nov 16, 6:58 am, duncan smith <[EMAIL P

Re: namespace question

2007-05-18 Thread Jordan Greenberg
T. Crane wrote: > Hi, > > If I define a class like so: > > class myClass: > import numpy > a = 1 > b = 2 > c = 3 > > def myFun(self): > print a,b,c > return numpy.sin(a) > > > I get the error that the global names a,b,c,numpy are not defined. Fairly > stra

Re: python noob, multiple file i/o

2007-03-16 Thread Jordan
g open() over file() (although I admit to using file() myself more often than not) >>for filename in matching_file_list: >> infile = open(filename,'r') # add 'r' for clarity if nothing else >> outfile = open(filename[:-4] + '.out.txt','w') # assumes file ext of >> original file is .txt >> # Process the input file line by line... >> for line in infile: >> pass # do thing --> you don't have to iterate line by line, if you >> specified what you wanted to do to each file we could probably help out here >> if you need it. >> # Be explicit with file closures >> outfile.close() >> infile.close() Might also add some try/except statements to be safe ;). Cheers, Jordan -- http://mail.python.org/mailman/listinfo/python-list

Re: logging and wx.Timer

2007-03-14 Thread Jordan
On Mar 14, 1:52 am, hg <[EMAIL PROTECTED]> wrote: > Hi, > > I read that logging was thread safe ... but can I use it under a GUI timer ? > > Thanks, > > hg That was barely enough information to be worthy of a reply. Need more than that. What do you mean under a gui timer? What gui? What type of

Re: Reading a portion of a file

2007-03-08 Thread Jordan
On Mar 8, 12:46 pm, "Jordan" <[EMAIL PROTECTED]> wrote: > On Mar 8, 11:52 am, "Rune Strand" <[EMAIL PROTECTED]> wrote: > > > > > On Mar 8, 5:12 pm, [EMAIL PROTECTED] wrote: > > > > I am using a script with a single file containing

Re: Reading a portion of a file

2007-03-08 Thread Jordan
On Mar 8, 11:52 am, "Rune Strand" <[EMAIL PROTECTED]> wrote: > On Mar 8, 5:12 pm, [EMAIL PROTECTED] wrote: > > > I am using a script with a single file containing all data in multiple > > sections. Each section begins with "#VS:CMD:command:START" and ends > > with "#VS:CMD:command:STOP". There is a

Re: pyHook or SetWindowsHookEx

2007-03-03 Thread Jordan
x27;t log the keystrokes of someone who is logged onto your machine from another; that would be a major security flaw. The only way (I think) this would work is if you wrote your own remote desktop program that logged keystrokes, and then sent it to the remote computer when logging off. Cheers, Jordan -- http://mail.python.org/mailman/listinfo/python-list

Re: How can I track/monitor an application and system resources.

2007-02-22 Thread Jordan
t search for taskmanager extensions on codeproject.com or look at the msdn on taskmanager to see how it gets all of its information (which is essentially what you want -- a taskmanager). Either way you'll almost defitely need pywin32, so look there first. Cheers, Jordan -- http://mail.python.org/mailman/listinfo/python-list

Re: Reading compressed files

2007-02-21 Thread Jordan
em if you know the syntax for each of these files. What you need to do is research each syntax and write a regexp or other string searching function to determine each format based on the archive header syntax. While you're at it, open a few archives with a hex editor or using open(...,'rb') and take a look at the syntax of each file to see if you can determine it yourself. Goodluck. Cheers, Jordan -- http://mail.python.org/mailman/listinfo/python-list

Re: Help Required for Choosing Programming Language

2007-02-20 Thread Jordan
using C++ over Python for gui building is if for some obscure reason Python wasn't fast enough. On the other hand, this brings up the argument of which is faster: Python or C++ ;) so let's not get into that. Python + WxPython = Good Language with Good GUI Toolkit. Cheers, Jordan -- http://mail.python.org/mailman/listinfo/python-list

Re: How to write a programe that include both pipe(low speed system call) and signal

2007-02-15 Thread Jordan
ou > > -- > LinuX Power Take a look at the subprocess module, which is meant to replace popen[1,2,3...](). Also, please try to explain the problem again, because I just can't decypher everything you're trying to do (and say). cheers, Jordan -- http://mail.python.org/mailman/listinfo/python-list

Re: Download parts not whole file in ones

2007-02-13 Thread Jordan
On Feb 13, 12:51 pm, "Jordan" <[EMAIL PROTECTED]> wrote: > On Feb 13, 8:09 am, NOSPAM plz <[EMAIL PROTECTED]> wrote: > > > > > Hey, > > > My problem is, is it possible to download parts of a file while. i think > > is it is called thread

Re: Download parts not whole file in ones

2007-02-13 Thread Jordan
> In my example it just download the whole file, and then print it. > > Any suggestions? > > Regards > Andreas That's because urllib.urlopen() is not a low enough level function to allow what you want, it will simply open the . Take a look inside of urllib.py and maybe you'l

Re: Running long script in the background

2007-02-07 Thread Jordan
On Feb 6, 8:26 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Hello, > > I am trying to write a python cgi that calls a script over ssh, the > problem is the script takes a very long time to execute so Apache > makes the CGI time out and I never see any output. The script is set > to print a

Re: asyncore.dispatcher.handle_read

2007-01-25 Thread Jordan
help. Good luck. Cheers, Jordan On Jan 25, 12:18 pm, Indy <[EMAIL PROTECTED]> wrote: > Greetings. > > I am writing an asynchronous server, and I use the standard library's > module asyncore. > I subclass asyncore.dispatcher. handle_accept works just right, that >

Re: running applications in python

2007-01-25 Thread Jordan
don't really need to redirect input/output/errors or other aspects of the opened application.Also, you'll probably want something more like: retcode = sp.call(...), so that you can check the return code to see if it was successful. Check out the subprocess module. Cheers, Jordan On J

Re: How to manage two (different) sockets without using threads?

2006-12-13 Thread Jordan
Why are you trying to make this asynchronous? I think part of the point of ftp using two sockets was to make it multithreaded. If you're going to make it asynchronous, It's probably going to be easier to do the "select"ing yourself, instead of relying on asyncore or asynchat. Unless you have an i

Re: Tarfile .bz2

2006-12-11 Thread Jordan
really on topic anymore but what's the method for tar.gz? And even more off the topic, does anyone know a good lossless compression method for images (mainly .jpg and .png)? Cheers, Jordan Wolfgang Draxinger wrote: > Jordan wrote: > > > When using python to create a tar.

Tarfile .bz2

2006-12-11 Thread Jordan
h must end in "\\" for this to work info = archive.gettarinfo(nthing) archive.addfile(info,file(nthing,'rb')) archive.close() --- Thanks, Jordan -- http://mail.python.org/mailman/listinfo/python-list

Re: How to create a global hotkey?

2006-12-07 Thread Jordan
entional keyloggers built in C/C++ which hide themselves from the OS - the purpose was not actually to spy on the user but to create backups of what was typed - it still does a very good job and the latest release has a lot of options and extendability). If your OS is linux, unix, or mac... good

Re: python skipping lines?

2006-11-27 Thread Jordan Greenberg
[EMAIL PROTECTED] wrote: > Hi, > Any ideas of what could be the problem? > Hard to say without seeing your code. Jordan Greenberg -- Posted via a free Usenet account from http://www.teranews.com -- http://mail.python.org/mailman/listinfo/python-list

Re: test message

2006-11-26 Thread Jordan Greenberg
Ben Finney wrote: > Jordan Greenberg <[EMAIL PROTECTED]> writes: > >> [EMAIL PROTECTED] wrote: >>> This is a test message, please ignore. >> I could do that, but reminding you that test messages go in *.test >> groups is way more fun. > > I'

Re: test message

2006-11-26 Thread Jordan Greenberg
er up my (and everyone else's) newsreader with your garbage. Thanks, Jordan -- Posted via a free Usenet account from http://www.teranews.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Python development time is faster.

2006-11-14 Thread Jordan
ly just to download python and tinker with it, maybe try making some python equivalents to whatever you've made in other languages. Cheers -Jordan Hendrik van Rooyen wrote: > "Chris Brat" <[EMAIL PROTECTED]> wrote: > > > > I've seen a few posts, columns an

Re: help using smtplib to work ..

2006-11-08 Thread Jordan
Your post was definitely the most helpful for me. For some reason, smtp for gmail seems to require that you call server.ehlo() a second time, after having called server.starttls(), otherwise, the server won't accept authorization. Thanks. -Jordan Gabriel Genellina wrote: > At Wednes

Re: 3d programming without opengl

2006-11-01 Thread Jordan
I don't thnk you should have any problems using Slut with wxpython - wx would be much less amazing if it couldn't do something like that. On the other hand, I thought that you were looking for something that doesn't use openGL and I think that Slut is built around it. Cheers,

Re: FOR statement

2006-10-20 Thread Jordan Greenberg
4 > 3 > 2 > 1 >>> def printreverse(lst): if lst: printreverse(lst[1:]) print lst[:1][0] >>> printreverse([1,2,3,4]) No good reason at all to do it this way. But recursion is fun. -Jordan Greenberg -- Posted via a free Usenet account from http://www.teranews.com -- http://mail.python.org/mailman/listinfo/python-list

Re: proper format for this database table

2006-10-19 Thread Jordan Greenberg
or just an auto-inc) name, etc... Table Students2Education: studentID (id from Students) EducationID (id from Education) Table Education: id (probably just some auto-inc) university yearStart yearEnd degreesEarned This way, if you have

Re: external file closed

2006-10-17 Thread Jordan
loopholes, such as if there is more than one pdf open. Cheers, Jordan utabintarbo wrote: > Jerry wrote: > > On Oct 17, 12:43 pm, "kilnhead" <[EMAIL PROTECTED]> wrote: > > > I am opening a file using os.start('myfile.pdf') from python. How can I > >

Re: intercepting keypresses, mouse movements, joystick movements.

2006-10-09 Thread Jordan
on't think that's covered), or for detecting system or dead keys (unless pyHook has been updated recently, the last time I checked the docs said it didn't capture those keys). Good Luck, Jordan TheSeeker wrote: > bryan rasmussen wrote: > > Hi, > > > > I'

Re: Need help with syntax on inheritance.

2006-10-03 Thread jordan . nick
SpreadTooThin wrote: > If you are deriving a new class from another class, > that you must (I assume) know the initializer of the other class. > > So in myClass > > import array > class myClass(arrary.array): >def __init__(self, now here I need to put array's constructor > parameters..., then

A Universe Set

2006-10-03 Thread jordan . nick
Has the addition of a Universe Set object ever been suggested. Like U = set(0), so that any object was a member of U? Maybe this gets into some crazy Cantorian stuff since U is in U. But it seems like it would be useful and would have a nice symmetry with emptyset:set([]), that is: for any obje

Re: XSLT speed comparisons

2006-09-29 Thread Jordan
be able to use a 2.5 interactive interpeter). Good Luck Jordan Damian wrote: > Sorry about the multiple posts folks. I suspect it was the "FasterFox" > FireFox extension I installed yesterday tricking me. > > I had a brief look at libxml(?) on my Ubuntu machine but haven't r

Re: XSLT speed comparisons

2006-09-29 Thread Jordan
If your using python 2.4.3 or essentially any of the 2.3, 2.4 series, i'd test out PyScripter as an IDE, it's one of the best that I've used. Unfortunately, they have yet to fully accomedate 2.5 code (you can still write 2.5 code with almost no problems, but you won't be able to use a 2.5 interact

Re: Writing Video conference software for Windows

2006-09-19 Thread Jordan
If you're going to need win32 system access use the win32all python extension (very, very good extension). Do you need single frame image capture, or constant video stream? PIL can be used for the first, it might also be usable for video, I'm not sure. For sound, python comes with some built in li

Re: Running python from a usb drive

2006-09-11 Thread Jordan
If making a usb version of python was that easy, movable python would be open source. Check out http://www.voidspace.org.uk/python/movpy/ if you need a portable usb version of python for work or something. Copying the Python24 directory is a good start, but doesn't include the enormous number of r

Re: uploading files to file system/zipping/downloading problems

2006-08-20 Thread Jordan
Assuming your upload_file.file.read() function works, the overwriting should be the only issue. Just want to point out that total_data += data is not advisable for this example (speed/efficiency issue, although i'm sure it could probably be even faster than what I replace it with if u decided to u

wxPython Grid Question

2006-08-16 Thread Jordan
Hey Peoples, I'm wonderg if there is a way to make a subclass of wx.grid.Grid in which the coloumn labels for the grid appear on the bottom of the grid instead of the top. 1 2 3 4 5 a| | | | | | b| | | | | | c| | | | | | d| | | | | | e| | | | | |

Re: Question about using python as a scripting language

2006-08-07 Thread Jordan Greenberg
ect (or medium sized, or anything more then a few lines, really) this gets really unwieldy really quickly (imagine if you had thousands of functions! Madness!) Terry's suggestion is a much better solution then this. If this looks easier, consider changing the rest of your program before klud

RE: ImportError raised in script, not interactive session.

2006-07-31 Thread Jordan R McCoy
e standard directories. If this isn't the case, what are you using for TARGET_DIR? Jordan -Original Message- From: [EMAIL PROTECTED] on behalf of Adam Blinkinsop Sent: Mon 7/31/2006 5:42 PM To: python-list@python.org Subject: ImportError raised in script, not interactive session. I

  1   2   >