tag:blogger.com,1999:blog-14063458.post113836355684762821..comments2024-03-14T00:19:46.449-07:00Comments on Shed Skin - A (restricted) Python-to-C++ Compiler: Shed Skin 0.0.6srepmubhttp://www.blogger.com/profile/15831320699731673389noreply@blogger.comBlogger11125tag:blogger.com,1999:blog-14063458.post-1146152202352152732006-04-27T08:36:00.000-07:002006-04-27T08:36:00.000-07:00hello xet7,I just added os.listdir, str.rstrip, st...hello xet7,<BR/><BR/>I just added os.listdir, str.rstrip, str.isdigit and some similar methods to CVS. I'll release them as part of SS 0.0.8 . please let me know if there are other methods you'd like me to add/implement. I'm not going to implement everything, but methods like os.listdir are quite useful and easily mapped to C++.<BR/><BR/><BR/>thanks, <BR/>mark.srepmubhttps://www.blogger.com/profile/15831320699731673389noreply@blogger.comtag:blogger.com,1999:blog-14063458.post-1140196054641863732006-02-17T09:07:00.000-08:002006-02-17T09:07:00.000-08:00hello xet,sorry for the delayed response. mailing ...hello xet,<BR/><BR/>sorry for the delayed response. mailing me is faster :) anyway, the compiled code becomes a binary, so you can use it like any other binary. that is, run it in the background, or start it and wait for it to finish (then you need to maintain some timer, probably, to update the UI now and then.)srepmubhttps://www.blogger.com/profile/15831320699731673389noreply@blogger.comtag:blogger.com,1999:blog-14063458.post-1139694270127739262006-02-11T13:44:00.000-08:002006-02-11T13:44:00.000-08:00So, is there a minimal example how to make interf...So, is there a minimal example how to make interface in Python to that compiled C++ file? So that compiled program doesn't open separate window (like exec:ing it) but it's integrated like with SWIG or something? Does calling compiled code block the f.ex. wxPython GUI working, or can it run in separate thread (or something) and then notify wxPython GUI, or get some events / progress messages from compiled file?xet7https://www.blogger.com/profile/11414590943747530345noreply@blogger.comtag:blogger.com,1999:blog-14063458.post-1139690226010638192006-02-11T12:37:00.000-08:002006-02-11T12:37:00.000-08:00Right now, you need to provide a 'type model' of e...Right now, you need to provide a 'type model' of each used library function, as well as a C++ implementation. I guess, for SQLite and wxWidgets, you can call the C++ version from the C++ code. <BR/><BR/>Another possibility is to write the interface in Python (so you can use anything possible in Python), and put the cpu intensive parts in a separate program. For example, if you're writing a chess program, you can put the engine in a separate program, and communicate with it via a file.srepmubhttps://www.blogger.com/profile/15831320699731673389noreply@blogger.comtag:blogger.com,1999:blog-14063458.post-1139612741658541472006-02-10T15:05:00.000-08:002006-02-10T15:05:00.000-08:00Yeah, it doesn't need speedup :) but I had to star...Yeah, it doesn't need speedup :) but I had to start somewhere :)<BR/><BR/>C++/exe version works ok, produces the same numbers as the Python version. Result lines are in different order, but that doesn't matter, I'd like to to use Shed Skin with more important code than that.<BR/><BR/>Thanks for your friendly answers!<BR/><BR/>Btw, how difficult it would be to integrate SQLite (or wxWidgets) code to Shed Skin? So that Python version would work with pySQLite, and C++ version with C++ SQLite wrapper?xet7https://www.blogger.com/profile/11414590943747530345noreply@blogger.comtag:blogger.com,1999:blog-14063458.post-1139601461646934952006-02-10T11:57:00.000-08:002006-02-10T11:57:00.000-08:00It doesn't sound like your program actually needs ...It doesn't sound like your program actually needs a speedup..? :) Anyway, does it work correctly now? Please let me know if you encounter any other problems, or you really need some library call.<BR/><BR/>Thanks!srepmubhttps://www.blogger.com/profile/15831320699731673389noreply@blogger.comtag:blogger.com,1999:blog-14063458.post-1139587496992734262006-02-10T08:04:00.000-08:002006-02-10T08:04:00.000-08:00The code just loads text file (line by line) that ...The code just loads text file (line by line) that is in certain format, and formats it for inserting into database. Text file is originally from data input program made with VB.<BR/><BR/>That text file contains info about old photos: place, description, photographer, photo number etc. It then checks if that photo.jpg files exist on disk, and does name end with p (vertical) or v (horizontal).<BR/><BR/>It's only one-time-only used script, about 300 lines with comments, and there's not much use for that code without those photos and data text file. Of course if it was code that I'd use in more cases, then there would be more sense to modify it a little and make small data text file for example. I'll see if I have more time for that someday.xet7https://www.blogger.com/profile/11414590943747530345noreply@blogger.comtag:blogger.com,1999:blog-14063458.post-1139504636389549012006-02-09T09:03:00.000-08:002006-02-09T09:03:00.000-08:00Hello xet7,Thanks for your interest in Shed Skin. ...Hello xet7,<BR/><BR/>Thanks for your interest in Shed Skin. Yep, just a few library calls are implemented atm. You can see which these are, by looking at the *_.py files in the Shed Skin directory. You can easily add to these, by adding entries to these files, and supplying C++ versions in the corresponding *_.?pp files.<BR/><BR/>What kind of program are you trying to compile? Could you perhaps send it to the Shed Skin mailing list? (see http://shedskin.sourceforge.net)srepmubhttps://www.blogger.com/profile/15831320699731673389noreply@blogger.comtag:blogger.com,1999:blog-14063458.post-1139317857254266772006-02-07T05:10:00.000-08:002006-02-07T05:10:00.000-08:00Oh, and I got past the first problem files=os.list...Oh, and I got past the first problem files=os.listdir('.') by specifying filenames directly.xet7https://www.blogger.com/profile/11414590943747530345noreply@blogger.comtag:blogger.com,1999:blog-14063458.post-1139317697692353832006-02-07T05:08:00.000-08:002006-02-07T05:08:00.000-08:00I changed my code a little to get it to run:- remo...I changed my code a little to get it to run:<BR/><BR/>- removed some code it doesn't support:<BR/>if os.path.exists(picpath + txt[4:].strip() + 'p.jpg')<BR/><BR/>- changed code:<BR/>txt = txt.rstrip()<BR/>=> txt.strip()<BR/><BR/>- isdigit() is not supported, so<BR/>if (txt.strip())[2:4].isdigit():<BR/>=> if "00"<=(txt.strip())[2:4]<="99":<BR/><BR/>Thanks for your work, I'll continue to study Shed Skin code.xet7https://www.blogger.com/profile/11414590943747530345noreply@blogger.comtag:blogger.com,1999:blog-14063458.post-1139313190639453222006-02-07T03:53:00.000-08:002006-02-07T03:53:00.000-08:00Hi,how can I list file directory in Shed Skin? I g...Hi,<BR/>how can I list file directory in Shed Skin? I got:<BR/>*ERROR* program:138: debug: no type!<BR/><BR/>Code starts to read and process files that begin with number 1-9, line 138 is "files=os.listdir('.')":<BR/><BR/>import os<BR/>files=os.listdir('.')<BR/>for file in files:<BR/>____if "1"<=file[:1]<="9":<BR/>________print file<BR/>________f=open(file, 'r')<BR/>...xet7https://www.blogger.com/profile/11414590943747530345noreply@blogger.com