label Printer GODEX does not pint EZPL - printing

I use vb6.
I am trying to print in a printer GODEX 500 in EZPL (which is supposed to be the default language of the printer).
I can print with ZPL but not with EZPL
This code works (ZPL)
printer.print "^XA
printer.print "^LH0,0
printer.print "^CF0,50,50
printer.print "^FO16,16
printer.print "^FD1^FS
printer.print "^CF0,30,25
printer.print "^FO340,16
printer.print "^FD2022^FS
printer.print "^PQ1,0,1,Y
printer.print "^CF0,35,35
printer.print "^FO130,66
printer.print "^FDFQ^FS
printer.print "^CF0,30,25
printer.print "^FO310,66
printer.print "^FDAGP^FS
printer.print "^CF0,35,35
printer.print "^FO130,110
printer.print "^FDPET^FS
printer.print "^CF0,30,30
printer.print "^FO130,155
printer.print "^FD100ml^FS
printer.print "^CF0,30,25
printer.print "^FO260,155
printer.print "^FD^FS
printer.print "^FT20,158^BQA,2,4
printer.print "^FDLA,MyCode R 1 1^FS
printer.print "^PQ1,0,1,Y
printer.print "^XZ"
But this code does not work (in EZPL):
printer.print "^Q25,4"
printer.print "^W50"
printer.print "^H10"
printer.print "^P1"
printer.print "^S2"
printer.print "^AD"
printer.print "^C1"
printer.print "^R0"
printer.print "~Q+0"
printer.print "^O0"
printer.print "^D0"
printer.print "^E35"
printer.print "~R200"
printer.print "^L"
printer.print "W30 , 34, 5, 2, m, 8, 5, 7, 0"
printer.print "MyCode"
printer.print "E"
Does anyone know how I can send EZPL commands to the printer?
Thank you very much

You first need to check if the printer supports EPL (most likely yes), then you should configure the printer to work with the EPL language.
You can do so by getting the allcv report from the printer then you have to look at the "device.languages" property to see what's the language currently set and what are the languages supported.
If you need to convert the printer to EPL, have a look here
If none of these works, I would doublecheck the code to be sure it is correct and once the EPL printer is visible in the printer list, you can create an example label using zebradesigner and selecting the EPL printer and using the print to file option to get a correct code to test

Related

SpeechRecognition doesn't work after debugging

I tried use SpeechRecognition with the follow function:
def on_listen():
r = sr.Recognizer()
with sr.Microphone() as source:
try:
print("Dites quelques choses...")
audio = r.listen(source, timeout = 4)
except:
print('Rien dit')
return
try:
text = r.recognize_google(audio, language = 'fr')
print(" Vous avez dit: " + text)
text = text
except sr.UnknownValueError:
print("On est mal à comprendre ce que vous avez dit !")
text = ''
except sr.RequestError as e:
text = ''
print("Besoin de connexion internet !")
return textenter code here
List item
In my PC it works fine but after debugging it doesn't work
requirements = kivy==2.0.0, kivymd==0.104.2,python3,pyjnius,PyAudio,****
android.permissions = CAMERA,INTERNET,ACCESS_NETWORK_STATE,RECORD_AUDIO
In my log:
09-24 16:46:11.453 23801 23836 I python : File
"/home/gence/Bureau/Python_to_apk/.buildozer/android/platform/build-armeabi-v7a/build/python-installs/agenda/kivy/app.py", line 950, in run
09-24 16:46:11.455 23801 23836 I python : File "/home/gence/Bureau/Python_to_apk/.buildozer/android/platform/build-armeabi-v7a/build/python-installs/agenda/kivy/base.py", line 582, in runTouchApp
09-24 16:46:11.456 23801 23836 I python : File "/home/gence/Bureau/Python_to_apk/.buildozer/android/platform/build-armeabi-v7a/build/python-installs/agenda/kivy/base.py", line 347, in mainloop
09-24 16:46:11.457 23801 23836 I python : File "/home/gence/Bureau/Python_to_apk/.buildozer/android/platform/build-armeabi-v7a/build/python-installs/agenda/kivy/base.py", line 387, in idle
09-24 16:46:11.459 23801 23836 I python : File "/home/gence/Bureau/Python_to_apk/.buildozer/android/platform/build-armeabi-v7a/build/python-installs/agenda/kivy/clock.py", line 733, in tick
09-24 16:46:11.460 23801 23836 I python : File "/home/gence/Bureau/Python_to_apk/.buildozer/android/platform/build-armeabi-v7a/build/python-installs/agenda/kivy/clock.py", line 776, in post_idle
09-24 16:46:11.461 23801 23836 I python : File "kivy/_clock.pyx", line 616, in kivy._clock.CyClockBase._process_events
09-24 16:46:11.463 23801 23836 I python : File "kivy/_clock.pyx", line 649, in kivy._clock.CyClockBase._process_events
09-24 16:46:11.464 23801 23836 I python : File "kivy/_clock.pyx", line 645, in kivy._clock.CyClockBase._process_events
09-24 16:46:11.465 23801 23836 I python : File "kivy/_clock.pyx", line 218, in kivy._clock.ClockEvent.tick
09-24 16:46:11.466 23801 23836 I python : File "/home/gence/Bureau/Python_to_apk/.buildozer/android/app/main.py", line 91, in to_listen
09-24 16:46:11.467 23801 23836 I python : File "/home/gence/Bureau/Python_to_apk/.buildozer/android/app/Methode.py", line 118, in on_listen
09-24 16:46:11.468 23801 23836 I python : File "/home/gence/Bureau/Python_to_apk/.buildozer/android/platform/build-armeabi-v7a/build/python-installs/agenda/speech_recognition/__init__.py", line 79, in __init__
09-24 16:46:11.470 23801 23836 I python : File "/home/gence/Bureau/Python_to_apk/.buildozer/android/platform/build-armeabi-v7a/build/python-installs/agenda/speech_recognition/__init__.py", line 110, in get_pyaudio
09-24 16:46:11.471 23801 23836 I python : AttributeError: Could not find PyAudio; check installation
09-24 16:46:11.471 23801 23836 I python : Python for android ended.
I need Help please !
When you are compiling the app buildozer cannot find a recipe for pyaudio to compile and hence silently fails and skips over it. So in reality pyaudio is not even bundled into your apk and why you are getting that error. As of now there is no rescipe for pyadio and as for as I know no is one working on making one. You can attempt to make your own recipe of I would suggest to change your library for speech recognition.
How to make recipe:https://python-for-android.readthedocs.io/en/latest/recipes/
Other alternative to speed recog that work on android:https://plyer.readthedocs.io/en/latest/#plyer.facades.STT

download file whith powershell v 2.0

I hope I am not out of OT I have a problem with powershell v2.0 with win 7 I am writing a dos batch file whose task, among other things, is to download a file. To do this I am using powershell 2.0 by win 7. I don't know this language and I can't go on anymore.
powershell.exe -NoExit -Command "& {(New-Object System.Net.WebClient).DownloadFile("https://downloads.html/example.exe","C:\tmp\example.exe")}"
the error he gives me is the following
')' missing in the method call. In row: 1 car: 52
& {((New-Object System.Net.WebClient) .DownloadFile (<<<< https://downloads.ar
duino.cc/arduino-1.8.13-windows.exe,C:\tmp\arduino-1.8.12-windows.exe))}
CategoryInfo: ParserError: (CloseParenToken: TokenId) [], Paren
tContainsErrorRecordException
FullyQualifiedErrorId: MissingEndParenthesisInMethodCall
thanks
The syntax is
(New-Object System.Net.WebClient).DownloadFile($url, $output)
I didn't run your code but it looks like you're missing a parentheses before ".download".

how to change the output file format in pSQL from default to csv?

I am using Linux and has connected to a pSQL DB server. After using the command \o to export file, the output file is separated by "|" horizontally and "_" (and '+') vertically. Please see below:
abc | cde | fgh | xyz
----+-----+-----+-----
123 | 321 | 123 | 123
123 | 321 | 222 | 111
923 | 238 | 928 | 192
ect.
This format might be a default but not very useful for data analysis.
Can I change the output file format into ".csv" by some additional optional command in pSQL?
Thanks,
You can export CSV in psql. There's a dedicated command to do so. I've written a longer article on this.
The gist is this:
\copy (SELECT ...) TO 'locale_file.csv' WITH (FORMAT csv, HEADER)
This will copy the data as CSV to your local drive (i.e. where psql is running from).

Windows 7 Trigger.io Error: environment can only contain strings

Running newly installed Trigger.io on hello world app in Windows 7 and I get this upon doing:
forge run web
File "C:\Users\john.jesus\AppData\Local\Trigger Toolkit\build-tools\forge\async.py", line 96, in run
result = self._target(*self._args, **self._kwargs)
File "C:\Users\john.jesus\AppData\Local\Trigger Toolkit\build-tools\forge\main.py", line 437, in run
build_to_run=build_to_run,
File "C:\Users\john.jesus\forge-workspace\helloworld\.template\generate_dynamic\customer_goals.py", line 124, in run_app
build_to_run.run()
File "C:\Users\john.jesus\forge-workspace\helloworld\.template\generate_dynamic\build.py", line 337, in run
self._call_with_params(task_method, task_args)
File "C:\Users\john.jesus\forge-workspace\helloworld\.template\generate_dynamic\build.py", line 296, in _call_with_params
return method(self, *params)
File "C:\Users\john.jesus\forge-workspace\helloworld\.template\generate_dynamic\web_tasks.py", line 141, in run_web
env=dict(os.environ, PORT=str(port), FORGE_DEBUG='1'))
File "C:\Users\john.jesus\forge-workspace\helloworld\.template\generate_dynamic\web_tasks.py", line 98, in _node
run_shell(node, *args, **kw)
File "C:\Users\john.jesus\forge-workspace\helloworld\.template\generate_dynamic\utils.py", line 338, in run_shell
raise state.error
TypeError: environment can only contain strings
I had exactly the same problem - seems to be because Python can't cope with unicode in the environment dictionary for POpen. Bit more info here:
Why does Popen fail on Windows if the "env" parameter contains a unicode object?
I edited
C:\Users\mattc\forge-workspace\prototype-app.template\generate_dynamic\module_dynamic\utils.py
And changed line 304 to remove the passing of the environment variable, so that I had:
state.proc = lib.PopenWithoutNewConsole(args, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, env=None, preexec_fn=preexec_fn)
then my forge-web worked and I was able to run it. Not entirely sure this is the 'correct' fix, though, but it gets it going.
Are you escaping slashes when pointing to files? ex: C:\folder\filename instead of C:\folder\filename?

print every nth line into a row using gawk

I have a very huge file in which I need to obtain every nth line and print it into a row.
My data:
1 937 4.320194
2 667 4.913314
3 934 1.783326
4 940 -0.299312
5 939 2.309559
6 936 3.229496
7 611 -1.41808
8 608 -1.154019
9 606 2.159683
10 549 0.767828
I want my data to look like this:
1 937 4.320194
3 934 1.783326
5 939 2.309559
7 611 -1.41808
9 606 2.159683
This is of course an example, I want every 10th line for my huge data file. I tried this so far:
NF == 6 {
if(NR%10) {print;}
}
To print every second line, starting with the first:
awk 'NR%2==1' file.txt
To print every tenth line, starting with the tenth line:
awk 'NR%10==0' file.txt
To use this in a script, add the following to a file called script.awk:
BEGIN {
print "Processing file"
}
NR%10==0
END {
print "Finished processing"
}
Then execute:
awk -f script.awk file.txt
With sed, you can do a lot of variations on this quite easily with the first~step command. For instance:
# Odd lines
sed -n 1~2p file
# Every tenth line (10, 20, 30, ...)
sed -n 10~10p file
# Every tenth line (1, 11, 21, ...)
sed -n 1~10p file
# First plus every tenth (1, 10, 20, 30, ...)
sed -n -e 1p -e 10~10p file
Piece of cake: cat test.txt | awk 'NR % 10 == 1'
It's not (g)awk, but it'll work:
cat myfile | grep ^[[:digit:]]*0[[:blank:]] should do the trick.
Doing it directly in command Prompt (Windows).
Put the gawk.exe file in the folder where the file is and start a command Prompt in the folder, and write
gawk "NR%n==x" oldfile.txt>newfile.txt
n is every n'th line you want to print and x is the starting line.
E.g n=10 and x=1, printing line 1,11,21,31,41......end line from the original file into the new file.
E.g n=20 and x=5, printing line 5,25,45,65......end line from the original file into the new file.

Resources