Re: boolian logic

2008-06-13 Thread marc wyburn
On 13 Jun, 10:34, Aidan <[EMAIL PROTECTED]> wrote: > marc wyburn wrote: > > HI all, I'm a bit stuck with how to work outboolianlogic. > > > I'd like to say if A is not equal to B, C or D: > >    do something. > > > I've tried > > > if

CSV variable seems to reset

2008-06-18 Thread marc wyburn
ound this or work out what the problem is, I'm assuming that the 'open' command buffers the data somewhere and that data is being wiped out by the CSV module but surely this shouldn't happen. thanks, Marc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Why is this blowing the stack, thought it was tail-recursive...

2008-07-12 Thread Marc Christiansen
ssecorp <[EMAIL PROTECTED]> asked: > Why is this blowing the stack, thought it was tail-recursive... Because python does no tail-call optimization. Ciao Marc -- http://mail.python.org/mailman/listinfo/python-list

Re: Testing for Internet Connection

2008-07-15 Thread Marc Christiansen
some possible problems I came up with. I don't know how often some- thing like this will happen. Ciao Marc -- http://mail.python.org/mailman/listinfo/python-list

Re: Swap memory in Python ? - three questions

2008-07-29 Thread Marc Christiansen
recent call last): File "", line 1, in MemoryError: can't allocate memory for array g=Numeric.zeros([1000,1000,500],Numeric.Int32) succeeds. So it looks like you have a 32bit kernel. Marc -- http://mail.python.org/mailman/listinfo/python-list

variable expansion with sqlite

2008-07-30 Thread marc wyburn
tion though. Any tips on where to start looking? Thanks, Marc. -- http://mail.python.org/mailman/listinfo/python-list

Re: variable expansion with sqlite

2008-07-30 Thread marc wyburn
Hi and thanks, I was hoping to avoid having to weld qmarks together but I guess that's why people use things like SQL alchemy instead. It's a good lesson anyway. Thanks, Marc. On Jul 30, 2:24 pm, Tim Golden <[EMAIL PROTECTED]> wrote: > Gerhard Häring wrote: > > My

Re: Factory for Struct-like classes

2008-08-13 Thread Marc Christiansen
len(contents))) for field, content in zip(self.structfields, contents): setattr(self, field, content) Struct.structfields = fields return Struct Use: Employee = defstruct("name", "salary") john = Employee('john doe', 34000) print john.salary Marc -- http://mail.python.org/mailman/listinfo/python-list

Re: Get all strings matching given RegExp

2008-04-03 Thread Marc Christiansen
c else: for i in alphabet: yield c for s in gen_strings(length - 1, alphabet): yield c + s def regex_matches(regex, max_length, alphabet=all_chars): r = re.compile('(' + regex + r')\Z') return (s for s in gen_strings(max_length, alphabet) if r.match(s)) Marc -- http://mail.python.org/mailman/listinfo/python-list

Re: xml.dom.minidom weirdness: bug?

2008-04-30 Thread Marc Christiansen
ou want a shallow copy (i.e. without any of the children, e.g. text content). Marc -- http://mail.python.org/mailman/listinfo/python-list

Re: is +=1 thread safe

2008-05-04 Thread Marc Christiansen
change. Here are the results of four runs: final count: 180 should be: 200 final count: 196 should be: 200 final count: 1999123 should be: 200 final count: 178 should be: 200 This is on a AMD64 X2 using Python 2.5.2 and numpy 1.0.4. Marc -- http://mail.python.org/mailman/listinfo/python-list

Re: confused about self, why not a reserved word?

2008-05-05 Thread Marc Christiansen
ello(sel): print "hi" Foo().Hello() 0:tolot:/tmp> Marc -- http://mail.python.org/mailman/listinfo/python-list

C++ and Python

2006-03-30 Thread marc . wyburn
I've been learning to write VST plugins in C++ and would like to switch back to Python. The first step of writing the plugin is to import the C++ header files from the Steinberg SDK. How can I do this in Python. I've tried looking at SWIG but didn't really understand what it was trying to do.

Re: C++ and Python

2006-03-30 Thread marc . wyburn
sorry accidentally hit post. has nyone tried this before? Thanks, Marc. -- http://mail.python.org/mailman/listinfo/python-list

Active Directory ADO strange objects returned

2009-12-11 Thread marc wyburn
don't understand is how I inspect the object to work out what it is programmatically. Do I need to do some sort of makepy trickery so that the object is understood by Python? I have already makepy'd MS ActiveX Data Object 2.8. thanks, Marc. -- http://mail.python.org/mailman/listinfo/python-list

Problem with win32ui

2009-12-22 Thread Marc Grondin
not be found. i have tried to figure out what is causing this but i come up empty. where should i be looking or what can i do? The file printorders.py first imports win32print with no problems. line 2 is where it imports win32ui. win32ui is used for printing. -- C-ya Later Take Care Marc Gron

Re: Problem with win32ui

2009-12-22 Thread Marc Grondin
start because the a pplication configuration is incorrect. Reinstalling the application may fix this problem. Dependencie walker does not find any major issues. what am i missing here. thank you in advance for your help. -- C-ya Later Take Care Marc Grondin -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem with win32ui

2009-12-23 Thread Marc Grondin
On 22/12/2009 1:05 PM, Gabriel Genellina wrote: En Tue, 22 Dec 2009 12:31:37 -0300, Marc Grondin escribió: Hello everyone, So i have been building an app with python(and learning as i go along) my knowledge of python is still kinda limited but the app work on my pc. I have also compiled it to

problem manipulating a list belonging to a class

2009-11-22 Thread Marc Leconte
) listA.mylist.append(5) print "1) ", listA.mylist print "2) ", listB.mylist >> 1) [5] >> 2) [5] I would have expected >> 1) [5] >> 2) [] Thanks in advance for advice, Marc. -- http://mail.python.org/mailman/listinfo/python-list

Re: problem manipulating a list belonging to a class

2009-11-23 Thread Marc Leconte
Thx all, good to know :) Le dimanche 22 novembre 2009 à 15:16 -0800, Steve Howell a écrit : > On Nov 22, 3:14 pm, Steve Howell wrote: > > > Explanations of why you need to write it that will follow... > > I knew this had to be written up somewhere... > > http://www.ferg.org/projects/python_got

Re: Python 3 encoding question: Read a filename from stdin, subsequently?open that filename

2010-11-30 Thread Marc Christiansen
th > Python 3.1 and subsequently open them, when some of those filenames > include characters with their high bit set? > > TIA! Try using sys.stdin.buffer instead of sys.stdin. It gives you bytes instead of strings. Also use byteliterals instead of stringliterals for paths, i.e. os.listdir(b'.'). Marc -- http://mail.python.org/mailman/listinfo/python-list

DRY and static attribute for multiple classes.

2011-02-01 Thread Marc Aymerich
Hi all, I want to provide an encapsulated static attribute called _registry for several classes. I try to use inheritance in order to make it DRY: all classes inherit from a BaseClass that implements the _registry encapsulation. But with inheritance it doesn't work how I want, because a single ins

Re: DRY and static attribute for multiple classes.

2011-02-02 Thread Marc Aymerich
On Feb 2, 12:11 am, Peter Otten <[email protected]> wrote: > Marc Aymerich wrote: > > Hi all, > > I want to provide an encapsulated static attribute called _registry > > for several classes. > > > I try to use inheritance in order to make it DRY: all class

Re: DRY and static attribute for multiple classes.

2011-02-02 Thread Marc Aymerich
On Feb 2, 12:11 am, Peter Otten <[email protected]> wrote: > Marc Aymerich wrote: > > Hi all, > > I want to provide an encapsulated static attribute called _registry > > for several classes. > > > I try to use inheritance in order to make it DRY: all class

Re: DRY and static attribute for multiple classes.

2011-02-02 Thread Marc Aymerich
On Feb 2, 12:18 pm, Peter Otten <[email protected]> wrote: > Marc Aymerich wrote: > > On Feb 2, 12:11 am, Peter Otten <[email protected]> wrote: > >> Marc Aymerich wrote: > >> > Hi all, > >> > I want to provide an encapsulated static attribute c

Re: DRY and static attribute for multiple classes.

2011-02-02 Thread Marc Aymerich
On Feb 2, 5:58 pm, Michele Simionato wrote: > Notice that Peter's approach also works without inheritance: > > registries = {} > > @property > def per_class(self): >    cls = type(self) >    try: >       return registries[cls] >    except KeyError: >       result = registries[cls] = [] >       ret

Re: DRY and static attribute for multiple classes.

2011-02-03 Thread Marc Aymerich
On Feb 3, 10:24 am, Peter Otten <[email protected]> wrote: > Marc Aymerich wrote: > > On Feb 2, 12:11 am, Peter Otten <[email protected]> wrote: > >> Marc Aymerich wrote: > > Hi!, > > Unfortunately per_class attribute losses the "independence&quo

Create classes at runtnime

2011-02-04 Thread Marc Aymerich
Hi! I need to create a pretty complex class at runtime. something like this one: (note: "" means that the number of attributes can be variable) class VirtualUserLimitForm(ModelForm): swap_limit = forms.CharField(max_length=100, initial=monitor1.default_limit) memory_limit = forms.Char

Re: Create classes at runtnime

2011-02-05 Thread Marc Aymerich
naries ..), but I have not yet clear whether this will be usefull for create the __init__ function at runtime too. Any clue on this? Many, many thanks!! :) Marc -- http://mail.python.org/mailman/listinfo/python-list

Re: Create classes at runtnime

2011-02-05 Thread Marc Aymerich
On Feb 5, 1:06 pm, Marc Aymerich wrote: > Thank you all for the answers! > > I'll try to give you the context in which I need to generate classes > like this. > > I'm developing a reusable control panel for an ISP. I have several > modules (VirtualUser, SystemUser,

Re: reddit = porn fodder

2010-09-13 Thread Marc Mientki
Am 13.09.2010 05:14, schrieb Xah Lee: note that reddit was originally somewhat a site for programers, written in common lisp. It is still for Lisp programmers: http://www.reddit.com/r/lisp/ regards Marc -- http://mail.python.org/mailman/listinfo/python-list

Re: how to name a function in a comp lang (design)

2010-10-20 Thread Marc Mientki
auty of the concept. But Mathematica has two serious problems: first, there is only one implementation and it is commercial, and secondly, Mathematica is very, very slowly and does not generate executable code that can be used without Mathematica itself. Thus, comparisons to other languages, s

Re: how to name a function in a comp lang (design)

2010-10-20 Thread Marc Mientki
Am 20.10.2010 14:07, schrieb Xah Lee: On Oct 20, 4:52 am, Marc Mientki wrote: Am 20.10.2010 13:14, schrieb Xah Lee: See also: • 〈The Importance of Terminology's Quality In Computer Languages〉 http://xahlee.org/UnixResource_dir/writ/naming_functions.html where i gave some exampl

Re: strange problem with multiprocessing

2010-11-11 Thread Marc Christiansen
in map >return self.map_async(func, iterable, chunksize).get() > File "/usr/lib64/python2.7/multiprocessing/pool.py", line 491, in get >raise self._value > ValueError: cannot convert float NaN to integer > The ValueError comes from run_test. It contains an int(x), where

EuroPython 2021: Talk Voting is Open

2021-05-17 Thread Marc-Andre Lemburg
Talk voting is your chance to tell us what you’d like to see at EuroPython 2021. We will leave talk voting open until: Sunday, May 23, 23:59:59 CEST In order to vote, please log in to the website and navigate to the talk voting page: * EuroPython 2021 Talk

EuroPython 2021: Session List Available

2021-05-31 Thread Marc-Andre Lemburg
Our program work group (WG) has been working hard over the last week to select sessions for EuroPython 2021, based on your talk voting and our diversity criteria. We’re now happy to announce the initial list with more than 100 sessions, brought to you by more than 100 speakers.

EuroPython 2021: Schedule published

2021-06-17 Thread Marc-Andre Lemburg
After two weeks of hard work by our program workgroup, we are very excited to announce the EuroPython 2021 schedule: * EuroPython 2021 Schedule * https://ep2021.europython.eu/schedule/ Seven full days of Python - EuroPython 2021 will

EuroPython 2021: Free tickets for Python Core Developers

2021-06-25 Thread Marc-Andre Lemburg
In 2019, we have set up the Guido van Rossum Core Developer Grant, to make it easy for Python Core Developers to attend EuroPython, but also to give something back to the core team and add a perk to make core development more attractive. If you are a core developer, please check our grant page for

EuroPython 2021: Volume Discount for Company Teams

2021-06-29 Thread Marc-Andre Lemburg
EuroPython 2021 offers special discounts on business tickets for company teams. * EuroPython Volume Discounts * https://ep2021.europython.eu/sponsor/packages/#Volume-Discount If you are going to attend the conference as a team, we offer the following volume discounts

EuroPython 2021: Trainings and Workshops

2021-07-06 Thread Marc-Andre Lemburg
Have you ever wanted to build an image search system, take a deep dive into pytest or learn about algorithmic trading? Then we have a treat for you! The EuroPython conference will start with two full training and workshop days on Monday, July 26th, and Tuesday, July 27th: * Eu

EuroPython 2021: Opening our Merchandise Shop

2021-07-08 Thread Marc-Andre Lemburg
We’re very happy to announce our merchandise shop for EuroPython 2021, with a fabulous new design for the attendee t-shirts: * EuroPython 2021 Merch Shop * https://ep2021.europython.eu/europython/europython-merchandise-shop/ You can find the shop under the "EuroPython

EuroPython 2021: Conference Organisers & Community Discounts

2021-07-16 Thread Marc-Andre Lemburg
The EuroPython Society (EPS) exists not only to run the EuroPython Conference, but also to support the wider Python community in Europe. It accomplishes this in many ways; here are two of them! * EuroPython Society supporting the community * https://blog.europython.eu/europython-202

EuroPython 2021: Keynotes and Booklet

2021-07-19 Thread Marc-Andre Lemburg
EuroPython 2021 begins next week. We are proud to present the keynote speakers and our conference booklet. Keynotes The following keynotes will take place on Wednesday, Thursday and Friday. Tickets are still available. If you want to find out more about our keynote speakers, please head

EuroPython 2021: Full-Day Workshops

2021-07-20 Thread Marc-Andre Lemburg
This year's edition of EuroPython begins with two days of training sessions as outlined in the schedule. Many of these last 3 hours, however, we would like to highlight two specific workshops available to those who want a deeper dive. They are most valuable for people new to the Python language and

EuroPython 2021: Data Science Mini-Conference

2021-07-22 Thread Marc-Andre Lemburg
It has become a tradition at EuroPython to include a special data science track. * EuroPython 2021 Data Science Mini-Conference * https://ep2021.europython.eu/events/data-science/ This year, we have expanded on the theme and included more data science related content than ever be

EuroPython Society: General Assembly 2021

2021-09-25 Thread Marc-Andre Lemburg
As last year, we are holding the General Assembly (GA) of the EuroPython Society (EPS) online for this year. General Assembly In accordance with our bylaws, we are calling for the EuroPython Society General Assembly to be held on Sunday, October 10th 2020, from 19:00 - 21:00 CEST

Re: c extension finding the module in object initialization

2021-09-27 Thread Marc-Andre Lemburg
Hi Robin, seeing that no one replied to your question, I'd suggest to ask this on the Python C-API ML: https://mail.python.org/mailman3/lists/capi-sig.python.org/ That's where the experts are, including the ones who implemented the mutli-phase logic. Cheers, -- Marc-Andre Lemburg

EuroPython 2021: Edited videos of the first day available

2021-09-27 Thread Marc-Andre Lemburg
We’re happy to release the first 42 cut videos of EuroPython 2021 covering the first day sessions of the conference. You can watch them on our YouTube channel: * EuroPython 2021 Playlist * https://www.youtube.com/playlist?list=PL8uoeex94UhHgMD9GOCbEHWku7pEPx9fW Over the next

EuroPython 2021: Edited videos of the second day available

2021-10-04 Thread Marc-Andre Lemburg
We’re happy to release another batch of 35 cut videos of EuroPython 2021 covering most of the second day sessions of the conference. Together with the first day videos, we now have 77 videos waiting for you. You can watch them on our YouTube channel: * EuroPython 2021 Playlist

EuroPython Society: Launching the EuroPython Society Fellow Grant

2021-10-08 Thread Marc-Andre Lemburg
We are excited to announce the new EuroPython Society Fellow Grant. The grant is intended to honor and show gratitude towards members of the EuroPython Society (EPS) and the EuroPython Workgroups who have contributed significantly towards our mission, the EuroPython conference and the Society as a

EuroPython 2021: All edited videos now available

2021-10-12 Thread Marc-Andre Lemburg
We’re happy to release another batch of 41 cut videos of EuroPython 2021 covering the third day sessions of the conference and a number of edited videos for the previous days. In total, we now have 118 videos waiting for you. You can watch them on our YouTube channel. We have created a EuroPython 2

Re: python interpreter

2005-10-13 Thread Marc 'BlackJack' Rintsch
an infinitive number of function pointers stored at `*ip`!? The Python equivalent might be :: for w in ip: w() if `ip` is a (finite) sequence of functions or callables in general. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: HTTPResponse.read() returns an empty string?

2005-10-18 Thread Marc 'BlackJack' Rintsch
e response object contains just the headers. So you can inspect them before you decide to download the actual content. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Python variables are bound to types when used?

2005-10-19 Thread Marc 'BlackJack' Rintsch
etails. > and if I did, > > if (l2 = "hello"): # would it become string? It would become a syntax error. No assignement allowed there. > and what if I never used it in the definition body? Again: The objects have types, the names not. A string that is never used remains a string. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Rich __repr__

2005-11-01 Thread Marc 'BlackJack' Rintsch
rn repr_str I'm a bit surprised that `Human_Sex` is subclassing `str`. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: user account logon from python

2005-11-09 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Philippe C. Martin wrote: > I am attempting to write a linux logon manager with python. Have you considered looking at the sources of xdm/gdm/kdm/... to see how they solve the problems you have? Ciao, Marc 'BlackJack' Rintsch -- http://mail

Re: option argument length

2005-12-04 Thread Marc 'BlackJack' Rintsch
s) = parser.parse_args() > > len(options) != 1 or len(options) > 2: > print "Incorrect number of arguments passed." > > How do I accomplish it ? Just insert an ``if`` in front of the condition and end the program with ``sys.exit()`` after the message. Ciao

Re: ANN: Dao Language v.0.9.6-beta is release!

2005-12-05 Thread Marc 'BlackJack' Rintsch
ry > the language. Their loss. :-) > And nobody else sees the need for change? Oh, except those who think > Tabs are evil and should no longer be allowed. > > How about (1) add some more flexibility for optional braces […] Try this:: from __future__ import braces Ciao, Marc &

Re: XML: Better way to accomplish this?

2005-01-03 Thread Marc 'BlackJack' Rintsch
se an attribute for the city nr.? Something like . At least if you intent to write a DTD or Schema this might be better. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Pythonic search of list of dictionaries

2005-01-04 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Bulba! wrote: > I put those dictionaries into the list: > >oldl=[x for x in orig] # where orig=csv.DictReader(ofile ... If you don't "do" anything with each `x` you can write this as: oldl = list(orig) Ciao, Mar

Re: EOF for binary?

2005-01-08 Thread Marc 'BlackJack' Rintsch
r/lib/python2.3/posixpath.py", line 142, in getsize return os.stat(filename).st_size TypeError: coercing to Unicode: need string or buffer, file found Something expected a string instead of a file object. >>> os.path.getsize("tmp.txt") 28190L Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: escape string for command line

2005-01-08 Thread Marc 'BlackJack' Rintsch
nt command % evil.encode('string-escape') echo '\'; rm -rf /;' > Will it > always be safe, even when binary data is submitted through POST? Don't know if it's always safe. Unprintable bytes like 0x00 will be escaped as '\x00'. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Documenting data members

2005-01-08 Thread Marc 'BlackJack' Rintsch
become: """ (Module description) :var xmlns: A dictionary of the namespaces. """ Ciao, Marc 'BlackJack' Rintsch .. _epydoc: http://epydoc.sourceforge.net/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Python & unicode

2005-01-12 Thread Marc 'BlackJack' Rintsch
lophone chinese? > > And, did you think of klingons? Klingons don't do Python, they hack ('n slash) in var'aq: http://www.geocities.com/connorbd/varaq/ SCNR, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Assigning to self

2005-01-18 Thread Marc 'BlackJack' Rintsch
I need a "Singleton" I just put it as global into a module. Either initialize it at module level or define a function with the content of your __init__(). Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: getting file size

2005-01-22 Thread Marc 'BlackJack' Rintsch
;> import os >>> os.path.getsize('/etc/shadow') 612L >>> f = open('/etc/shadow', 'r') Traceback (most recent call last): File "", line 1, in ? IOError: [Errno 13] Permission denied: '/etc/shadow' Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: python without OO

2005-01-26 Thread Marc 'BlackJack' Rintsch
()) with this syntax: ``tbl.attr`` and it's also possible to put functions into those tables. So it's already a prototype based OO language. Remember: you need objects for an OO language -- classes are optional! Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: "pickle" vs. f.write()

2005-02-02 Thread Marc 'BlackJack' Rintsch
ame__, self.name, self.age, self.friends, self.comment) And it's robust against changing the class name. It even works in subclasses if the signature of the __init__() method stays the same. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Package organization

2005-06-23 Thread Marc 'BlackJack' Rintsch
ase it's nice to have a more descriptive name than `File`. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: map/filter/reduce/lambda opinions and background unscientific mini-survey

2005-07-07 Thread Marc 'BlackJack' Rintsch
esis. Using tuples it > would be. But empty parenthesis are parsed as empty tuple:: In [8]: type( () ) Out[8]: Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: How can I get an sha1 hash in base32?

2005-07-23 Thread Marc 'BlackJack' Rintsch
elsewhere). Thanks. Doesn't Bitzi calculate some kind of audio fingerprint? Just a hash of the file would result in very different hash values for different codecs, bitrates etc. for the "same" audio data. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: consistency: extending arrays vs. multiplication ?

2005-07-23 Thread Marc 'BlackJack' Rintsch
] >>>> a+b > [1, 2, 3, 4, 5, 6] Both operate on the lists themselves and not on their contents. Quite consistent if you ask me. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: "Compile time" checking?

2005-08-10 Thread Marc 'BlackJack' Rintsch
ple (?) test:: def tester(a, b, c): global tester print "bogus test function", a, b, c def tester(a, b): print "other test function", a, b tester(1, 2, 3) # This runs fine. tester(1, 2)# This too. > Any other comments appreciated (a

Re: "Compile time" checking?

2005-08-10 Thread Marc 'BlackJack' Rintsch
# some code if __name__ == '__main__': foo() `__name__` is set to the module name if the module will be imported but to '__main__' if the module is directly executed. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: "Compile time" checking?

2005-08-11 Thread Marc 'BlackJack' Rintsch
clear to a human reader that the wrapping doesn't change the number of arguments. But it's harder to let a program figure this out. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: pickle.load not working?

2005-08-14 Thread Marc 'BlackJack' Rintsch
" > ip = "" > loggedin = 0 > invalid_logins = 0 > allow_login = 1 > status = "" > realname = "" > phone = "" > email = "" > > derek = chatuser If this is copy and pasted and not jus

Re: creating/modifying sparse files on linux

2005-08-17 Thread Marc 'BlackJack' Rintsch
with 314,572,800 numbers. That seems to eat up all your RAM and causes the swapping. You can use `xrange(len)` instead which uses a constant amount of memory. But be prepared to wait some time because now you are writing 314,572,800 characters *one by one* into the file. It would be faster to write larger strings in each step. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: pickle.load not working?

2005-08-19 Thread Marc 'BlackJack' Rintsch
epr(b) Out[232]: '<__main__.A instance at 0x4075e52c>' Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Re: error processing variables

2005-09-09 Thread Marc 'BlackJack' Rintsch
on't give two different objects the same name!? >>> import shutil >>> >>> #variables >>> s = shutil This can be written as ``import shutil as s`` or maybe you could use ``from shutil import copy2`` to import the `copy2` function into the moduls namespac

Re: encryption with python

2005-09-10 Thread Marc 'BlackJack' Rintsch
order > usable_IDs = range(last_number_used, last_number_used + 1000) - usable_IDs.sort(random.random()) + random.shuffle(usable_IDs) > last_number_used += 1000 > return usable_IDs.pop() Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: overwriting method in baseclass

2005-02-08 Thread Marc 'BlackJack' Rintsch
l entity without sacrificing the stability of your own project. [...] The section deals specifically with the situation how to manage 3rd party source code with subversion which you want to update from time to time and even apply some modifications. Ciao, Marc 'BlackJack' Rintsch

Re: list of all type names

2005-03-01 Thread Marc 'BlackJack' Rintsch
hted in your text editor. If I type ``dict`` it's immediatly colored differently than "normal" names and I know it's probably not a good idea to rebind this name to something else. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: binutils "strings" like functionality?

2005-03-03 Thread Marc 'BlackJack' Rintsch
u find it interesting and challenging go ahead and try it. It is possible and with the help of the 're' and 'mmap' modules it should be quite easy to filter strings out of files without the need to load them into memory at once. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Equality operator

2005-03-05 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, italy wrote: > Why doesn't this statement execute in Python: > > 1 == not 0 > > I get a syntax error, but I don't know why. `==` has a higher precedence than `not` so Python interprets it as:: (1 == not) 0 This works:: >>>

Re: using python to parse md5sum list

2005-03-06 Thread Marc 'BlackJack' Rintsch
d(aline[:-1].split(None, 1)) That works too if md5sum opened the files in binary mode which is the default on Windows. The filename is prefixed with a '*' then, leaving just one space between checksum and filename. > myfile.close() Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Convert python to exe

2005-03-13 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote: > I have a python script under linux, I wonder if I can be converted to > an executable or not? Place '#!/usr/bin/env python' as the first line of your script and type:: chmod u+x yourscript.py at the command line. ;

Re: Can't seem to insert rows into a MySQL table

2005-03-14 Thread Marc 'BlackJack' Rintsch
ot; % ("a", "b", "c") ) AFAIK grumfish made the Right Thingâ. If you use '%', some interesting things can happen, e.g. if your values contain "'" characters. The "%s"s without quotes and the comma let the DB module format and

Re: The use of :

2004-11-29 Thread Marc 'BlackJack' Rintsch
;:' serves as a very good hint to "python aware" text editors to automagically indent the next line after hitting return. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Pythonic use of CSV module to skip headers?

2004-12-02 Thread Marc 'BlackJack' Rintsch
er line. for row in reader: # do something with row Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

ANN: mkplaylist.py 0.3

2004-12-08 Thread Marc 'BlackJack' Rintsch
http://www.andrewchatham.com/pyogg It's "beta quality" software and only tested on Linux, so I'm interested in positive/negative feedback and bug reports. You can find the script here: http://www.marc.rintsch.de/software.html#mkplaylist Ciao, Marc 'BlackJack'

Re: A beginner's problem...

2004-12-15 Thread Marc 'BlackJack' Rintsch
vePython pack (PythonWin IDE) > > Solution anyone? Yes -> help(reload) Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: getopt: Make argument mandatory

2004-12-15 Thread Marc 'BlackJack' Rintsch
the subject of your post. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: getopt: Make argument mandatory

2004-12-15 Thread Marc 'BlackJack' Rintsch
simple toggle), > that means a user specified value must always be specified. I had the following in mind: http://www.python.org/doc/2.4/lib/optparse-what-options-for.html Although the optparse documentation discourages `required options` there are two examples in the source distribution how to i

Re: cross platform use of set locale

2005-03-22 Thread Marc 'BlackJack' Rintsch
between unix's it's horrid. Have you tried this:: import locale locale locale.setlocale(LC_ALL, '') locale.format('%.2f', 100, True) The `True` turns on grouping. Should work cross platform. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: problems with  character

2005-03-22 Thread Marc 'BlackJack' Rintsch
x27; in latin-1 encoding is a non breakable space character. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: cross platform use of set locale

2005-03-22 Thread Marc 'BlackJack' Rintsch
/ it'd be nicer if i could just select a proper locale It uses the locale of the system. If *your* systems locale is configured to use ',' as separator for grouping, then it should be used by `locale.format()`. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: Re: problems with  character

2005-03-23 Thread Marc 'BlackJack' Rintsch
aracter:: In [42]: import unicodedata In [43]: unicodedata.name('\xc2\xa0'.decode('utf-8')) Out[43]: 'NO-BREAK SPACE' In [44]: unicodedata.name('\xc2\xbb'.decode('utf-8')) Out[44]: 'RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK' Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: newbie help

2005-03-23 Thread Marc 'BlackJack' Rintsch
ell us in complete sentences what you want to achieve, not in incomplete C snippets. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: newbie help

2005-03-23 Thread Marc 'BlackJack' Rintsch
of handling multiple > buffers and how i can map index to a buffer? Still incomplete. You don't map an index to a buffer in that code. What is getBuf() doing? Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: escape single and double quotes

2005-03-24 Thread Marc 'BlackJack' Rintsch
scape(row[4]), row[1])) > elif row[2] == 6: # name part = 'toponym' > query = ("update names set toponym='%s' where name_id=%s" % \ >(escape(row[4]), row[1])) > sql.execute(query) > sql.commit() > connection.close() A lot of redundant code. Try something like the following instead of the ``elif`` sequence:: name_part = ['prefix', 'given', 'surname', 'suffix', 'patronym', 'toponym'] for row in result: query = 'update names set %s=%%s where name_id=%%s' % name_part[row[2]-1] sql.execute(query, (row[4], row[1])) sql.commit() Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

<    1   2   3   4   5   6   7   8   9   10   >