Re: pyinstaller wrong classified as Windows virus

2021-11-26 Thread Peter Heitzer
MB. I would suggest to build your own installer, for example using NSIS https://nsis.sourceforge.io It is not very complicated. If you include the normal Python installation and the additional packages and your scripts the whole installer will not be greater as about 30 MB. If you want I can mail yo

Re: Creating a Windows executable on a Linux system

2019-06-26 Thread Peter Heitzer
it possible to >create a Windows executable on a Linux system? >Any pointers about best practice creating a standalone executable are >welcome. Is using a portable Python installation an option? -- Dipl.-Inform(FH) Peter Heitzer, peter.heit...@rz.uni-regensburg.de -- https://mail.python

Re: Writing some floats in a file in an efficient way

2018-02-21 Thread Peter Heitzer
per float instead of just 8. >Is there a way to write a float with only 8 bytes ? Use struct.pack() -- Dipl.-Inform(FH) Peter Heitzer, peter.heit...@rz.uni-regensburg.de -- https://mail.python.org/mailman/listinfo/python-list

Re: Validating regexp

2017-08-09 Thread Peter Heitzer
gt; re.compile()? Although I'm not sure that 'A|B|' is actually invalid. >> But re.compile("(") throws. >Yeah, it does not throw for 'A|B|' - but mysql chokes on it with empty >subexpression for regexp' I'd like to flag it before it gets to SQL. Then you need to do a real sql quer

Re: Planning a Python Course for Beginners

2017-08-08 Thread Peter Heitzer
Stefan Ram <r...@zedat.fu-berlin.de> wrote: > I am planning a Python course. [different topics] > Are there any other very simple things that > I have missed and that should be covered very > early in a Python course? The differences between blanks and tabs :-) -- Dipl

Re: How to store properties

2017-02-08 Thread Peter Heitzer
ictionary for your config. You could pickle and unpickle it. -- Dipl.-Inform(FH) Peter Heitzer, peter.heit...@rz.uni-regensburg.de -- https://mail.python.org/mailman/listinfo/python-list

Re: Get min and max dates

2016-12-08 Thread Peter Heitzer
from the time module. Then you could write dts2.append(strptime(d,'%d-%b-%Y) min and max return a struct_time type that can easily converted to the original date format -- Dipl.-Inform(FH) Peter Heitzer, peter.heit...@rz.uni-regensburg.de -- https://mail.python.org/mailman/listinfo/python-list

Re: Tie dictionary to database table?

2016-06-10 Thread Peter Heitzer
Christian Gollwitzer <aurio...@gmx.de> wrote: >Am 10.06.16 um 09:30 schrieb Peter Heitzer: >> Michael Selik <michael.se...@gmail.com> wrote: >>> An ORM might be overkill. If you just want a persistent dictionary, just >>> use the shelve module. https:

Re: Tie dictionary to database table?

2016-06-10 Thread Peter Heitzer
mans a bit and modified the task so that I need not read values but rather make updates to the tables. -- Dipl.-Inform(FH) Peter Heitzer, peter.heit...@rz.uni-regensburg.de -- https://mail.python.org/mailman/listinfo/python-list

Tie dictionary to database table?

2016-06-09 Thread Peter Heitzer
is if I write email['frank']='fr...@middle-of-nowhere.org' in my python script it generates a statement like update users set email='fr...@middle-of-nowhere.org' where username='frank'; Any hints to already existing modules are highly appreciated. and have -- Dipl.-Inform(FH) Peter Heitzer

Re: How to remove the line numbers from the file in python

2016-02-26 Thread Peter Heitzer
Ganesh Pal wrote: >what would be the easiest way to remove the lines in the leading >numbers 1.e 1 ,2, 19 from this file using python ? import sys,re for line in sys.stdin: print re.sub('^\d+','',line).rstrip() --

Re: show instant data on webpage

2016-01-27 Thread Peter Heitzer
mustang wrote: >> You even could use python for the webserver. Read the docs for the module >> "SimpleHTTPServer". >now I'm using apache. Is it possible to do the same with python+apache >or it's better to use SimpleHTTPServer? mod_python exists for apache. If your only goal

Re: show instant data on webpage

2016-01-27 Thread Peter Heitzer
mustang wrote: >> open("myData.dat", "w").close() >> >> while True: >> temp = sensor.readTempC() >> riga = "%f\n" % temp >> with open("myData.dat", "a") as f: >> f.write(riga) >> time.sleep(1) >yes great it works!thanks a lot! >Anyway to refresh

Re: How to simulate C style integer division?

2016-01-21 Thread Peter Heitzer
Shiyao Ma wrote: >Hi, >I wanna simulate C style integer division in Python3. >So far what I've got is: ># a, b = 3, 4 >import math >result = float(a) / b >if result > 0: > result = math.floor(result) >else: > result = math.ceil(result) >I found it's too laborious. Any quick

Re: Can I copy/paste Python code?

2015-07-21 Thread Peter Heitzer
ryguy7272 ryanshu...@gmail.com wrote: I'm trying to copy some Python code from a PDF book that I'm reading. I want to test out the code, and I can copy it, but when I paste it into the Shell, everything is all screwed up because of the indentation. Every time I paste in any kind of code, it

Fast 12 bit to 16 bit sample conversion?

2015-07-20 Thread Peter Heitzer
I am currently writing a python script to extract samples from old Roland 12 bit sample disks and save them as 16 bit wav files. The samples are layouted as follows 0 [S0 bit 11..4] [S0 bit 3..0|S1 bit 3..0] [S1 bit 11..4] 3 [S2 bit 11..4] [S2 bit 3..0|S3 bit 3..0] [S3 bit 11..4] In other

Re: Fast 12 bit to 16 bit sample conversion?

2015-07-20 Thread Peter Heitzer
MRAB pyt...@mrabarnett.plus.com wrote: On 2015-07-20 14:10, Peter Heitzer wrote: I am currently writing a python script to extract samples from old Roland 12 bit sample disks and save them as 16 bit wav files. The samples are layouted as follows 0 [S0 bit 11..4] [S0 bit 3..0|S1 bit 3..0