Building a Dynamic Library (libpython.so) for Python 2.4.3 Final
I've been trying to make python a dynamic library. I downloaded Python 2.4.3 Final from the Python web site and I cannot get it to create the library. I've tried using the directive: --enable-shared and --enable-shared=yes and both of them had the same effect of creating a bunch of parts of the python interpreter in .so format but not in creating a single libpython2.4.so.X.Y file. I could probably hack something together using ar but I would prefer to do it "correctly" by setting some options. I'm compiling under OpenBSD 3.5. Thanks for any advice. -- http://mail.python.org/mailman/listinfo/python-list
How to add lines to the beginning of a text file?
Hello, As the subject says how would I go about adding the lines to the beginning of a text file? Thanks in advance. -- http://mail.python.org/mailman/listinfo/python-list
How to add lines to the beginning of a text file?
Hello, As the subject says how would I go about adding the lines to the beginning of a text file? Thanks in advance. -- http://mail.python.org/mailman/listinfo/python-list
Re: CSV performance
On Mon, 27 Apr 2009 04:22:24 -0700 (PDT), psaff...@googlemail.com wrote: > I'm using the CSV library to process a large amount of data - 28 > files, each of 130MB. Just reading in the data from one file and > filing it into very simple data structures (numpy arrays and a > cstringio) takes around 10 seconds. If I just slurp one file into a > string, it only takes about a second, so I/O is not the bottleneck. Is > it really taking 9 seconds just to split the lines and set the > variables? I assume you're reading a 130 MB text file in 1 second only after OS already cashed it, so you're not really measuring disk I/O at all. Parsing a 130 MB text file will take considerable time no matter what. Perhaps you should consider using a database instead of CSV. -- http://mail.python.org/mailman/listinfo/python-list
ply and threads
I have two threads that exchange information by passing messages. I wanted to parse those messages with ply. I'd prefer using two independent parsers so that I can avoid using locks. Can somebody explain how to do this with ply? Ply seems to be doing a lot of odd things, such as reading the the python file that imported it, reading doc strings of it's functions, etc, so I'm not sure how to make this thread safe. This is from yacc.py: # The current implementation is only somewhat object-oriented. The # LR parser itself is defined in terms of an object (which allows multiple # parsers to co-exist). However, most of the variables used during table # construction are defined in terms of global variables. Users shouldn't # notice unless they are trying to define multiple parsers at the same # time using threads (in which case they should have their head examined). It would seem that creating two parsers in the main thread, and then passing one of them to the other thread, is all I need to do to be thread safe? But then again I'm not even sure how to create two parsers. Examples I've seen just call yacc.yacc() at the end, and do not even access yacc instances. Any help is appreciated and thanks in advance. Dean -- http://mail.python.org/mailman/listinfo/python-list
RE: wxPython Cookbook
Very cool! Thanks for doing this. I can't wait to dig into your cookbook. Regards, Dean Gonzales -Original Message- From: Python-announce-list [mailto:python-announce-list-bounces+dean.gonzales=amd@python.org] On Behalf Of Mike Driscoll Sent: Wednesday, August 24, 2016 12:57 PM To: python-announce-l...@python.org Subject: ANN: wxPython Cookbook Hi, Several years ago, the readers of my popular Python blog <http://www.blog.pythonlibrary.org/> asked me to take some of my articles and turn them into a cookbook on wxPython. I have finally decided to do just that. I am including over 50 recipes that I am currently editing to make them more consistent and updating them to be compatible with the latest versions of wxPython. I currently have nearly 300 pages of content! If you'd like to check out the funding campaign for the book, you can find it here: https://www.kickstarter.com/projects/34257246/wxpython-cookbook/ Thanks, Mike -- https://mail.python.org/mailman/listinfo/python-announce-list Support the Python Software Foundation: http://www.python.org/psf/donations/ -- https://mail.python.org/mailman/listinfo/python-list
PIL Image transform
Okay, so here is the situation. I have need to do some on-the-fly image creation. I have everything working great except for the last part of it, applying a perspective type transform to the image. The transform will take a rectangular 2D image and transform it to a 3D representation in 2D. Please see the link to see what I am trying to do: http://seanberry.com/transform.png I have PIL v1.15 installed which has a PERSPECTIVE transform, but it does not appear to do what I want - or I can't figure out how to use it correctly because it is using a transform matrix's coefficients. Here is the only info I could find on the usage: http://mail.python.org/pipermail/image-sig/2005-February/003198.html This is for the creation of images to be used in Flash. Originally I was doing the image processing in Flash because Flash 8 has a BitmapData class which does the basics of images, copy, transform, etc. To accomplish the transform I was using an algorithm that approximated triangles to fill and worked really well, but I need the image processing to be server side, not client. So, here I am. Anyone have any idea how to accomplish my goal here? Is there a way to fill a triangle with a bitmap using PIL? What about better docs on the PERSPECTIVE transform? Thanks for any and all help on this. -- http://mail.python.org/mailman/listinfo/python-list
Re: PIL Image transform
> This looks like a correct description of the sources: > > In Image.py: > > elif method == PERSPECTIVE: ># change argument order to match implementation >data = (data[2], data[0], data[1], >data[5], data[3], >data[4], >data[6], >data[7]) > > and then in Geometry.c: > > static int > perspective_transform(double* xin, double* yin, int x, int y, void* >data) > { >double* a = (double*) data; >double a0 = a[0]; double a1 = a[1]; double a2 = a[2]; >double a3 = a[3]; double a4 = a[4]; double a5 = a[5]; >double a6 = a[6]; double a7 = a[7]; > >xin[0] = (a0 + a1*x + a2*y) / (a6*x + a7*y + 1); >yin[0] = (a3 + a4*x + a5*y) / (a6*x + a7*y + 1); > >return 1; > } > > Something like this is almost what you what: > > im = im.transform(im.size, Image.PERSPECTIVE, (1, 0, 0, 0, 1, 0, -0.004, > 0)) > > But the problem really is that the top row of the image is at at y of > 0-- I think you want the origin of the image to be in the centre for > this to work properly. > > Is there a way to do that in PIL? thanks for the reply. I have been able to use the Image.PERSPECTIVE transform via trial and error to get it to work properly for each transform. What I am really looking for I guess is a way to calculate the 8 int tuple to match the perspective change I am going for. For a given image there may be 5 elements that need to be 'painted' on with perspective. A database table will include the transform tuples based on the source image. So, by passing a starting image and a pattern image, the starting image can be covered with. Perhaps the best way to explain is visually http://seanberry.com/perspective.png What I need to know is how you take a surface like (P1, P5, P6, P2) and describe it with the 8 int tuple? I know that for the elements in the transform a - h they are as follows... (a, b, c, d, e, f, g, h) a / e is the ratio of height to width. For a = 2, e = 1 the output is half the width of the original. b is the tan of the angle of horizonal skew. e is the vertical skew equivalent of b. c and f are the x and y offsets respectively. g and h are the values that actually distort the image ranther than doing an affine transform... which is where I need the help... I appreciate any additional insight into this problem. This is a small step in a massive project I am working on and need to get past this part to move on to the next. I am also willing to $pay$ for help that results in a success. Thanks. -- http://mail.python.org/mailman/listinfo/python-list
Easy question on minidom
I am using minidom to parse a 20,000 line XML file. I have a few instances where the number of child nodes of a particular node can be variable in number. To access them I am doing something like the following... xmldoc = minidom.parseString(r) results = xmldoc.childNodes[0] for myNode in results.childNodes[1].childNodes: do Stuff with myNode... problem is I am having a heck of a time trying to access the value of the node. For instance I get things like this But I need the values... any help here? -- http://mail.python.org/mailman/listinfo/python-list
Experienced UK based developer required
A software house based in Bristol, UK require an experienced developer to maintain and progress our Enterprise Management software suite. The suite is a group of applications used to monitor, manage and alert on all aspects of the enterprise infrastructure from the network to application level. The majority of the suite is developed using Python. For more information please see http://www.rms.co.uk/careers.htm ,call Phil Golder / Dean Houghton on +44 (0) 1454 281265 or email [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list
Help on the deformer object
I am trying to use a MESH transform from the Python Imaging Library and am having trouble defining my deformer object. What I want to do is map one eight item tuple like (x0, y0, x1, y1, x2, y2, x3, y3) to another set of points like (x00, y00, x10, y10, x20, y20, x30, y30) where (xn, yn) is a point. >From the docs: im.transform(size, MESH, data, filter) image => image Similar to QUAD, but data is a list of target rectangles and corresponding source quadrilaterals. What I need to know is the format that the MESH should be in... a list of target rectangles and corresponding source quadrilaterals??? [(x0, y0, x1, y1, x2, y2, x3, y3) , (x00, y00, x10, y10, x20, y20, x30, y30)] does not work. Thanks. -- http://mail.python.org/mailman/listinfo/python-list
Pythonic way to condese my array
I have a list of dictionaries where each dictionary defines, among other things, a row and column number. So, my list might look like this: [{'row':1, 'column':1, otherdata}, {'row':1, 'column':2, 'otherdata}...] This data is passed to flash and used there to create a grid of objects that are placed based on the row and column values. For a given set of data I may have values column values in the range of 1, 9 inclusive. What I would like to do is take my list of dictionaries (like the one listed above) and shift the column numbers down to fill in missing values... example (only the column key,value pair is show for simplification): [{'column':1}, {'column':2}, {'column', 4}, {'column': 8}, {'column':2}, {'column', 4}] If this were the dataset... I would want to change all 4s to 3 and all 8s to 4. That way I end up with 1 ... 4 instead of 1, 2, 4, and 8. Is there some slick way to do this? Thanks -- http://mail.python.org/mailman/listinfo/python-list
Iterate through list two items at a time
Hi all, I'm looking for a way to iterate through a list, two (or more) items at a time. Basically... myList = [1,2,3,4,5,6] I'd like to be able to pull out two items at a time - simple examples would be: Create this output: 1 2 3 4 5 6 Create this list: [(1,2), (3,4), (5,6)] I want the following syntax to work, but sadly it does not: for x,y in myList: print x, y I can do this with a simple foreach statement in tcl, and if it's easy in tcl it's probably not too hard in Python. Thanks, Dave -- http://mail.python.org/mailman/listinfo/python-list
Re: Iterate through list two items at a time
Thanks for all the fast responses. I'm particularly a fan of the zip method, followed closely by the xrange example. All, of course, are a lot of help! Thanks, Dave -- http://mail.python.org/mailman/listinfo/python-list
Embedding Python into C/C++ applications
Hi Could somebody, please tell me where I can find information about embedding Python into a C/C++ application. The example in the docs is rather simple. I am looking for something a bit more complex and longer -- Best Regards John -- http://mail.python.org/mailman/listinfo/python-list
Python V2.4.2 source code
Hi Does anybody know from where I can get a copy of the source for Python V2.4.2. I downloaded what is reckoned to be the source code from www.python.org, but is turns out to be the MacXOS version with the core modules missing. The reason I am looking for the source code is so I can make a debug build -- Best Regards John -- http://mail.python.org/mailman/listinfo/python-list
Re: Python V2.4.2 source code
Hi That particular file doesn't include the implementation files for the core modules. The platform specific directories only include two or three files. Only the Mac directory contains any C code files -- Best Regards John -- http://mail.python.org/mailman/listinfo/python-list
Re: Python V2.4.2 source code
Hi I downloaded what I thought was the source code from http://www.python.org/2.4.2/python-2.4.2.tgz -- Best Regards John -- http://mail.python.org/mailman/listinfo/python-list
Re: Python V2.4.2 source code
Hi Thank you very much. It seems the version tar that is embedded in WinRAR is broken. It gets as far as the Mac directory and then bombs out. The version of tar that is bundled with CygWin worked just fine -- Best Regards John -- http://mail.python.org/mailman/listinfo/python-list
urlopen
Hi all, I'm running into some trouble using urllib.urlopen to grab a page from our corporate intranet. The name of the internal site is simply http://web (no www or com). I can use urlopen to grab a site like http://www.google.com just fine. However, when I use urlopen to grab the internal site, I instead get data from http://www.web.com. This is the url returned by the geturl() function. There must be a way to stop Python, or whoever is doing it, from changing my url. Maybe urllib is not the correct approach. Does anyone know a solution to this? Thanks, Dave -- http://mail.python.org/mailman/listinfo/python-list
Basic question about sockets and security
Hi all, I'm just starting out in sockets/network programming, and I have a very basic question...what are the 'security' implications of opening up a socket? For example, suppose I've written a simple chat server and chat client. The server opens a socket, listens on a port, and accepts incoming connections. The clients open a socket and connect to the server. If the server receives a message from a client, it sends that message out to every client. When a client receives a message, it places it in a text widget. So...are there inherent dangers in doing this? I have no real security concern in the actual application, but can an open socket somehow allow someone access to the rest of the computer? Is the 'security' of the socket handled at the OS level (or within the socket module)? I realize this isn't necessarily a Python question, but I wrote my application in Python and I'm not sure where to start. I'll repost this elsewhere if someone points me towards a more relevant group. Thanks, Dave -- http://mail.python.org/mailman/listinfo/python-list
Python Based API
Hi, I work on a project that is built entirely using python and Tkinter. We are at the point where we would like to give access to our functionality to others via some sort of API. People who would use our API develop in all kinds of languages from C/C++ to Pascal. Ideas that come to mind that allow us to build such an API are: 1) Require others to imbed the python interpreter via the c API to be able to utilize our functionality. 2) Build an XML RPC interface around our code. 3) Rewrite our code base in C/C++, which should make it accessible to all modern languages. I'm looking for more and potentially better ideas that will allow us to offer an API to our customers without having to throw away or redo a lot of the python code that we have already written. Thanks in advance, Dean -- http://mail.python.org/mailman/listinfo/python-list
Matplotlib change xticks and retain xticks changing during zoom
Hello, I execute the following code: try: from math import * import pylab as p except: print "Couldn't import all dependent libraries" sys.exit() dataLength = 100 data = [sin(2*pi*x/dataLength) for x in range(0,dataLength)] p.plot(data) p.show() This produces a figure window. When I zoom in regions of the plot, the xticks change correctly to the zoomed region. This is in contrast to the effect of the following code: try: from math import * import pylab as p except: print "Couldn't import all dependent libraries" sys.exit() dataLength = 100 data = [sin(2*pi*x/dataLength) for x in range(0,dataLength)] p.plot(data) newXTicks= [str(x/2.0) for x in p.xticks()[0]] p.xticks(p.xticks()[0], newXTicks) p.show() This code produces tick marks [0, 10, 20, 30, 40, 50]. However when zooming, the xtick marks do not adjust correctly to the zoomed regions. Your help on this issue would be great, thanks! -- http://mail.python.org/mailman/listinfo/python-list
Starting seperate programs
[cid:image9e02f1.JPG@63ab2305.a06442dd] Is there a way for a python program start another python program, and then continue, without waiting for the second program to finish? os.startfile() seems to be what I want on windows, but I need it to work on linux and mac as well. Is there a function that does essentially the same as startfile, but without needing an associtated program (i.e. asking for one)? Thanks in advance... Dave <>-- http://mail.python.org/mailman/listinfo/python-list
Embedded Python
Hi Is it possible to execute a whole script using the C API function PyRun_String? At moment I load the script into a buffer. Then I get each line of the script and pass it PyRun_String. This seems very inefficient. It would be more efficient if I could pass the complete string buffer to PyRun_String and execute the script as a whole -- Best Regards John -- http://mail.python.org/mailman/listinfo/python-list
Problem with C-API
Hi I spent the whole of yesterday trying the get the following C code to execute PyRun_String("def title();", Py_file_input, dict, dict); PyRun_String("\treturn 'Foo Bar'", Py_file_input, dict, dict); PyRun_String("x = title()", Py_file_input, dict, dict); PyObject * result = PyRun_String("print x", Py_file_input, dict, dict); printf( "The result is %s\n", PyObject_AsString( result ); Each line throws an error. Could somebody tell what is wrong with the above code. Here below is the output from my test app Starting Test .. The file "testtitle" is open for reading The variable codeStrings contains Line 0 def title() Line 1 return "Foo Bar" The variable scriptText contains def title() return "Foo Bar" The variable tempList contains Line 0 testtitle Line 1 title Module Name is testtitle Function Name is title The variable functionCode contains def title() return "Foo Bar" Python initialized successfully Module object successfully created Dict object successfully created Failed to create a Result object. The title of the this task is -- Best Regards John -- http://mail.python.org/mailman/listinfo/python-list
Re: Problem with C-API
Hi Duncan Your version of the app works apart from this part else { PyObject *rString = PyObject_Str(result); if (rString==NULL) { Py_DECREF(result); PyErr_Print(); return; } printf( "The result is %s\n", PyString_AsString(rString)); Py_DECREF(rString); Py_DECREF(result); } } The result of the printf state is: "The result is None" result = PyRun_String("print x", Py_file_input, dict, dict); The above line of code displays the value returned from the title() function. My problem is I need to be able to cature the return value because in the real application it will be displayed in a Process Log Widget. Also the real scripts will be much longer. I have not had a problem writing Python extensions, but when it comes to embedded Python I just see how to get my code to work. Any further help would be greatly appreciated -- Best Regards John -- http://mail.python.org/mailman/listinfo/python-list
Re: Problem with C-API
Hi Duncan's example worked to a point. The line PyRun_String( "print x", Py_file_input, dict, dict); print out the contents of x, but I don't want to print x out. I want to be able to grab whateven the variable x contains so that I can pass it on for further processing by the C++ application. BTW this is only a test case. The real scripts are much bigger. I must say the documentation is not of much help and there are no books or articles covering embedding Python in any detail. What there is is very much out of date. -- Best Regards John -- http://mail.python.org/mailman/listinfo/python-list
Re: DO NOT USE JAVA BECAUSE IT IS NOT OPEN SOURCE
[EMAIL PROTECTED] wrote: > Programing Languiges Are Ment to be free. That is why i am starting The > Coo De Tar thats french for Blow of state it is a flash/java > alternative and if you are going to use a server side languige use > Perl,Python or better yet Ruby. What is the point of a languige without > a standerd and without a open source distrabution. Coo De Tar will be > released as a api for perl,python and ruby. Java sucks because it IS > NOT FREE. I AM A GNU GUY I BELEVE THAT SOFTWARE MUST AND SHALL BE > FREE!! do not use java because it is an oxymoron Wait, you aren't going far enough. All intellectual property is an afont. You must stop using all patented devices, all copyrighted materials, and all tradmarked names. Also, if you know any trade secrets, you must stop using and condoning them as well. Of course this means you must stop driving cars, for every car has patented devices. Even many bicycles are so encumbered, so you might need to walk. But be careful, many shoes are also patented and trademarked. God only knows if they also use trade secrets as well, but ignorance is bliss. You will also find that such devices as microwaves are truely evil. Not only are they patented, but they also use closed source software to operate the device. The chips that run this code are very likely patented as well. Finally, the manual may be copyrighted. No honorable human being could even consider using such a device as they offend every ideal we stand for. While I am typing this, I realised that my computer uses a patented CPU, and the BIOS itself is not open source. I will need to switch to an open CPU design, and find an open source BIOS. I will need to be very careful not to utilize an evil closed source driver for any of my peripherals, and be certain that none of the devices are patented. This means I will need to use technology that is 17 years old or more, so I expect to be back online soo with a 300 baud modem. I'm not sure if Fast Page Mode memory is free yet, so I will use an iron core memory just to be sure. I will need to solder together my own devices, as even though the patents have expired, the old devices are still encumbered by trademarks. I'll get back to you in 20 years after I have removed the last traces of evil intellectual property from my life. So long commrad, Dean G. -- http://mail.python.org/mailman/listinfo/python-list
ConfigParser.items sorting
Hi, Just wondering how I can get the items() command from ConfigParser to not resort all the item pairs that it presents. I am trying to get it to read some data in order: [Relay Info] relay_name: IPC relay_current_range: [60, 64, 68, 72, 76, 80, 84, 88, 92, 96, 100, 104, 108, 112, 116] relay_current_mutliplier: [1/8, 1/4, 1/2, 1, 2, 4] relay_i: arcfc/(relay_current_range*relay_current_mutliplier) so I can input the data and then eval() the equation at the end but when I go config.items('Relay Info') It mixes everything up, is there a way to stop this? Here is my selection code variables = sorted(config.items('Relay Info')) #Get inputs from user for each variable for variable in variables: if variable[0] == 'relay_name': vars()[variable[0]] = variable[1] else: vars()[variable[0]] = 'not a real thing this is just a fake that will never turn up to establish the variable' if variable[1][0] == '[' and variable[1][-1] == ']': if variable[0] != 'Any': while (variable[1].count(vars()[variable[0]]) < 1): vars()[variable[0]] = raw_input(str(variable)[1:-1] + "\n") if variable[1].count(vars()[variable[0]]) < 1: print 'Setting unavailable' else: vars()[variable[0]] = raw_input(str(variable)[1:-1] + "\n") else: vars()[variable[0]] = variable[1] vars()[variable[0]] = float(eval(vars()[variable[0]])) Thanks for the help! -- http://mail.python.org/mailman/listinfo/python-list
Re: ConfigParser.items sorting
On Oct 28, 4:50 pm, Jon Clements wrote: > On 28 Oct, 06:21, Dean McClure wrote: > > > > > > > Hi, > > > Just wondering how I can get theitems() command fromConfigParserto > > not resort all the item pairs that it presents. > > > I am trying to get it to read some data in order: > > > [Relay Info] > > relay_name: IPC > > relay_current_range: [60, 64, 68, 72, 76, 80, 84, 88, 92, 96, 100, > > 104, 108, 112, 116] > > relay_current_mutliplier: [1/8, 1/4, 1/2, 1, 2, 4] > > relay_i: arcfc/(relay_current_range*relay_current_mutliplier) > > > so I can input the data and then eval() the equation at the end but > > when I go > > config.items('Relay Info') > > It mixes everything up, is there a way to stop this? > > > Here is my selection code > > > variables = sorted(config.items('Relay Info')) > > #Get inputs from user for each variable > > for variable in variables: > > if variable[0] == 'relay_name': > > vars()[variable[0]] = variable[1] > > else: > > vars()[variable[0]] = 'not a real thing this is just a fake > > that > > will never turn up to establish the variable' > > if variable[1][0] == '[' and variable[1][-1] == ']': > > if variable[0] != 'Any': > > while > > (variable[1].count(vars()[variable[0]]) < 1): > > vars()[variable[0]] = > > raw_input(str(variable)[1:-1] + "\n") > > if > > variable[1].count(vars()[variable[0]]) < 1: > > print 'Setting unavailable' > > else: > > vars()[variable[0]] = > > raw_input(str(variable)[1:-1] + "\n") > > else: > > vars()[variable[0]] = variable[1] > > vars()[variable[0]] = float(eval(vars()[variable[0]])) > > > Thanks for the help! > > I'm not 100% sure what you're asking, as why should the order be > important? > > It's probably worth mentioning that the builtin dictionary type is > 'unordered' as it uses hashing to store keys. However, theConfigParsermodule > does allow you to supply a dict_type parameter in > version 2.6+ [http://docs.python.org/library/configparser.html], so > you could provide an 'ordered dictionary' which returns itsitemsin > insertion order. There's lots of recipes out there for those, but I > believe Raymond Hettinger has a fairly good one on the ActiveState(?) > cookbook site. (Google for python cookbook). > > Since however, the idea of processing INI files is that you *know* > what you're looking for and how to interpret it, I'm not sure why > you're not using something similar to this (v2.6.2): > > relay_name = config.get('Relay Info', 'relay_name') > relay_current_range = config.get('Relay Info', 'relay_current_range') > relay_current_range_list = eval(relay_current_range) > > ...etc... > > hth, > > Jon. Sorry, basically I was just using configparser to pull sets of variables and equations to calculate the clearing time of a circuit breaker. As each device is slightly different and I like the structure of the configparser I decided it'd be an acceptable way to do this. The thing is that I wanted to have the relay settings in the first section, then have sections for different protection settings, all of these have a few input parameters and an output for clearing time. The user will select the config file for the relay they want and therefore not all the settings will be the same, I know this isn't the intended use of the configparser but I thought it'd be much easier for people to run from their hdd, just a folder of conf files that can be edited or expanded on with relative ease. In order to accommodate for all the different configurations I thought I would have (as my code was showing but poorly explained) the variable name in the config file (these will be standardised to a degree) set to be either a set value or a selectable range in which the program will ask the user to select a value from the range. One relay may have a value for overload that is a percentage of the CT value while others may have a selected full load current which is used for everything so having all the input variables and then the equation to output the clearing time means that I can ask for the input values and evaluate the equation. Or at least I would be able to if I could output them in order? Thanks -- http://mail.python.org/mailman/listinfo/python-list
Re: ConfigParser.items sorting
On Oct 29, 9:05 am, Jon Clements wrote: > On 28 Oct, 21:55, Dean McClure wrote: > > > > > > > On Oct 28, 4:50 pm, Jon Clements wrote: > > > > On 28 Oct, 06:21, Dean McClure wrote: > > > > > Hi, > > > > > Just wondering how I can get theitems() command fromConfigParserto > > > > not resort all the item pairs that it presents. > > > > > I am trying to get it to read some data in order: > > > > > [Relay Info] > > > > relay_name: IPC > > > > relay_current_range: [60, 64, 68, 72, 76, 80, 84, 88, 92, 96, 100, > > > > 104, 108, 112, 116] > > > > relay_current_mutliplier: [1/8, 1/4, 1/2, 1, 2, 4] > > > > relay_i: arcfc/(relay_current_range*relay_current_mutliplier) > > > > > so I can input the data and then eval() the equation at the end but > > > > when I go > > > > config.items('Relay Info') > > > > It mixes everything up, is there a way to stop this? > > > > > Here is my selection code > > > > > variables = sorted(config.items('Relay Info')) > > > > #Get inputs from user for each variable > > > > for variable in variables: > > > > if variable[0] == 'relay_name': > > > > vars()[variable[0]] = variable[1] > > > > else: > > > > vars()[variable[0]] = 'not a real thing this is just a > > > > fake that > > > > will never turn up to establish the variable' > > > > if variable[1][0] == '[' and variable[1][-1] == ']': > > > > if variable[0] != 'Any': > > > > while > > > > (variable[1].count(vars()[variable[0]]) < 1): > > > > vars()[variable[0]] = > > > > raw_input(str(variable)[1:-1] + "\n") > > > > if > > > > variable[1].count(vars()[variable[0]]) < 1: > > > > print 'Setting > > > > unavailable' > > > > else: > > > > vars()[variable[0]] = > > > > raw_input(str(variable)[1:-1] + "\n") > > > > else: > > > > vars()[variable[0]] = variable[1] > > > > vars()[variable[0]] = float(eval(vars()[variable[0]])) > > > > > Thanks for the help! > > > > I'm not 100% sure what you're asking, as why should the order be > > > important? > > > > It's probably worth mentioning that the builtin dictionary type is > > > 'unordered' as it uses hashing to store keys. However, > > > theConfigParsermodule does allow you to supply a dict_type parameter in > > > version 2.6+ [http://docs.python.org/library/configparser.html], so > > > you could provide an 'ordered dictionary' which returns itsitemsin > > > insertion order. There's lots of recipes out there for those, but I > > > believe Raymond Hettinger has a fairly good one on the ActiveState(?) > > > cookbook site. (Google for python cookbook). > > > > Since however, the idea of processing INI files is that you *know* > > > what you're looking for and how to interpret it, I'm not sure why > > > you're not using something similar to this (v2.6.2): > > > > relay_name = config.get('Relay Info', 'relay_name') > > > relay_current_range = config.get('Relay Info', 'relay_current_range') > > > relay_current_range_list = eval(relay_current_range) > > > > ...etc... > > > > hth, > > > > Jon. > > > Sorry, basically I was just usingconfigparserto pull sets of > > variables and equations to calculate the clearing time of a circuit > > breaker. As each device is slightly different and I like the structure > > of theconfigparserI decided it'd be an acceptable way to do this. > > The thing is that I wanted to have the relay settings in the first > > section, then have sections for different protection settings, all of > > these have a few input parameters and an output for clearing time. The > > user will select the config file for the relay they want and therefore > > not all the settings will be the same, I know this isn't the intended > >
Pythonw.exe randomly crashing
Hi, I have a python application I wrote that is randomly crashing, I was wondering if anyone else has ran into this error, or if anyone has any idea about how to fix it. This is currently running under Windows server 2008 R2 x64 in terminal services, with Python 2.6.4 x64 installed. I ran into this problem with previous versions of Python on windows 2003 server running under 32 bit. I have been unable to duplicate the error under a devolvement platform. The application is a simple GUI used for time clock stations on a shop floor; it has a multithreaded GUI which displays some rotating informational images. A Text box that displays a constantly updating clock, and a text box that accepts employee clock number input and one that displays results returned from a background thread that runs a telnet session to a server. I can't really tell you where the error is occurring within the actual code, as it takes days of the application running to happen. Does anyone have any suggestions as to how I can get it to give me more information about the crash? Log Name: Application Source:Application Error Date: 5/6/2010 3:33:40 PM Event ID: 1000 Task Category: (100) Level: Error Keywords: Classic User: N/A Description: Faulting application name: pythonw.exe, version: 0.0.0.0, time stamp: 0x4ba3b0d9 Faulting module name: tcl85.dll, version: 8.5.2.2, time stamp: 0x48515e43 Exception code: 0xc005 Fault offset: 0x0005863d Faulting process id: 0xa98 Faulting application start time: 0x01cae87cff98c7c4 Faulting application path: C:\Python26\pythonw.exe Faulting module path: C:\Python26\DLLs\tcl85.dll Report Id: a7a18c68-594e-11df-b65f-005056b55389 Thanks, Dean Weimer Network Administrator Orscheln Management Co -- http://mail.python.org/mailman/listinfo/python-list
Building Python with Tcl/Tk on Cygwin_NT-5.1
Dear Python Community, I am trying to build Python with Tcl/Tk under the Cygwin_NT-5.1 OS. Has anyone done this? Do I need to build tcl8.4.9 and tk8.4.9 under the unix directory or the win directory. I found that the Tcl/Tk unix directories compiled just fine and built the libtcl8.4.a and libtk8.4.a libraries for use. But I don't think that Python is looking for this. If you've built Python with Tcl/Tck, is it possible for you to send me instructions on how you did it? Thanks in advance... Best regards, Dean -- http://mail.python.org/mailman/listinfo/python-list
Re: Building Python with Tcl/Tk on Cygwin_NT-5.1
Dear Jason, Thanks for fixing this problem. I'm sure all the CDAT/Cygwin users really appreciate it. I'll put the update on the CDAT web portal. Best regards, Dean >Dean, > >On Tue, Feb 08, 2005 at 12:55:15PM -0500, Jason Tishler wrote: > > >>On Tue, Feb 08, 2005 at 08:01:11AM -0800, Dean N. Williams wrote: >> >> >>>$ rebaseall >>>/usr/bin/rebaseall: line 70: [: too many arguments >>>/usr/bin/rebaseall: line 75: [: too many arguments >>>/usr/bin/rebaseall: line 94: $TmpFile: ambiguous redirect >>>cannot read /cygdrive/c/Documents >>> >>>On my laptop installation everything works just fine. What is the >>>difference? >>> >>> >>The TMP and/or TEMP environment variables have at least two spaces in >>them. >> >>The easiest workaround is to execute rebaseall like the following: >> >>$ TMP=/tmp rebaseall >> >>Long term I will change rebaseall to deal better with spaces in shell >>variables. >> >> > >The above rebaseall problem has been fixed: > >http://cygwin.com/ml/cygwin-announce/2005-07/msg00031.html > >Jason > > > -- http://mail.python.org/mailman/listinfo/python-list
Re: Building Python with Tcl/Tk on Cygwin_NT-5.1
Hi Jason, I downloaded your new Cygwin from http://cygwin.com and tried to build install Python/CDAT again. It appears to have built properly, but when I try to execute, it receive a sock error. How do I get around this problem? When I built Cygwin, I instructed it to install everything. Thanks in advance for your help and best regards, Dean -- http://mail.python.org/mailman/listinfo/python-list
Re: Building Python with Tcl/Tk on Cygwin_NT-5.1
Hi Jason, To be more specific. If I try to import socket I get the "ImportError: No module named _socket". What do I need to install from Cygwin in order for this to work? Thanks, Dean > > > Hi Jason, > >I downloaded your new Cygwin from http://cygwin.com and tried to > build install Python/CDAT again. It appears to have built properly, > but when I try to execute, it receive a sock error. How do I get > around this problem? > >When I built Cygwin, I instructed it to install everything. > > Thanks in advance for your help and best regards, >Dean > > -- http://mail.python.org/mailman/listinfo/python-list
Re: Building Python with Tcl/Tk on Cygwin_NT-5.1
Jason, >Dean, > >On Fri, Jul 22, 2005 at 05:11:45AM -0700, Dean N. Williams wrote: > > >>I downloaded your new Cygwin from http://cygwin.com and tried to build >>install Python/CDAT again. It appears to have built properly, but when >>I try to execute, it receive a sock error. How do I get around this >>problem? >> >> > >I don't know -- it is not clear what you are trying to do. Are you >trying to build Cygwin Python or just CDAT? > I am trying to build Python first, then eventually I'll get to CDAT. > >On Fri, Jul 22, 2005 at 07:09:08AM -0700, Dean N. Williams wrote: > > >>To be more specific. If I try to import socket I get the "ImportError: >>No module named _socket". What do I need to install from Cygwin in >>order for this to work? >> >> > >AFAICT, nothing. The above seems to indicate your Python installation >is broken. > The Python builds with the exception of the socketmodule. There seems to be some problems here. I can import all needed modules except the socket module. > >Jason > > > -- http://mail.python.org/mailman/listinfo/python-list
Re: Building Python with Tcl/Tk on Cygwin_NT-5.1
Jason, > >>Is there anyway for me to get back to an older version of Cygwin? >> >> > >What do you mean by the above? An older Cygwin? An older Cygwin >Python? An older rebase? > I installed Cygwin back in February on my laptop. (Call this Cygwin A.) I have not updated it (i.e., Cygwin A) since getting Python to run. Last week, I obtained another laptop, which I installed Cygwin (from the Internet) on last Thursday. (Call this Cygwin B.) Cygwin Versions: Cygwin A = the February 2005, version Cygwin B = Thursday's, July 21, 2005 version Last Friday, I built Python2.4 on Cygwin A with no errors. (The socketmodule worked and I can import socket.) I also built Python2.4 on newer version of Cygwin (i.e., Cygwin B), but the socketmodule doesn't work. I get an error message when importing socket. The Python2.4 is the same for both. The only difference is in the Cygwin version. That is, the version I installed from the internet in February and the version I installed last Thursday. When installing from the internet, there is no way to specify which version (or date) of Cygwin to download. I was wondering if you kept version controls, so I could go back to the February version of Cygwin since I know the Python Socket Module works. > > > >>In my Python2.4 log file, I tracked it down to the file >>Python2.4/Modules/socketmodule.c file: 3350 INET_ADDSTRLEN, which >>says "INET_ADDSTRLEN" is undeclared. I know this has something to do >>with the _ssl extension. >> >> > >Is the above from building Python or CDAT? > The above is building Python. > > > >>Also in my Python2.4 log file, I see DB_LSTAT_ERR is undeclared. Has >>something to do with the building of the gdbm extension. >> >> > >Ditto. > Yeap. The is from the Python build. > > > >>Also when I tryed "rebaseall" it no longer worked. When I went to >>"Start/run..." and tried to run "ash", I got the error stating it >>didn't know what "ash" was. Any help on this is appreciated. >> >> > >If Cygwin's bin is not in your Windows PATH, then give the full path to >ash. For example: > >C:\Cygwin\bin\ash.exe > >Then start rebaseall is follows: > >$ PATH=/bin rebaseall > Thanks. I will try this and see if this gets around my problem. Thanks again for any help on this Best regards, Dean -- http://mail.python.org/mailman/listinfo/python-list
Re: Building Python with Tcl/Tk on Cygwin_NT-5.1
[snip] I was able to run C:/cygwin/bin/ash.exe. This is good. In the "ash.exe" window, I ran PATH=/bin rebaseall and received the same error: "rebaseall: only ash processes are allowed .. Execute '/bin/rebaseall' from ash." -Dean >If Cygwin's bin is not in your Windows PATH, then give the full path to >ash. For example: > >C:\Cygwin\bin\ash.exe > >Then start rebaseall is follows: > >$ PATH=/bin rebaseall > >Jason > > > -- http://mail.python.org/mailman/listinfo/python-list
Re: Building Python with Tcl/Tk on Cygwin_NT-5.1
Right! Forgot to exit out of ALL Cygwin processes. This does work. -Dean Jason Tishler wrote: >Dean, > >On Mon, Jul 25, 2005 at 11:27:16AM -0700, Dean N. Williams wrote: > > >>I was able to run C:/cygwin/bin/ash.exe. This is good. In the >>"ash.exe" window, I ran PATH=/bin rebaseall and received the same >>error: "rebaseall: only ash processes are allowed .. Execute >>'/bin/rebaseall' from ash." >> >> > >Did you read the error message? In particular, the following: > >Exit all Cygwin processes and stop all Cygwin services. > >Jason > > > -- http://mail.python.org/mailman/listinfo/python-list
Re: Building Python with Tcl/Tk on Cygwin_NT-5.1
Hi Jason, To get "import socket" to work in Python2.4, I had to do something that I never recomend and that is hack the Python code. Since I need this to work for someone that is going on travel, I just modified the socketmodule.c file. REPLACE: /* Irix 6.5 fails to define this variable at all. This is needed for both GCC and SGI's compiler. I'd say that the SGI headers are just busted. */ #if defined(__sgi) && !defined(INET_ADDRSTRLEN) #define INET_ADDRSTRLEN 16 #endif WITH: #define INET_ADDRSTRLEN 16 This is a temporary fix until the Cygwin build works. Best regards, Dean >Dean, > >On Fri, Jul 22, 2005 at 05:11:45AM -0700, Dean N. Williams wrote: > > >>I downloaded your new Cygwin from http://cygwin.com and tried to build >>install Python/CDAT again. It appears to have built properly, but when >>I try to execute, it receive a sock error. How do I get around this >>problem? >> >> > >I don't know -- it is not clear what you are trying to do. Are you >trying to build Cygwin Python or just CDAT? > >On Fri, Jul 22, 2005 at 07:09:08AM -0700, Dean N. Williams wrote: > > >>To be more specific. If I try to import socket I get the "ImportError: >>No module named _socket". What do I need to install from Cygwin in >>order for this to work? >> >> > >AFAICT, nothing. The above seems to indicate your Python installation >is broken. > >Jason > > > -- http://mail.python.org/mailman/listinfo/python-list
Re: Building Python with Tcl/Tk on Cygwin_NT-5.1
Jason, Thanks for fixing this bug in Cygwin. Remember there was another undefined variable for the Python build _bsd... Best regards, Dean >On Mon, Jul 25, 2005 at 03:02:45PM -0700, [EMAIL PROTECTED] wrote: > > >>Let me know when you have it solved. >> >> > >The problem has been fixed in Cygwin CVS: > >http://cygwin.com/ml/cygwin/2005-07/msg01257.html >http://cygwin.com/ml/cygwin-cvs/2005-q3/msg00046.html > > > >>In the meantime, I have a workaround. >> >> > >Unfortunately, you will have to live with your workaround until Cygwin >1.5.19 is released. :,( > >Jason > > > -- http://mail.python.org/mailman/listinfo/python-list
Re: Building Python with Tcl/Tk on Cygwin_NT-5.1
[snip] >I didn't get this error. Did you forgot to install one of the >libdb${version}-devel packages: > >$ cygcheck -cd | grep 'libdb.*-devel' >libdb2-devel2.7.7-4 >libdb3.1-devel 3.1.17-2 >libdb4.1-devel 4.1.25-1 >libdb4.2-devel 4.2.52-1 > No, I did an install all at the top of the installation. Didn't know I needed to specify libraries. If I select "install" for everything (that is, all packages show "install") shouldn't this include the above? -Dean -- http://mail.python.org/mailman/listinfo/python-list
Re: Building Python with Tcl/Tk on Cygwin_NT-5.1
Dear Jason, I installed Cygwin on another Windows XP platform, this time I selected "ALL" for the setup installation. Everything appears to have been install just fine, except for when I do the "rebaseall" command. I am receiving the following error messages when I do the "rebaseall" command at the prompt: $ rebaseall /usr/bin/rebaseall: line 70: [: too many arguments /usr/bin/rebaseall: line 75: [: too many arguments /usr/bin/rebaseall: line 94: $TmpFile: ambiguous redirect cannot read /cygdrive/c/Documents On my laptop installation everything works just fine. What is the difference? Thanks in advance and best regards, Dean Dean, Please keep your replies on-list. On Wed, Feb 02, 2005 at 05:14:21AM -0800, Dean N. Williams wrote: I am trying to do the following according to your notes: 3. Due to issues with Cygwin's fork() and DLL base address conflicts, one should rebase their Cygwin system to prevent fork() failures. Use the following procedure to rebase your system: a. install the Cygwin rebase package (if necessary) b. shutdown all Cygwin processes c. start bash (do not use rxvt) d. execute rebaseall (in the bash window) I think this is why idle fails. So I did the above: [Dean [EMAIL PROTECTED] ...ASD_work/bin]$ rebaseall ReBaseImage (/usr/bin/cygexpat-0.dll) failed with last error = 6 What am I doing wrong here? It appears you did not follow step b above. Did you shutdown *all* Cygwin processes include services? Jason -- http://mail.python.org/mailman/listinfo/python-list
Re: Building Python with Tcl/Tk on Cygwin_NT-5.1
Dear Jason, The "$ TMP=/tmp rebaseall" command worked! Thank you. When a new Cygwin is available w/ your changes please let me know... Best regards, Dean On Tue, Feb 08, 2005 at 08:01:11AM -0800, Dean N. Williams wrote: $ rebaseall /usr/bin/rebaseall: line 70: [: too many arguments /usr/bin/rebaseall: line 75: [: too many arguments /usr/bin/rebaseall: line 94: $TmpFile: ambiguous redirect cannot read /cygdrive/c/Documents On my laptop installation everything works just fine. What is the difference? The TMP and/or TEMP environment variables have at least two spaces in them. The easiest workaround is to execute rebaseall like the following: $ TMP=/tmp rebaseall Long term I will change rebaseall to deal better with spaces in shell variables. Jason -- http://mail.python.org/mailman/listinfo/python-list
Re: Building Python with Tcl/Tk on Cygwin_NT-5.1
Hi Jason, I have a other Cygwin port question. It turns out that the auto-import for XtStrings an widgetClass didn't get resolved. This a similar auto-import resolving error that I got when trying to build Tcl/Tk. I ended up using the shared Tcl/Tk that came with Cygwin. But in this case I must be able to build my software. Can you tell me how to get around this problem? Or can you tell me which cygwin mail list to send my plea for help? Thanks and best regards, Dean gcc -shared -Wl,--enable-auto-image-base -o gplot gplot.o cgm.o ccgm.o utils.o io.o carray.o devices.o hload.o emul.o tty.o ps.o cgmc.o xws_cla.o xws_color.o xws_delim.o xws_marker.o xws_polygon.o xws_polyline.o xws_setup.o xws_text.o drvcla.o-L/usr/X11R6/lib -lXp -lXpm -lXaw -lXmu -lXext -lXt -lX11 /usr/lib/libm.a -lc Info: resolving _XtStrings by linking to __imp__XtStrings (auto-import) Info: resolving _widgetClass by linking to __imp__widgetClass (auto-import) > P.S. "Platform Windows XP/Cygwin 1.5.1." -- http://mail.python.org/mailman/listinfo/python-list
Newbie OOP Question & Code Snippet
Hi All, I'm a newbie just learning Python, using a couple of books to learn the language. (Books: "Visual Quickstart Guide - Python, 2nd Ed", "Practical Programming - An Intro to Computer Science using Python"). I'm just now learning OOP material as presented in both books -- I'm new to this approach -- the last formal language I learned was Fortran77 -- :o) I am running Python 3.2.1 on Mac OS/X 10.6.8. My problem stems from a simple example in the Visual Quickstart book. The code is: #person.py class Person: """Class to represent a person""" def __init__(self): self.name=' ' self.age=0 def display(self): print("Person('%s', age)" % (self.name, self.age)) - When I run this, the shell presents thus: >>> RESTART >>> >>> p=Person() >>> p.name='Bob' >>> p.age=24 >>> p.display() Traceback (most recent call last): File "", line 1, in p.display() File "/Volumes/dean_richardson/GoFlex Home Personal/Dean's Code/Python3.x/Person.py", line 9, in display (self.name, self.age)) TypeError: not all arguments converted during string formatting >>> --- I'm sure this is something simple, but I can't see it. Any help appreciated! Regards, Dean -- http://mail.python.org/mailman/listinfo/python-list
Tkinter canvas size determination
I need to determine the size of a canvas while the process is running. Does anyone know of a technique that will let me do that? Thanks, Dean -- http://mail.python.org/mailman/listinfo/python-list
Re: Tkinter canvas size determination
Cameron Laird wrote: > In article <[EMAIL PROTECTED]>, > Dean Allen Provins <[EMAIL PROTECTED]> wrote: > >>I need to determine the size of a canvas while the process is running. >>Does anyone know of a technique that will let me do that? > > . > . > . > Does > >>> import Tkinter > >>> c = Tkinter.Canvas() > >>> c.create_oval(13, 51, 80, 130) > 1 > >>> c.pack() > >>> print c.cget("width") > 284 > help? > > There are actually several different notions of the size of a > canvas. The example abovve should be a good starting point, > though. > > There's also a mailing list specifically for Tkinter http://tkinter.unpythonic.net/wiki/mailing_20lists >; that > might interest you. Your suggestion helps immensely. I missed it in Shipman's Tkinter reference. And thank you for the mail list reference. I'll pursue it. Regards, Dean -- http://mail.python.org/mailman/listinfo/python-list
Re: Tkinter canvas size determination
Cameron: Cameron Laird wrote: > In article <[EMAIL PROTECTED]>, > Dean Allen Provins <[EMAIL PROTECTED]> wrote: > >>I need to determine the size of a canvas while the process is running. >>Does anyone know of a technique that will let me do that? > > . > . > . > Does > >>> import Tkinter > >>> c = Tkinter.Canvas() > >>> c.create_oval(13, 51, 80, 130) > 1 > >>> c.pack() > >>> print c.cget("width") > 284 > help? > > There are actually several different notions of the size of a > canvas. The example abovve should be a good starting point, > though. > > There's also a mailing list specifically for Tkinter http://tkinter.unpythonic.net/wiki/mailing_20lists >; that > might interest you. I tried the "cget" function, and it returned the width that I had used when creating the canvas - even though the canvas was wider than that value at display time (and also after manually resizing the window). To your knowledge, is there a method to determine the current dimensions? Thanks, Dean -- http://mail.python.org/mailman/listinfo/python-list
Re: Tkinter canvas size determination
Martin: Martin Franklin wrote: > Dean Allen Provins wrote: > >> Cameron: >> >> Cameron Laird wrote: >> >>> In article <[EMAIL PROTECTED]>, >>> Dean Allen Provins <[EMAIL PROTECTED]> wrote: >>> >>>> I need to determine the size of a canvas while the process is running. >>>> Does anyone know of a technique that will let me do that? >>> >>> . >>> . >>> . >>> Does >>> >>> import Tkinter >>> >>> c = Tkinter.Canvas() >>> >>> c.create_oval(13, 51, 80, 130) >>> 1 >>> >>> c.pack() >>> >>> print c.cget("width") >>> 284 >>> help? >>> >>> There are actually several different notions of the size of a >>> canvas. The example abovve should be a good starting point, >>> though. >>> There's also a mailing list specifically for Tkinter >> http://tkinter.unpythonic.net/wiki/mailing_20lists >; that >>> might interest you. >> >> >> I tried the "cget" function, and it returned the width that I had used >> when creating the canvas - even though the canvas was wider than that >> value at display time (and also after manually resizing the window). >> >> To your knowledge, is there a method to determine the current dimensions? >> >> Thanks, >> >> Dean > > > > Dean, > > Look at the winfo_* methods of Tkinter widgets, I think the one you want > is called winfo_reqheight / winfo_reqwidth or something very similar > pydoc Tkinter.Canvas will sort that out > > Martin Thanks. That is exactly what I needed. I tried it, and it returned the desired values. Regards, Dean -- http://mail.python.org/mailman/listinfo/python-list
unrecognized command line option "-Wno-long-double"
Dear Python and Mac Community, I have just successfully built gcc version 4.1.0 for my Mac OS X 10.4.6. gcc -v Using built-in specs. Target: powerpc-apple-darwin8.6.0 Configured with: /usr/local/src/gcc-4.1.0/configure Thread model: posix gcc version 4.1.0 When I try to build Python 2.4.3, I get the following error below: gcc -c -fno-strict-aliasing -no-cpp-precomp -mno-fused-madd -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -I. -I./Include -DPy_BUILD_CORE -o Modules/python.o Modules/python.c gcc: unrecognized option '-no-cpp-precomp' gcc: unrecognized option '-no-cpp-precomp' cc1: error: unrecognized command line option "-Wno-long-double" make: *** [Modules/python.o] Error 1 Python make failed. What is the best solution for this unrecognized command line option? Thanks for your help in advance, Dean -- http://mail.python.org/mailman/listinfo/python-list
printing under MS win
Hi: My Linux-based Python/Tkinter application runs nicely, and printing works just fine (to a user-selected file, or an "lpr" device specified in the Entry box). Alas, the user wants to run it under MS Win, and of course will want to print the canvas for posterity. A Google search turned up a similar request from many years ago, which seemed to go unanswered. My current thoughts are 1) get the user to print to a file and let him copy the file to his printer (which is postscript); 2) do much the same as (1), but let the user display and print under Ghostscript/Ghostview; and 3) get the user to install UNIX printing services (which I found not to be trivial when I had to do it once) and then printing will run much as it does on UNIX/Linux. Any thoughts or other ideas? Regards, Dean Calgary -- http://mail.python.org/mailman/listinfo/python-list
Re: printing under MS win
Tim Golden wrote: > [Dean Allen Provins] > > | My Linux-based Python/Tkinter application runs nicely, and printing > | works just fine (to a user-selected file, or an "lpr" device specified > | in the Entry box). Alas, the user wants to run it under MS > | Win, and of > | course will want to print the canvas for posterity. > | > | A Google search turned up a similar request from many years ago, which > | seemed to go unanswered. > > Well, you don't really say what kind of data you wanted to > print, but maybe this page might spark a few ideas: > > http://timgolden.me.uk/python/win32_how_do_i/print.html > > TJG I'm printing PostScript (the default from a canvas). It looks like your URL pointer will answer the question quite adequately, as all the printers here are PS. Thanks. Dean -- http://mail.python.org/mailman/listinfo/python-list