Wheelerof4te wrote:How did you install Go?
The golang package is the one you want. The version in stable should be fine: https://golang.org/doc/go1compat
Wheelerof4te wrote:How did you install Go?
Wheelerof4te wrote:I started writing Python about 5 months ago and I am loving it. It allows me to automate some of the tasks I do, experiment with useful CLI programs, even write a game or two.
Wheelerof4te wrote:So, what are your favorite editors and programming styles for writing Python?
import csv
class BookInc:
pattern = "kuf: 02-" # in Serbian
entries = []
def __init__(self, num: int, year: int, com_name: str, com_seat: str, amount: float, date=""):
self.num = self.pattern + str(num) + "/" + str(year)
self.com_name = com_name
self.com_seat = com_seat
self.amount = amount
self.date = date
BookInc.entries.append(self)
@staticmethod
def make_csv(head1: str, head2: str, head3: str, head4: str, head5: str, filename="BookInc2020.csv"): # add as many as needed
with open(filename, 'w', newline='') as csvfile: # again, Serbian. Change to BookInc.csv
writer = csv.writer(csvfile, delimiter=' ', quoting=csv.QUOTE_MINIMAL)
writer.writerow([head1] + [head2] + [head3] + [head4] + [head5])
for entry in BookInc.entries:
writer.writerow([entry.num] + [entry.com_name] + [entry.com_seat] + [entry.amount] + [entry.date])
pylkko wrote:In my experience most people that say something like "vim is the only way" or "use ed, like I do". don't actually produce much code. Being mininalist is fine and nice, but once you hit the point that it hurts productivity, it's not smart any more.
pylkko wrote:In my experience most people that say something like "vim is the only way" or "use ed, like I do". don't actually produce much code. Being mininalist is fine and nice, but once you hit the point that it hurts productivity, it's not smart any more.
Also, gedit is fairly simple and stable. In the add-ons there are Python syntax high-lighting, a Python terminal git highlighting and other things that can be used to make it a fairly light-weight editor that nevertheless offers more useful functionality than just a simple text editor.
Head_on_a_Stick wrote:[
Although this is certainly true for me (I couldn't code my way out of a wet paper bag) I don't think it's true for the hardcore vim coders, once you're used to it's methods the text entry is blindingly efficient.
EDIT: https://sanctum.geek.nz/arabesque/series/unix-as-ide/
Wheelerof4te wrote:
- Code: Select all
with open("KUF.csv", 'w', newline='') as csvfile: # again, Serbian. Change to BookInc.csv
## default file to write to
csv_file = 'KUF.csv'
## option to write to a different CSV file
def argparser():
Argparser = argparse.ArgumentParser()
Argparser.add_argument('--csv', type=str, default = csv_file , help='CSV output file')
args = Argparser.parse_args()
return args
## parse the arguments
args = argparser()
with open(args.csv, 'w', newline='') as csvfile:
from fin.books import BookInc # fin is a package with books.py module
def main():
# Entries:
r1 = BookInc(1344, 19, "FEDEX", "New York", 203.34, "21.05.2019.")
r2 = BookInc(1345, 19, "The Expose", "Alabama", 178.54,)
r3 = BookInc(1346, 19, "Electro Cars", "Memphis", 345.43, "23.05.2019.")
r4 = BookInc(1347, 19, "Aramco", "Riyad", 300.23, "25.05.2019.")
r5 = BookInc(1348, 19, "Amar Trade", "Dubai", 300.00, "27.05.2019.")
r6 = BookInc(1349, 19, "Dunav Osiguranje", "Belgrade", 304.00, "27.05.2019.")
r7 = BookInc(1350, 19, "Brent Crude", "Washington D.C.", 250.60,)
r8 = BookInc(1351, 19, "ShellCo", "Texas", 367.56, "29.05.2019.")
# Make .csv file:
BookInc.make_csv("Num./Year.", "Company", "Seat", "Amount", "Date", filename="BookInc2019.csv")
# Start the program:
if __name__ == "__main__":
main()
Head_on_a_Stick wrote:pylkko wrote:In my experience most people that say something like "vim is the only way" or "use ed, like I do". don't actually produce much code. Being mininalist is fine and nice, but once you hit the point that it hurts productivity, it's not smart any more.
Although this is certainly true for me (I couldn't code my way out of a wet paper bag) I don't think it's true for the hardcore vim coders, once you're used to it's methods the text entry is blindingly efficient.
EDIT: https://sanctum.geek.nz/arabesque/series/unix-as-ide/
Wheelerof4te wrote:^ Thanks for the tips. I am struggling with inheritance, but luckily see no need for it right now in my programs.
Users browsing this forum: No registered users and 5 guests