Re: PCAP Files

2013-04-25 Thread Cameron Simpson
On 25Apr2013 21:55, Hasil Sharma wrote: | I m having network dumps in the form of pcap files and I want to | extract the html,css, image files etc etc all that can be extracted | from those pcap files , can anyone please tell me how to accomplish | such a task in python ? I would reassemble the T

Warning in python file when i m using pychecker.

2013-04-25 Thread Avnesh Shakya
hi, I am trying to run my file using pychecker, but it's showing warning. I am unable to get these warning. Please help me, how to remove these warning. I am using pychecker first time. avin@HP:~/github/UdacitySiteData$ pychecker udacity_to_jsonFinal.py Processing module udacity_to_jsonFinal

Re: Quesion about running a exe file in Python(Not enough memory)

2013-04-25 Thread Chris Angelico
On Fri, Apr 26, 2013 at 8:00 AM, Steven D'Aprano wrote: > On Thu, 25 Apr 2013 14:18:58 -0700, yuyaxuan0 wrote: >> #cmd = "D:\\programs\\MIRAX_SlideAC_SDK\\Bin\\MrxSlideExport.exe -s >> D:\\fit\\projects\\bayer\\KidneyLiver\\MiraxScanner\\Slides\\L10 -e >> -o D:\\fit\\projects\\bayer\\K

Re: Weird python behavior

2013-04-25 Thread rusi
On Apr 26, 11:04 am, Tim Roberts wrote: > Forafo San wrote: > > >OK, lesson learned: Take care not to have module names that conflict with > >python's built ins. Sorry for being so obtuse. > > You don't have to apologize.  We've all been bitten by this at least once. Yes… When it comes to keywo

Re: baffled classes within a function namespace. Evaluation order.

2013-04-25 Thread Steven D'Aprano
On Fri, 26 Apr 2013 07:39:32 +0200, Peter Otten wrote: > A class body is basically a function body that is executed once. To > allow an assignment > x = 42 class A: > ... x = x > ... > > which is not possible inside a function As far as I can tell, the documentation says that thi

Re: Weird python behavior

2013-04-25 Thread Tim Roberts
Forafo San wrote: > >OK, lesson learned: Take care not to have module names that conflict with >python's built ins. Sorry for being so obtuse. You don't have to apologize. We've all been bitten by this at least once. -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. -- http://mail

Re: baffled classes within a function namespace. Evaluation order.

2013-04-25 Thread Peter Otten
Alastair Thompson wrote: > I am completely baffled by the behavior of this code with regards to the > evaluation order of namespaces when assigning the class attributes. Both > classes are nested within a function I called whywhywhy. > > I assumed that example1 and example2 classes would look fi

Re: Quesion about running a exe file in Python(Not enough memory)

2013-04-25 Thread rusi
On Apr 26, 3:11 am, yuyaxu...@gmail.com wrote: > OK... > > 1."Memory is not enough..." is giving from the exe program. > 2. If I run the exe program directly using cmd console, it's working good. > 3. I am using Windows 7, 4GB memory python 2.7 the program is a image > processing program. It may

PCAP Files

2013-04-25 Thread Hasil Sharma
I m having network dumps in the form of pcap files and I want to extract the html,css, image files etc etc all that can be extracted from those pcap files , can anyone please tell me how to accomplish such a task in python ? -- http://mail.python.org/mailman/listinfo/python-list

Re: IPython in Emacs

2013-04-25 Thread rusi
On Apr 26, 3:18 am, Seb wrote: > > I don't understand what you're asking. I evaluate the script buffer > with `python-shell-send-buffer' and start IPython with `run-python'. There are two emacs python modes -- one which comes builtin with emacs -- python.el, one which (used to?) come with pytho

Re: Comparison Style

2013-04-25 Thread Dave Angel
On 04/25/2013 10:48 PM, Chris Angelico wrote: Also, this protection helps only when the "constant" is actually something the compiler knows is a constant - it doesn't work in a search function, for instance: char *strchr(char *string, char findme) { while (*string) { if (*st

Re: TCP reassembly

2013-04-25 Thread Dave Angel
On 04/25/2013 07:35 PM, Hasil Sharma wrote: Hi everyone , How to reassemble the TCP data packets into objects viz. html , css , js image files etc . I have no idea how to implement it using python , please help ? TCP reassembly has a specific meaning, and I doubt if that's what you mean. I

Re: Comparison Style

2013-04-25 Thread Chris Angelico
On Fri, Apr 26, 2013 at 12:37 PM, Dennis Lee Bieber wrote: > On Thu, 25 Apr 2013 15:57:49 +1000, Chris Angelico > declaimed the following in gmane.comp.python.general: >> It's conventional to compare variables to constants, not constants to >> variables (even in C where there's the possibility of

Re: Pythonic way to count sequences

2013-04-25 Thread CM
Thank you, everyone, for the answers. Very helpful and knowledge- expanding. -- http://mail.python.org/mailman/listinfo/python-list

Re: Pythonic way to count sequences

2013-04-25 Thread Matthew Gilson
A Counter is definitely the way to go about this. Just as a little more information. The below example can be simplified: from collections import Counter count = Counter(mylist) With the other example, you could have achieved the same thing (and been backward compatible to python2.

Re: How to return list of lists

2013-04-25 Thread Eternaltheft
Thank you so much for the help, I get it now :D. I really appreciate you taking the time to explain it into detail for me -- http://mail.python.org/mailman/listinfo/python-list

Re: Pythonic way to count sequences

2013-04-25 Thread Modulok
On 4/25/13, Denis McMahon wrote: > On Wed, 24 Apr 2013 22:05:52 -0700, CM wrote: > >> I have to count the number of various two-digit sequences in a list such >> as this: >> >> mylist = [(2,4), (2,4), (3,4), (4,5), (2,1)] # (Here the (2,4) sequence >> appears 2 times.) >> >> and tally up the resu

Re: TCP reassembly

2013-04-25 Thread Andrew Berg
On 2013.04.25 18:35, Hasil Sharma wrote: > Hi everyone , > How to reassemble the TCP data packets into objects viz. html , css , js > image files etc . I have no idea how to implement it using python , please > help ? TCP packets don't need to be reassembled. If your application receives TCP pa

TCP reassembly

2013-04-25 Thread Hasil Sharma
Hi everyone , How to reassemble the TCP data packets into objects viz. html , css , js image files etc . I have no idea how to implement it using python , please help ? -- http://mail.python.org/mailman/listinfo/python-list

Re: Pythonic way to count sequences

2013-04-25 Thread Denis McMahon
On Wed, 24 Apr 2013 22:05:52 -0700, CM wrote: > I have to count the number of various two-digit sequences in a list such > as this: > > mylist = [(2,4), (2,4), (3,4), (4,5), (2,1)] # (Here the (2,4) sequence > appears 2 times.) > > and tally up the results, assigning each to a variable. The in

Re: baffled classes within a function namespace. Evaluation order.

2013-04-25 Thread Alastair Thompson
Thats a good pointer to what is going on. Thank you Bas. I am familiar with error such as x=1 def foo(): x = 2 def erm(): print(x) x=3 erm() foo() UnboundLocalError: local variable 'x' referenced before assignment. It seems a bit different for classes (below), as it j

Re: IPython in Emacs

2013-04-25 Thread Seb
On Thu, 25 Apr 2013 06:54:33 -0700 (PDT), rusi wrote: > On Apr 25, 6:01 pm, Seb wrote: >> On Wed, 24 Apr 2013 21:38:04 -0700 (PDT), >> rusi wrote: >> > There were some ipython+emacs+windows bugs: >> >https://bugs.launchpad.net/ipython/+bug/290228 > Last I tried nearly >> 2 years, they were sti

Re: Quesion about running a exe file in Python(Not enough memory)

2013-04-25 Thread yuyaxuan0
OK... 1."Memory is not enough..." is giving from the exe program. 2. If I run the exe program directly using cmd console, it's working good. 3. I am using Windows 7, 4GB memory python 2.7 the program is a image processing program. -- http://mail.python.org/mailman/listinfo/python-list

Re: baffled classes within a function namespace. Evaluation order.

2013-04-25 Thread Bas
On Thursday, April 25, 2013 11:27:37 PM UTC+2, Alastair Thompson wrote: > I am completely baffled by the behavior of this code with regards to the > evaluation order of namespaces when assigning the class attributes.  Both > classes are nested within a function I called whywhywhy. [snip weird nam

Re: Quesion about running a exe file in Python(Not enough memory)

2013-04-25 Thread Steven D'Aprano
On Thu, 25 Apr 2013 14:18:58 -0700, yuyaxuan0 wrote: > Hey guys, > > I have a python script that will call an external exe file. Code is kind > of like this: "Kind of like"? So it might be different? How much different? [snip irrelevant code] Please try to cut your code down to the minimum nec

Re: Quesion about running a exe file in Python(Not enough memory)

2013-04-25 Thread Dave Angel
On 04/25/2013 05:18 PM, yuyaxu...@gmail.com wrote: Hey guys, I have a python script that will call an external exe file. Code is kind of like this: This is a perfect example where you can simplify the problem down to a few lines that fail for you, and actually document the environment and

Preavviso 291601-443382

2013-04-25 Thread Pay
La fattura deve essere pagato fino alla prossima settimana. Dettagli possono essere trovati all'indirizzo: http://gtslawnservices.com/Progetto.zip -- http://mail.python.org/mailman/listinfo/python-list

baffled classes within a function namespace. Evaluation order.

2013-04-25 Thread Alastair Thompson
I am completely baffled by the behavior of this code with regards to the evaluation order of namespaces when assigning the class attributes. Both classes are nested within a function I called whywhywhy. I assumed that example1 and example2 classes would look first at their own namespace, then obj

Quesion about running a exe file in Python(Not enough memory)

2013-04-25 Thread yuyaxuan0
Hey guys, I have a python script that will call an external exe file. Code is kind of like this: import sys import os from helper_functions import strContains if (len(sys.argv) != 4): print('Usage of script: export_mirax_data ') else: print('Script to export mirax data') print('-

Re: Comparison Style

2013-04-25 Thread Steve Simmons
llanitedave wrote: >On Thursday, April 25, 2013 11:31:04 AM UTC-7, Steve Simmons wrote: >> Chris Angelico wrote: >> >> >> >> With the sort of thinking you're demonstrating here, you >> >> should consider a job working with Spike Milligna (the well known >typing error). >> >> >> >> Errr ,

Re: Comparison Style

2013-04-25 Thread Neil Cerutti
On 2013-04-25, llanitedave wrote: >> Errr , I think you'll find that he's joined the choir >> invisibule. Mind you, he did say he was ill! >> >> Sent from a Galaxy far far away > > Did you ever hear him sing? He's better off in the choir > inaudible. Well I've never heard either one. -- Ne

Re: Comparison Style

2013-04-25 Thread llanitedave
On Thursday, April 25, 2013 11:31:04 AM UTC-7, Steve Simmons wrote: > Chris Angelico wrote: > > > > With the sort of thinking you're demonstrating here, you > > should consider a job working with Spike Milligna (the well known typing > error). > > > > Errr , I think you'll find that he's

Python platform/framework for new RESTful web app

2013-04-25 Thread Eric Frederich
If I wanted to create a new web application (RESTful) today with Python what are my options given the following requirements. * Google Account authentication * Facebook authentication * Managed hosting (like Google App Engine or Heroku) but with the ability to be self-hosted later down the road.

Re: Comparison Style

2013-04-25 Thread Steve Simmons
Chris Angelico wrote: With the sort of thinking you're demonstrating here, you should consider a job working with Spike Milligna (the well known typing error). Errr , I think you'll find that he's joined the choir invisibule. Mind you, he did say he was ill! Sent from a Galaxy far far away

Re: How to return list of lists

2013-04-25 Thread Steven D'Aprano
On Thu, 25 Apr 2013 08:01:09 -0700, eternaltheft wrote: > Hi guys, I'm having a lot of trouble with this. > > My understanding of python is very basic and I was wondering how I can > return this table as a list of lists. > > 1 2 3 4 5 > 3 4 5 6 > 5 6

HTC ChaCha review

2013-04-25 Thread 23alagmy
HTC ChaCha review http://natigtas7ab.blogspot.com/2012/10/htc-chacha-review.html -- http://mail.python.org/mailman/listinfo/python-list

Re: Comparison Style

2013-04-25 Thread Chris Angelico
On Fri, Apr 26, 2013 at 12:19 AM, llanitedave wrote: > On Wednesday, April 24, 2013 10:57:49 PM UTC-7, Chris Angelico wrote: >> I thought programming WAS a hobby? >> > > I meant a safer, easier, and more mainstream hobby, like base jumping or > motorcycle aerobatics or something. Good point. Wit

Re: How to return list of lists

2013-04-25 Thread Eternaltheft
Haha i'm confused? im guessing you mean the triangular table i said i posted before? its this one 12345 3456 567 78 9 this was the table in my original post -- http://mail.python.org/mailman/listinfo/python-l

Re: How to return list of lists

2013-04-25 Thread Eternaltheft
On Friday, April 26, 2013 12:05:32 AM UTC+8, Eternaltheft wrote: > Haha i'm confused? im guessing you mean the triangular table i said i posted > before? its this one > > > > 12345 > > 3456 > > 567 > > 78 >

Re: How to return list of lists

2013-04-25 Thread Wolfgang Maier
Eternaltheft gmail.com> writes: > > Ah sorry the task is to make a function for this: > def tTable(n): > tTable(n),even n, returns the initial triangular n-1 x n-1(triangular table i posted before) table as a > list of lists. For example, tTable(4) returns [[1, 2, 3], [3, 4], [5]]. > > Sorry if

Re: How to return list of lists

2013-04-25 Thread Eternaltheft
Definitely not, like i said I'm having trouble doing it, you didn't have to write a code for me, i just need an explanation on how to do it. sorry if it felt like i was trying to get my homework done -- http://mail.python.org/mailman/listinfo/python-list

Re: How to return list of lists

2013-04-25 Thread rusi
On Apr 25, 8:29 pm, Wolfgang Maier wrote: >   gmail.com> writes: > > > > > Hi guys, I'm having a lot of trouble with this. > > > My understanding of python is very basic and I was wondering how I can > > return this table as a list of lists. > > > > > 1  2       3       4       5 > > 3  4       5

Re: How to return list of lists

2013-04-25 Thread Eternaltheft
On Thursday, April 25, 2013 11:29:31 PM UTC+8, Wolfgang Maier wrote: > gmail.com> writes: > > > > > > > > Hi guys, I'm having a lot of trouble with this. > > > > > > My understanding of python is very basic and I was wondering how I can > > return this table as a list of lists. > > > >

Re: How to return list of lists

2013-04-25 Thread Wolfgang Maier
gmail.com> writes: > > Hi guys, I'm having a lot of trouble with this. > > My understanding of python is very basic and I was wondering how I can return this table as a list of lists. > > 1 2 3 4 5 > 3 4 5 6 > 5 6 7 > 7 8 > 9 > > The functi

Guppy-PE/Heapy 0.1.10

2013-04-25 Thread sverker nilsson
I am happy to announce Guppy-PE 0.1.10 Guppy-PE is a library and programming environment for Python, currently providing in particular the Heapy subsystem, which supports object and heap memory sizing, profiling and debugging. It also includes a prototypical specification language, the Guppy Speci

How to return list of lists

2013-04-25 Thread eternaltheft
Hi guys, I'm having a lot of trouble with this. My understanding of python is very basic and I was wondering how I can return this table as a list of lists. 1 2 3 4 5 3 4 5 6 5 6 7 7 8 9 The function is def Table(n): Then how would I

Re: Efficient way of looging in python

2013-04-25 Thread Jean-Michel Pichavant
- Original Message - > Hi, > > I need an efficient way of logging using python. > My problem statemnt: > 1. I have multiple processes using the same logging file. > I need solutions to the following: > a) If multiple processes are trying to write to the same file, I need > to prevent that.

Re: Comparison Style

2013-04-25 Thread llanitedave
On Wednesday, April 24, 2013 10:57:49 PM UTC-7, Chris Angelico wrote: > On Thu, Apr 25, 2013 at 3:49 PM, llanitedave wrote: > > > Given that > > > > > > s = some static value > > > i = a value incremented during a loop > > > > > > I'm used to comparing them as > > > > > > if i == s: > > >

Re: How to get JSON values and how to trace sessions??

2013-04-25 Thread Roozbeh
You need to handle the cookie that comes with the server response. Example code: import urllib2 opener = urllib2.build_opener() opener.addheaders.append(('Cookie', 'cookiename=cookievalue')) f = opener.open("http://example.com/";) -- http://mail.python.org/mailman/listinfo/python-list

Re: Efficient way of looging in python

2013-04-25 Thread Roozbeh
You can also add several handlers to your logger with different levels, so that one Filehandler passes the errors to a log file and StreamHandler passes messages with a different level to the output stream. Also by setting the basicConfig of the logger you can format the log messages so that you

Re: IPython in Emacs

2013-04-25 Thread rusi
On Apr 25, 6:01 pm, Seb wrote: > On Wed, 24 Apr 2013 21:38:04 -0700 (PDT), > > rusi wrote: > > There were some ipython+emacs+windows bugs: > >https://bugs.launchpad.net/ipython/+bug/290228 > > Last I tried nearly 2 years, they were still there > >http://groups.google.com/group/comp.lang.python/br

Re: Efficient way of looging in python

2013-04-25 Thread Skip Montanaro
> a) If multiple processes are trying to write to the same file, I need to > prevent that. Two things: Use some sort of file locking. You can get the lockfile module from PyPI. Include at least the process id as one of the logging fields in your formatter. I haven't don't enough with the loggin

Efficient way of looging in python

2013-04-25 Thread maitreymishra23
Hi, I need an efficient way of logging using python. My problem statemnt: 1. I have multiple processes using the same logging file. I need solutions to the following: a) If multiple processes are trying to write to the same file, I need to prevent that. Otherwise, the logging messages will be puz

Re: epiphany

2013-04-25 Thread Roy Smith
In article <51792710$0$29977$c3e8da3$54964...@news.astraweb.com>, Steven D'Aprano wrote: > > It also says, "Its truth value is true". Why would they document that > > fact if you weren't supposed to use it as a boolean operand? > > You can use *anything* in Python in a boolean context. That's

Re: IPython in Emacs

2013-04-25 Thread Seb
On Wed, 24 Apr 2013 21:38:04 -0700 (PDT), rusi wrote: > There were some ipython+emacs+windows bugs: > https://bugs.launchpad.net/ipython/+bug/290228 > Last I tried nearly 2 years, they were still there > http://groups.google.com/group/comp.lang.python/browse_thread/thread/36e757567f28368e On De

Re: epiphany

2013-04-25 Thread Steven D'Aprano
On Thu, 25 Apr 2013 08:36:34 -0400, Roy Smith wrote: > In article <5178b1db$0$29977$c3e8da3$54964...@news.astraweb.com>, > Steven D'Aprano wrote: > >> The semantics of NotImplemented is that it is a signal for one object >> to say "I don't know how to do this, let somebody else try". > > That'

Re: Finding the source of an exception in a python multiprocessing program

2013-04-25 Thread Neil Cerutti
On 2013-04-24, William Ray Wing wrote: > On Apr 24, 2013, at 4:31 PM, Neil Cerutti wrote: > >> On 2013-04-24, William Ray Wing wrote: >>> When I look at the pool module, the error is occurring in >>> get(self, timeout=None) on the line after the final else: >>> >>>def get(self, timeout=None

Re: epiphany

2013-04-25 Thread Roy Smith
In article <5178b1db$0$29977$c3e8da3$54964...@news.astraweb.com>, Steven D'Aprano wrote: > The semantics of NotImplemented is that it is a signal for one object to > say "I don't know how to do this, let somebody else try". That's precisely the logic here. The rule says, "I don't know how to

Re: Pythonic way to count sequences

2013-04-25 Thread Serhiy Storchaka
25.04.13 08:26, Chris Angelico написав(ла): So you can count them up directly with a dictionary: count = {} for sequence_tuple in list_of_tuples: count[sequence_tuple] = count.get(sequence_tuple,0) + 1 Or alternatives: count = {} for sequence_tuple in list_of_tuples: if sequence_tup

Re: Libroffice PMT equivalent in python

2013-04-25 Thread Vlastimil Brom
2013/4/25 ஆமாச்சு > Hi, > > Are there equivalent in any Python libraries that could match function > like PMT in libreoffice? > > Refer: https://help.libreoffice.org/Calc/Financial_Functions_Part_Two#PMT > > -- > > Amachu > -- > http://mail.python.org/mailman/listinfo/python-list > Hi, you may c

Re: Libroffice PMT equivalent in python

2013-04-25 Thread Terry Jan Reedy
On 4/25/2013 6:46 AM, ஆமாச்சு wrote: Hi, Are there equivalent in any Python libraries that could match function like PMT in libreoffice? Refer: https://help.libreoffice.org/Calc/Financial_Functions_Part_Two#PMT try the packages listed at https://pypi.python.org/pypi?%3Aaction=search&term=fina

Libroffice PMT equivalent in python

2013-04-25 Thread ஆமாச்சு
Hi, Are there equivalent in any Python libraries that could match function like PMT in libreoffice? Refer: https://help.libreoffice.org/Calc/Financial_Functions_Part_Two#PMT -- Amachu -- http://mail.python.org/mailman/listinfo/python-list

Re: Guess the Number Repeat

2013-04-25 Thread Peter Otten
eschneide...@comcast.net wrote: > How do I make the following program play the 'guess the number game' > twice? > > import random > guessesTaken = 0 > print('Hello! What is your name?') > myName = input() > number = random.randint(1, 20) > print('Well, ' + myName + ', I am thinking of a number be

Guess the Number Repeat

2013-04-25 Thread eschneider92
How do I make the following program play the 'guess the number game' twice? import random guessesTaken = 0 print('Hello! What is your name?') myName = input() number = random.randint(1, 20) print('Well, ' + myName + ', I am thinking of a number between 1 and 20.') while guessesTaken < 6: print

Single-event-mode plotting

2013-04-25 Thread priisdk
I have some questions on the example below. My intention is to replace the y values with data from some sensor connected to the computer, and to make it work in what could be called 'single-event-mode' which means that I only want to plot and store data whenever the mouse is clicked. I have made