Python Forum
converting from c# to python
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
converting from c# to python
#1
Hi im new into python so i need ask few things
how do i use declarations in python, for example , in C you can use
Quote:void str(FILE *fp, int x){
and how i declare variable in python, in c you can write
Quote:char sendline[MAXLINE];
Reply
#2
You don't declare variables in Python. They're created dynamically when they're assigned for the first time. We don't use arrays in Python either, generally, we use lists and add things to them rather than allocate the space beforehand. You can create a list full of None if for some reason you must pre-allocate.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Converting python to FileMaker DWolf 6 1,753 Sep-22-2022, 03:40 AM
Last Post: DWolf
  Converting python to c# benahmadi 1 2,674 Oct-22-2019, 09:50 PM
Last Post: micseydel
  converting array to and from string in python 3.7.2 srm 5 6,273 Jul-03-2019, 01:11 PM
Last Post: snippsat
  help with converting C# function to Python korenron 17 11,486 May-19-2019, 10:26 AM
Last Post: Gribouillis
  Converting R code to python mcva 2 12,575 Mar-09-2019, 04:01 PM
Last Post: mcva
  converting python script to another version gptura 5 4,813 Mar-13-2018, 12:16 PM
Last Post: gptura
  Converting Pseudocode to Python ncp511 1 5,168 Jan-16-2018, 04:34 PM
Last Post: Windspar
  Resources for converting Python 2.x code to 3.x Luke_Drillbrain 4 5,058 May-03-2017, 06:34 PM
Last Post: snippsat
  Need help converting some code from python 2.7 to 3.5 Blue Dog 3 4,938 Oct-18-2016, 12:30 AM
Last Post: sparkz_alot

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020