You Are Here:

Community: Developer Discussion Boards

#1 Old Solution for Semacode in Python (sort of) - 2006-11-21, 16:08

Join Date: Nov 2006
Posts: 5
jibberia
Offline
Registered User
Hello Everybody...

In my quest to get semacode barcode scanning working *quickly* from python, I have implemented it as a web service with a quick PHP script. The semacode documentation suggests this, but they must have never tried it - their code doesn't work!

The problem is within java - many AWT image processing functions depend on a window server to do their work. In 1.4, though, a workaround was provided - environment variable java.awt.headless.

So, here's some PHP code:

$handle = fopen($filename, 'wb');
fputs($handle, $picfile, strlen($picfile));
fclose($handle);

$execstring = "java -Djava.awt.headless=true -jar semacode.jar -f $filename";

exec($execstring, $output, $error);
if($error > 0) {
echo "error $error. tried $execstring";
} else {
echo $output[0];
# we should delete the file here
}

I hope this helps somebody - I've spent a considerable amount of time on it!

-Kevin
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules

You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump
Similar Threads
Thread Thread Starter Forum Replies Last Post
Please help installing Python libraries on S60 ericroijen Python 11 2009-07-18 11:43
Python for Series 60 released on Forum Nokia! eriksmartt Python 5 2009-07-14 18:00
How to install python to S60 Emulator? xiximato Python 14 2009-03-10 13:13
Python C++ Extension with Callback crashing diggerdeep Python 2 2005-11-10 17:33
Need help for testing nokia solution exosystem General Discussion 0 2003-08-21 18:27

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia 
RDF Facets: qdcZidentifierQSxhttpE3aE2fE2fdiscussionE2eforumE2enokiaE2ecomhttpE3aE2fE2fdiscussionE2eforumE2enokiaE2ecomE2fforumE2fshowthreadE2ephpE3ftE3d81449X qdcZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qdcZtypeQUqfntypeZCommunityContentQ qdcZtypeQUqfntypeZE44iscussionQ qdcZtypeQUqfntypeZE44iscussionContentQ qdcZtypeQUqfntypeZE52esourceQ qdcZtypeQUqfntypeZWebpageQ qdcZtypeQUqmarsZManagedE52esourceQ qdcZtypeQUqwebZInformationE52esourceQ qdcZtypeQUqwebZPageQ qdcZtypeQUqwebZE52esourceQ qdcZtypeQUqrdfsZE52esourceQ qfnZtopicQUqfnTopicZpythonQ qfnZtypeQUqfntypeZCommunityContentQ qfnZtypeQUqfntypeZE44iscussionQ qfnZtypeQUqfntypeZE44iscussionContentQ qfnZtypeQUqfntypeZE52esourceQ qfnZtypeQUqfntypeZWebpageQ qfnZuserE5ftagQSxpythonX qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX qrdfZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qrdfZtypeQUqfntypeZCommunityContentQ qrdfZtypeQUqfntypeZE44iscussionQ qrdfZtypeQUqfntypeZE44iscussionContentQ qrdfZtypeQUqfntypeZE52esourceQ qrdfZtypeQUqfntypeZWebpageQ qrdfZtypeQUqmarsZManagedE52esourceQ qrdfZtypeQUqwebZInformationE52esourceQ qrdfZtypeQUqwebZPageQ qrdfZtypeQUqwebZE52esourceQ qrdfZtypeQUqrdfsZE52esourceQ