RE: Cracking hashes with Python

2013-11-25 Thread Marc
Hashes, by definition, are not reversible mathematically. The only way to figure out what they represent is to take plaintext that might be the plaintext based on anything you might know about the original plaintext (which is often nothing) and hash it; then see if the hash matches the one you hav

Parsing multiple lines from text file using regex

2013-10-27 Thread Marc
since it is already done, if possible. Any help in pointing me in the right direction would be most appreciated. Thank you, Marc -- https://mail.python.org/mailman/listinfo/python-list

RE: Parsing multiple lines from text file using regex

2013-10-27 Thread Marc
>What was wrong with the answer Peter Otten gave you earlier today on the >tutor mailing list? > >-- >Python is the second best programming language in the world. >But the best has yet to be invented. Christian Tismer > >Mark Lawrence > I did not receive any answers from the Tutor list, so I tho

RE: Parsing multiple lines from text file using regex

2013-10-28 Thread Marc
>Hi Marc, did you actually subscribe to the tutor list or did you just >send an email there? Peter replied to you and you can see the reply >here: >https://mail.python.org/pipermail/tutor/2013-October/098156.html > >He only sent the reply back to the tutor list and didn't em

RE: Parsing multiple lines from text file using regex

2013-10-28 Thread Marc
>Hi Marc, did you actually subscribe to the tutor list or did you just >send an email there? Peter replied to you and you can see the reply >here: >https://mail.python.org/pipermail/tutor/2013-October/098156.html > >He only sent the reply back to the tutor list and didn'

RE: Parsing multiple lines from text file using regex

2013-11-03 Thread Marc
ed: outfile.write("Banner type: %s Banner Delimiter: %s\n" % (banner[0][0], banner[0][1])) outfile.write("Banner Text:\n") outfile.write(banner[0][2]) Probably not the prettiest, most concise code, but it gets the job done. Thanks again, Marc -- https://mail.python.org/mailman/listinfo/python-list

Diferent files: GUI (wxpython) Program

2007-10-11 Thread marc
Hi why I can call an .py GUI (wxpython) from a program and control it? I'm newbie in python. -- http://mail.python.org/mailman/listinfo/python-list

Re: Diferent files: GUI (wxpython) Program

2007-10-11 Thread marc
[EMAIL PROTECTED] escribió: > On Oct 11, 5:44 pm, marc <[EMAIL PROTECTED]> wrote: >> Hi why I can call an .py GUI (wxpython) from a program and control it? >> I'm newbie in python. > > Sorry, could you restate that? Explain again what you want to do. >

Re: Diferent files: GUI (wxpython) Program

2007-10-11 Thread marc
[EMAIL PROTECTED] escribió: > On Oct 11, 5:44 pm, marc <[EMAIL PROTECTED]> wrote: >> Hi why I can call an .py GUI (wxpython) from a program and control it? >> I'm newbie in python. > > Sorry, could you restate that? Explain again what you want to do. >

Re: f---ing typechecking

2007-02-15 Thread Marc
, (1,)] That's the trouble with obvious -- my obvious may not be so obvious to you (and vice versa). That's why the Zen of Python says "In the face of ambiguity, refuse the temptation to guess." (Although it also says "Flat is better than nested", but I'll ig

Directorio europeo de arte y diseño

2007-11-13 Thread marc
MARC3ART - GUÍA EUROPEA DE ARTE Y DISEÑO ofrece de manera ordenada, detallada y actualizada información sobre eventos artísticos-culturales y de diseño de interés para personas relacionadas con el medio. Ofrece de manera permanente calendario de exposiciones, concursos de arte, convocatorias y

Re: pylab without X11

2008-09-30 Thread marc
or SVG or pdf, there might be other possibilities, I do not know To save the file : savefig Marc Willem-Jan Vriend a écrit : I want to use pylab (matplotlib) on a machine without X11. I'm trying to generate onthefly graphics for an apache2 web service, so they do not have to be disp

Re: pylab without X11

2008-09-30 Thread marc
This may help ... or not ( 2nd part ) try not to do pylab.figure() in your script: pylab.plot, or pylab.imshow or whatever you want to use then savefig("myFigure.png")for example do not use show() in my case ( with the WXAgg backend ), it works, it generates the png file Marc

Re: CrazyHTTPd - HTTP Daemon in Python

2013-05-26 Thread Marc Christiansen
ting a project right now that is limited to Python 2 is about as > much use as a chocolate teapot. I.e. not very useful, but slightly more so than you would expect: http://www.thenakedscientists.com/HTML/content/kitchenscience/exp/how-useless-is-a-chocolate-teapot/ Adiaŭ Marc -- http://mail.python.org/mailman/listinfo/python-list

Re: Cutting a deck of cards

2013-05-26 Thread Marc Christiansen
Thanks, RVic, >> python newbie >> >> -- >> http://mail.python.org/mailman/listinfo/python-list > > > list(range(13 * 4 * decks)) == range(13 * 4 * decks) > > ;) Not in Python3.x >>> decks = 6 >>> list(range(13 * 4 * decks)) == range(13 * 4 * decks) False Adiaŭ Marc -- http://mail.python.org/mailman/listinfo/python-list

Re: Cutting a deck of cards

2013-05-26 Thread Marc Christiansen
What does "list(range(13 * 4 * decks))" returns in Python 3? > A list of course. But Py3 range is very similar to Py2 xrange, it returns a range object. Adiaŭ Marc -- http://mail.python.org/mailman/listinfo/python-list

method that can be called from a class and also from an instance

2012-11-22 Thread Marc Aymerich
Hi, I want to create a method within a class that is able to accept either a class or an instance. class MyClass(object): @magic_decorator def method(param): # param can be MyClass (cls) or an instance of MyClass (self) so I can do something like: instance = MyClass() MyClass.

Re: method that can be called from a class and also from an instance

2012-11-22 Thread Marc Aymerich
On Thursday, November 22, 2012 4:51:30 PM UTC+1, Peter Otten wrote: > Marc Aymerich wrote: > > > > > Hi, > > > > > > I want to create a method within a class that is able to accept either a > > > class or an instance. > > > >

Re: method that can be called from a class and also from an instance

2012-11-22 Thread Marc Aymerich
On Thursday, November 22, 2012 5:26:59 PM UTC+1, Dave Angel wrote: > On 11/22/2012 11:12 AM, Thomas Bach wrote: > > > On Thu, Nov 22, 2012 at 10:52:56AM -0500, Dave Angel wrote: > > >> On 11/22/2012 10:14 AM, Marc Aymerich wrote: > > >>> I want to create

Re: strptime - dates formatted differently on different computers

2012-12-11 Thread Marc Christiansen
# ambiguous, I know datetime.datetime(2013, 1, 2, 0, 0) # should be datetime.datetime(2013, 2, 1, 0, 0) so it doesn't like long german dates and it misparses the numerical form. And I even was so nice to set the locale :) (not that it succeeds without…) I admit I didn't read any documentatio

Is it possible monkey patch like this?

2012-12-18 Thread Marc Aymerich
Dear all, I want to monkey patch a method that has lots of code so I want to avoid copying all the original method for changing just two lines. The thing is that I don't know how to do this kind of monkey patching. Consider the following code: class OringinalClass(object): def origina_metho

Loading a PKCS#1 public key using M2Crypto

2013-01-16 Thread Marc Aymerich
e lots code using M2Crypto. So my question is, is there any way to load this key using M2Crypto? Can I convert somehow the key to X.501? I'll be very, very grateful if someone can come up with an interesting idea! thanks a lot!! Marc -- http://mail.python.org/mailman/listinfo/python-list

Re: Loading a PKCS#1 public key using M2Crypto

2013-01-17 Thread Marc Aymerich
On Thursday, January 17, 2013 1:32:25 AM UTC+1, Piet van Oostrum wrote: > Marc Aymerich writes: > > > > > Hi, > > > I've been trying very, very hard to load an RSA key using M2Crypto but > > without any success. > > > > > > basicall

Re: Loading a PKCS#1 public key using M2Crypto

2013-01-17 Thread Marc Aymerich
approach is also possible with M2Crypto because it has a method for constructing RSA keys [2]. [1] http://stackoverflow.com/a/10574723 [2] http://www.heikkitoivonen.net/m2crypto/api/M2Crypto.RSA-module.html#new_pub_key Thanks again! Marc PS: Sorry for my email format, I'm using google groups and it seems to ignore any mailing best practice. -- http://mail.python.org/mailman/listinfo/python-list

Re: Loading a PKCS#1 public key using M2Crypto

2013-01-18 Thread Marc Aymerich
On Fri, Jan 18, 2013 at 12:10 AM, Piet van Oostrum wrote: > Marc Aymerich writes: > >> Thank you very much Piet, >> I'm just starting to grasp these cryptography related concepts and your code >> is helping me a lot to understand how to handle these keys in a low

unexpected behaviour playing with dynamic methods

2012-02-23 Thread Marc Aymerich
this is what actually returns: >>> a_instance.name 'c' just the last 'name' value. What can I do in order to generate a method like this but that returns 'b' ? What is wrong in my understanding of this pice of code? Thanks !!! marc -- http://mail.python.org/mailman/listinfo/python-list

Re: unexpected behaviour playing with dynamic methods

2012-02-23 Thread Marc Aymerich
On Feb 23, 2:05 pm, Peter Otten <__pete...@web.de> wrote: > Marc Aymerich wrote: > > Hi, > > > I'm playing a bit with python dynamic methods and I came up with a > > scenario that I don't understant. Considering the follow code: > > > # Declar

Re: numpy.genfromtxt with Python3 - howto

2012-04-06 Thread Marc Christiansen
latin1') > > data = np.genfromtxt(inpstream) Hi Helmut, numpy.genfromtxt wants bytes, not str. Use inpstream = io.open(sys.stdin.fileno(), "rb") or simply inpstream = sys.stdin.buffer Ciao Marc -- http://mail.python.org/mailman/listinfo/python-list

Default value for optional parameters unexpected behaviour?

2011-06-26 Thread Marc Aymerich
Hi, I'm trying to define a function that has an optional parameter which should be an empty list whenever it isn't given. However, it takes as value the same value as the last time the function was executed. What is the reason of this behaviour? How does python deal with default values (i.e. when a

Re: pairwise combination of two lists

2011-08-17 Thread Marc Christiansen
n present you a memory efficient, reusable solution, the generator: def combiner(li1, li2): for a, b in itertools.product(li1, li2): yield a + b ;) HTH, Marc -- http://mail.python.org/mailman/listinfo/python-list

Python encoding question

2011-02-25 Thread Marc Muehlfeld
are both prints show the wrong encoding, when I switch "fetchone()" to "fetchall()": ('M\xc3\xbcnchen',) [('M\xc3\xbcnchen',)] I'm running Python 2.4.3 on CentOS 5. Regards, Marc -- http://mail.python.org/mailman/listinfo/python-list

best practice to resolve module dependency within a reusable application

2011-03-22 Thread Marc Aymerich
Hi, I'm developing a reusable app splited into modules. The end user chooses what modules wants to keep installed. Most of this modules are quite independent from each other, but I have one of them (called moduleP) with a pretty strong dependency with another another(called moduleBase). So I need t

subclassing an extension (non built-in) class / type in python 3.2

2011-04-28 Thread Marc Gronle
access the class by the module's dictionary. Does anybody have an example or just a hint, how to successfully realize this type of inheritance? I will be grateful for every response. Cheers Marc -- GMX DSL Doppel-Flat ab 19,99 Euro/mtl.! Jetzt mit gratis Handy-Flat! http://portal.gmx.net/

Fwd: subclassing an extension (non built-in) class / type in python 3.2

2011-04-28 Thread Marc Gronle
access the class by the module's dictionary. Does anybody have an example or just a hint, how to successfully realize this type of inheritance? I will be grateful for every response. Cheers Marc -- NEU: FreePhone - kostenlos mobil telefonieren und surfen!

Gambit REPL app for iPhone/iPod touch/iPad

2011-05-19 Thread Marc Feeley
Android device. If someone wants to try porting Gambit REPL to Android let me know and I can help. The sources of Gambit REPL for iOS are in the examples/iOS subdirectory of the Gambit source distribution. Marc -- http://mail.python.org/mailman/listinfo/python-list

Re: GIL in alternative implementations

2011-05-28 Thread Marc Christiansen
python2.4 525369 736202 python2.5 449496 551023 python2.6 903405 937335 python2.7 885834 910144 python3.1 866557 766842 python3.2 100 100 So even CPython (at least < 3.2) isn't safe. And I wouldn't rely on 3.2 not to break. Marc -- http://mail.python.org/mailman/listinfo/python-list

Sharing credentials between multiple interactive processes

2017-12-15 Thread Marc Aymerich
uting the exact same code (peers)? any thoughts? -- Marc -- https://mail.python.org/mailman/listinfo/python-list

could use some help with this problem! I've been working on it for days but cant seem to get it right !

2018-02-19 Thread Marc Cohen
USING PYTHON 2: Write a program to play this game. This may seem tricky, so break it down into parts. Like many programs, we have to use nested loops (one loop inside another). In the outermost loop, we want to keep playing until we are out of stones. Inside that, we want to keep alternating p

Re: Subtracting dates to get hours and minutes

2022-12-12 Thread Marc Lucke
hould be /very/ easy to do. - Marc On 12/12/2022 5:01 pm, Steve GS wrote: How do I subtract two time/dates and calculate the hours and minutes between? Steve -- https://mail.python.org/mailman/listinfo/python-list

combinations of all rows and cols from a dataframe

2023-03-29 Thread marc nicole
Hello everyone, Given a dataframe like this: 2 6 8 5 I want to yield the following list of lists: [ [[2],[6,5]], [[2],[6]], [[2],[5]], [[8],[6,5]], [[8],[6]], [[8],[5]], [[6],[2,8]], [[6],[8]], [[6],[2]], [[5],[2,8]], [[5],[2]], [[5],[8]], [[6,5],[2,8]] ] I have written the following (which d

Re: Choosing a Python IDE. what is your Pythonish recommendation? I do not know what to choose.

2017-01-02 Thread Marc Brooks
I'd recommend you be willing to put in the time and effort to learn the tools you want to use, if you want to do professional software development. Pick one, use it for a month (at least 100+ hours of hands on keyboard coding). Sublime, Vi are great for Python, since Python doesn't require as muc

Re: How to create development Python environment on Linux.

2016-06-02 Thread Marc Brooks
I am pretty sure (but not 100%) that the pip that virtualenv installs when it first creates the virtualenv is the version of pip installed on the system. Here's the process I used to bootstrap a new Python 2.7 dev environment. 1. Download and install the latest version of pip as sudo so it's syst

Re: Python on Windows with linux environment

2016-06-02 Thread Marc Brooks
that it was sometimes a bit more annoying to get libraries installed, since it couldn't use any pre-compiled binaries for Windows. I don't know if that's still the case, since this was a few years back and I'm doing my dev work on a mac nowadays. Marc On Thu, Jun 2, 2016 at 7

Re: i'm a python newbie & wrote my first script, can someone critique it?

2016-06-10 Thread Marc Brooks
The structure of your program is really not that Pythonic. I'd recommend you take a look at PEP 8. https://www.python.org/dev/peps/pep-0008/ It's not perfect, but it's a good start to get a feel for how to structure your Python work. Marc On Fri, Jun 10, 2016 at 7:05 PM, Chr

Re: i'm a python newbie & wrote my first script, can someone critique it?

2016-06-11 Thread Marc Brooks
Look into docstrings. They will make your code much more readable to a Python reader. On Sat, Jun 11, 2016 at 2:16 PM mad scientist jr wrote: > For those who don't want to have to wade through comments, here is a > version without so many comments: > > # For Python 3.x > # This script creates mul

Re: Indentation example?

2016-06-12 Thread Marc Dietz
tation would be considered to be only 8 spaces wide. I hope this helped a little. :) Cheers Marc. -- https://mail.python.org/mailman/listinfo/python-list

clusters of numbers

2018-12-15 Thread Marc Lucke
hey guys, I have a hobby project that sorts my email automatically for me & I want to improve it.  There's data science and statistical info that I'm missing, & I always enjoy reading about the pythonic way to do things too. I have a list of percentage scores: (1,11,1,7,5,7,2,2,2,10,10,1,2,2

Processing an image with numarray.nd image

2005-10-04 Thread Raphaël MARC
Hello, Can anyone tell me how to open an image and transform it into a list so that the functions of the multi dimensionnal module of numarray (numarray.nd image) can process it ? Do I have to use PIL ? So I would code something like : import Image im = Image.open("Python.jpg") data = list(im.ge

subprocess and non-blocking IO (again)

2005-10-10 Thread Marc Carter
process" really should have corresponding methods. If it makes anything simpler, I only *need* this on Linux/Unix (Windows would be a nice extra though). thanks for reading, Marc -- http://mail.python.org/mailman/listinfo/python-list

Re: subprocess and non-blocking IO (again)

2005-10-11 Thread Marc Carter
Donn Cave wrote: > If you want to use select(), don't use the fileobject > functions. Use os.read() to read data from the pipe's file > descriptor (p.stdout.fileno().) This is how you avoid the > buffering. Thankyou, this works perfectly. I figured it would be something

Re: Python vs Ruby

2005-10-19 Thread jean-marc
I'd believe that would be Lua, but then again what is common to one might not be to another ;-) -- http://mail.python.org/mailman/listinfo/python-list

Re: Python vs Ruby

2005-10-19 Thread jean-marc
As you see, pythonistas are a nice humourous bunch... But to help a bit more in your balancing act you might take a look at: http://blog.ianbicking.org/ruby-python-power.html It's rather nice, and commented. -- http://mail.python.org/mailman/listinfo/python-list

Re: textwidget.tag_bind("name", "", self.donothing) not working

2005-10-26 Thread jean-marc
but you don't want to use the state=DISABLED option because it gray's out the field showing people that it is not available for editing, right? -- http://mail.python.org/mailman/listinfo/python-list

Re: textwidget.tag_bind("name", "", self.donothing) not working

2005-10-26 Thread jean-marc
Sorry, kinda wrote over your intentions... -- http://mail.python.org/mailman/listinfo/python-list

Re: textwidget.tag_bind("name", "", self.donothing) not working

2005-10-26 Thread jean-marc
To make amends, I tried my own search and came up with this (that you might already have...): http://groups.google.com/group/comp.lang.python/browse_thread/thread/1384f49c35ffba9b/5928092247429e9a%235928092247429e9a?sa=X&oi=groupsr&start=1&num=3 Maybe you'll understand it better than me :-) --

MPI and python+threads on IRIX

2005-01-21 Thread Marc Poinot
ice ? Idea ? Patch ? Coconut ? -MP- --- Marc POINOT Alias: marcvsEmail: [EMAIL PROTECTED] ONERA -MFE/DSNA/ELSATel: 01.46.73.42.84 Info: [EMAIL PROTECTED] 29, Div. LeclercFax: 01.46.73.4

Re: Where can I find sample "beginner" programs to study?

2005-01-28 Thread Marc Poulin
Todd_Calhoun wrote: > I'm trying to learn Python (and programming), and I'm wondering if there > are any places where I can find small, simple programs to study. > > Thanks. Look at http://www.livewires.org.uk/python/ Good projects and tutorials for beginners. -- http://mail.python.org/mailma

Using HTTPSConnection and verifying server's CRT

2005-01-31 Thread Marc Poulhiès
ething that could help me? Thanks, Marc -- http://mail.python.org/mailman/listinfo/python-list

Re: Using HTTPSConnection and verifying server's CRT

2005-01-31 Thread Marc Poulhiès
[EMAIL PROTECTED] (Ng Pheng Siong) writes: Hi, > According to Marc Poulhiès <[EMAIL PROTECTED]>: >> I tried to see if the M2Crypto has this possibility, but from my tests >> and from what I can find on the website, it seems not :/ > > How did you test and where on

Re: Using HTTPSConnection and verifying server's CRT

2005-02-01 Thread Marc Poulhiès
Marc Poulhiès <[EMAIL PROTECTED]> writes: > [EMAIL PROTECTED] (Ng Pheng Siong) writes: >> M2Crypto does server cert verification. With M2Crypto's httpslib, you pass >> in an SSL.Context instance to the HTTPSConnection constructor to configure >> the SSL;

Re: test_socket.py failure

2005-02-02 Thread Marc Christiansen
er in >the day. > >I wonder if the developers wanted to tie the python source >code so closely to a glibc version and possibly gnu-libc >specific? Perhaps SuSE did patch the glibc... Saluton Marc -- http://mail.python.org/mailman/listinfo/python-list

Re: Finding user's home dir

2005-02-03 Thread Marc Christiansen
what your code does. Except it also execfile()s $HOME/.pythonrc.py, which might not be wanted. Saluton Marc -- http://mail.python.org/mailman/listinfo/python-list

List mapping question

2005-02-03 Thread Marc Huffnagle
ating a list with the values of a, b and c instead of the actual variables themselves, then trying to set a string equal to an integer, which it really didn't like. Marc -- http://mail.python.org/mailman/listinfo/python-list

Re: List mapping question

2005-02-03 Thread Marc Huffnagle
Steve Holden wrote: Marc Huffnagle wrote: I have a number of variables that I want to modify (a bunch of strings that I need to convert into ints). Is there an easy way to do that other than saying: > a = int(a) > b = int(b) > c = int(c) I tried > [i = int(i) for i in [a, b,

Re: how to use more than 1 __init__ constructor in a class ?

2005-06-23 Thread jean-marc
Singletoned wrote: > Rocco Moretti wrote: > > Steven D'Aprano wrote: > > > > That's the joys of a mostly self-taught programming knowledge: you miss > > > out on all the buzzwords. > > > > Being mostly self taught myself, I have a tendancy to use infrequently > > encountered terms in related but

Thanks for PIL (and other stuff)

2005-06-23 Thread jean-marc
I was just reading on daily-python that PIL is 10 years old... So I wish it and its author(s) a good day, week, month, year and more! Really! Jean-Marc PS If I knew that Python had a anniversary date, I'd also write to thanks our BDFL (and authors)! But no such luck, so I'm restain

Re: SOAP and XMLRPC

2005-08-15 Thread jean-marc
why isn't this good? http://www.enappsys.com/backend.jsp Seems to be what you're looking for... (second entry of a googled 'xml-rpc visual basic' search!) JM PS Tell us why the refered *.dll don't do, so I won't refer to it again if it's of no value. -- http://mail.python.org/mailman/listinfo/p

Re: seeking Python developers

2005-08-15 Thread jean-marc
What level? and is geography important? JM -- http://mail.python.org/mailman/listinfo/python-list

Re: python classes taught

2005-08-20 Thread jean-marc
Cegep du Vieux Montreal (technical college level), uses Python for CGI in web developement class. ...At least when I give this course ;-) Jean-Marc -- http://mail.python.org/mailman/listinfo/python-list

RE: RE Despair - help required

2005-08-25 Thread Marc Boeren
Hi, > Don't think it will do much good. I need to get them from a file and > extract the last folder in the path. For example: > if I get "c:\dos\util" > I want to extract the string "\util" Still, os.path is your friend: import os filepath = r'C:\dos\util' base, last = os.path.split(file

RE: What is the role of F in dict(E, **F)

2005-09-05 Thread Marc Boeren
;: 4} > >>> > > But what is the role of **F? >>> D={'a':1, 'b':2} >>> E={'b':4,'c':6} >>> D.update(E, a=3) >>> D {'a': 3, 'c': 6, 'b': 4} Ciao, Marc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Basic file operation questions

2005-02-08 Thread Marc Huffnagle
() comes close, but is only viable for "small" files. Marc -- http://mail.python.org/mailman/listinfo/python-list

Re: Is Python as capable as Perl for sysadmin work?

2005-02-08 Thread Marc Huffnagle
ive value, but you'd mistaken! Now, this may not bother Unix sysadmins, but the honest truth is that you'll be administrating Windows systems, too, anywhere you work! >>> a = "\\" >>> print a \ Marc -- http://mail.python.org/mailman/listinfo/python-list

Re: Module RE, Have a couple questions

2005-03-01 Thread Marc Huffnagle
Dasacc There is a better (faster/easier) way to do it than using the re module, the find method of the string class. [EMAIL PROTECTED] wrote: (1) How do I perform a search for "word" and have it return every line that this instance is found? [line for line in document if line.find('a') != -1] (2)

Re: Module RE, Have a couple questions

2005-03-01 Thread Marc Huffnagle
Oops, made a mistake. Marc Huffnagle wrote: Dasacc There is a better (faster/easier) way to do it than using the re module, the find method of the string class. [EMAIL PROTECTED] wrote: (1) How do I perform a search for "word" and have it return every line that this instance is found?

Re: Module RE, Have a couple questions

2005-03-01 Thread Marc Huffnagle
Francis Girard wrote: Le mardi 1 Mars 2005 16:52, Marc Huffnagle a écrit : [line for line in document if (line.find('word') != -1 \ and line.find('wordtwo') != -1)] Hi, Using re might be faster than scanning the same line twice : My understanding of the second questio

Re: Best way to make a list unique?

2005-03-09 Thread Marc Christiansen
ection in order""" > data = self._data > #prev, next = data[None] > #while next is not None: root = self._root prev, next = data[root] while next is not root: > yield next > prev, next = data[next] > > def __len__(self): > return len(self._data)-1 > > def __repr__(self): > return "%s(%s)" % (self.__class__.__name__,list(self)) >>> a=OrdSet([None,1,None,3]) >>> a OrdSet([None, 1, 3]) Marc -- http://mail.python.org/mailman/listinfo/python-list

Huge performance gain compared to perl while loading a text file in a list ...!?

2005-03-12 Thread Marc H.
Hello, I recently converted one of my perl scripts to python. What the script does is simply search a lot of big mail files (~40MB) to retrieve specific emails. I simply converted the script line by line to python, keeping the algorithms & functions as they were in perl (no optimization). The purp

RE: comment out more than 1 line at once?

2004-11-30 Thread Marc Boeren
/ Well, you could fake it by doing """ block of code here is commented out """ which will work most of the time... Cheerio, Marc. -- http://mail.python.org/mailman/listinfo/python-list

Re: ANNOUNCE: Ice 2.0 released

2004-11-30 Thread Marc Laukien
as been developed by ZeroC employees. Note that this does of course not apply for third-party code that is being used by Ice, such as BZIP2, Berkeley DB, OpenSSL, etc. - Anand PS: Please feel free to set FU-Ts as appropriate. What are FU-Ts? -- Marc -- http://mail.python.org/mailman/listinfo/python-list

Re: ANNOUNCE: Ice 2.0 released

2004-11-30 Thread Marc Laukien
it, of course. Thanks for the explanation. I learn something new every day :) -- Marc -- http://mail.python.org/mailman/listinfo/python-list

Re: ANNOUNCE: Ice 2.0 released

2004-11-30 Thread Marc Laukien
apm wrote: Marc Laukien <[EMAIL PROTECTED]> wrote in message news:<[EMAIL PROTECTED]>... 100% of the Ice source code has been developed by ZeroC employees. Fixes, bug reports, and enhancement requests have come in from Open Source developers around the world, as can be seen from the f

Re: cookie lib policy how-tp?

2004-12-07 Thread Marc Christiansen
these >> days")] >> >> -Jonathan >> > > Tried that already. At least, I hope I guessed at least one of the > possible identifiers correct: MSIE6.0, MSIE 6.0, MSIE/6.0 When my opera is set to identify as MSIE, it sends "Mozilla/4.0 (compatible;

Re: cookie lib policy how-tp?

2004-12-08 Thread Marc Christiansen
lla/4.0 (compatible; MSIE 6.0; X11; Linux i686) Opera 7.54 [en]". > > Hi Marc, > > thanks for the hint! that brought me a big step forward! You're welcome :) Marc -- http://mail.python.org/mailman/listinfo/python-list

RE: Why are tuples immutable?

2004-12-16 Thread Marc Boeren
return -1 > if self.lot > other.lot: > return 1 > return 0 A little less verbose: def __cmp__ (self, other): compared = cmp(self.block, other.block) if not compared: compared = cmp(self.lot, other.lot) return compared HTH, Marc. -- h

Implement logic on object.attribute and object.attribute()

2013-11-24 Thread Marc Aymerich
lf, name): return HTTPAttribute(name) But I'm stuck implementing the HTTP GET request when accessing "object.attribute", Any idea ?? Thanks!! -- Marc -- https://mail.python.org/mailman/listinfo/python-list

Re: Implement logic on object.attribute and object.attribute()

2013-11-24 Thread Marc Aymerich
On Sun, Nov 24, 2013 at 2:45 PM, Steven D'Aprano wrote: > On Sun, 24 Nov 2013 05:04:16 -0800, Devin Jeanpierre wrote: > >> On Sun, Nov 24, 2013 at 4:52 AM, Marc Aymerich >> wrote: >>> Hi, >>> I'm playing with python internals to make ob

Re: Implement logic on object.attribute and object.attribute()

2013-11-24 Thread Marc Aymerich
ET call will not be a problem since this objects will be used in just a few particular places and the workflow is always something like: # Initiate firmware building node.ctl.firmware() # wait until finished while node.ctl.firmware.progress < 100: time.sleep(1) Thanks for sharing your knowledge guys !! -- Marc -- https://mail.python.org/mailman/listinfo/python-list

Re: Implement logic on object.attribute and object.attribute()

2013-11-24 Thread Marc Aymerich
On Sun, Nov 24, 2013 at 3:37 PM, Chris Angelico wrote: > On Mon, Nov 25, 2013 at 1:16 AM, Marc Aymerich wrote: >> ... def do_get(self): >> ... # Do a HTTP GET request. >> ... return "Get stuff" >> ... def do_put(self): &

Re: Highest performance HTTP REST microframework?

2014-01-04 Thread Marc Aymerich
@route and > app.merge(app2) extra features. The biggest performance gains on HTTP architectures are usually made by doing proper HTTP caching. Without knowing anything about your architecture is hard to tell something more specific :) -- Marc -- https://mail.python.org/mailman/listinfo/python-list

Re: Graph or Chart Software for Django

2014-01-17 Thread Marc Aymerich
a JS library called highcharts, the django-side are only views that dump some data in json format perhaps in django-users mailing list you'll be able to find better answers than here :) -- Marc -- https://mail.python.org/mailman/listinfo/python-list

Re: Templating engines that work very well with Python/Django

2014-01-17 Thread Marc Aymerich
good comparatives between both. -- Marc -- https://mail.python.org/mailman/listinfo/python-list

Why this throws an UnboundLocalError ?

2014-01-30 Thread Marc Aymerich
credits" or "license" for more information. >>> import globalstate >>> globalstate.update() Traceback (most recent call last): File "", line 1, in File "globalstate.py", line 4, in update GLOBAL += 1 UnboundLocalError: local variable 'GL

Re: Why this throws an UnboundLocalError ?

2014-01-31 Thread Marc Aymerich
On Thu, Jan 30, 2014 at 11:53 PM, Chris Angelico wrote: > On Fri, Jan 31, 2014 at 9:46 AM, Marc Aymerich wrote: >> GLOBAL = 0 >> >> def update(): >> GLOBAL += 1 > > If you assign to a name, Python makes it local, unless you explicitly > tell it that you

Futex hang when running event loop on a separated thread

2015-11-24 Thread Marc Aymerich
lly kill the program each time :( -- Marc -- https://mail.python.org/mailman/listinfo/python-list

Re: Futex hang when running event loop on a separated thread

2015-11-24 Thread Marc Aymerich
On Tue, Nov 24, 2015 at 4:29 PM, Marc Aymerich wrote: > Hi, > > I have to run the asyncio.loop on a separated thread because the main > thread is running FUSE. Apparently fuse needs to run on the main > thread because it uses signal(): > > > File "/usr/loca

Re: Futex hang when running event loop on a separated thread

2015-11-24 Thread Marc Aymerich
definitive solution I'll be doing a os.kill(os.getpid(), signal.SIGKILL) inside the finally block. [1] https://docs.python.org/3.5/library/threading.html#threading.Thread.daemon On Tue, Nov 24, 2015 at 4:46 PM, Marc Aymerich wrote: > On Tue, Nov 24, 2015 at 4:29 PM, Marc Aymerich wrote: >&

Re: Futex hang when running event loop on a separated thread

2015-11-24 Thread Marc Aymerich
On Tue, Nov 24, 2015 at 7:11 PM, Zachary Ware wrote: > On Tue, Nov 24, 2015 at 9:46 AM, Marc Aymerich wrote: >> if __name__ == '__main__': >> loop_container = {} >> handler = threading.Thread(target=run_loop, args=(loop_container, )) &g

Re: Futex hang when running event loop on a separated thread

2015-11-24 Thread Marc Aymerich
On Tue, Nov 24, 2015 at 8:41 PM, Zachary Ware wrote: > On Tue, Nov 24, 2015 at 12:37 PM, Marc Aymerich wrote: >> still it appears to work only if the main thread is in the foreground >> (as of calling Thread() with deamon=True), I don't get why it behaves >> differen

Re: Futex hang when running event loop on a separated thread

2015-11-24 Thread Marc Aymerich
On Tue, Nov 24, 2015 at 9:17 PM, Marc Aymerich wrote: > On Tue, Nov 24, 2015 at 8:41 PM, Zachary Ware > wrote: >> On Tue, Nov 24, 2015 at 12:37 PM, Marc Aymerich wrote: >>> still it appears to work only if the main thread is in the foreground >>> (as of calling

  1   2   3   4   5   6   7   8   9   10   >