character encoding conversion

2004-12-11 Thread Dylan
or pointers would be greatly appreciated. -Dylan Schiemann http://www.dylanschiemann.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Aborting Python from C code

2011-04-30 Thread Dylan Evans
will do > exactly this (within a few instructions is fine), but the Python > script is able to prevent that from happening, which I don't like. > > Chris Angelico > -- > http://mail.python.org/mailman/listinfo/python-list > -- http://dylan-evans.github.com "The UNIX s

Re: stderr writting before stdout

2020-05-24 Thread Dylan Evans
Hi, This data is being line buffered, so either a newline or flush is required to get it to actually write to the terminal / file. On Sun, May 24, 2020 at 2:34 PM Souvik Dutta wrote: > Also this code maintains order i.e. writting is displayed before no errors. > Why is that? > > import sys > sys

Re: Final statement from Steering Council on politically-charged commit messages

2020-08-17 Thread Dylan Distasio
That's quite an interesting ruling by the SC. I'm not surprised to see them bend the knee to PC, but it is disheartening to see they're fine opening a can of political worms in a programming language. I suspect they will deplore messages outside of their bubble though. On Mon, Aug 17, 2020 at 2:

compound strip() string problem

2005-04-08 Thread Dylan Wilson
d the output to a pcap file DDDMMMHHMM.out if platform == 'nt': os.system('%s %s %s' % (wincommand, flag, time)) if platform == 'posix': os.system('%s %s %s' % (lincommand, flag, time)) -- Thanks, Dylan -- http://mail.python.org/mailman/listinfo/python-list

HELP PLEASE printing single characters!

2015-12-02 Thread Dylan Riley
hi all, I have been trying to figure out all day why my code is printing single characters from my list when i print random elements using random.choice the elements in the list are not single characters for example when i print, print(LIST[random.choice]) i get: ["e", "x", "a", "m", "p", "l", "

Re: HELP PLEASE printing single characters!

2015-12-02 Thread Dylan Riley
On Wednesday, December 2, 2015 at 7:09:23 PM UTC, Ian wrote: > On Wed, Dec 2, 2015 at 12:58 PM, Dylan Riley wrote: > > hi all, > > I have been trying to figure out all day why my code is printing single > > characters from my list when i print random elements using r

problem

2015-12-04 Thread Dylan Goodwin
Every time I try and run python 3.5 it keeps coming up with modify, repair or uninstall -- https://mail.python.org/mailman/listinfo/python-list

Re: Is it possible to deliver different source distributions for different Python versions?

2015-04-06 Thread Dylan Evans
y. This will run 2to3 on the code when it installs it. I don’t know whether this is good style but it does work. I got it from the feedparser source code.  --  Dylan Evans On 6 April 2015 at 11:05:47, python-list-requ...@python.org (python-list-requ...@python.org) wrote: Send Python-list mailing

Re: Python-list Digest, Vol 139, Issue 7

2015-04-06 Thread Dylan Evans
understanding and my apologies once again. I hope my attempt at help was at least readable. (Also sorry if I’m committing another faux pas by clogging up the list but I had to apologise!) — Dylan Evans -- https://mail.python.org/mailman/listinfo/python-list

error help import random

2015-11-20 Thread Dylan Riley
This is my fortune cookie program i wrote in python. the problem is it will not run past the first line of input. could someone please identify the error and explain to me why. here is the code: #the program silulates a fortune cookie #the program should display one of five unique fortunes, at ran

Re: error help import random

2015-11-20 Thread Dylan Riley
On Friday, November 20, 2015 at 11:06:05 PM UTC, Rob Gaddi wrote: > On Fri, 20 Nov 2015 15:15:42 -0500, Terry Reedy wrote: > > > On 11/20/2015 12:22 PM, Dylan Riley wrote: > >> This is my fortune cookie program i wrote in python. > >> the problem is it will not ru

anyone tell me why my program will not run?

2015-11-20 Thread Dylan Riley
i am learning python and was tasked with making a program that flips a coin 100 times and then tells you the number of heads and tails. I have done so coming up with this piece of work but it doesnt run can anyone help me out? #This is credited to dylan print(" \\ \\ \\ \\ \\ \\ \\ \\ D

Re: HTTPserver: how to access variables of a higher class?

2013-04-05 Thread Dylan Evans
On 05/04/2013 9:09 PM, "Tom P" wrote: > > First, here's a sample test program: > > import sys > from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler > > class MyRequestHandler(BaseHTTPRequestHandler, object): > def do_GET(self): > top_self = super(MyRequestHandler, self) # tr

Re: Run python script with ./

2013-04-05 Thread Dylan Evans
On Sat, Apr 6, 2013 at 1:04 AM, LubanWorks wrote: > > > > My question is: > > Why when I use #!/home/luban/Linux/Python/2.7.3/bin/python at the > beginning of myscript.py, *./*myscript.py can work, > > but if I use the wrapper #!/home/luban/bin/python in my python script, use > *./* to run the s

Re: Trying to understand working with dicts

2013-04-05 Thread Dylan Evans
On Fri, Apr 5, 2013 at 10:34 PM, inshu chauhan wrote: > Hello everyone, > > Here in my part of the code where cc is a dictionary. I want to understand > what actually cc.iterkeys() and cc[k] actually doing. > I am already reading > http://docs.python.org/2/library/stdtypes.html#dict.items > and ht

Re: I hate you all

2013-04-05 Thread Dylan Evans
On Sat, Apr 6, 2013 at 7:41 AM, wrote: > Hello > > I just tried python 3.3 with some simple script meant for unit test. > > How can python authors be so arrogant to impose their tabs and spaces > options on me ? It should be my choice if I want to use tabs or not ! > > Don't like it? Use ruby.

Re: HTTPserver: how to access variables of a higher class?

2013-04-06 Thread Dylan Evans
On Sun, Apr 7, 2013 at 1:05 AM, Tom P wrote: > On 04/05/2013 02:27 PM, Dylan Evans wrote: > >> On 05/04/2013 9:09 PM, "Tom P" wrote: >> >>> >>> First, here's a sample test program: >>> >>> import sys >>&g

Re: I hate you all

2013-04-06 Thread Dylan Evans
pretty happy to adopt a language which defines a sane style. This is a nice flame war you have stirred up. On Sat, Apr 6, 2013 at 3:13 PM, wrote: > On Saturday, April 6, 2013 7:28:55 AM UTC+3, Dylan Evans wrote: > > On Sat, Apr 6, 2013 at 7:41 AM, wrote: > > > > Hell

Re: parse the file

2013-04-07 Thread Dylan Evans
You can read the fantastic manual at http://docs.python.org/2/library/xml.etree.elementtree.html or i'm sure someone will do it for a modest fee. On Sat, Apr 6, 2013 at 3:11 PM, 水静流深 <1248283...@qq.com> wrote: > I have an xml file . http://s.yunio.com/bmCS5h > > It is

Re: subprocess question re waiting

2013-04-08 Thread Dylan Evans
On Mon, Apr 8, 2013 at 9:48 PM, Alain Ketterlin wrote: > loial writes: > > > I want to call a child process to run a shell script and wait for that > > script to finish. Will the code below wait for the script to finish? > > If not then how do I make it wait? > [...] > > process = subprocess.Pop

Re: Can anyone please help me in resolving the error => AttributeError: Array instance has no attribute '__trunc__'

2013-04-08 Thread Dylan Evans
On Mon, Apr 8, 2013 at 8:07 PM, wrote: > I am trying to create 2D arrays without using advanced features like > numpy, for this I have created 2 separate modules arrays.py and array2D.py. > Here's the code for that: > > arrays.py module: > == > import ctypes > > class Array: > > #

Re: subprocess question re waiting

2013-04-08 Thread Dylan Evans
On Mon, Apr 8, 2013 at 10:22 PM, Dave Angel wrote: > On 04/08/2013 08:01 AM, Dylan Evans wrote: > >> On Mon, Apr 8, 2013 at 9:48 PM, Alain Ketterlin < >> al...@dpt-info.u-strasbg.fr >> >>> wrote: >>> >> >> loial writes: >>> >

Re: is "_io.py" missing from 2.7.4 ?

2013-04-08 Thread Dylan Evans
On Mon, Apr 8, 2013 at 11:12 PM, dbv wrote: > In 2.7.4, io.py shows: > > import _io > import abc > > from _io import (DEFAULT_BUFFER_SIZE, BlockingIOError, > UnsupportedOperation, > open, FileIO, BytesIO, StringIO, BufferedReader, > BufferedWriter, BufferedRWPair

Re: USBLock : lock/unlock your computer with a USB key

2013-04-11 Thread Dylan Evans
This looks cool, would actual be pretty useful. I see you did it as a usb project but probably bluetooth would be better so you could just pair it to your phone and know that your PC will lock when you walk away. On Tue, Apr 9, 2013 at 1:21 AM, Sven wrote: > I've been working on a little proje

Re: USBLock : lock/unlock your computer with a USB key

2013-04-12 Thread Dylan Evans
On Fri, Apr 12, 2013 at 6:16 AM, Ian Kelly wrote: > On Thu, Apr 11, 2013 at 9:23 AM, Ethan Furman wrote: > > On 04/11/2013 04:13 AM, Sven wrote: > >> > >> Yes, I had the idea to add bluetooth too, removes the whole plugging and > >> unplugging spiel. I might start work on that, > >> and if anyon

Re: Newline at EOF Removal

2006-01-09 Thread Dylan Wilson
Do you mean somthing like this? >>> f = open("file.txt") >>> w = open('outfile.txt', 'w') >>> for line in f.split('\n'): ...w.write(line) ... >>> w.close() >>> '\n' in open('/home/wandleg/outfile.txt').read() False -- http://mail.python.org/mailman/listinfo/python-list

A __getattr__ for class methods?

2006-02-08 Thread Dylan Moreland
I'm trying to implement a bunch of class methods in an ORM object in order to provide functionality similar to Rails' ActiveRecord. This means that if I have an SQL table mapped to the class "Person" with columns name, city, and email, I can have class methods such as: Person.find_by_name

Re: A __getattr__ for class methods?

2006-02-08 Thread Dylan Moreland
Michael Spencer wrote: > Dylan Moreland wrote: > > I'm trying to implement a bunch of class methods in an ORM object in > > order to provide functionality similar to Rails' ActiveRecord. This > > means that if I have an SQL table mapped to the class "Person&quo

Re: What editor shall I use?

2006-02-08 Thread Dylan Moreland
Radek Kubicek wrote: > > What editor shall I use if my Python script must contain utf-8 > > characters? > > I use XP > > vim :-) > > > Thank you for reply > > l.b. > > not for all :-) I myself have just begun using vim. Does anyone have any tips/convenient tweaks for python programming with it?

Re: how to remove using replace function?

2006-02-08 Thread Dylan Moreland
I think you want to use the replace method of the string instance. Something like this will work: # See http://docs.python.org/lib/string-methods.html#l2h-196 txt = "an unfortunate in the middle" txt = txt.replace("", "") -- http://mail.python.org/mailman/listinfo/python-list

Re: how to remove using replace function?

2006-02-08 Thread Dylan Moreland
[EMAIL PROTECTED] wrote: > nope didn't work Could you be more specific about the error? Both my example and yours work perfectly on my box. -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie Q: dynamically assigning object attribute

2006-02-09 Thread Dylan Moreland
Take a look at the built-in function setattr: http://ftp.python.org/doc/lib/built-in-funcs.html#l2h-64 -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie Q: dynamically assigning object attribute

2006-02-09 Thread Dylan Moreland
No problem. There are, in fact, ugly class-based methods of doing this. You could assign to an instance's __dict__ dictionary, or -- if the class is a new-style class -- you can call the __setattr__(self, name, value) method. -- http://mail.python.org/mailman/listinfo/python-list

Re: Splitting a string

2006-02-14 Thread Dylan Moreland
Take a look at: http://docs.python.org/lib/node115.html#l2h-878 So I would try something like: pat = re.compile(r" (?:AND|OR|AND NOT) ") pat.split(string) Compile the regular expression with re.IGNORECASE if you like. Nico Grubert wrote: > Dear Python users, > > I'd like to split a string wher

Re: Splitting a string

2006-02-14 Thread Dylan Moreland
Woops! Thanks for the correction. I was assuming greediness for some reason. Fredrik Lundh wrote: > Dylan Moreland wrote: > > > So I would try something like: > > > > pat = re.compile(r" (?:AND|OR|AND NOT) ") > > pat.split(string) > > footnote: this y

Re: how to write a C-style for loop?

2006-02-14 Thread Dylan Moreland
John Salerno wrote: > I assume this is the way for loops are written in C, but if it helps to > be specific, I'm referring to C# for loops. The Python for loop seems to > be the same (or similar) to C#'s foreach loop: > > foreach int i in X > > But how would you write a C# for loop in Python? Do y

Re: pop line from file

2006-02-15 Thread Dylan Wilson
Try open.readline() >>>help(open) ... -- http://mail.python.org/mailman/listinfo/python-list

Re: looping over more than one list

2006-02-16 Thread Dylan Moreland
> def lowest(s1,s2): > s = "" > for c1,c2 in [x for x in zip(s1,s2)]: > s += lowerChar(c1,c2) > return s > > but it's hardly any more elegant than using a loop counter, and I'm > guessing it's performance is a lot worse - I assume that the zip > operation is extra work? > > Iain

Re: general coding issues - coding style...

2006-02-18 Thread Dylan Moreland
calmar wrote: > On 2006-02-18, Diez B. Roggisch <[EMAIL PROTECTED]> wrote: > > - why are these {{{ thingies there? > > markers for folding for vim > http://www.calmar.ws/tmp/sc.png I would look into one of the many Vim scripts which automatically fold most large blocks without the ugly {{{. --

How to best return a string from C to CPython 2.5?

2008-10-06 Thread dylan . fun
I'm trying to return a Python string from a C++ function (actually inside gnuradio) using CPython 2.5. My C++ function is declared like: typedef struct { int size; unsigned char *data; } STRING STRINGBUF myfunc(std::string s) { STRINGBUF buf; . . . buf.size = s.length(); buf.data

file()

2008-07-18 Thread Dylan Wilson
well, I'm in the beginings of making a random sentence generator for a mod my friend makes, but I want the nouns, verbs pastverbs, etc. to be easily customizable by editing a file, but, last night file() worked fine and today it's saying " line 1: `read_who = file('who.ini', 'r')'" here's what

Re: Getting a list of all classes derived from a base class

2006-04-02 Thread Dylan Moreland
Vijairaj R wrote: > Hi, > I have a requirement to findout all the classes that are derived from a > single base class. > > This is how I do it currently. > > class Test: > case = [] > > class Test1(Test): > Test.case.append("Test1") > > class Test2(Test): > Test.case.append("Test2") >

Re: Getting a list of all classes derived from a base class

2006-04-03 Thread Dylan Moreland
Alex Martelli wrote: > Vijairaj R <[EMAIL PROTECTED]> wrote: >... > > class Test: > > do not use old-style classes: they exist ONLY for backwards > compatibility. > > Make you class Test new-style: > > class Test(object): >... > > > and you can call Test.__subclasses__() to get a list of a

Re: - Removing Need For Repeated Definition of __str__

2006-04-03 Thread Dylan Moreland
Ilias Lazaridis wrote: > I have some python code which looks similar to this: > > class Car(BaseClass) : >manufacturer = factory.string() >model = factory.string() >modelYear = factory.integer() > >def __str__(self): >return '%s %s %s' % (self.modelYear,

FW: IDE+hg

2009-11-30 Thread Dylan Palmboom
From: NiklasRTZ [mailto:nikla...@gmail.com] Sent: 26 November 2009 12:38 PM To: python-list@python.org Subject: Re: IDE+hg On Nov 25, 7:28 am, alex23 wrote: > NiklasRTZ wrote: > > no py IDE I found has easy hg access. > > ActiveState's Komodo IDE has support for CVS, Perforce, subversion, > ba

Graphical nodes

2009-10-06 Thread Dylan Palmboom
Hi everyone Please could someone tell me of any libraries that you could use to make use of graphical nodes in python. Each node would hold data and properties. I am trying to achieve a similar effect, as in the application spoken about below. If you have seen an application called Nuke, by the f

Colour sampling

2009-10-15 Thread Dylan Palmboom
Does anyone know what python libraries are available to do the following: 1. I would like to take a photograph of an object with a colour. In this case, it is a sheet of sponge. 2. Feed this image into a function in a python library and let the function "automatically scan" this image's pixel

RE: Python GUI

2009-10-25 Thread Dylan Palmboom
PyQt is what we use at work and it is excellent and easy to learn too! I definitely recommend it. -Original Message- From: Philip Semanchuk [mailto:phi...@semanchuk.com] Sent: 26 October 2009 03:42 AM To: Python-list (General) Subject: Re: Python GUI On Oct 25, 2009, at 8:39 PM, Ronn

Choosing GUI Module for Python

2009-11-13 Thread Dylan Palmboom
-Original Message- From: catalinf...@gmail.com [mailto:catalinf...@gmail.com] Sent: 13 November 2009 10:06 AM To: python-list@python.org Subject: Re: Choosing GUI Module for Python Tkinter is deafult on python . Is more easy to use any editor text (geany). I don?t see a good IDE for GUI O

IDLE won't start on Mac OSX

2010-07-15 Thread Dylan Gleason
Hello, My name is Dylan. I am new to this list and am just getting started with Python and programming in general (although I have some experience with general UNIX wankery). I am trying to fire up Python ver. 2.7 with IDLE (I am using Mac OSX 10.6.3), but it will not start, citing the

Mail Merge from python data

2010-11-02 Thread Dylan Evans
I'm setting up a database for an organisation who want to do mail merges in office 2010. I know i can use the MySQL ODBC driver for the mail merge but i have set up the database with lots of relations and many-to-many links which i'm sure will lead to a huge amount of confusion (I think, i don't re

Re: Mail Merge from python data

2010-11-03 Thread Dylan Evans
On Wed, Nov 3, 2010 at 3:20 PM, Tim Harig wrote: > This page didn't make it to through to my nntp server so I appologize if I > miss something that was covered. > > On 2010-11-03, Dennis Lee Bieber wrote: > > On Tue, 2 Nov 2010 20:32:13 +1000, Dylan Evans > &g